Chan et al. 2022
Causal scrubbing is a strict test of a circuit hypothesis. Given a claim about which parts of a system carry a computation, it resamples, or 'scrubs', everything the hypothesis says is irrelevant, replacing those signals with values from other inputs, and checks whether the behaviour still holds. If the hypothesis is correct, scrubbing the irrelevant parts should not hurt performance; if it is wrong, performance should drop. It is one of the most demanding validation methods in mechanistic interpretability, because it tests a whole hypothesis at once rather than one edge. We apply it to the VCS by resampling activations outside a hypothesised circuit and measuring whether the program's behaviour is preserved. On this machine the true data-flow hypothesis, which we know from the disassembly, passes cleanly: scrubbing everything outside it preserves the behaviour on every game, while a deliberately wrong hypothesis fails, and the two are told apart on every game. This makes causal scrubbing exact here, because the resample-and-re-run operation is a genuine intervention on a fully observable machine. As with the other exact methods, the caveat is that confirming the correct wiring is not the same as recovering what the circuit means or how its variables combine into the computed function.
New to explainable AI? This block explains the method as it is used on neural networks, then how we run the very same method on an Atari 2600, where — unlike for a network — we know the right answer. Every implementation step links to the code. See also the XAI primer for the shared vocabulary.
Most interpretability methods produce explanations. Causal scrubbing checks one. You bring a hypothesis: “for this behaviour, only these parts of the network matter, and they compute this”. Causal scrubbing turns that sentence into an experiment that the hypothesis can fail.
The trick is a simple consequence of the claim. If a part really does not matter, then replacing its activation with the activation it had on a different, random input should not change the behaviour. So: take everything the hypothesis calls irrelevant, resample it from other inputs (this is the “scrubbing”), run the model, and measure how much of the original performance survives. If it all survives, the hypothesis passes. If performance collapses, something the hypothesis called irrelevant was in fact doing work. It tests a whole explanation at once, not one component at a time, which makes it one of the strictest checks in mechanistic interpretability.
A hypothesis has three parts: the model's computational graph \(G\), a simpler “story” graph \(I\), and a map \(c\) saying which nodes of \(G\) implement which nodes of \(I\). Scrubbing rewrites the forward pass on input \(x\). Every activation not claimed by the hypothesis is taken from a random other input \(x'\). Every activation that is claimed may be taken from any input \(x''\) that agrees with \(x\) on the feature the story says it computes. The score is the share of the loss gap that survives:
\[ \text{loss recovered} \;=\; \frac{\mathbb{E}[L_{\text{random}}] - \mathbb{E}[L_{\text{scrubbed}}]} {\mathbb{E}[L_{\text{random}}] - \mathbb{E}[L_{\text{model}}]} . \]1 means the hypothesis explains all of the behaviour; 0 means it explains none of it. \(L_{\text{random}}\) is the loss when everything is resampled.
Toy example. A model computes \(y = 3x_1 + 0\cdot x_2\). The clean input is \(x=(1,4)\), so \(y=3\). A random other input is \(x'=(2,7)\). Hypothesis A: “only \(x_1\) matters”. Scrub \(x_2\) to 7: \(y = 3\cdot 1 + 0 \cdot 7 = 3\). Unchanged, so A passes. Hypothesis B: “only \(x_2\) matters”. Scrub \(x_1\) to 2: \(y = 6\). The output moved, so B fails. A real test resamples many \(x'\) and averages, because one lucky resample can hide a dependence.
| Components of the network | The candidate RAM cells of the game (for Pong: the two scores, paddle positions, ball position). |
|---|---|
| The behaviour | The value of output cells after the 15-frame horizon: cells that are driven by other cells but drive none themselves. |
| The hypothesis | A set of cells claimed to carry the behaviour. The TRUE one is the outputs plus all their ancestors in the exact data-flow graph. |
| Resampling from another input | Writing a different value into an out-of-circuit cell at \(f^*\): each value from the oracle set {0, base+17, base+37} except the current one. |
| Loss recovered | Scrubbing-preserved performance: the share of (trial, output) pairs whose output byte equals the clean run. |
| A wrong hypothesis | The true circuit with one demonstrably live ancestor swapped for an irrelevant cell, keeping the size the same. |
On a network you must guess the hypothesis. On the VCS we can compute the true one and
then check that scrubbing rewards it and punishes a false one. Our runner
causal_scrubbing.jl does this per game:
Where we differ from the original. The resample values are not activations from other real inputs. They come from the oracle's fixed value set, the same set used to build the true graph. The hypothesis is also only a set of cells: it makes no claim about what each cell computes, so there is no “consistent” resampling of in-circuit cells. Because the true circuit is built from the same interventions, its pass is close to guaranteed; it can still fail if several scrubbed cells interact. The informative half of the experiment is the wrong hypothesis: it must fail, and it shows that the test can tell a right story from a wrong one.
XAI the interpretability method substrate the bit-exact emulator it runs on (jutari, Julia).
causal_scrubbing.jl:289 — The scrub: overwrite every out-of-circuit cell, keep circuit cells, replay the tail.causal_scrubbing.jl:276 — The resample distribution per cell: {0, base+17, base+37} minus the current value.causal_scrubbing.jl:221 — The exact data-flow graph the true hypothesis is derived from.causal_scrubbing.jl:245 — Transitive closure: every cell with a path to an output joins the true circuit.causal_scrubbing.jl:352 — Chooses the behaviour: sink cells of the true graph that have at least one ancestor.causal_scrubbing.jl:426 — Builds true and wrong hypotheses, runs every scrub trial, computes pass/fail and the triad.shared_testbed_impl.jl:115 — The shared gameplay checkpoint, action tail and clean continuation.jutari_oracle.jl:176 — Writes one byte into emulated RAM: the physical act of scrubbing a cell.StellaEnvironment.jl:259 — One bit-exact video frame; each scrub trial replays 15 of them.oracle_intervene.jl:242 — The exact intervention oracle behind the shared state's cause-density gate.The figure shows two preservation maps for Pong (output cell × scrub trial): one for the true hypothesis and one for the wrong one. Expect the true map fully preserved and the wrong map broken in some trials, and the same split game after game in the scores. That pattern means two things. The test is sensitive: it catches a story that wrongly calls a live cell irrelevant. And it is exact here, because each resample is a real intervention on a fully observable machine, not an approximation. What a pass does not tell you is how the circuit computes the behaviour. It confirms the wiring, not the algorithm.
julia --project=jutari tools/xai_study/phaseC_mechanistic/causal_scrubbing.jl --games core
Writes causal_scrubbing_<game>.{json,npz} and causal_scrubbing_core_summary.json into tools/xai_study/phaseC_mechanistic/out/. --selftest runs a quick check on Pong.
Read next: ACDC — automatic circuit discovery · Interchange interventions / DAS · Path patching / IOI circuit · Activation patching / causal mediation
The score is the behaviour preserved when resampling activations consistent with a hypothesised circuit. We scrub, that is resample, everything the hypothesis marks as irrelevant and measure whether the program's behaviour still holds. The grading is always against the intervention oracle. For the true data-flow hypothesis, which we know from the disassembly, scrubbing preserves the behaviour on every core game, so the preserved performance is at the ceiling; a deliberately wrong hypothesis fails, and the two are told apart on every game. Faithfulness for this method is that preserved-performance score, and it is exact here, because the resample-and-re-run operation is a genuine intervention on a fully observable machine. There is no sprite-position hard-case here, because the method works by intervention rather than by a gradient. The grading is a pass/fail of a whole hypothesis against the oracle, not a comparison to another method. The important qualification, which the score does not by itself capture, is that confirming the correct wiring is not the same as recovering what the circuit means or how its variables combine. The audit box reports the measured triad, with faithfulness at the ceiling on the correct hypothesis.
The score is measured against the §1 intervention oracle — never against another interpretability method. F (faithful) is always vs the oracle; see the execution stack. How each of F / S / M is actually computed for this method (and whether it matches the paper) is in the box just below; the numbers are in the In the audit box under it.
The exact formula this method uses for each score, read from its runner, and
whether it matches the paper's §3 (F ∧ S ∧ M triad) definition.
From the committed audit
fsm_math_phaseC.json.
| Axis | Formula (as computed) | What it measures | Matches §3? |
|---|---|---|---|
| F faithfulness | \(F = \dfrac{\#\{\text{true-circuit sink readouts preserved under scrub}\}}{\#\ \text{readouts}} \in [0,1]\) | For the ground-truth hypothesised circuit, the fraction of the behaviour (true-graph sink cells) preserved across the resample distribution. | ◐ partial causal_scrubbing.jl (F = clamp(true_preserved)). The hypothesis is built FROM the A1 oracle data-flow (ancestors of the output), so it is oracle-grounded, but F is a scrubbing-preservation fraction, NOT the paper's edge-F1 (circuit discovery) nor a causal-effect-agreement correlation (patching/mediation). It measures 'does the oracle-derived circuit pass the scrub' rather than 'how well does the method's discovered claim agree with the oracle'. Record: extra.triad.F / top-level value (pong F=1.0; battery mean F=0.979, n=42). how it's measured — call stack:
|
| S sufficiency | \(S = \dfrac{\#\{\text{readouts preserved (held-out resample)}\}}{\#\ \text{readouts}} \in [0,1]\) | Held-out scrubbing sufficiency; equals the F scalar here. | ✓ matches causal_scrubbing.jl (S = clamp(true_preserved)). A bit-exact-re-run preservation fraction in [0,1]; the new §3 (sec:triad) admits the fraction-within-tolerance [0,1] special case of the held-out test, which this satisfies. Record: extra.triad.S (pong S=1.0). how it's measured — call stack:
|
| M minimality | \(M = |U^{\star}| / |\hat{U}| \in (0,1]\quad U^{\star}=\{u:\Delta y(u)>0\},\ \hat{U}=\{u:|\mathrm{attr}(u)|>\tau\}\) | Oracle-mover cells over the number of cells the hypothesised circuit names. | ✓ matches causal_scrubbing.jl now emits M = |U*|/|U_hat| with U_hat = the named circuit cells (M_note '|U*|=4 (oracle movers) / |U_hat|=6 (method above-threshold) (CELL-valued hypothesis)'), the paper's set-size ratio. Record: extra.triad.M (pong M=0.667). Replaced the former candidate-cell-denominator ratio. how it's measured — call stack:
|
✓ matches = the same quantity as §3; ◐ partial = the same kind of estimator but a differing detail; ✗ does not match = a different quantity (see the note). Definitions: F = agreement with the oracle's true causal effects Δy(u); S = held-out predictive score in [−1, 1]; M = |U*|/|Û| (true-minimal-set size / named-set size).
This is the method's entry in the actual cross-method audit — scored on the paper's correctness triad, each axis a mean over 44 of the 44 scored games (44 committed §R records), not the single example shown above. Tradition: causal. The example figure (Pong) is one of those records.
F faithfulness (scored vs the oracle for every method) · S sufficiency (held-out predictive score in [−1, 1]; a negative value means the explanation predicts held-out interventions worse than the unperturbed baseline; reported for the predictive methods across all three phases where the calibration/held-out split is defined) · M minimality (true-minimal-set / named-set; where the method names a cause set) — n/a otherwise, per the paper's F ∧ S ∧ M triad.
Source: leaderboard.json · the whole leaderboard is on the
methods page and the
Paper 2 audit.
This method's faithfulness on each of the 44 scored games (all-regime F; this method has no content-vs-position split (see the note below)). Click a header to
sort. Every number is read from site_data.json
(methods.causal_scrubbing.per_game).
content-F and position-F are n/a for this method. The content-vs-position split applies only to pixel-attribution methods — those that produce an attribution map over the framebuffer, whose score can be read separately on the smooth content outputs and the discrete position outputs (where the naive gradient is provably zero). This method does not attribute to a pixel output; it is graded by its own fidelity metric (scrubbing_preserved_performance_true), reported as the F column, so there is no content or position regime to separate.
M is n/a on 1 of these games. Minimality is M = |U*|/|Û|, the size of the true minimal cause set over the size of the set the method actually names. On a game where the method names nothing (|Û| = 0 — it discovers no circuit, its attribution map is all-zero, or it decodes no cell), that ratio is undefined, so M is left blank rather than scored. The aggregate M is the mean over the 43 games where the method did name a cause set.
| Game | F (all) | content-F | position-F | S | M | Note |
|---|---|---|---|---|---|---|
| Air Raid | 1.000 | n/a | n/a | 1.000 | 0.667 | recovers the true causes |
| Alien | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Assault | 1.000 | n/a | n/a | 1.000 | 0.778 | recovers the true causes |
| Asterix | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Atlantis | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Bank Heist | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Berzerk | 1.000 | n/a | n/a | 1.000 | 0.875 | recovers the true causes |
| Bowling | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Boxing | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Breakout | 1.000 | n/a | n/a | 1.000 | 0.667 | recovers the true causes |
| Carnival | 1.000 | n/a | n/a | 1.000 | 0.667 | recovers the true causes |
| Centipede | 1.000 | n/a | n/a | 1.000 | 0.500 | recovers the true causes |
| Chopper Command | 1.000 | n/a | n/a | 1.000 | 0.286 | recovers the true causes |
| Demon Attack | 1.000 | n/a | n/a | 1.000 | 0.667 | recovers the true causes |
| Double Dunk | 1.000 | n/a | n/a | 1.000 | 0.889 | recovers the true causes |
| Enduro | 1.000 | n/a | n/a | 1.000 | 0.333 | recovers the true causes |
| Fishing Derby | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Freeway | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Frostbite | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Gopher | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Hero | 1.000 | n/a | n/a | 1.000 | 0.600 | recovers the true causes |
| Ice Hockey | 1.000 | n/a | n/a | 1.000 | 0.900 | recovers the true causes |
| Jamesbond | 1.000 | n/a | n/a | 1.000 | 0.500 | recovers the true causes |
| Kangaroo | 1.000 | n/a | n/a | 1.000 | 0.750 | recovers the true causes |
| Krull | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Kung-Fu Master | 1.000 | n/a | n/a | 1.000 | n/a | recovers the true causes |
| Montezuma's Revenge | 1.000 | n/a | n/a | 1.000 | 0.875 | recovers the true causes |
| Ms. Pac-Man | 1.000 | n/a | n/a | 1.000 | 0.947 | recovers the true causes |
| Name This Game | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Pacman | 1.000 | n/a | n/a | 1.000 | 0.500 | recovers the true causes |
| Phoenix | 1.000 | n/a | n/a | 1.000 | 0.500 | recovers the true causes |
| Pitfall | 1.000 | n/a | n/a | 1.000 | 0.667 | recovers the true causes |
| Pong | 1.000 | n/a | n/a | 1.000 | 0.667 | recovers the true causes |
| Q*bert | 1.000 | n/a | n/a | 1.000 | 0.500 | recovers the true causes |
| Riverraid | 1.000 | n/a | n/a | 1.000 | 0.917 | recovers the true causes |
| Road Runner | 1.000 | n/a | n/a | 1.000 | 0.889 | recovers the true causes |
| Seaquest | 1.000 | n/a | n/a | 1.000 | 0.786 | recovers the true causes |
| Skiing | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Space Invaders | 1.000 | n/a | n/a | 1.000 | 0.700 | recovers the true causes |
| Tennis | 1.000 | n/a | n/a | 1.000 | 0.778 | recovers the true causes |
| Venture | 1.000 | n/a | n/a | 1.000 | 0.929 | recovers the true causes |
| Video Pinball | 1.000 | n/a | n/a | 1.000 | 1.000 | recovers the true causes |
| Yars' Revenge | 1.000 | n/a | n/a | 1.000 | 0.857 | recovers the true causes |
| Private Eye | 0.890 | n/a | n/a | 0.890 | 0.818 | recovers the true causes |
The path from this method's runner (run_game) into the bit-exact VCS substrate, and the
computation it involves. Every step links to the exact source on main. From
callstack_phaseC.json.
env_reset!(env; boot_noop_steps = 60, boot_reset_steps = 4) jutarienv_step!(env::StellaEnvironment, action::Integer) jutaribuild_shared_testbed(game; ... intervene_ram = intervene_ram!, run_intervention = run_intervention, soft_ram_peek = soft_ram_peek, ...) runnersnapshot(env::StellaEnvironment, frame::Integer) jutariresample_values(at_target::Snapshot, cand_idx::Vector{Int}, k::Int) runnerscrub_assign(base_ckpt, tail, cand_idx, circuit, assign) -> intervene_ram! runner intervene_ram! @ causal_scrubbing.jl:294; performance-preserved compared TRUE vs WRONG circuit hypothesestrue_dataflow_graph(base_ckpt, tail, cand_idx, at_target) -> intervene_ram!; ancestors(A, out) runner ancestors @ :245Scored against the exact intervention oracle Δy(u): run_intervention(checkpoint, actions, target_frame, horizon, cause).
The figure is generated from the committed record by
docs/gen_method_figures.py; the game frame
and each RAM cell's screen footprint are produced by
render_scenes.jl /
cell_footprints.jl.