Causal inference · Prologue: Why it matters now

Right for the wrong reason

Why can an AI model predict well and still give the wrong advice?

P1 · 4 min 33 s · published

Because a model learns whatever pattern best predicts the answer, and a pattern that predicts is not a cause. A pneumonia model learned which hospital an X-ray came from. Feedlot records can make antibiotics look deadly, because vets treat the animals most at risk. To answer “what if I do this?” you need an experiment or a causal model.

Key points

  • An AI that read the hospital, not the lungs, usually did worse in hospitals it hadn’t seen.
  • A confounder drives both the decision and the outcome, like the risk a vet sees when cattle arrive.
  • Pearl’s ladder has three rungs, seeing, doing and imagining, and data from the bottom rung can’t climb on its own.
  • Even a correlation of 0.98 across five samples can’t tell you what to change.

Chapters

  1. 0:00 An AI right for the wrong reason
  2. 0:49 What this series is about
  3. 1:15 The same trap on a farm
  4. 2:27 Pearl’s ladder of causation
  5. 3:38 A near-perfect pattern

Key terms

Confounder
Something that affects both a decision and its outcome, so a comparison mixes the treatment’s effect with its own. At a feedlot, the risk a vet sees on arrival drives both which groups get antibiotics and which animals die. When the confounder is the very reason for treating, it is called confounding by indication.
Intervention
A deliberate change to the world, as opposed to watching it. “If I put another pass of nitrogen on this field, what will happen to its protein?” is an intervention question, on the second rung of Pearl’s ladder. Data gathered only by watching can’t answer it on their own.
Counterfactual
What would have happened instead. A field had an extra pass of nitrogen and made thirteen per cent protein: would it have made thirteen per cent without it? Counterfactual questions sit on the top rung of Pearl’s ladder, and every causal effect compares an outcome that happened with one that didn’t.
Ladder of causation
Judea Pearl’s three rungs of causal questions. Seeing: given what I’ve seen, what should I expect? Doing: what happens if I intervene? Imagining: what would have happened instead? Most AI learns on the bottom rung, and data from it can’t climb to the next without an experiment or a causal model.

Transcript

In 2018, researchers trained an AI to spot pneumonia on chest X-rays. On the images it learned from, it did well. Then they looked at what it was using. The model could tell which hospital an X-ray came from, from clues like the type of scanner and the markers stamped on the image. And the hospitals had very different rates of pneumonia.

So part of what looked like diagnosis was the model working out where the patient had been scanned. In hospitals it hadn't seen before, it usually did worse. Nothing in the model was broken. It did exactly what it was built to do: find the pattern that best predicts the answer.

The trouble is, a pattern that predicts is not the same as a cause. This series is about that difference. Where the idea came from, how people learned to measure it, and why it matters for the food we grow and eat. It comes from Vitagri, whose causal engine, Vitagri Vitals, builds causal links between agriculture and food nutrition.

Here's the same trap on a farm. When young cattle arrive at a feedlot after a long journey, some groups get antibiotics straight away, to head off pneumonia before it starts. Vets call it metaphylaxis. Now look back through the records. It's quite possible the treated groups lost more animals than the untreated ones. A model trained on those records would learn that treatment goes with death.

Do the antibiotics kill cattle? No. The vet chose to treat the groups that looked most at risk: lighter calves, mixed from many sources, a long journey, cold rain on arrival. Those same things make animals ill. Something that drives both the decision and the outcome is called a confounder. When the confounder is the very reason for treating, medicine calls it confounding by indication. And here's the hardest part: much of that judgement is never written down. You can't correct for something you never recorded. That's why, when the answer matters, the decision is made at random, so no hidden judgement can line up with the result.

The computer scientist Judea Pearl gave us a simple way to picture the gap: a ladder with three rungs. The bottom rung is seeing. Fields that got more nitrogen grew grain with more protein. Given what I've seen, what should I expect? Most of the AI in use today learns here, from patterns in data it observed.

The second rung is doing. If I put another pass of nitrogen on this field, what will happen to its protein? That's an intervention: a question about changing the world, not just watching it. The top rung is imagining. This field had the extra pass and made thirteen per cent protein, enough for the milling contract. Would it have made thirteen per cent without it? That's a counterfactual: what would have happened instead.

Here's the key point. No amount of data from the bottom rung gets you to the second on its own. You need one of two things. An experiment, where you do the intervening yourself. Or a model of how the world works, drawn up before you look at the data, that tells you what to correct for.

Even a near-perfect pattern isn't enough. On Barn Door Farm, grain zinc tracked fibre across five wheat samples with a correlation of 0.98. Five samples from one season can't tell you what to change. So a model can predict well and still give bad advice, because it learned on the bottom rung. Next time: what happens when AI and causal thinking work together, and where that partnership still falls short.

Questions

What is confounding by indication?

Confounding where the confounder is the very reason for treating. At a feedlot, vets give antibiotics to the groups that look most at risk on arrival: lighter calves, mixed from many sources, after a long journey or cold rain. Those same things make animals ill, so treated groups can lose more animals even if the antibiotics help.

Why make a treatment decision at random?

Because much of the judgement behind a decision is never written down, and you can’t correct for something you never recorded. When the decision is made at random, no hidden judgement can line up with the result, so a difference in outcomes can be put down to the treatment.

What are the three rungs of the ladder of causation?

Seeing: given what I’ve seen, what should I expect? Doing: if I put another pass of nitrogen on this field, what will happen? Imagining: would this field have made thirteen per cent protein without the extra pass? Most AI learns on the bottom rung, and data alone can’t get you to the second.

Sources

  1. Zech, J.R., Badgeley, M.A., Liu, M. et al. (2018). Variable generalization performance of a deep learning model to detect pneumonia in chest radiographs: a cross-sectional study. PLOS Medicine, 15(11), e1002683. doi:10.1371/journal.pmed.1002683
  2. Pearl, J. and Mackenzie, D. (2018). The book of why: the new science of cause and effect. Basic Books. www.hachettebookgroup.com/titles/judea-pearl/the-book-of-why/9780465097616/
  3. Vitagri (n.d.). Barn Door Farm wheat, harvest 2025: grain zinc and fibre across five samples [published case study]. vitagri.org. vitagri.org/predictive-model/

All 30 films · Glossary · The Vitagri Academy

Follow the change in farming

Causal evidence is changing how farming is measured and rewarded. Leave your email and we will tell you when new films, courses and findings are published.

Prefer to read online? Vitagri also writes on Substack. See our privacy policy for how we use your email.