all lessons/ world_models/ 07 · actions and causalitylesson 7 / 16

Actions and causality

Watching what agents usually do reveals correlations. Predicting what your action will cause is a different question — one that needs interventions, coverage, and a model that never confuses the data-collection policy with the world.

Where we are
Lessons 01–06 gave us belief state, action-conditioned dynamics, uncertainty, and stable rollouts. One assumption slipped by unexamined: that the action effect learned from logged trajectories is the effect the agent gets when it chooses that action itself. This lesson pins down when that assumption holds — and what to do when it doesn’t.
Forced by 06Action-conditioned rollouts under supplied actions. This stepSeparate observation from intervention: confounding, identification, support. Forces 08A causal model can now be safely consumed by imagination.

1 · The braking paradox

Train a model on dashcam video and it learns, correctly, that hard braking and collisions go together. So does braking cause collisions? Obviously not — drivers brake because a crash is already looming. The correlation is real and completely misleading, and a planner that trusts it will learn to avoid the brake pedal. That gap — between “what usually follows action a in the log” and “what my action a causes” — is the whole lesson.

Put it in the planner’s terms. At time t the agent has history Ht = (o≤t, a<t), a belief bt, and candidate actions. Its real question isn’t “what came after a before?” It is:

If I deliberately set At = a from this situation, how will the distribution of St+1, Ot+1, and reward change?

We’ll write random variables in uppercase (S,O,A) and specific realized or chosen values in lowercase (s,o,a), so we can cleanly separate “the logged At happened to equal a” from “the agent forced At=a.” Those two are not the same operation, and a model can nail held-out trajectories by learning the old controller’s habits, then fail the moment a new planner picks an unusual action.

From first principles, keep three mechanisms separate:

  1. The environment evolves by state and action: St+1 = f(St, At, εt), with exogenous process noise εt — influences from outside our model.
  2. The sensor emits an observation: Ot+1 = g(St+1, ηt+1), with sensor noise η.
  3. The behavior policy produced the log: At = πb(Ht, ξt), with policy randomness ξ.

The behavior policy is a data-collection habit, not a law of physics. A causal world model must learn the first two mechanisms without baking in the third — otherwise changing the policy will look like changing “the world.”

2 · Where the false signal comes from

Trace the braking paradox to its root. A hidden road condition U affects both the driver’s braking A and the stopping success Y: ice makes drivers brake hard, and ice also makes stopping harder. The causal graph has U → A, U → Y, and the genuine action edge A → Y. The path A ← U → Y is a backdoor path — it manufactures association between action and outcome that the action never actually transmits.

That is confounding: a common cause of both the action and the outcome. The confounder needn’t be literally invisible; it’s enough that the state fed to the model leaves it out or blurs its relevant values. In a partially observed world, road friction, another person’s intent, battery health, or object mass can all quietly play U.

Observation versus intervention
Raise P(hard | icy) so the driver reserves hard braking for ice. The observational effect flips negative while do(a) stays positive — the sign flip is confounding, computed live from the §4 numbers.
Interactive causal graph.
hard − gentle
meaning
policy use
to fix

One honest caveat. If St were the complete causal state — Markov, fully observed, containing every common cause of At and St+1 — then the ordinary conditional transition p(st+1 | st, at) would equal the interventional one p(st+1 | st, do(at)). So it isn’t that action-conditioned models are always non-causal. The problem is that learned latents and finite histories may not be causally sufficient — and low prediction loss never proves that they are.

3 · Conditioning and intervening are exact — and different

Conditioning filters the data to cases where something was observed. p(Y | A=a) asks: among trajectories where the behavior policy happened to choose a, how often did each outcome occur? Seeing the action is evidence about its causes — if hard braking mostly happens on ice, then seeing hard braking makes ice more likely.

Intervening edits the data-generating process itself. Pearl’s do(A=a) replaces the structural equation A = πb(H,ξ) with the constant assignment A := a. Graphically, it cuts every arrow into A while keeping the arrows out of it — the weather doesn’t change just because an experimenter forces the brake. The two operations differ in exactly one term:

p(Y | A=a) = Σu p(Y | a,u) p(u | a)    observational p(Y | do(A=a)) = Σu p(Y | a,u) p(u)    interventional

