Phase C · mechanistic interpretability

Sparse autoencoders

Cunningham et al. 2023; Bricken et al. 2023; Templeton et al. 2024

← back to the method catalogue

What it does?

A sparse autoencoder tries to break a tangled state into clean, single-meaning features. It is a small neural network trained to reconstruct the recorded state through a wide but sparsely active hidden layer, so that only a few hidden units fire for any given input. The hope is that each hidden unit becomes 'monosemantic', standing for one human-meaningful concept, which would untangle the superposition thought to hide features inside neural activations. Sparse autoencoders are a central, fast-growing tool in mechanistic interpretability. We train one on the recorded RAM trajectory of the VCS and match its learned features to known, verified game-variable cells. On this small state the reconstruction is nearly perfect and every game-variable cell the SAE is asked to match gets a matching feature. By the metric the field usually uses to claim a feature 'is' a concept, the SAE looks like a complete success. The VCS lets us apply a stronger test. We ablate the matched feature, re-run the real ROM, and ask whether the computation it is supposed to name actually changes. Often it does not: the feature is named but causally unused: clamping it and re-running changes nothing. The sparse autoencoder is therefore our sharpest example of a method that scores well on the standard matching metric while failing the causal test that only a known machine can provide.

Sparse autoencoders result

Left: the frame. Right: the recovered structure/effect against the ground truth (matched components or preserved behaviour), with the RAM cells labelled. feature_variable_matched_fraction = 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 fraction of sparse-autoencoder features that match a known, verified game-variable cell, together with a causal-use check by ablation. We first measure the matched fraction, how many of the concept cells the SAE was asked to represent get a matching feature, and on this small state that fraction is high. That is the metric the field usually uses to claim a feature is a concept. The VCS then applies a stronger test the audit treats as the real faithfulness: we ablate the matched feature, re-run the real ROM, and ask whether the computation it is supposed to name actually changes. Often it does not, so the causal faithfulness is low even though the matched fraction is high, and the sufficiency can even go negative. This split is the point: a feature can be named yet causally unused. There is no sprite-position hard-case here, because the method is scored on features and their ablation, not on a rendered position. Its plausibility proxy is high, which places it in the danger zone of high plausibility with low faithfulness. The grading is always against the intervention oracle, never against the matching metric alone. The audit box reports the measured triad, so you can read the low causal faithfulness directly.

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 = \rho_{\mathrm{Spearman}}\!\left(\mathrm{attr}_{\mathrm{recovery}},\ \Delta y(u)\right)\)Spearman correlation between per-cell SAE recovery and the oracle causal importance: paper-shaped causal-effect agreement.✓ matches sae.jl (extra.triad.F = _spearman(recovery, oracle.importance)) IS the oracle-causal-agreement correlation, exactly §3's Phase-C causal-effect-agreement F, and leaderboard.py reads extra.triad.F. Record: sae_pong.json extra.triad.F=0.041. (The top-level 'value' field is still the feature_variable_matched_fraction naming stat, but the committed triad F is the correct causal Spearman.)
how it's measured — call stack:
  1. F = Spearman(per-cell SAE recovery, oracle causal importance) — sae.jl:784
  2. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
S
sufficiency
\(S = \rho_{\mathrm{Pearson}}\!\left(\mathrm{attr}_{\mathrm{recovery}},\ \Delta y_{\mathrm{held\text{-}out}}(u)\right) \in [-1,1]\)Held-out predictive correlation between SAE recovery and the causal effect on an unseen do(base+37) bit-exact re-run; can be negative.✓ matches sae.jl (S = _pearson(recovery, oracle.held_out)). A held-out predictive correlation in [-1,1] on a disjoint intervention (paper-conform; negative allowed). Record: extra.triad.S (sae_pong.json S=−0.458; battery mean S=0.041, n=43).
how it's measured — call stack:
  1. S = Pearson(SAE recovery, held-out do(base+37) effect) — sae.jl:785
  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\}\)Oracle-mover count over the number of cells the SAE names above threshold.✓ matches sae.jl now emits M = |U*|/|U_hat| in extra.triad.M (M_note '|U*|=4 (oracle movers) / |U_hat|=4 (method above-threshold)'), the paper's set-size ratio. Record: sae_pong.json extra.triad.M=1.0. Replaced the former monosemanticity/target-share proxy.
