Causal Reasoning

Why a model trained on observational data cannot tell cause from correlation, what that costs when you act on it, and what actually identifies one.

Published Updated

On this page

Definition

Causal reasoning is working out what causes what, rather than what merely goes with what — and the reason it gets its own page is that a machine learning model fitted to observational data cannot do it, no matter how much data or how many parameters you give it. That is not a shortcoming of any particular architecture that a bigger one would fix: several different causal structures produce exactly the same observed correlations, so the information needed to tell them apart is simply not present in the data.

The cost is concrete. A purely predictive model is fine as long as you only use its output to anticipate something. The moment you use it to decide something — treat this patient, discount this customer, show this ad — you are asking a question the model was never able to answer, because acting on a variable changes the very distribution the model was fitted to. This is why a model with excellent accuracy can produce recommendations that are useless or actively harmful, and why "correlation is not causation" is an engineering constraint rather than a debating point.

How It Works

Pearl's ladder of causation

Judea Pearl, who won the 2011 Turing Award for this work, organises the whole subject as three rungs, and the ordering is strict.

Rung one is seeing. It answers what is associated with what: given that I observe a customer contacting support, how likely are they to cancel? Formally P(Y | X). Every regression, every classifier, every recommender and every next-token prediction in a large language model lives here. So does essentially all of machine learning.

Rung two is doing. It answers what happens if I intervene: if I reach out to that customer, does the cancellation rate change? Formally P(Y | do(X = x)), where the do operator means the value was set by an action rather than observed. Seeing a variable take a value tells you about everything that produced that value; setting it tells you only about what follows from it. Those are different quantities, and in general they are not equal.

Rung three is imagining. It answers what would have happened had I acted differently, for a specific case that already happened: this patient received the drug and died — would they have survived without it? Counterfactuals are the rung that credit assignment, blame, regret and most explanation live on, and they cannot be checked against any observation, because the alternative world was never run.

The point that answers the reader's actual question is that these rungs cannot be climbed with data alone. A dataset of observations is rung-one information. Adding a hundred times more rows, or a thousand times more parameters, gets you a better estimate of the same rung-one quantity. To reach rung two you must add something that is not in the data: either an experiment that actually intervenes, or an explicit assumption about the causal structure that you are prepared to defend. "Rain makes the grass wet" and "wet grass makes it rain" imply identical correlations; nothing inside the correlation distinguishes them.

Confounding, stated mechanically

A confounder is a variable with an arrow into both the treatment and the outcome. That is the whole definition, and it is worth holding mechanically rather than intuitively, because the intuitive version ("something else was going on") does not tell you what to do.

People who take vitamin supplements live longer than people who do not. Health-consciousness causes both — it makes you more likely to buy supplements and more likely to exercise, sleep and see a doctor. In graph terms there is a path from supplements back through health-consciousness and forward to longevity: supplements ← health-consciousness → longevity. Association flows along that path even if the pills do nothing at all. Adjusting for the confounder — comparing supplement takers to non-takers within groups of equal health-consciousness — blocks the path, which is why the standard advice is to measure and control for confounders.

Simpson's paradox, worked

Here is the sharpest demonstration that better statistics cannot patch correlation into causation. Charig and colleagues published these kidney stone treatment results in the BMJ in 1986; the counts are real and you can verify every ratio.

TreatmentSmall stones (< 2 cm)Large stones (≥ 2 cm)Overall
A — open surgery93% (81 / 87)73% (192 / 263)78% (273 / 350)
B — percutaneous nephrolithotomy87% (234 / 270)69% (55 / 80)83% (289 / 350)

Treatment A wins on small stones, 93% to 87%. Treatment A wins on large stones, 73% to 69%. Treatment A loses overall, 78% to 83%. Nothing here is a rounding artefact — the same 350 patients per arm, added up two different ways, reverse the answer.

The reversal is caused by who got which treatment. Large stones are harder to treat: 73% success versus 93% on the good treatment. And 263 of A's 350 patients (75%) had large stones, against only 80 of B's 350 (23%). Treatment A was disproportionately given the difficult cases, so its overall number is dragged down by the mix, not by the treatment. Stone size is the confounder, and it has an arrow into both the choice of treatment (surgeons chose open surgery for hard cases) and the outcome.

Note carefully what this does not mean. It is not that the subgroup numbers are "the true ones" and the aggregate is a mistake. Both tables are correct arithmetic on the same data. Which one answers your question depends on a causal claim — that stone size influenced treatment assignment — and that claim comes from knowing something about urology, not from anything in the 700 rows. A statistical procedure with no causal input cannot choose between them, and that is the point.

The collider trap, and why "control for everything" is wrong

The natural conclusion from Simpson's paradox is to adjust for every variable you have. That is exactly the mistake, and understanding why is what separates people who have used causal graphs from people who have heard of them.

