Causal Models and Interventions › Interventions and the do-Operator

Michael BrenndoerferJune 21, 20267 min read
World Models HandbookAll chapters
Part 4 of 12Space, Physics, and Causality
Chapter 21Causal Models and Interventions › Interventions and the do-Operator
Reading section 4 of 14 · Interventions and the do-Operator · 7 minSection 4 of 14 · 7 min

Book contents

Section 4 of 14 · 7 min read

Causal Models and Interventions › Interventions and the do-OperatorOne section · Sections in this chapter4 / 14 ↓

An intervention is the surgical act of reaching into a system and replacing one mechanism with another. Every non-target mechanism and the distribution of the exogenous variables are held fixed; an interventional distribution still averages over exogenous realizations rather than retaining one episode's realized profile. Retaining the same realization is the additional cross-world commitment made by a counterfactual. This modularity clause is what makes the do-operator a useful model of action: when you set the thermostat, the model changes one rule and lets the rest of the causal network propagate the consequences.

The do-Operator

The intervention do(X=x)\mathrm{do}(X = x) replaces the structural mechanism X=fX(pa(X),uX)X = f_X(\mathrm{pa}(X), u_X) with the constant X=xX = x. All other mechanisms are left alone. The resulting distribution is computed with the truncated factorization:

P(v1,…,vn∣do(X=x))=∏Vi∈V∖{X}P(vi∣pa(vi))∣X=x,P(v_1, \dots, v_n \mid \mathrm{do}(X = x)) = \prod_{V_i \in V \setminus \{X\}} P(v_i \mid \mathrm{pa}(v_i)) \bigg|_{X = x},

that is, the product over all mechanisms except the one that was replaced.

where:

  • XX: the endogenous variable being intervened on, with xx the value forced on it
  • Vi∈V∖{X}V_i \in V \setminus \{X\}: the product runs only over variables whose mechanisms were not replaced
  • ∣X=x\big|_{X = x}: wherever XX appears as a parent of a surviving mechanism, substitute the constant xx.

Graphically, the intervention mutilates the causal graph by deleting every edge into XX.

The word "mutilates" is chosen deliberately and is worth a moment of discomfort. Deleting the edges into XX does not mean the parents stop influencing the world; it means they stop influencing XX through the intervened mechanism. In the sprinkler graph, do(T=1)\mathrm{do}(T = 1) deletes the edge from SS to TT, so sprinkler state no longer depends on or conveys information about season, but season still causes rain, and rain still wets the grass. The truncated factorization expresses this operation algebraically: delete one factor from the product and substitute the forced value wherever the variable appears as a parent. For continuous variables, read the factors as conditional densities.

The essential distinction is between conditioning and intervening:

  • Conditioning on X=xX = x means selecting the subpopulation where XX happens to equal xx. The parents of XX are still active, so their influence remains.
  • Intervening on X=xX = x means forcing XX to equal xx regardless of its parents. The influence of the parents is severed.

A useful way to hold this distinction in mind is to think about who is responsible for XX taking the value xx. Under conditioning, the value arises through the normal operation of the mechanisms, so observing X=xX = x is also evidence about the parents: if the sprinkler is on, the season is probably dry. Under intervention, the value is imposed from outside, so it carries no evidence about anything upstream. Conditioning is listening; intervening is speaking. Confusing the two is a recurring source of error across applied fields, but selection bias, collider bias, regression to the mean, and off-policy distribution shift are distinct phenomena rather than synonyms for one mistake.

In the sprinkler model with W=R∨TW = R \lor T, both P(wet∣T=1)P(\text{wet} \mid T = 1) and P(wet∣do(T=1))P(\text{wet} \mid \mathrm{do}(T = 1)) equal exactly 1, since a forced-on sprinkler wets the grass regardless of season. The season-mixing contrast instead appears at T=0T = 0: observing that the sprinkler is off is evidence for the wet season and raises the probability of rain, while forcing it off carries no such evidence, so P(wet∣T=0)≈0.51P(\text{wet} \mid T = 0) \approx 0.51 exceeds P(wet∣do(T=0))=0.45P(\text{wet} \mid \mathrm{do}(T = 0)) = 0.45. In this particular example, conditioning on T=0T = 0 makes wetness look higher than intervention does, because a switched-off sprinkler is a marker for the wet season, and the two effects pull in opposite directions. The general lesson is that the sign and size of the gap between seeing and doing is unpredictable without a causal model; there is no rule of thumb like "association overestimates causation." The gap can go either way, which is why it must be reasoned about explicitly.