how it's measured — call stack:
  1. minimality_score(SAE recovery, oracle importance) — sae.jl:786
  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 40 scored games (40 committed §R records), not the single example shown above. Tradition: dim_reduction. The example figure (Pong) is one of those records.

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

S is negative on 22 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
Name This Game0.783n/an/a0.7491.000
Bowling0.584n/an/a0.4761.000
Jamesbond0.580n/an/a-0.0970.875
Yars' Revenge0.570n/an/a0.4490.700
Alien0.359n/an/a0.4631.000
Krull0.308n/an/a0.4861.000
Freeway0.286n/an/a0.4811.000
Frostbite0.275n/an/a0.0591.000
Hero0.273n/an/a-0.1141.000
Road Runner0.258n/an/a0.5400.462
Q*bert0.252n/an/a-0.1170.467
Double Dunk0.221n/an/a0.5871.000
Private Eye0.208n/an/a0.1931.000
Riverraid0.201n/an/a0.2861.000
Ice Hockey0.176n/an/a0.2601.000
Ms. Pac-Man0.169n/an/a-0.2581.000
Tennis0.156n/an/a-0.2331.000
Air Raid0.137n/an/a0.0901.000
Assault0.114n/an/a0.3740.900
Berzerk0.054n/an/a-0.2210.875
Atlantis0.053n/an/a-0.5081.000
Demon Attack0.050n/an/a0.4480.750no true-cause signal
Pong0.041n/an/a-0.4581.000no true-cause signal
Bank Heist0.000n/an/a-0.5061.000no true-cause signal
Beam Rider0.000n/an/a-0.2621.000no true-cause signal
Boxing0.000n/an/a0.2151.000no true-cause signal
Breakout0.000n/an/a-0.4471.000no true-cause signal
Carnival0.000n/an/a-0.1121.000no true-cause signal
Centipede0.000n/an/a-0.4461.000no true-cause signal
Chopper Command0.000n/an/a-0.0860.769no true-cause signal
Fishing Derby0.000n/an/a-0.3510.714no true-cause signal
Kangaroo0.000n/an/a-0.0731.000no true-cause signal
Montezuma's Revenge0.000n/an/a-0.2241.000no true-cause signal
Pacman0.000n/an/a-0.3041.000no true-cause signal
Phoenix0.000n/an/a-0.2701.000no true-cause signal
Pitfall0.000n/an/a-0.2440.846no true-cause signal
Seaquest0.000n/an/a0.7061.000no true-cause signal
Space Invaders0.000n/an/a-0.1281.000no true-cause signal
Venture0.000n/an/a-0.0351.000no true-cause signal
Video Pinball0.000n/an/a0.4501.000no true-cause signal

Call stack — how it runs on jutari / jaxtari

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_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 (drives the RAM-trajectory recording) — env_step!(env::StellaEnvironment, action::Integer) jutari
  3. Assemble the shared gameplay-state testbed via build_sae_shared_state — build_shared_testbed(game; ... intervene_ram = J.intervene_ram!, run_intervention = O.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. Record the RAM trajectory (per-frame 128-byte tape) the SAE is fit on — sae_record_ram(game, frames, ...) -> env_step! runner
  2. Fit the sparse autoencoder (L1-regularised) on the z-scored RAM tape — fit!(s::SAE, X; epochs, lr) (ctor SAE @ :375, loss @ :395) runner
  3. CAUSAL-USE test: ablate feature f (zero its code), DECODE + denorm to a full raw RAM vector, WRITE it over all cells and re-run; effect = screen break of ablated-decode vs un-ablated-decode re-run (isolates the feature) — causal_use(...) -> run_full_write(raw_ablate) -> intervene_ram! over all cells; env_step! runner run_full_write writes the decoded RAM via intervene_ram! (sae.jl:627), denorm_ram @ :598; scored only on ORACLE-CAUSAL cells via oracle_importance @ :536

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

Implementation
tools/xai_study/phaseC_mechanistic/sae.jl
Reference
Cunningham et al. 2023; Bricken et al. 2023; Templeton et al. 2024
Record
sae_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.