A collider is a variable that two others both point into: A → C ← B. Conditioning on a collider creates an association between A and B where none existed.

Take a company that hires an applicant if they either pass the coding test or arrive with a strong internal referral. Suppose the two are entirely independent among applicants: of 100 applicants, 50 pass the test, 50 have a referral, and the four combinations split evenly at 25 each.

PopulationHas referralNo referralReferral rate
All 100 applicants — passed test252550%
All 100 applicants — failed test252550%
The 75 hired — passed test252550%
The 75 hired — failed test250100%

Among applicants, test performance says nothing about referral strength: 50% either way. Among the 75 people actually hired, everyone who failed the test necessarily had a referral — that is the only way they got in — so the referral rate among hired test-failers is 100% against 50% for hired test-passers. A model trained on employee records will find a clean negative relationship between coding ability and referral strength. It is entirely an artefact of conditioning on hired, which both variables cause.

This generalises to every dataset that exists because of a selection process: patients in a hospital, users who completed signup, loans that were approved, papers that were published. Adding a variable to a model is not a neutral act of caution. Adjust for a confounder and you remove bias; adjust for a collider and you manufacture it.

Real-World Applications

Online experimentation platforms are causal inference deployed at industrial scale. Microsoft, Amazon, Netflix, Booking.com and Airbnb each run continuous randomised experiments rather than reading observational dashboards, precisely because the dashboards live on rung one. The most quoted result from Microsoft's experimentation team is that only about one third of ideas that reach an A/B test actually improve the metric they were designed to improve, with roughly another third neutral or negative — a rate that observational analysis systematically fails to reveal, because features tend to be shipped to the users most likely to engage anyway.

Epidemiology established the template. No randomised trial of smoking was ever ethical or possible, so the causal case for smoking and lung cancer was built observationally, by Doll and Hill from 1950 onward and codified in Austin Bradford Hill's 1965 criteria — strength, consistency, dose-response, temporality, biological plausibility. Those criteria are an early, informal statement of exactly the problem this page describes: what has to be true of observational data before a causal claim can be defended.

Economics built the quasi-experimental toolkit and got a Nobel for it: David Card, Joshua Angrist and Guido Imbens shared the 2021 prize for extracting causal conclusions from natural experiments. Card and Krueger's 1994 study is the canonical case — New Jersey raised its minimum wage from $4.25 to $5.05 in April 1992 while neighbouring Pennsylvania did not, giving a comparison that no observational wage regression could construct.

Health policy occasionally gets a true experiment by accident. Oregon expanded Medicaid in 2008 by lottery because demand exceeded funding: roughly 90,000 people signed up for about 10,000 places. Because allocation was random, the resulting comparison is a genuine randomised trial of health insurance on a general adult population — the only one of its kind.

Advertising measurement is where getting this wrong is most expensive. Observational estimates of ad effectiveness compare people who saw an ad to people who did not, but ad systems deliberately target the people most likely to convert. Lewis and Rao's 2015 analysis showed that the resulting bias routinely exceeds the effect being measured, so the observational number can be off by more than the entire true return. This is the same failure that makes an anomaly detection or risk scoring model unsafe to act on directly.

Tooling exists and is open source: DoWhy for stating causal assumptions explicitly and stress-testing them, EconML for heterogeneous treatment effects, Uber's CausalML for uplift modelling, and causal-learn and Tetrad for constraint-based and score-based causal discovery.

Key Concepts

Why randomisation works

Randomised assignment is the gold standard for one specific mechanical reason: it deletes every arrow into the treatment. If a coin flip decides who gets the drug, then nothing — not health-consciousness, not stone size, not anything unmeasured or unimaginable — can influence assignment. Every back-door path is severed at the source, which is why an RCT identifies the causal effect without you needing to know what the confounders were. That last clause is the magic: adjustment requires you to have measured the confounders, and randomisation does not.

The reason people reach for observational shortcuts anyway is cost, and the arithmetic is unforgiving. To detect a lift from a 2.0% to a 2.2% conversion rate — a 10% relative improvement, the kind of result a business genuinely cares about — the standard approximation for 80% power at the 5% level is about 16 × p(1 − p) / δ² users per arm. That is 16 × 0.02 × 0.98 / 0.002², or roughly 78,000 per arm and 157,000 users in total. Halve the effect you want to detect and the requirement quadruples. Most questions worth asking are simply too small to randomise at reasonable cost, which is why the next section exists.

The quasi-experimental toolkit, by the assumption each one buys

