Phase A · neuroscience battery

A8 · Whole-state recording

cf. Jonas & Kording 2017

← back to the method catalogue

What it does?

Whole-state recording is the simplest possible method: write down everything. At each step we record every bit of RAM and every register, the complete internal state over time. This is the raw material that every other method in the study works from. In neuroscience it is the dream of recording every neuron at once, and it is often treated as the thing that would finally let us understand the system. The intuition is that if we have the full state, we have hidden nothing, so we must have the explanation. We include it as a deliberate baseline to test that intuition. By construction the complete record is perfectly faithful and perfectly sufficient: it contains every cause, so nothing is missing, and it can predict any intervention because it holds the whole machine. The point of including it is to show what such a record still lacks. A dump of all 128 RAM cells is not an account of the computation. It names everything, so it names nothing in particular, and the true cause of any given output is a tiny handful of those cells. Completeness is not understanding, and this method makes that concrete.

A8 · Whole-state recording result

Left: the frame. Right: this method's per-cell/per-component result against the ground-truth importance, with the RAM cells labelled. wholestate_minimality_M_vs_oracle = 0.031 — this example only (pong, state gameplay(seed=0,prefix=90)+15); the audit aggregate is below.

Neuroscience battery · the record-everything baseline

Learn the method — a beginner's guide

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 idea in plain words

Every method in this battery looks at part of the system: one unit, one pair, one pooled signal. The obvious objection is “then record everything”. Neuroscience has pursued that dream for decades. Large projects aim to record every neuron of a brain at once, and techniques such as calcium imaging already capture tens of thousands of cells. The hope behind it is that once nothing is hidden, understanding will follow.

A8 tests that hope on a machine where the dream is already true. The Atari's complete state is tiny, and we can copy all of it at every frame. Such a record is a perfect description: it misses nothing, and from it the machine can be rebuilt exactly. But is it an explanation? An explanation should also be small: it should point at the few things that matter for the output you asked about. A8 is the deliberate baseline that scores perfectly on completeness and at the floor on smallness. It makes the gap between having the data and understanding the system measurable.

How it works on a neural network

Neuroscience origin. Whole-brain or whole-population recording: the Brain Activity Map / BRAIN Initiative vision (Alivisatos et al. 2012) of measuring every spike of every neuron. Jonas & Kording had the complete state of their simulated chip at every step, with every transistor known, and showed that standard analyses of it still failed to reveal how the chip ran its programs.

Deep-learning analogue. Dumping every activation: caching all hidden states of every layer for an input, the way interpretability libraries “run with cache”. It is always the first step, never the explanation. To grade it, we use the study's three axes. With \(U^*\) the true minimal set of causes of an output and \(\hat U\) the set an explanation names:

\[ F = \frac{|U^*\cap \hat U|}{|U^*|}\ \text{(nothing causal left out)}, \qquad S = \text{does }\hat U\text{ reproduce the output?}, \qquad M = \frac{|U^*|}{|\hat U|} . \]

(The study defines F per method; for a set-valued explanation like this one it is the recall above.) A full dump names every unit, so \(\hat U\) is everything. It contains every cause (F = 1), it reproduces the output (S = 1), and M is as small as it can get.

Toy example. A network has 1000 hidden units. For one prediction, careful ablations show that only 3 units matter. The activation dump lists all 1000 numbers: F = 1, S = 1, and \(M = 3/1000 = 0.003\). A good explanation names those 3 units: F = 1, S = 1, M = 1. Same faithfulness, opposite usefulness. M is the axis that tells them apart.

Recipe

  1. Record the complete internal state at every time step (every unit, every register).
  2. Present the full record as the “explanation”: its named set \(\hat U\) is the whole state.
  3. Check faithfulness: does \(\hat U\) contain every true cause? (Trivially yes.)
  4. Check sufficiency: restore the recorded state and confirm it reproduces the output exactly.
  5. Find the true minimal cause set \(U^*\) by intervention and compute \(M=|U^*|/|\hat U|\).
  6. Run the control: the oracle's own minimal set must score F = S = M = 1.

From a neural network to the Atari

Recording every neuron / caching every activationCopying the full machine state each frame: the 128 bytes of RAM (the program's variables) and the 64 TIA registers (the video/sound chip's settings), 192 bytes in all.
The output to explainThe rendered screen 15 frames after the intervention frame \(f^*\).
The true minimal cause set \(U^*\) (unknown in a brain)Candidate RAM bytes whose poking (to 0, base+17 or base+37) changes at least one screen pixel when the real ROM is re-run: found by the intervention oracle.
The named set \(\hat U\)All 128 RAM bytes. The TIA registers are recorded too, but the minimality denominator counts RAM only.
Sufficiency of a recordingWriting the recorded RAM back into a copy of the machine and checking that RAM and screen come out byte-identical.

