cf. Jonas & Kording 2017
A tuning curve measures how strongly a unit responds to some variable. In neuroscience one plots a neuron's firing rate against, say, the angle of a bar, and a sharp peak is read as the neuron being 'tuned' to that feature. We build the same curves for RAM cells. For each cell we plot its value against a game variable and against screen luminance, then measure how strongly the cell tracks each one. A cell that closely follows a game variable is called tuned to it. The intuition is that a strongly tuned cell must encode that variable and therefore drive the behaviour. This is one of the workhorses of systems neuroscience. On the VCS it is actively misleading. Many cells co-vary with the beam clock and the frame counter, so apparent tuning is cheap and common. A cell can track a game variable perfectly while playing no causal role in producing it. The method thus flags cells that look meaningful but are not, which is exactly the trap we set out to measure. It is the same present-versus-used problem that also defeats linear probing.
Each point is a RAM cell: its true causal importance (x) against its tuning strength to a game variable (y). Red points are strongly tuned yet not causal — the trap the metric measures. A3_game_variable_spurious_tuning_rate = 0.500 — this example only (pong, state gameplay(seed=0,prefix=90)+15); the audit aggregate is below.
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.
Put an electrode next to one neuron in a cat's visual cortex. Show the cat a bar of light at different angles. At one angle the neuron fires a lot; at others it is quiet. Plot firing rate against angle and you get a bump: the neuron's tuning curve. A sharp bump makes the neuron selective, or “tuned”, to that angle. Hubel and Wiesel won a Nobel prize for such curves. The tempting conclusion is that the neuron encodes the angle and that the brain uses it to see.
Deep learning does the same thing under other names: finding the “cat neuron”, the “edge detector” in layer 1, or a unit that lights up for one class. The method is purely observational. It watches a unit and a variable change together; it never asks whether the unit is needed. On the VCS we can check that second question with the oracle. We find that many strongly tuned bytes play no causal role at all. Being correlated with a variable and being used to produce behaviour are different things.
Neuroscience origin. A tuning curve is the mean response \(r_i(s)\) of unit \(i\) as a function of a stimulus variable \(s\) (bar angle, sound pitch, head direction). Its sharpness is often summarised by a selectivity index. The extreme form is the “grandmother cell” that fires only for one person.
Neural-network analogue. Network dissection (Bau et al.) measures how well the activation map of a unit overlaps a labelled concept (“dog”, “wood”). Class-selectivity indices compare a unit's mean activation on its favourite class with the others. A simple, general version is the absolute Pearson correlation between a unit's activation over many inputs and a variable \(g\):
\[ s_i \;=\; \max_{g}\; \big|\rho\big(x_i(t),\, g(t)\big)\big|,\qquad \rho(x,g) = \frac{\operatorname{cov}(x,g)}{\sigma_x\,\sigma_g}. \]A unit is strongly tuned if \(s_i \ge \tau\). Leavitt & Morcos then ablated highly selective units and found that removing them often did not hurt, and sometimes helped: selectivity is a poor guide to importance.
Toy example. A game runs for 10 frames, \(t = 1,\dots,10\). The ball moves right at a steady speed: \(\text{ball\_x}(t) = 20 + 2t\). A separate byte is a frame counter: \(\text{timer}(t) = t\). The timer is never read when the ball is drawn. Still, \(\rho(\text{timer}, \text{ball\_x}) = 1\) exactly, because both are straight lines in \(t\). The tuning method calls the timer perfectly tuned to ball position. If you overwrite the timer, the ball does not move differently. In the language of statistics, the shared driver \(t\) is a confounder: it makes two unrelated things move together.
| The neuron | One candidate RAM byte of the VCS's 128-byte working memory, taken from published RAM annotations (OCAtari / AtariARI) for that game. |
|---|---|
| The recording | A 150-frame trajectory: RAM and screen logged after every frame while the bit-exact emulator plays the shared seeded random input (then no-ops). |
| The stimulus variable | Two families: game variables (the other labelled bytes' own time series, e.g. ball x, plus a raw score byte) and luminance (mean palette value of the screen) as a low-level “hardware” feature. |
| The tuning curve | Absolute Pearson correlation of the byte's value with each variable over the 150 frames; the frame clock is kept as a confound control. |
| “Is it used?” | The oracle: overwrite the byte at frame \(f^*\) with \(0\), base\(+17\) or base\(+37\), re-run the real ROM 15 frames, count changed screen pixels. Any change means causal. |
The runner A3_tuning.jl combines one observational part (the method) and one
interventional part (the truth) for each game.
record_parity_trajectory steps the emulator frame by frame for
150 frames along the same input stream (no-op after the 105 gameplay frames) and stores the 128 RAM
bytes and the full screen after every frame. This is the “electrode recording”.Why the trap is so easy to fall into on the VCS. Everything in a game is locked to the 60 Hz frame clock. Timers, animation counters and positions of moving objects all change in step with it, so over a short window many bytes look like straight lines in time and correlate strongly with each other. Some of those bytes are also never used for what reaches the screen within 15 frames. The game variables themselves are other RAM bytes, not hand-measured quantities, so a “tuned” pair may simply be two outputs of the same routine.
XAI the interpretability method substrate the bit-exact emulator it runs on (jutari, Julia).
A3_tuning.jl:234 — The recording: step the ROM frame by frame and stack RAM plus screen into a (T × n) tape.A3_tuning.jl:390 — The stimulus variables: each labelled byte's time series plus a raw score byte.A3_tuning.jl:370 — The hardware variable (mean screen luminance) and the frame-clock confound.A3_tuning.jl:413 — The method: |Pearson| tuning, self-column excluded, threshold τ = 0.7, spurious-tuning rates.A3_tuning.jl:325 — The ground truth: do(0 / +17 / +37) per byte, 15-frame re-run, max changed pixels.A3_tuning.jl:477 — F (Spearman vs oracle), S (held-out +37 effect), M (named vs true movers).A3_tuning.jl:582 — One game end to end: shared state, oracle, recording, tuning, triad.shared_testbed_impl.jl:115 — The shared seeded-gameplay state and its oracle cause-density gate.StellaEnvironment.jl:259 — One video frame of the bit-exact emulated VCS (called once per recorded frame).StellaEnvironment.jl:350 — Read the 128 RAM bytes out of the console: the “electrode”.The figure is a scatter plot with one dot per candidate byte. The x-axis is the oracle's true causal importance, the y-axis the byte's tuning strength to a game variable. Red dots are spurious: strongly tuned (high on the y-axis) yet at zero on the x-axis. Green dots are genuine. If tuning were a good guide, the dots would rise from bottom-left to top-right. In Pong the top-left corner is occupied: bytes that track a game variable almost perfectly but do not change the screen when overwritten. Also look at the bottom-right: causal bytes, such as a score byte that does not change during the window, show no tuning at all. Tuning misses them as well.
julia --project=jutari tools/xai_study/phaseA_kording/A3_tuning.jl --games core
Writes A3_tuning_<game>.{json,npz} per game and the index A3_tuning_all.json into tools/xai_study/phaseA_kording/out/. --tau 0.7 sets the tuning threshold, --traj-frames 150 the recording length, --selftest runs the checks without writing.
Read next: Linear probing + control tasks · A4 · Pairwise correlations · A2 · Single-unit lesions · A7 · Dimensionality reduction (NMF/PCA)
The score is a spurious-tuning rate: the fraction of cells that are strongly tuned to a game variable yet are not among the oracle's causal cells. We first find the cells whose value tracks a game variable strongly, then ask the intervention oracle which of those cells actually cause the output. A tuned cell that is not causal is a false positive, and the spurious-tuning rate counts them. Faithfulness is one minus that rate, so a method that only flags true causes scores high and a method that flags many non-causal cells scores low. On the VCS the rate is high, because many cells co-vary with the beam clock, so tuning is cheap and often unrelated to causation. This is the same present-versus-used trap that also defeats linear probing: a cell can carry a variable without the program using it. The grading is always against the oracle. There is no sprite-position hard-case here, because the output is a tuning judgement, not a coordinate. Because per-game correlations for this family can go negative, the aggregate clips each per-game value at zero before averaging, so a method with no real signal lands near zero rather than at a spurious floor. The audit box reports the aggregated faithfulness.
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 correlation between per-cell game-variable tuning selectivity and the oracle causal importance over 8 candidate cells. | ✓ matches Scored vs oracle causal importance (not vs external labels); the per-game clip-at-0-then-mean is applied at aggregation (paper cites A3 = 0.213 clip-at-zero mean). Runner A3_tuning.jl,; record out/A3_tuning_pong.json triad.F=-0.007. how it's measured — call stack:
|
| S sufficiency | \(S = \rho_{\mathrm{Pearson}}\!\left(\mathrm{attr},\ \Delta y_{\mathrm{held\text{-}out}}(u)\right) \in [-1,1]\) | Pearson correlation of the selectivity map vs the held-out do(base+37) screen break. | ✓ matches Held-out predictive correlation in [-1,1] of the selectivity map vs the held-out do(base+37) screen break: the §3 (sec:triad) form. A3_tuning.jl; record S=0.441 (battery air_raid). 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 cells over the number of strongly-tuned cells the method names. | ✓ matches Runner now emits M = |U*|/|U_hat| (M_note '|U*|=10 (oracle movers) / |U_hat|=7 (method above-threshold)'), the paper's set-size ratio. Record out/A3_tuning_*.json extra.triad.M. Replaced the former 1 − spurious-tuning 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: correlational. 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.A3_tuning.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 (A3_game_variable_spurious_tuning_rate), reported as the F column, so there is no content or position regime to separate.
M is n/a on 5 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 39 games where the method did name a cause set.
S is negative on 15 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 |
|---|---|---|---|---|---|---|
| Name This Game | 0.866 | n/a | n/a | 0.754 | 1.000 | recovers the true causes |
| Freeway | 0.829 | n/a | n/a | 0.873 | 1.000 | |
| Air Raid | 0.717 | n/a | n/a | 0.719 | 1.000 | |
| Boxing | 0.681 | n/a | n/a | 0.728 | 1.000 | |
| Bowling | 0.603 | n/a | n/a | 0.573 | 1.000 | |
| Bank Heist | 0.564 | n/a | n/a | 0.247 | 1.000 | |
| Yars' Revenge | 0.553 | n/a | n/a | 0.358 | 0.500 | |
| Q*bert | 0.518 | n/a | n/a | 0.183 | 0.467 | |
| Berzerk | 0.513 | n/a | n/a | 0.223 | 0.875 | |
| Fishing Derby | 0.491 | n/a | n/a | 0.490 | 0.714 | |
| Frostbite | 0.476 | n/a | n/a | 0.346 | 1.000 | |
| Demon Attack | 0.406 | n/a | n/a | 0.200 | 0.750 | |
| Double Dunk | 0.378 | n/a | n/a | 0.653 | 1.000 | |
| Krull | 0.305 | n/a | n/a | 0.184 | 1.000 | |
| Tennis | 0.231 | n/a | n/a | -0.217 | 1.000 | |
| Hero | 0.229 | n/a | n/a | -0.114 | 1.000 | |
| Jamesbond | 0.188 | n/a | n/a | 0.130 | 0.875 | |
| Private Eye | 0.166 | n/a | n/a | 0.292 | 1.000 | |
| Pitfall | 0.146 | n/a | n/a | 0.257 | 0.846 | |
| Alien | 0.105 | n/a | n/a | 0.245 | 1.000 | |
| Seaquest | 0.078 | n/a | n/a | 0.311 | 1.000 | |
| Assault | 0.051 | n/a | n/a | -0.004 | 0.900 | |
| Phoenix | 0.025 | n/a | n/a | -0.184 | 1.000 | no true-cause signal |
| Chopper Command | 0.007 | n/a | n/a | 0.180 | 0.769 | no true-cause signal |
| Asterix | 0.000 | n/a | n/a | -0.325 | 1.000 | no true-cause signal |
| Atlantis | 0.000 | n/a | n/a | -0.446 | 1.000 | no true-cause signal |
| Breakout | 0.000 | n/a | n/a | -0.381 | 1.000 | no true-cause signal |
| Carnival | 0.000 | n/a | n/a | -0.024 | 1.000 | no true-cause signal |
| Centipede | 0.000 | n/a | n/a | -0.590 | 1.000 | no true-cause signal |
| Enduro | 0.000 | n/a | n/a | -0.710 | 0.667 | no true-cause signal |
| Gopher | 0.000 | n/a | n/a | 0.000 | n/a | no true-cause signal |
| Ice Hockey | 0.000 | n/a | n/a | 0.032 | 1.000 | no true-cause signal |
| Kangaroo | 0.000 | n/a | n/a | 0.000 | n/a | no true-cause signal |
| Kung-Fu Master | 0.000 | n/a | n/a | 0.000 | n/a | no true-cause signal |
| Montezuma's Revenge | 0.000 | n/a | n/a | -0.226 | 1.000 | no true-cause signal |
| Ms. Pac-Man | 0.000 | n/a | n/a | 0.000 | n/a | no true-cause signal |
| Pacman | 0.000 | n/a | n/a | 0.000 | n/a | no true-cause signal |
| Pong | 0.000 | n/a | n/a | -0.412 | 1.000 | no true-cause signal |
| Riverraid | 0.000 | n/a | n/a | 0.092 | 1.000 | no true-cause signal |
| Road Runner | 0.000 | n/a | n/a | 0.083 | 0.429 | no true-cause signal |
| Skiing | 0.000 | n/a | n/a | -0.290 | 1.000 | no true-cause signal |
| Space Invaders | 0.000 | n/a | n/a | -0.070 | 1.000 | no true-cause signal |
| Venture | 0.000 | n/a | n/a | -0.083 | 1.000 | no true-cause signal |
| Video Pinball | 0.000 | n/a | n/a | 0.472 | 1.000 | no true-cause signal |
The path from this method's runner (compute_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_a3_shared_state(game) -> build_shared_testbed(game; ...) runnerfunction build_shared_testbed(game; ...) runnercause_density = count(>(floor), deltas) runnerrecord_parity_trajectory(game, actions) runnerenv_step!(env, Int(actions[t])) jutariget_ram(env) jutarigame_variable_signals(traj, cands) runnerluminance_and_clock(traj) runnerrun_a3_tuning(traj, cands, oracle_importance; tau=0.7) 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.