Phase A · neuroscience battery

A2 · Single-unit lesions

cf. Jonas & Kording 2017

← back to the method catalogue

What it does?

A lesion study asks what breaks when a part is removed. It is the oldest tool in neuroscience: damage one region, see what behaviour is lost, and infer that region's role. We apply the same idea to memory. We freeze one RAM cell at a time, hold it at a fixed value, re-run the program, and measure how much the screen changes. A cell whose freezing wrecks the picture is judged important; a cell whose freezing does nothing is judged irrelevant. Ranking every cell this way gives a per-unit importance map. The appeal is that the test is causal: we do not just watch the cell, we intervene on it and see the effect. This is why the single-unit lesion is the one classical method that scores near the top of our battery. Its weakness is that it changes one cell at a time. It is therefore blind to causes that only act together, where two cells matter jointly but neither matters alone. So it recovers a correct ranking of which units matter, but not the way they combine into the actual computation.

A2 · Single-unit lesions result

Left: the frame. Middle: each cell's lesion importance painted on the screen via its footprint. Right: lesion importance vs the cell's true causal role. lesion_importance_spearman_vs_oracle_role = 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 a rank correlation between each cell's lesion importance and its true causal role. Lesion importance is how much the screen changes when the cell is frozen; the true role comes from the intervention oracle. We rank the cells by each and take the Spearman correlation of the two rankings, so the metric asks whether lesioning orders the cells the same way the oracle does. Faithfulness for this method is that rank correlation, and it is high, because lesioning is itself a real intervention on the machine. The grading is always against the oracle, not against any other method. The important limit the score does not penalise on its own is interactions. A single-unit lesion changes one cell at a time, so it is blind to causes that only act together. On some games the per-unit ranking misses a large fraction of the joint effects the oracle records, where a pair of cells swings the behaviour far beyond the sum of the two single lesions. So a near-perfect ranking still hides the way the cells combine. There is no position hard-case for this method; its output is a ranking, not a sprite coordinate. The audit box reports the measured correlation across the core games.

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_phaseA.json.

AxisFormula (as computed) What it measuresMatches §3?
F
faithfulness
\(F = \rho_{\mathrm{Spearman}}\!\left(\mathrm{attr},\ \Delta y(u)\right)\)Spearman rank correlation between the single-unit lesion importance map and the exact-oracle per-unit causal role over 8 units.✓ matches Rank correlation of attribution vs oracle causal effects; matches the paper's ranked-output correlation primitive. A2_lesions.jl,,; record out/A2_lesions_pong.json triad.F=1.0.
how it's measured — call stack:
  1. F = Spearman(lesion importance, oracle causal role) — A2_lesions.jl:645
  2. oracle_role: per-unit causal role over the full-horizon do-set — A2_lesions.jl:621
  3. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
S
sufficiency
\(S = \rho_{\mathrm{Spearman}}\!\left(\mathrm{attr},\ \Delta y_{\mathrm{held\text{-}out}}(u)\right) \in [-1,1]\)Rank correlation of the lesion map (built on {0, alt}) vs the per-unit role under the held-out clamp value base+37.✓ matches Rank correlation in [-1,1] of the lesion map (built on {0,alt}) vs the per-unit role under the held-out clamp value base+37: a non-null held-out predictive correlation, the §3 (sec:triad) form. A2_lesions.jl; record S=0.836.
how it's measured — call stack:
  1. S = Spearman(lesion map, per-unit role under held-out do(base+37)) — A2_lesions.jl:648
  2. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
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\}\)Number of oracle-causal units over the number of units the lesion map names above threshold.✓ matches Runner now emits M = |U*|/|U_hat| (M_note '|U*|=4 (oracle movers) / |U_hat|=4 (method above-threshold)'), the paper's set-size ratio. Record out/A2_lesions_pong.json extra.triad.M=1.0. Replaced the former 1 − false-specificity rate.
how it's measured — call stack:
  1. minimality_score(lesion names, oracle movers) — A2_lesions.jl:655
  2. minimality_score: |U*| oracle movers / |U_hat| named units — 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: intervention. The example figure (Pong) is one of those records.

0.965F — faithfulness vs oracle (mean over 42 games, ±0.021 CI95)
0.589S — sufficiency: held-out predictive (n/a where the paper does not define this axis)
1.000M — 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.A2_lesions.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 (lesion_importance_spearman_vs_oracle_role), reported as the F column, so there is no content or position regime to separate.