Read term by term: Y is the outcome, A the action, U the common cause. The first weights road conditions by p(u|a) — the mix the old policy selected. The second weights by p(u) — the mix in the target population. They’re equal only under extra conditions: randomized action, U not affecting the action, or Y not varying with U. In a sequential model we want a belief-conditioned causal transition, p(St+1 | bt, do(At=a)) — “start from this belief, then force this action.” Dropping the starting state (p(s'|a)) is usually too crude: the same throttle does very different things uphill, downhill, or against a wall.

4 · Do the numbers: hard braking looks harmful

Let U ∈ {dry, icy}, A ∈ {hard, gentle}, and Y=1 mean “stops within 20 metres.” Instead of a probability grid, build it the way nature and the driver do:

  1. Nature picks the road. 80% dry, 20% icy — the population we care about.
  2. The driver reads the road and brakes. Hard braking is rare on dry roads (probability 0.10) but common on ice (0.90). So the action itself leaks information about difficulty.
  3. Physics turns road + action into outcome. Dry: success 0.90 hard, 0.70 gentle. Icy: both worse, but hard still beats gentle, 0.40 vs 0.10.

Notice the physical truth before any arithmetic: hard braking is better on each road. Yet the log can reverse that, because hard braking was aimed disproportionately at the harder road. Follow both computations so their different meanings stay visible.

What the log reports. Hard braking happens with probability 0.8×0.1 + 0.2×0.9 = 0.26; successful hard-brake cases have probability 0.8×0.1×0.9 + 0.2×0.9×0.4 = 0.144. So:

P(Y=1 | A=hard) = 0.144 / 0.26 ≈ 0.554

Gentle braking happens with probability 0.74; successful gentle cases have probability 0.8×0.9×0.7 + 0.2×0.1×0.1 = 0.506. So:

P(Y=1 | A=gentle) = 0.506 / 0.74 ≈ 0.684

The log says hard braking is 13 points worse. Now intervene, holding the population’s road mix fixed:

P(Y=1 | do(hard)) = 0.8×0.90 + 0.2×0.40 = 0.80 P(Y=1 | do(gentle)) = 0.8×0.70 + 0.2×0.10 = 0.58

The causal answer says hard braking is 22 points better. Nothing paradoxical happened — we answered two different questions with two different road mixtures. The old policy reserved hard braking for hard cases, so the action smuggled in the difficulty. If road condition is observed and blocks the backdoor, the second formula recovers the truth; if it’s hidden, the effect may not be recoverable at all — and a bigger transformer just estimates the observational distribution more precisely while staying precisely wrong about the intervention.

5 · Identification: when does data even determine the answer?

A causal effect is identifiable when the observed-data distribution plus stated assumptions pins it down uniquely. This is not the same as having enough samples: with few samples an identifiable effect just has wide error bars; with hidden confounding, infinite observational data can still leave several causal stories equally compatible. The usual routes to identification:

Adjustment trap
More conditioning is not always safer. Conditioning on a collider — a variable caused by both the action and another cause — creates spurious association. Conditioning on a mediator removes the very effect you wanted. Choose adjustment variables from a causal story, not from a feature-importance ranking.

6 · Positivity: you can’t learn an untried choice for free

Even with no confounding, estimation needs support (positivity, overlap). For every situation the target policy may visit, the data must have actually tried each action whose effect you want:

π(a | b) > 0 ⇒ πb(a | b) > 0

In words: if your new policy might choose a at belief b, the logger must have sometimes chosen it there. And “nonzero” is only the mathematical floor — if the probability is tiny, estimates have enormous variance and the network extrapolates instead of inferring.

This is why expert demonstrations are both precious and dangerous. Experts give competent behavior in common states, but they deliberately avoid collisions, unstable grasps, extreme torques, and recovery states — so action support is narrow and failures are missing. A planner optimizing against such a model searches far harder than any test set, and may discover an unsupported action with a gloriously high predicted reward. That is model exploitation, not intelligence.

The naive reflex is “collect more data,” but volume isn’t the missing ingredient — which alternatives were tried from which situations is. That dictates a staged strategy:

  1. Start with expert logs to learn the ordinary operating region cheaply — knowing their competence is also their blind spot.
  2. Add controlled random exploration where consequences are reversible. Randomization breaks the action↔difficulty link and gives locally clean effects; it’s unsafe as a universal policy, so keep it bounded.
  3. Mix multiple purposeful policies to widen state and action coverage — though each can still use hidden information, so diversity reduces one weakness without erasing confounding.
  4. Use a simulator to repeat dangerous or rare interventions cheaply via matched-start resets — inheriting a sim-to-real gap wherever contact, friction, or human response differ.
  5. Finish with guarded online exploration aimed at decision-relevant uncertainty, under constraints, monitoring, and a fallback controller.

Order matters: experts ground normal behavior, controlled diversity exposes alternative effects, simulation expands the safe envelope, and guarded reality corrects simulator and model bias. No source suffices alone — each trades one kind of evidence for one kind of risk. And inverse-propensity weighting can correct observed selection by reweighting a sample by roughly π(a|b)/πb(a|b) — but when πb is near zero the weight explodes, when it’s zero nothing helps, and propensity methods never touch hidden confounding.

7 · Counterfactuals ask an even sharper question

An intervention is population-level: what outcome distribution would result if action a were forced? A counterfactual is about this specific episode: given that this vehicle actually braked gently and stopped after 24 metres, what would its stopping distance have been had it braked hard? In a structural causal model, that takes three steps:

  1. Abduction: infer a posterior over the exogenous variables ε from the factual history — this episode’s particular friction, delay, disturbances.
  2. Action: replace the action equation with A:=a'.
  3. Prediction: re-run the modified mechanisms using the same inferred ε.
Ya′(u) = outcome produced for the same unit u when A is set to a′

That “same noise” is what makes it counterfactual. Sampling a fresh road and fresh disturbances under each candidate action compares two different possible episodes — enough for expected-value planning, but not the individual counterfactual. Individual effects are generally harder to identify than average intervention effects, because you never observe both Ya and Ya′ for the same real episode.

8 · Some actions change the world; others reveal it

Actions reach utility by two routes. A world-changing action alters physical state: push the box, brake, deliver medicine. An information action alters what the agent will observe: move the camera past an occluder, tap an object to gauge stiffness, ask a clarifying question. One action can do both. For active perception, write the two mechanisms separately:

St+1 ~ p(St+1 | St, do(At));   Ot+1 ~ p(Ot+1 | St+1, At)

A camera rotation barely changes the scene state but strongly changes the next observation, which updates belief:

bt+1(s′) ∝ p(ot+1 | s′,at) Σsp(s′|s,at)bt(s)

(predict the next state from the old belief, then reweight by how well each state explains the new observation). An information action is worth taking when that belief update improves later decisions — its immediate physical reward may be negative (it costs time) while its value of information is positive:

VOI(a) = Eo~p(o|b,a)[maxa′ Q(b′(o),a′)] − maxa′Q(b,a′) − cost(a)

Term by term: expected value after seeing the action’s observation, minus value if you act now without it, minus sensing cost. A world model that predicts physical reward but never models belief change will systematically undervalue looking, probing, and asking.

9 · Train and plan without pretending uncertainty is knowledge

A practical system pairs causal design with uncertainty-aware control. Learn a belief representation from history, but pressure it to keep variables that predict outcomes under varied policies — not just variables that identify the logger. Train ensembles or a Bayesian approximation to expose disagreement in poorly supported regions, record behavior-policy probabilities when you can, and add intervention data where it matters. At planning time, score reward while penalizing unsupported or disputed transitions:

belief = infer_belief(observation_history, action_history)
for candidate_sequence in action_sequences:
    imagined = belief
    score = 0
    for action in candidate_sequence:
        next_dist = world_model.predict(imagined, do=action)
        uncertainty = ensemble_disagreement(next_dist)
        support = behavior_density(imagined, action)
        if violates_hard_constraint(next_dist):
            score = -infinity
            break
        score += expected_reward(next_dist)
        score -= beta * uncertainty
        score -= gamma * support_penalty(support)
        imagined = next_dist
    record (candidate_sequence, score)
choose first action of the highest-scoring candidate_sequence
execute, observe reality, update belief, and replan

The explicit do=action is a semantic reminder — an API flag cannot make observational training causal. β governs caution about ignorance; γ discourages straying from demonstrated support; hard constraints protect outcomes too costly to trade for reward; receding-horizon execution limits how long the agent trusts an uncorrected model. These safeguards have real costs: a big support penalty is safe but blocks improvement past the demonstrator; a small one allows discovery but invites exploitation. The right setting depends on reversibility, severity, monitoring latency, and how fast real observations correct the belief.

10 · Diagnostics: did it learn control, or just correlation?

Ordinary held-out likelihood is necessary but not sufficient, because train and test logs can share the same policy. Add tests that isolate the action’s effect:

The sharpest test freezes the start belief, optimizes actions against the model, then executes only in a high-fidelity simulator or guarded real setup. If predicted return rises while actual return falls, the planner found a model error — track this optimization gap as you turn up the optimization pressure.

11 · Failure modes and what they imply

Read each failure as a causal trace — symptom, then the shortcut or missing mechanism, then a test that can falsify it before you apply the repair.

  1. Different actions produce nearly identical rollouts. Passive state already predicts most frames, so the lazy loss-minimizer ignores the action. Balance intervention data, add action-sensitivity tests, and weight task-relevant action consequences. Success = changing only the action produces the right sign, size, delay, and variables.
  2. An action “works” only under the training controller. Policy identity or hidden state stayed confounded with the action. Collect multi-policy or randomized data, improve the causal state, and test under a controller with different frequencies. If the effect vanishes after the policy shift, the model learned the logger, not the physics.
  3. The planner picks extreme, unnatural controls. Optimization crossed the support boundary into optimistic extrapolation. Constrain actions, penalize epistemic uncertainty, collect targeted safe data — and watch the predicted-vs-realized gap widen as pressure rises; that widening is the signature.
  4. Prediction leans on camera shake or dashboard cues. A post-action cue leaks the command through an easier route than physics. Mask nuisance channels, alter overlays, randomize camera effects, test temporal order. A real action model keeps its prediction after those correlates are broken.
  5. Counterfactual videos change unrelated background details. Each branch drew fresh latent noise, so it’s a different episode, not a different action in the same one. Share inferred exogenous variables across branches; unrelated background should then hold fixed while true descendants change.
  6. The agent never looks before a risky manipulation. The model omits action-dependent observations or the value of information. Model belief updates and train sensing actions on later decision value, not immediate reward. Test whether a look reduces posterior uncertainty and improves the next choice.
  7. Offline metrics are great, online return collapses. The planner induced a new state–action distribution the passive test set never measured. Evaluate closed-loop, map support along chosen plans, re-observe reality, and iterate collection. The decisive test is not another random holdout — it’s whether error concentrates where optimization chooses to go.
Shortcut warning
Action tokens often correlate with dashboard overlays, controller sounds, camera shake, or future frames that leak the action. A network can ride those cues to continue video without learning how the command changes the scene. Remove the leakage and test interventions from matched beliefs.

12 · A first-principles checklist

  1. Name the causal query. Average intervention, individual counterfactual, or just forecasting the current policy? Specify outcome, horizon, starting population, and action.
  2. Draw the mechanisms. Separate latent environment, sensor, behavior policy, reward, and possible hidden common causes; mark which variables are pre-action, post-action, or selected into the dataset.
  3. Audit identification. State why the effect follows from the data: randomization, sufficient adjustment, a valid instrument, multiple environments plus invariance, or trusted structure.
  4. Audit overlap. Compare target-policy actions with logger support in the states the target will visit; treat weak support as epistemic uncertainty, not a license to interpolate.
  5. Design interventions. Spend experiment budget where effects are uncertain and decision-relevant; respect constraints, use simulation or guarded trials for high stakes.
  6. Evaluate under optimization. Test matched starts, action swaps, policy shifts, long rollouts, and adversarial plans — prediction on untouched logs doesn’t simulate deployment.
  7. Close the loop. Execute a short prefix, observe, update, detect mismatch, fall back safely. Causal learning cuts model error; feedback caps the cost of what remains.

Where this points next

We can now state the contract imagination needs: a belief-conditioned model that predicts the consequences of chosen actions, preserves uncertainty, and flags when a plan leaves identifiable support. Lesson 08 puts that model to work as a training environment — generating synthetic trajectories to train a policy inside imagination — while carrying the caution forward: imagined experience is only worth as much as the causal mechanism it visits.

Takeaway
Action-conditioned prediction is not automatically causal. Conditioning preserves the behavior policy’s selection; do(a) replaces that selection and asks what the action itself changes. Recovering the answer needs a causally sufficient state or a valid identification strategy, plus state–action support. Then planning must still respect epistemic uncertainty, value information-gathering actions, test matched counterfactuals, and re-observe reality before model errors compound.

Interview prompts