Why Better Models Fail When They Learn the Wrong Differences
Hatched by Nan Wang
May 12, 2026
10 min read
5 views
71%
The hidden question behind every model
What if the hardest part of modeling is not building a better predictor, but deciding which differences are real and which are noise?
That question sits underneath two problems that often get discussed separately. In one, you are engineering features for boosted trees and trying to squeeze better performance out of the data by encoding, transforming, and combining variables. In the other, you are estimating causal effects and trying desperately to avoid being fooled by differences between treated and untreated groups. One world celebrates clever feature construction. The other warns that apparently clever differences can be deadly.
Yet both are wrestling with the same deeper issue: a model only becomes useful when it learns the right distinctions. If it learns distinctions that are predictive but irrelevant, it becomes brittle. If it ignores distinctions that matter, it becomes biased. The challenge is not simply to make a model more sensitive. It is to make it sensitive in the right way.
The central problem is not whether a model can detect difference. It is whether it can tell the difference between signal, confounding, and artifact.
That idea changes how we should think about both feature engineering and propensity score matching. They are not opposites. They are two disciplines built around the same discipline of discernment.
Feature engineering is not about adding information, it is about naming structure
Boosted trees are often described as powerful because they can discover nonlinearity and interaction automatically. That is true, but it is only half the story. Their performance still depends on what kinds of structure are visible in the input data. A tree cannot split on a pattern it cannot express. A ratio, a log transform, a count, a missingness flag, or a category encoding can reveal structure that was otherwise hidden.
Think of a boosted tree model as a very fast detective. It can spot patterns, but only among the clues you place on the table. If the clue “price per unit” never appears, the model may infer it indirectly and inefficiently from raw ingredients. If the relationship is multiplicative rather than additive, a log transform can turn a messy curve into a simpler shape. Feature engineering, in this sense, is not decoration. It is a way of translating reality into a geometry the model can read.
But there is a trap: the same act of translation can also distort meaning. If you create features casually, you may turn a stable concept into a collection of brittle proxies. A model can become excellent at exploiting quirks that happen to correlate with the target in your training data, yet fail when the data shifts. This is the machine learning version of learning the wrong lesson from a practice exam.
The best feature engineering does two things at once. First, it reduces the work the model has to do. Second, it preserves the substantive structure of the problem. A good feature is not merely predictive. It is legible. It tells the model something the raw columns could not tell it cleanly, while still reflecting something real in the world.
Here is a concrete example. Suppose you are predicting hospital readmission. Raw age, diagnosis code, and length of stay are useful, but a feature like “days since last discharge” may better capture the clinical pattern of instability. Meanwhile, encoding a rare diagnosis carelessly can create noise or leakage. The point is not to pile on transformations. The point is to surface the most meaningful organization of the data.
That is why feature engineering in boosted trees is best understood as a theory of relevant structure. You are not asking, “What more can I feed the model?” You are asking, “What shape does the truth take?”
Causal inference asks the same question, but under stricter rules
Propensity score matching lives in a harsher world. Here, the wrong distinction can create an illusion of truth. If treated and untreated groups differ in ways that also affect outcomes, a naive comparison confuses selection with effect. Matching tries to create balance, but it depends on a crucial assumption: that the variables used to estimate treatment assignment actually capture the meaningful differences between groups.
This is where the familiar advice becomes almost moral in tone: measure everything. Of course, nobody can literally measure everything, but the instruction signals a philosophy. If there is a variable that affects both treatment and outcome, and you ignore it, your estimate may be contaminated. Domain expertise becomes indispensable because it helps you identify which differences are structurally important rather than merely convenient to observe.
The tension is obvious. In predictive modeling, extra features can help. In causal modeling, extra variables can hurt if they introduce noise, reduce overlap, or distract from the right adjustment set. But the deeper issue is not whether to include more or fewer variables. It is whether your variable set represents the true structure of the assignment process.
A simple analogy helps. Imagine trying to estimate whether a tutoring program improves test scores. Students who enroll may already be more motivated, may have struggling grades, may differ in parental support, or may be assigned by schools with different practices. If you match only on observed GPA, you are pretending that the rest of the landscape does not exist. Your estimate may look precise while being deeply wrong. If you match on everything indiscriminately, however, you may obscure the balance you need or amplify noise.
This is why sensitivity analysis matters. It acknowledges a humble but crucial fact: no observational design fully eliminates uncertainty about what was not measured. Sensitivity analysis asks how large an unmeasured confounder would need to be to overturn the conclusion. That is not a weakness. It is intellectual honesty.
Causal inference does not reward the model that predicts best. It rewards the design that most faithfully excludes the wrong explanation.
The shared mental model: distinguish prediction structure from explanation structure
The bridge between these domains becomes visible when you realize that they optimize different kinds of correctness.
A boosted tree model is often judged by predictive performance. It asks: given these inputs, can we forecast the target accurately? Feature engineering improves that task by exposing nonlinearities, thresholds, and interactions. The model is allowed to use any correlation that helps prediction, even if the correlation is not causally meaningful.
Propensity score matching, by contrast, is about explanation under counterfactual uncertainty. It asks: if treatment assignment had been different, what would have happened? Here, correlations are dangerous unless they are tied to the assignment mechanism and outcome structure. A variable that improves prediction but is downstream of treatment can distort the causal estimate. A feature that boosts accuracy can be poison for identification.
So the real distinction is not between machine learning and causal inference. It is between two forms of structure:
- Prediction structure, which helps a model compress the world into useful forecasts.
- Explanation structure, which helps a design isolate the part of the world that can plausibly be attributed to intervention.
The mistake is to assume these structures are interchangeable. They overlap, but they are not the same. A variable can be excellent for one purpose and harmful for the other.
Consider credit risk. A boosted tree may find that zip code, browsing behavior, and account age are highly predictive of default. Great for forecasting. But if you are trying to estimate the causal effect of a new lending policy, some of those variables may be proxies for structural inequities rather than legitimate adjustment variables. They can make the model look sophisticated while baking in historical bias. Prediction tells you what tends to happen. Causal inference tells you what changes when you act.
The practical lesson is profound: the same feature can be either a lens or a distortion, depending on the question.
A better framework: the three tests of a useful variable
To unify these perspectives, use a simple framework before adding, encoding, or matching on any variable. Ask three questions.
1. Does it reveal real structure?
A useful variable captures something stable in the underlying system. A log transform of income may reveal proportional differences better than raw dollars. An interaction between age and dosage may reflect how treatment operates differently across subgroups. In causal work, a confounder such as baseline severity may reveal why groups differ before treatment.
If a variable only mirrors idiosyncratic noise, it is a decorative feature. If it reflects a real mechanism, it is informative.
2. Does it help the right task?
For boosted trees, the task may be prediction, ranking, or anomaly detection. For propensity score matching, the task is balance on pre-treatment differences that could bias outcomes. A variable that helps one task may not help the other. Post-treatment variables are a classic example: they may improve prediction, but they can undermine causal interpretation.
This is the decisive filter. A variable is not good or bad in itself. It is good or bad relative to the question.
3. What happens if I get it wrong?
Some mistakes are recoverable. Others are not. A noisy feature in a predictive model may slightly reduce accuracy. An omitted confounder in a causal study can reverse the sign of the effect. This asymmetry should change your standards. In causal analysis, uncertainty about hidden variables deserves special scrutiny because the cost of error is much higher.
This third question is where sensitivity analysis becomes more than a statistical add-on. It is a way to measure fragility. If your conclusion falls apart under a plausible amount of unmeasured confounding, then the estimate is not robust, no matter how polished the matching procedure looks.
The practical discipline of modeling: engineer, then interrogate
There is a temptation to separate modeling into two personalities. One personality is creative and iterative: build features, encode categories, try interactions, let the model learn. The other is skeptical and austere: control confounding, verify balance, test assumptions, and worry about what is missing. In reality, the best work alternates between both.
Start by engineering the data so the important structure is visible. That means using domain expertise to identify candidate variables, considering transformations that reflect real relationships, and being alert to hidden interactions. But then switch roles and interrogate the result. Ask whether the features are merely predictive or whether they are also defensible for the question at hand. Ask whether balance improved in the parts of the covariate space that matter. Ask what unmeasured variable could still break the story.
A useful habit is to treat every variable as having a biography. Where did it come from? What does it measure? When was it measured relative to treatment or outcome? What mechanism links it to the target? This habit protects both feature engineering and causal design from becoming ritualistic. It forces you to see the data as a recorded process, not just a matrix.
Another helpful analogy is cartography. Feature engineering draws roads, rivers, and landmarks so the model can navigate. Propensity score matching draws boundaries carefully so the comparison stays fair. Both require good mapmaking. But a map can be useful for traveling and useless for settling disputes about territory. The mapmaker must know the purpose.
Key Takeaways
- Do not ask only whether a variable is useful. Ask what kind of usefulness it has. Predictive usefulness and causal usefulness are not the same.
- Treat feature engineering as structure discovery, not cleverness. The goal is to reveal real patterns in a form the model can use.
- Use domain expertise aggressively. It is the best tool for identifying which variables may confound an effect and which transformations reflect substantive reality.
- Be suspicious of variables that improve fit but change interpretation. In causal work, especially, better accuracy can hide worse identification.
- Always ask what happens if a key variable is missing. Sensitivity analysis is not optional polish. It is a test of whether your conclusion is brittle.
The deepest lesson: models should learn the world, not the accident of observation
The most important connection between boosted trees and propensity score matching is not technical. It is philosophical. Both methods become powerful only when they are disciplined by a theory of what differences matter. Without that theory, a model may become extremely good at noticing patterns that are statistically real but substantively empty. It may master the accident of observation while missing the structure of the world.
That is the real danger in modern modeling. We are surrounded by tools that can extract signal from nearly anything. The harder task is deciding which signals deserve to be trusted. Feature engineering teaches us to reveal structure. Causal inference teaches us to respect structure. Together they suggest a higher standard: do not merely predict what is correlated. Learn what is relevant, what is pre-treatment, what is stable, and what can survive scrutiny.
When you adopt that standard, modeling stops being a contest of sophistication and becomes an exercise in judgment. The best model is not the one that sees the most. It is the one that sees clearly enough to avoid being fooled by the wrong differences.
Sources
Hatch New Ideas with Glasp AI 🐣
Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)
Start Hatching 🐣