S is negative on 3 of these games. Sufficiency asks whether the explanation can predict the outcome of held-out interventions it was not fit on; for this method S is the held-out predictive correlation between its claim and the true effect, so it lies in [−1, 1]. A value near 0 means the explanation predicts no better than the unperturbed output; a negative value means it predicts worse — its held-out claim is anti-correlated with the truth (named yet causally unused). The aggregate S is the mean over the scored games.

GameF (all)content-Fposition-FSMNote
Alien1.000n/an/a0.4291.000recovers the true causes
Bank Heist1.000n/an/a0.4621.000recovers the true causes
Beam Rider1.000n/an/a1.0001.000recovers the true causes
Bowling1.000n/an/a0.6641.000recovers the true causes
Boxing1.000n/an/a0.4891.000recovers the true causes
Breakout1.000n/an/a0.7811.000recovers the true causes
Carnival1.000n/an/a0.4641.000recovers the true causes
Centipede1.000n/an/a0.7141.000recovers the true causes
Chopper Command1.000n/an/a0.8031.000recovers the true causes
Fishing Derby1.000n/an/a0.8531.000recovers the true causes
Ice Hockey1.000n/an/a0.7801.000recovers the true causes
Kangaroo1.000n/an/a0.6021.000recovers the true causes
Krull1.000n/an/a0.2311.000recovers the true causes
Ms. Pac-Man1.000n/an/a0.3951.000recovers the true causes
Name This Game1.000n/an/a0.7001.000recovers the true causes
Pacman1.000n/an/a0.4191.000recovers the true causes
Pitfall1.000n/an/a0.9171.000recovers the true causes
Pong1.000n/an/a0.8361.000recovers the true causes
Seaquest1.000n/an/a0.8001.000recovers the true causes
Tennis1.000n/an/a0.7341.000recovers the true causes
Video Pinball1.000n/an/a-0.1261.000recovers the true causes
Yars' Revenge0.999n/an/a0.4691.000recovers the true causes
Q*bert0.998n/an/a0.1641.000recovers the true causes
Berzerk0.998n/an/a0.7561.000recovers the true causes
Private Eye0.997n/an/a0.5151.000recovers the true causes
Phoenix0.993n/an/a0.5291.000recovers the true causes
Hero0.993n/an/a0.6241.000recovers the true causes
Demon Attack0.989n/an/a0.4381.000recovers the true causes
Space Invaders0.986n/an/a0.8121.000recovers the true causes
Jamesbond0.985n/an/a0.6001.000recovers the true causes
Venture0.979n/an/a0.5471.000recovers the true causes
Assault0.973n/an/a0.7941.000recovers the true causes
Riverraid0.972n/an/a0.7131.000recovers the true causes
Road Runner0.963n/an/a0.8611.000recovers the true causes
Atlantis0.950n/an/a0.7461.000recovers the true causes
Montezuma's Revenge0.925n/an/a0.6961.000recovers the true causes
Kung-Fu Master0.870n/an/a0.6471.000recovers the true causes
Gopher0.818n/an/a0.6621.000
Frostbite0.803n/an/a0.7211.000
Freeway0.802n/an/a-0.6901.000
Double Dunk0.782n/an/a-0.1091.000
Air Raid0.753n/an/a0.3601.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_phaseA.json.

Applied on the substrate

  1. assemble the shared gameplay-state testbed + cause-density gate for this game — build_a2_shared_state(game) -> build_shared_testbed(game; ...) runner
  2. build_shared_testbed definition: booted checkpoint + shared output + gate — function build_shared_testbed(game; ...) runner
  3. cause-density gate counts causes with |Delta_y|>floor via the oracle — cause_density = count(>(floor), deltas) runner
  4. boot the real ROM and replay to the target frame (runner-local boot_replay) — boot_replay(spec, actions, target_frame) runner
  5. step the real emulator one frame per action — env_step!(env, Int(actions[i])) jutari
  6. read the 128-byte RAM — get_ram(env) jutari

The computation

  1. lesion primitive: deepcopy the checkpoint, CLAMP one/more cells to a fixed value, re-run the tail, snapshot — lesion_continue(checkpoint, pokes, tail) runner
  2. clamp writes the fixed value into the RAM byte before re-running — intervene_ram!(env, idx, v) runner
  3. the lesion map (method under test): per-unit importance = best out-delta over the exhaustive single-unit clamp set {clamp->0, clamp->alt=base XOR 0xFF}, plus screen change and works-flag — lesion_map(checkpoint, tail, cands, at_target, ...) runner

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

Implementation
tools/xai_study/phaseA_kording/A2_lesions.jl
Reference
cf. Jonas & Kording 2017
Record
A2_lesions_pong.json
All records
phaseA_kording/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.