How we apply it to the VCS

The runner A8_wholestate.jl is short, because the method is trivial. What it measures is not.

Honest caveats. \(U^*\) is searched only among the game's candidate bytes, with three poke values and one horizon. Bytes outside that list are never tested, so \(|U^*|\) may be undercounted, and M with it. The verdict does not change: the dump is far larger than any plausible cause set.

Read the code

XAI the interpretability method   substrate the bit-exact emulator it runs on (jutari, Julia).

Reading the result

The audit box shows the three axes side by side. F and S sit at the ceiling. M sits near the floor. That contrast is the whole result. The figure shows the activity (variance) of every RAM byte over the recording, with the candidate bytes marked: many bytes change over time, far more than the handful the oracle marks as causal for the output. Read A8 as the yardstick for the other methods. Any method that claims to explain should name fewer things than this dump while keeping F and S high. A method that cannot beat the dump on M has described, not explained.

Pitfalls

Try it yourself

julia --project=jutari tools/xai_study/phaseA_kording/A8_wholestate.jl --games core

Writes A8_<game>.json/.npz per game and the combined A8_wholestate.json/.npz into tools/xai_study/phaseA_kording/out/. --selftest checks the contract on the first game without writing. A few minutes per game; the cost is the three re-runs per candidate byte.

Original papers & further reading

Read next: A2 · Single-unit lesions · A1 · Connectomics / data-flow graph · Causal scrubbing · ACDC — automatic circuit discovery

How it's scored

The score that matters for this method is minimality, not faithfulness. Recording the whole state is perfectly faithful, because it contains every cause, and perfectly sufficient, because it holds the whole machine and can predict any intervention. So F and S are both at the ceiling by construction. Minimality is defined as the size of the true minimal cause set divided by the size of the set the explanation names. The whole-state dump names all 128 RAM cells, while the true cause of any output is a handful of them, so the ratio is tiny and the minimality is very low. That is the whole point of including this baseline: a complete record is faithful and sufficient yet says nothing in particular, because it withholds nothing. The grading is always against the intervention oracle, which supplies the true minimal set. There is no sprite-position hard-case here; the method makes no positional claim. The audit box reports the exact per-axis triad, F, S, and M, read straight from the leaderboard, so you can see faithfulness and sufficiency at the ceiling beside a minimality near the floor.

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 = \mathrm{recall}\!\left(U^{\star}\mid \hat{U}=\text{whole state}\right) = 1\)Recall of the oracle-causal cells under the record-everything map; trivially 1.0 because the whole state includes every cell.◐ partial Scored vs the oracle causal cells but the primitive is recall (not the correlation/edge-F1 the paper specifies); it is a hard-coded 1.0 by construction, consistent with the paper's 'trivially faithful' whole-state baseline. Runner A8_wholestate.jl,; record out/A8_pong.json triad.F=1.0.
how it's measured — call stack:
  1. whole state names every cell ⇒ recall of oracle-causal cells = 1 — A8_wholestate.jl:561
  2. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
S
sufficiency
\(S = \mathbb{1}\!\left[\text{restored 128-byte RAM} = \text{exact RAM + frame}\right] \in \{0,1\}\)1 if the recorded whole 128-byte RAM state, restored, reproduces the exact RAM and frame (lossless), else 0.✓ matches Literal sufficiency: the recorded whole 128-byte RAM state, restored, reproduces the exact RAM and frame (bit-exact re-run). §3 (sec:triad) admits the [0,1] fraction-within-tolerance special case of the held-out test; this boolean 1/0 hit is that special case at its extreme. A8_wholestate.jl; record S=1.0.
how it's measured — call stack:
  1. lossless check: restored 128-byte RAM == exact RAM — A8_wholestate.jl:399
  2. S folded into the triad record — A8_wholestate.jl:565
  3. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
M
minimality
\(M = |U^{\star}| / |\hat{U}| = n_{\mathrm{causal}} / 128\)Number of oracle-causal cells over the size of the named set (128), the whole-state minimality floor.✓ matches The only Phase-A method whose M is exactly |U*|/|U_hat|; paper cites whole-state M=0.07. Headline metric_name = wholestate_minimality_M_vs_oracle. A8_wholestate.jl,; record out/A8_pong.json M=0.03125 = 4/128.
how it's measured — call stack:
  1. M = |oracle-causal cells| / 128 (whole-state floor) — A8_wholestate.jl:563
  2. 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 44 of the 44 scored games (44 committed §R records), not the single example shown above. Tradition: descriptive. The example figure (Pong) is one of those records.