None of these are algorithms you can run without thinking. Each buys identification at the price of one assumption that the data cannot verify for you.

  • Instrumental variables need a variable that shifts the treatment but affects the outcome through no other route — the exclusion restriction. Angrist and Krueger used quarter of birth as an instrument for years of schooling, since compulsory-attendance laws mean birth date nudges how long you stay in school while having no plausible direct effect on later earnings. The assumption is untestable and the whole result rests on it.
  • Difference-in-differences buys the parallel trends assumption: absent the intervention, the treated and untreated groups would have moved in step. Grant that, and every confounder that is constant over time cancels out when you subtract the two changes. It says nothing about confounders that were themselves changing.
  • Regression discontinuity exploits an arbitrary cutoff — a scholarship at a test score of 60, a subsidy at an income threshold — and buys the assumption that units just above and just below the line are otherwise comparable. The price is that the estimate is local: it tells you the effect near the threshold and nothing about anyone far from it.

Challenges

A model that predicts well can recommend disastrously

The most useful example in the literature comes from a 1990s multi-hospital study of pneumonia patients, reported by Rich Caruana and colleagues at KDD in 2015. A model trained to predict mortality learned a rule that was accurate and lethal: patients with asthma had lower risk of dying from pneumonia. The correlation was real. The reason was that asthmatic patients presenting with pneumonia were considered high-risk, so they were admitted directly to intensive care and treated aggressively — and that worked. Asthma was a marker for receiving better care, not a cause of survival. As a forecast, "asthmatics do better" was correct. As a decision rule — send asthmatics home, treat them as low priority — it would have killed people, and it would have destroyed the very correlation it was built on, since the good outcomes depended on the aggressive treatment that the rule removes.

The pattern recurs everywhere and is easy to spot once named. Customers who contact support churn more, so a naive model flags support contact as a churn driver — but suppressing support contact does not retain anyone, because contacting support is a symptom of the dissatisfaction rather than its cause. Users who install the mobile app have higher lifetime value, so growth spends heavily on app installs, and discovers that the app was a marker of already-committed users. In each case the model is right about rung one and silent about rung two, and the deployment treats its silence as agreement. This is also why a model can pass every robustness and generalization check on held-out data and still fail on contact with the world: held-out data comes from the same distribution, and acting is precisely what changes the distribution.

Causal discovery from data alone is hard, and often impossible

Algorithms that recover causal graphs from observational data (PC, FCI, GES, LiNGAM and their descendants) do exist, but they generally cannot return a single graph. They return an equivalence class — a set of structures that all fit the observations identically — and the choice within it needs background knowledge, time ordering or a functional assumption such as additive non-Gaussian noise. Unmeasured confounding, selection effects and measurement error each degrade the result further, and none of them announce themselves.

Where large language models actually sit

The honest position is narrow and worth stating precisely. An LLM has read an enormous quantity of text in which humans state causal relationships, so it can reproduce the causal claim that smoking causes lung cancer, or that altitude affects temperature, with high reliability. That makes it genuinely useful in a causal workflow: proposing candidate confounders a researcher forgot, drafting a plausible first graph, flagging that a proposed adjustment set looks like a collider, translating a vague business question into a well-posed intervention.

But reproducing causal claims found in text is not inferring causal structure from data. The model repeats what its sources concluded, inherits their errors, and has no independent purchase on any relationship nobody has written down — which is exactly the situation for the proprietary dataset you actually want analysed. Fluent causal language is also not rung-two capability: writing a paragraph about counterfactuals and computing one are different operations. Treat an LLM as a well-read collaborator whose hypotheses still need an experiment and it earns its place; treat its output as an identification strategy and you have added confident prose to an unidentified estimate. The same caveat applies when using one to produce explanations of another model's behaviour.

Frequently Asked Questions

Causal reasoning is working out which variable actually produces a change in another, rather than which variables merely move together. It is what lets a system answer 'what happens if I intervene?' instead of only 'what usually accompanies what?'
Because the information is not in the data. Many different causal structures produce exactly the same observational distribution, so no amount of extra rows or parameters can distinguish them. Climbing from correlation to causation requires either an experiment or an explicit, defended assumption about structure.
Three rungs: association (seeing what goes with what), intervention (what happens if I do this), and counterfactuals (what would have happened had I acted differently). A model fitted to observational data lives entirely on the first rung.
A reversal in which a treatment looks worse overall but better within every subgroup, because the subgroups were not assigned the treatment at equal rates. In the 1986 kidney stone data, open surgery beat percutaneous nephrolithotomy on both small stones (93% vs 87%) and large stones (73% vs 69%), yet lost overall, 78% to 83%.
A collider is a variable that two others both cause. Conditioning on it creates an association between those two causes even when none exists in the population. This is why 'control for everything you have' is bad advice: adjusting for a collider manufactures a spurious relationship rather than removing one.
They can reproduce causal knowledge written down in their training text, which makes them genuinely useful for proposing hypotheses and candidate confounders. That is retrieval of causal claims, not inference of causal structure from data, and the two fail in different ways.

Continue Learning

Explore our use-case guides and prompts to deepen your AI knowledge.