For agents, planning treats a chosen action as an intervention on the action node. Logged trajectories are different: their actions are assignments generated by a behavior policy. On-policy and off-policy data can differ in support without either being hidden-confounded, and behavioral cloning reproduces the behavior policy's conditional action distribution rather than automatically inheriting unmeasured confounding. Hidden confounding arises when information omitted from the modeled history influences both policy choices and downstream outcomes. Keeping policy assignment, support shift, and intervention semantics separate is essential when deciding what a fitted model can support.

Interventions come in flavors worth distinguishing, and the distinctions matter because real agents rarely perform the textbook version:

  • Hard interventions replace the mechanism entirely, as in do(X=x)\mathrm{do}(X = x).
  • Soft interventions modify a mechanism without fully specifying the value, for example by randomizing XX or by altering the strength of a parent's influence while keeping noise. They can be more realistic for some systems and, when the intervention targets, design, availability, and model assumptions are sufficiently informative, can identify causal structure that the available hard-intervention design does not. A soft intervention that changes how XX depends on its parents can reveal direction in suitable model classes even when the experimenter cannot directly set XX to an exact value.
  • Uncertain interventions arise when the realized target or strength of a perturbation is not known exactly. A robot command can be a hard intervention on a command variable while the physical actuator state remains a stochastic downstream consequence shaped by dynamics, latency, and contact. Modeling error appears when those two variables are collapsed; representing both preserves an exact command intervention without pretending the realized effect is certain.

Identification is the question of when a Rung 2 quantity can be computed from Rung 1 data plus assumptions. This framing converts a philosophical question, "can we ever learn causation from correlation?", into a precise, per-model question: "given this graph, observed variables, and distributional assumptions, is the interventional quantity determined by the observational distribution?" Sometimes the answer is yes and sometimes no. One standard tool is the backdoor criterion: if ZZ contains no descendant of XX and blocks every path from XX to YY that starts with an arrow into XX, then, under consistency and positivity,

P(Y∣do(X=x))=∑zP(Y∣X=x,Z=z) P(Z=z).P(Y \mid \mathrm{do}(X = x)) = \sum_{z} P(Y \mid X = x, Z = z)\, P(Z = z).

where:

  • ZZ: the adjustment set, the observed variables that block every backdoor path from XX to YY
  • zz: a value the adjustment set can take; the sum averages over all of them (replace it by an integral when ZZ is continuous)
  • P(Z=z)P(Z = z): how often that value occurs, which weights the contribution of each stratum

The intuition behind the formula is worth spelling out. A backdoor path is a route of association between XX and YY that does not flow through the causal arrow X→YX \to Y, typically a common cause like the heat load in our opening example. Under the stated assumptions, stratifying on ZZ compares units with the same measured common causes; the outer sum then averages the stratum-specific conditional outcomes over the target population. This can identify the same population contrast as a randomized experiment, though it does not literally randomize the data and remains vulnerable to unmeasured confounding and model error. Off-policy importance weighting is related but different: state or context supplies the adjustment strata, while weights such as πtarget(a∣s)/πbehavior(a∣s)\pi_{\mathrm{target}}(a\mid s)/\pi_{\mathrm{behavior}}(a\mid s) correct the behavior policy's action selection.

This is the adjustment formula. It tells you that with a valid adjustment set and the required support, an interventional distribution can be computed from observational conditionals. When no valid observed set exists, the effect is not identified by this formula; an experiment, an instrument, a front-door strategy, a proxy model, or other stronger structural assumptions may still identify it. The underlying limitation is informational rather than a matter of estimator sophistication. Two causal models can assign the same probability to every observed dataset while disagreeing about the effect of XX on YY. In off-policy evaluation, propensity weighting corrects policy selection only when the needed exchangeability and support assumptions hold.