1.000F — faithfulness vs oracle (mean over 44 games, ±0.000 CI95)
1.000S — sufficiency: held-out predictive (n/a where the paper does not define this axis)
0.075M — minimality: true-minimal-set / named-set (n/a otherwise)
44committed 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 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.A8_wholestate.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 (wholestate_minimality_M_vs_oracle), reported as the F column, so there is no content or position regime to separate.

GameF (all)content-Fposition-FSMNote
Air Raid1.000n/an/a1.0000.094recovers the true causes
Alien1.000n/an/a1.0000.031recovers the true causes
Assault1.000n/an/a1.0000.070recovers the true causes
Asterix1.000n/an/a1.0000.062recovers the true causes
Atlantis1.000n/an/a1.0000.055recovers the true causes
Bank Heist1.000n/an/a1.0000.031recovers the true causes
Berzerk1.000n/an/a1.0000.109recovers the true causes
Bowling1.000n/an/a1.0000.062recovers the true causes
Boxing1.000n/an/a1.0000.070recovers the true causes
Breakout1.000n/an/a1.0000.055recovers the true causes
Carnival1.000n/an/a1.0000.117recovers the true causes
Centipede1.000n/an/a1.0000.055recovers the true causes
Chopper Command1.000n/an/a1.0000.078recovers the true causes
Demon Attack1.000n/an/a1.0000.070recovers the true causes
Double Dunk1.000n/an/a1.0000.094recovers the true causes
Enduro1.000n/an/a1.0000.016recovers the true causes
Fishing Derby1.000n/an/a1.0000.039recovers the true causes
Freeway1.000n/an/a1.0000.109recovers the true causes
Frostbite1.000n/an/a1.0000.109recovers the true causes
Gopher1.000n/an/a1.0000.148recovers the true causes
Hero1.000n/an/a1.0000.086recovers the true causes
Ice Hockey1.000n/an/a1.0000.070recovers the true causes
Jamesbond1.000n/an/a1.0000.055recovers the true causes
Kangaroo1.000n/an/a1.0000.078recovers the true causes
Krull1.000n/an/a1.0000.086recovers the true causes
Kung-Fu Master1.000n/an/a1.0000.047recovers the true causes
Montezuma's Revenge1.000n/an/a1.0000.102recovers the true causes
Ms. Pac-Man1.000n/an/a1.0000.109recovers the true causes
Name This Game1.000n/an/a1.0000.031recovers the true causes
Pacman1.000n/an/a1.0000.055recovers the true causes
Phoenix1.000n/an/a1.0000.062recovers the true causes
Pitfall1.000n/an/a1.0000.086recovers the true causes
Pong1.000n/an/a1.0000.031recovers the true causes
Private Eye1.000n/an/a1.0000.094recovers the true causes
Q*bert1.000n/an/a1.0000.055recovers the true causes
Riverraid1.000n/an/a1.0000.148recovers the true causes
Road Runner1.000n/an/a1.0000.047recovers the true causes
Seaquest1.000n/an/a1.0000.117recovers the true causes
Skiing1.000n/an/a1.0000.055recovers the true causes
Space Invaders1.000n/an/a1.0000.094recovers the true causes
Tennis1.000n/an/a1.0000.086recovers the true causes
Venture1.000n/an/a1.0000.125recovers the true causes
Video Pinball1.000n/an/a1.0000.055recovers the true causes
Yars' Revenge1.000n/an/a1.0000.031recovers the true causes

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 — build_a8_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(game, actions, target_frame) runner
  5. record the WHOLE state (128 RAM + 64 TIA) per frame across the trajectory — record_whole_state(game, actions) runner
  6. step the real emulator one frame per action while recording — env_step!(env, Int(actions[t])) jutari

The computation

  1. whole-state restore: write the full recorded 128-byte RAM back over the baseline checkpoint (the whole-state 'readout') — restore_whole_ram(checkpoint, ram) runner
  2. whole-state sufficiency (method under test): does restoring the ENTIRE recorded RAM reproduce the exact frame (RAM+screen) — verify_wholestate_sufficiency(checkpoint, at_target) runner
  3. minimal-set sufficiency (positive control): restore ONLY the oracle-causal cells and check the frame is reproduced (contrast that makes over-recording measurable) — verify_minimal_sufficiency(checkpoint, at_target, causal_idx) runner
  4. oracle-causal importance per cell (defines the minimal causal set) — oracle_causal_importance(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/A8_wholestate.jl
Reference
cf. Jonas & Kording 2017
Record
A8_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.