Phase C · mechanistic interpretability

Causal scrubbing

Chan et al. 2022

← back to the method catalogue

What it does?

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.

Causal scrubbing result

Left: the frame. Right: the recovered structure/effect against the ground truth (matched components or preserved behaviour), with the RAM cells labelled. scrubbing_preserved_performance_true = 1.000 — this example only (pong, state gameplay(seed=0,prefix=90)+15); the audit aggregate is below.

How it's scored

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.

How F, S, M are computed here

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.

AxisFormula (as computed) What it measuresMatches §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:
  1. true_preserved: fraction of true-circuit readouts kept under resample-scrub — causal_scrubbing.jl:547
  2. F = clamp(true_preserved) — causal_scrubbing.jl:699
  3. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
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:
  1. true_preserved: readouts kept over held-out resample trials — causal_scrubbing.jl:547
  2. S = clamp(true_preserved) — causal_scrubbing.jl:700
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:
  1. minimality_score(named circuit cells, oracle movers) — causal_scrubbing.jl:696
  2. minimality_score: |U*| oracle movers / |U_hat| named cells — triad_sm.jl:57
  3. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242

✓ 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).

In the audit

This is the method's entry in the actual cross-method audit — scored on the paper's correctness triad, each axis a mean over all 42 scored games (42 committed §R records), not the single example shown above. Tradition: causal. The example figure (Pong) is one of those records.

0.979F — faithfulness vs oracle (mean over 42 games, ±0.036 CI95)
0.979S — sufficiency: held-out predictive (n/a where the paper does not define this axis)
0.814M — minimality: true-minimal-set / named-set (n/a otherwise)
42committed records aggregated
0.00human-plausibility proxy

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.

Results per game

This method's faithfulness on each of the 42 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 41 games where the method did name a cause set.

GameF (all)content-Fposition-FSMNote
Air Raid1.000n/an/a1.0001.000recovers the true causes
Alien1.000n/an/a1.0001.000recovers the true causes
Assault1.000n/an/a1.0000.778recovers the true causes
Atlantis1.000n/an/a1.0001.000recovers the true causes
Bank Heist1.000n/an/a1.0001.000recovers the true causes
Beam Rider1.000n/an/a1.0001.000recovers the true causes
Berzerk1.000n/an/a1.0000.875recovers the true causes
Bowling1.000n/an/a1.0001.000recovers the true causes
Boxing1.000n/an/a1.0001.000recovers the true causes
Breakout1.000n/an/a1.0000.667recovers the true causes
Carnival1.000n/an/a1.0000.667recovers the true causes
Centipede1.000n/an/a1.0000.500recovers the true causes
Chopper Command1.000n/an/a1.0000.286recovers the true causes
Demon Attack1.000n/an/a1.0000.667recovers the true causes
Fishing Derby1.000n/an/a1.0001.000recovers the true causes
Freeway1.000n/an/a1.0001.000recovers the true causes
Frostbite1.000n/an/a1.0001.000recovers the true causes
Gopher1.000n/an/a1.0001.000recovers the true causes
Hero1.000n/an/a1.0000.600recovers the true causes
Ice Hockey1.000n/an/a1.0000.900recovers the true causes
Jamesbond1.000n/an/a1.0000.500recovers the true causes
Kangaroo1.000n/an/a1.0000.750recovers the true causes
Krull1.000n/an/a1.0001.000recovers the true causes
Kung-Fu Master1.000n/an/a1.000n/arecovers the true causes
Montezuma's Revenge1.000n/an/a1.0000.875recovers the true causes
Ms. Pac-Man1.000n/an/a1.0000.947recovers the true causes
Name This Game1.000n/an/a1.0001.000recovers the true causes
Pacman1.000n/an/a1.0000.500recovers the true causes
Phoenix1.000n/an/a1.0000.500recovers the true causes
Pitfall1.000n/an/a1.0000.667recovers the true causes
Pong1.000n/an/a1.0000.667recovers the true causes
Q*bert1.000n/an/a1.0000.500recovers the true causes
Riverraid1.000n/an/a1.0000.917recovers the true causes
Road Runner1.000n/an/a1.0000.889recovers the true causes
Seaquest1.000n/an/a1.0000.786recovers the true causes
Space Invaders1.000n/an/a1.0000.700recovers the true causes
Tennis1.000n/an/a1.0000.778recovers the true causes
Venture1.000n/an/a1.0000.929recovers the true causes
Video Pinball1.000n/an/a1.0001.000recovers the true causes
Yars' Revenge1.000n/an/a1.0000.714recovers the true causes
Private Eye0.890n/an/a0.8900.818recovers the true causes
Double Dunk0.235n/an/a0.2351.000

Call stack — how it runs on jutari / jaxtari

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.

Applied on the substrate

  1. Boot the real ROM with the xitari-parity reset (60 NOOP + 4 RESET) — env_reset!(env; boot_noop_steps = 60, boot_reset_steps = 4) jutari
  2. Deterministically step the emulator one action per env-frame — env_step!(env::StellaEnvironment, action::Integer) jutari
  3. Assemble the shared gameplay-state testbed (checkpoint at f*, causes, shared screen output, cause-density gate) — build_shared_testbed(game; ... intervene_ram = intervene_ram!, run_intervention = run_intervention, soft_ram_peek = soft_ram_peek, ...) runner
  4. Freeze byte-exact RAM + screen out of the env at a frame — snapshot(env::StellaEnvironment, frame::Integer) jutari

The computation

  1. Build the per-cell resample-value pool from the at-target state (donor activations to swap in for out-of-circuit cells) — resample_values(at_target::Snapshot, cand_idx::Vector{Int}, k::Int) runner
  2. Scrubbing re-run: resample-ablate every out-of-circuit candidate cell (in-circuit cells keep their base value), then continue the tail and snapshot — scrub_assign(base_ckpt, tail, cand_idx, circuit, assign) -> intervene_ram! runner intervene_ram! @ causal_scrubbing.jl:294; performance-preserved compared TRUE vs WRONG circuit hypotheses
  3. True data-flow graph the scrub hypothesis is checked against (per-cell interchange over the candidate set) + ancestors closure — true_dataflow_graph(base_ckpt, tail, cand_idx, at_target) -> intervene_ram!; ancestors(A, out) runner ancestors @ :245

Scored against the exact intervention oracle Δy(u): run_intervention(checkpoint, actions, target_frame, horizon, cause).

Implementation
tools/xai_study/phaseC_mechanistic/causal_scrubbing.jl
Reference
Chan et al. 2022
Record
causal_scrubbing_pong.json
All records
phaseC_mechanistic/out

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.