cf. Jonas & Kording 2017
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.
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.
The oldest question in brain science is: what stops working if this part is gone? In 1848 an iron rod destroyed part of Phineas Gage's frontal lobe. He survived, but his personality changed. Doctors concluded that this region had something to do with self-control. That is a lesion study: remove or silence one part, watch which behaviour is lost, and credit the part with that behaviour.
The appeal is that a lesion is an intervention, not an observation. You do not just watch a unit fire together with a behaviour; you take the unit away and see whether the behaviour goes too. That is a causal test. Its weakness is that it tests one unit at a time. If two units do a job together, or back each other up, removing one may show nothing, or something misleading. On the Atari we can measure both sides: how well single lesions rank the units, and how much of the joint behaviour they cannot see.
Neuroscience origin. Lesions come from accidents (Gage), strokes and surgery, and in animals from deliberate damage, cooling or drugs. Modern tools such as optogenetics can switch a cell type off for a few milliseconds. Jonas & Kording “lesioned” the transistors of a simulated 6502 chip one by one (the VCS CPU, the 6507, is a 6502 variant) and found some that broke only one game. They warned that this does not mean the transistor is a “Donkey Kong transistor”.
Neural-network analogue. An ablation study: set one unit's activation to zero (or to its mean) and measure the drop in accuracy or in a logit. Dropout does random ablations during training. Written as an intervention on unit \(u\) with a set of clamp values \(V\):
\[ I(u) \;=\; \max_{v \in V}\; \big|\,y\big(\mathrm{do}(h_u := v)\big) - y\,\big| . \]Rank the units by \(I(u)\) and you have an importance map. To test it, compare its ranking with a trusted ranking by Spearman's \(\rho\), the correlation of the two rank lists (\(+1\) = same order).
Toy example. Let \(y = a\cdot b + c\) at \(a=b=c=1\), so \(y = 2\). Lesion \(a\) to 0: \(y = 1\), \(I(a) = 1\). Likewise \(I(b) = 1\) and \(I(c) = 1\). The map says all three matter equally. Now lesion \(a\) and \(b\): \(y = 1\), a drop of 1, not \(1+1 = 2\). The interaction term
\[ \Delta_{\text{int}}(a,b) = E(a,b) - \big(E(a)+E(b)\big) = 1 - 2 = -1 \]is non-zero: \(a\) and \(b\) work as a team (a product), \(c\) works alone (a sum). No single-unit map can tell those two kinds of units apart.
| The neuron | One candidate RAM byte: one of the 128 bytes of VCS working memory that published annotations (OCAtari / AtariARI) link to a game concept such as ball x or score. |
|---|---|
| The lesion | intervene_ram! at frame \(f^*\): overwrite the byte with \(0\) (“silence”) or with base XOR 255 (every bit flipped, a maximally different value). |
| The behaviour | After 15 frames of re-run: the absolute change of every candidate byte plus the number of screen pixels that differ from the un-lesioned run. |
| The neurologist's ground truth | The oracle role of each byte: the same measurement with a larger set of interventions \(\{0,\ +17,\ +37,\ \text{XOR }255\}\), each a real re-run of the real ROM (the cartridge program). |
| Patients with two lesions | Pairs of the most important bytes, both flipped at once, to measure the interaction term. |
The runner A2_lesions.jl works on the same frozen game state as every method in the
study: the cartridge is booted (60 no-op plus 4 reset frames), then 90 frames of seeded random
joystick input are played. That frame is \(f^*\); the horizon is the next 15 frames. Two fresh
replays must agree byte for byte before anything is scored.
How this differs from a brain lesion. Our “lesion” is a one-time write at \(f^*\), not a clamp held for the whole horizon. The game program is free to overwrite the byte on the next frame, much as a brain can compensate. Also note that the lesion's two clamps are a subset of the oracle's four interventions, measured with the same footprint. A high rank correlation is therefore expected by design; the interaction count is the informative part.
XAI the interpretability method substrate the bit-exact emulator it runs on (jutari, Julia).
A2_lesions.jl:278 — The lesion primitive: deep-copy, write one or two bytes, step the horizon, snapshot.A2_lesions.jl:373 — The two lesion values {0, base XOR 0xFF}, next to the oracle's four and the held-out one.A2_lesions.jl:345 — The behavioural readout: per-byte absolute change plus count of changed screen pixels.A2_lesions.jl:385 — Per-unit importance map under a given do-set (used for the method, the oracle and the held-out probe).A2_lesions.jl:696 — Pair lesions among the top units: the interaction term the single-unit map cannot see.A2_lesions.jl:575 — One game: shared state, bit-exact check, lesion vs oracle maps, Spearman, interactions, triad.shared_testbed_impl.jl:115 — The shared seeded-gameplay state and its oracle cause-density gate.oracle_intervene.jl:242 — The reference oracle: poke a cause, re-run the ROM, snapshot (drives the gate).jutari_oracle.jl:176 — Write one byte into the console's RAM (the A2 runner carries an identical local copy).StellaEnvironment.jl:259 — One video frame of the bit-exact emulated VCS.The figure shows the game frame, a heat-map of where on the screen the lesions changed pixels, and a bar chart with two bars per candidate byte: the oracle's true causal role and the lesion importance, both scaled so the largest is 1. A faithful map has bars of matching height. In Pong they match exactly: the score bytes and the ball bytes are tall, the paddle bytes are zero. That is why this is the one classical method near the top of the battery. What the bars do not show is how the bytes combine. Look in the record's interaction block for the pairs whose joint lesion is far from the sum of the singles.
julia --project=jutari tools/xai_study/phaseA_kording/A2_lesions.jl --games core
Writes A2_lesions_<game>.{json,npz} per game and a combined A2_lesions.{json,npz} into tools/xai_study/phaseA_kording/out/. --max-pairs K caps the interaction budget (default 60); --shard i --nshards n runs one game per cluster task.
Read next: Occlusion · Activation patching / causal mediation · A1 · Connectomics / data-flow graph · A3 · Tuning curves
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.
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.
| Axis | Formula (as computed) | What it measures | Matches §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:
|
| 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:
|
| 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:
|
✓ 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: intervention. 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.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 2 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.
| Game | F (all) | content-F | position-F | S | M | Note |
|---|---|---|---|---|---|---|
| Alien | 1.000 | n/a | n/a | 0.429 | 1.000 | recovers the true causes |
| Bank Heist | 1.000 | n/a | n/a | 0.462 | 1.000 | recovers the true causes |
| Bowling | 1.000 | n/a | n/a | 0.664 | 1.000 | recovers the true causes |
| Boxing | 1.000 | n/a | n/a | 0.489 | 1.000 | recovers the true causes |
| Breakout | 1.000 | n/a | n/a | 0.781 | 1.000 | recovers the true causes |
| Carnival | 1.000 | n/a | n/a | 0.424 | 1.000 | recovers the true causes |
| Centipede | 1.000 | n/a | n/a | 0.714 | 1.000 | recovers the true causes |
| Chopper Command | 1.000 | n/a | n/a | 0.803 | 1.000 | recovers the true causes |
| Fishing Derby | 1.000 | n/a | n/a | 0.853 | 1.000 | recovers the true causes |
| Ice Hockey | 1.000 | n/a | n/a | 0.780 | 1.000 | recovers the true causes |
| Kangaroo | 1.000 | n/a | n/a | 0.602 | 1.000 | recovers the true causes |
| Krull | 1.000 | n/a | n/a | 0.231 | 1.000 | recovers the true causes |
| Ms. Pac-Man | 1.000 | n/a | n/a | 0.395 | 1.000 | recovers the true causes |
| Name This Game | 1.000 | n/a | n/a | 0.700 | 1.000 | recovers the true causes |
| Pacman | 1.000 | n/a | n/a | 0.419 | 1.000 | recovers the true causes |
| Pitfall | 1.000 | n/a | n/a | 0.917 | 1.000 | recovers the true causes |
| Pong | 1.000 | n/a | n/a | 0.836 | 1.000 | recovers the true causes |
| Private Eye | 1.000 | n/a | n/a | 0.611 | 1.000 | recovers the true causes |
| Seaquest | 1.000 | n/a | n/a | 0.800 | 1.000 | recovers the true causes |
| Tennis | 1.000 | n/a | n/a | 0.734 | 1.000 | recovers the true causes |
| Video Pinball | 1.000 | n/a | n/a | -0.126 | 1.000 | recovers the true causes |
| Yars' Revenge | 0.999 | n/a | n/a | 0.693 | 1.000 | recovers the true causes |
| Q*bert | 0.998 | n/a | n/a | 0.164 | 1.000 | recovers the true causes |
| Berzerk | 0.998 | n/a | n/a | 0.756 | 1.000 | recovers the true causes |
| Phoenix | 0.993 | n/a | n/a | 0.529 | 1.000 | recovers the true causes |
| Hero | 0.993 | n/a | n/a | 0.624 | 1.000 | recovers the true causes |
| Demon Attack | 0.989 | n/a | n/a | 0.438 | 1.000 | recovers the true causes |
| Space Invaders | 0.986 | n/a | n/a | 0.812 | 1.000 | recovers the true causes |
| Jamesbond | 0.985 | n/a | n/a | 0.600 | 1.000 | recovers the true causes |
| Air Raid | 0.984 | n/a | n/a | 0.973 | 1.000 | recovers the true causes |
| Asterix | 0.983 | n/a | n/a | 0.917 | 1.000 | recovers the true causes |
| Skiing | 0.983 | n/a | n/a | 0.667 | 1.000 | recovers the true causes |
| Venture | 0.979 | n/a | n/a | 0.547 | 1.000 | recovers the true causes |
| Double Dunk | 0.979 | n/a | n/a | 0.155 | 1.000 | recovers the true causes |
| Assault | 0.973 | n/a | n/a | 0.794 | 1.000 | recovers the true causes |
| Riverraid | 0.972 | n/a | n/a | 0.713 | 1.000 | recovers the true causes |
| Road Runner | 0.963 | n/a | n/a | 0.861 | 1.000 | recovers the true causes |
| Atlantis | 0.950 | n/a | n/a | 0.746 | 1.000 | recovers the true causes |
| Montezuma's Revenge | 0.925 | n/a | n/a | 0.696 | 1.000 | recovers the true causes |
| Kung-Fu Master | 0.870 | n/a | n/a | 0.647 | 1.000 | recovers the true causes |
| Gopher | 0.818 | n/a | n/a | 0.662 | 1.000 | |
| Frostbite | 0.803 | n/a | n/a | 0.721 | 1.000 | |
| Freeway | 0.802 | n/a | n/a | -0.690 | 1.000 | |
| Enduro | 0.500 | n/a | n/a | 0.500 | 1.000 |
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.
build_a2_shared_state(game) -> build_shared_testbed(game; ...) runnerfunction build_shared_testbed(game; ...) runnercause_density = count(>(floor), deltas) runnerboot_replay(spec, actions, target_frame) runnerenv_step!(env, Int(actions[i])) jutariget_ram(env) jutarilesion_continue(checkpoint, pokes, tail) runnerintervene_ram!(env, idx, v) runnerlesion_map(checkpoint, tail, cands, at_target, ...) runnerScored 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.