Phase C · mechanistic interpretability

ACDC — automatic circuit discovery

Conmy et al. 2023

← back to the method catalogue

What it does?

ACDC automates circuit discovery. Instead of a human proposing a circuit and patching it by hand, ACDC starts from the full computational graph and prunes edges one at a time. It removes an edge by resample-ablation, replacing the signal on that edge with a resampled value, and keeps the edge only if removing it hurts performance beyond a threshold. Sweeping the threshold traces out a family of candidate circuits. The output is a minimal subgraph that, in principle, carries the computation, found automatically. This is one of the main tools for scaling mechanistic interpretability beyond hand analysis. We apply it to the VCS by pruning the candidate data-flow graph and comparing the discovered circuit to the true routine over a threshold sweep. The VCS gives ACDC an unusually fair test, because we have the exact wiring and can also run a positive control that prunes under exhaustive exact interventions. Against that control ACDC's shortfall is a real property of single-shot discovery, not a broken scorer. It recovers a fraction of the true edges: its precision is reasonable but its recall is limited, because dependencies re-derived through other cells survive the resample and are pruned away. On one game it recovers a perfect, minimal circuit that nonetheless fails to regenerate the behaviour, which is one of the paper's key separations between a correct graph and a working computation.

ACDC — automatic circuit discovery result

Two adjacency matrices over the candidate RAM cells: the true data-flow graph and the graph this method recovered. A bright cell (row = cause, column = effect) is an edge; the difference between the two panels is the error. discovered_circuit_best_F1_vs_true_dataflow = 0.154 — this example only (pong, state gameplay(seed=0,prefix=90)+15); the audit aggregate is below.

How it's scored

The score is the best F1 of the auto-discovered circuit against the true data-flow over a threshold sweep. ACDC prunes edges by resample-ablation, keeping an edge only if removing it hurts performance beyond the current threshold, and sweeping the threshold traces a family of candidate circuits from which we take the best F1 against the true routine. The grading is always against the intervention oracle's true wiring. Faithfulness for this method is that best F1, and it is partial: precision is reasonable but recall is limited, because dependencies re-derived through other cells survive the resample and get pruned away. A positive control runs the identical pruning under exhaustive exact interventions and reaches a perfect F1 on every game, so the shortfall is a real measurement of single-shot discovery, not a broken scorer. There is no sprite-position hard-case here; the output is a circuit. One of the paper's key separations comes from this method: on one game ACDC recovers a perfect, minimal circuit that nonetheless fails to regenerate the behaviour under held-out interventions, so sufficiency drops well below faithfulness. The grading is always against the oracle. The audit box reports the measured triad, so you can see faithfulness beside a lower sufficiency on the same discovered graph.

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 = F_1^{\mathrm{edge}}(\hat{E}, E^{\star})\)Best-τ F1 of the ACDC-discovered inter-cell edge set against the exhaustive-oracle true data-flow graph.✓ matches acdc.jl (F = best_score.f1); true graph = exhaustive do-set 0/base+17/base+37 over the candidate cells. This is exactly the paper's circuit-discovery F = edge F1 vs the true data-flow graph. Record: extra.triad.F and top-level value (e.g. acdc_pong.json F=0.154; battery mean F=0.625, n=35).
how it's measured — call stack:
  1. F = best-τ edge-F1 of the discovered circuit, into the triad — acdc.jl:735
  2. score_edges: edge precision·recall → F1 — acdc.jl:474
  3. true causal effect Δy(u) by bit-exact re-run — oracle_intervene.jl:242
S
sufficiency
\(S = \dfrac{\#\{\text{clean readouts preserved under scrub}\}}{\#\ \text{readouts}} \in [0,1]\)Fraction of the clean readouts the discovered circuit alone reproduces when everything outside it is resample-ablated (bit-exact re-run).✓ matches acdc.jl (S = scrub_preserved). A held-out-flavoured sufficiency on bit-exact re-runs; the new §3 (sec:triad) admits the fraction-within-tolerance [0,1] special case of the held-out predictive test, and this preservation fraction is that form, so it satisfies §3. Record: extra.triad.S (acdc_pong.json S=0.625).
how it's measured — call stack:
  1. scrub_preserved: clean readouts kept when non-circuit parents are resample-scrubbed — acdc.jl:720
  2. S folded into the triad record — acdc.jl:735
M
minimality
\(M = |U^{\star}| / |\hat{U}| = |E^{\star}| / |\hat{E}| \in (0,1]\)True-graph edge count over the number of discovered edges (edge-level |U*|/|U_hat|).✓ matches acdc.jl now emits M = |true edges|/|discovered edges|, the paper's M = |U*|/|U_hat| at the edge level (as path_patching does). Record: extra.triad.M with M_note '|U*|=12 true edges / |U_hat|=1 discovered edges (best-F1 tau)' (acdc_pong.json M=1.0). Replaced the former edge-precision (1 - FP/n_disc).
how it's measured — call stack:
  1. M = |true edges| / |discovered edges| (best-τ) — acdc.jl:731
  2. score_edges counts the true and discovered edge sets — acdc.jl:474

✓ 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 35 scored games (35 committed §R records), not the single example shown above. Tradition: causal. The example figure (Pong) is one of those records.

0.625F — faithfulness vs oracle (mean over 35 games, ±0.110 CI95)
0.299S — 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)
35committed 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 35 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.acdc.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 (discovered_circuit_best_F1_vs_true_dataflow), reported as the F column, so there is no content or position regime to separate.

M is n/a on 4 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 31 games where the method did name a cause set.

GameF (all)content-Fposition-FSMNote
Alien1.000n/an/a0.1671.000recovers the true causes
Hero1.000n/an/a0.2941.000recovers the true causes
Jamesbond1.000n/an/a0.3851.000recovers the true causes
Phoenix1.000n/an/a0.0831.000recovers the true causes
Q*bert1.000n/an/a0.1001.000recovers the true causes
Tennis1.000n/an/a0.3331.000recovers the true causes
Video Pinball1.000n/an/a0.2861.000recovers the true causes
Venture0.961n/an/a0.4441.000recovers the true causes
Road Runner0.923n/an/a0.3331.000recovers the true causes
Montezuma's Revenge0.889n/an/a0.3331.000recovers the true causes
Yars' Revenge0.889n/an/a0.3851.000recovers the true causes
Seaquest0.880n/an/a0.2171.000recovers the true causes
Boxing0.867n/an/a0.7271.000recovers the true causes
Centipede0.800n/an/a0.4441.000
Krull0.800n/an/a0.0801.000
Riverraid0.688n/an/a0.2271.000
Atlantis0.667n/an/a0.1111.000
Bowling0.667n/an/a0.0501.000
Frostbite0.667n/an/a0.4211.000
Double Dunk0.636n/an/a0.2501.000
Demon Attack0.615n/an/a0.4671.000
Berzerk0.562n/an/a0.2691.000
Chopper Command0.545n/an/a0.8001.000
Space Invaders0.500n/an/a0.5291.000
Assault0.429n/an/a0.4501.000
Ice Hockey0.429n/an/a0.2001.000
Carnival0.364n/an/a0.2221.000
Private Eye0.364n/an/a0.1671.000
Pitfall0.308n/an/a0.4381.000
Breakout0.286n/an/a0.3331.000
Pong0.154n/an/a0.6251.000
Air Raid0.000n/an/a0.000n/ano true-cause signal
Kangaroo0.000n/an/a0.133n/ano true-cause signal
Ms. Pac-Man0.000n/an/a0.053n/ano true-cause signal
Pacman0.000n/an/a0.125n/ano true-cause signal

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

Applied on the substrate

  1. Boot the real ROM with the xitari-parity reset (60 NOOP + 4 RESET) before any replay — env_reset!(env; boot_noop_steps = 60, boot_reset_steps = 4) jutari
  2. Deterministically step the emulator one action per env-frame (drives boot_replay/continue re-runs) — env_step!(env::StellaEnvironment, action::Integer) jutari
  3. Assemble the shared seeded-random-action gameplay-state testbed (checkpoint at f*, causes, shared screen output, cause-density gate) — build_shared_testbed(game; ... run_intervention = O.run_intervention, soft_ram_peek = soft_ram_peek, ...) via build_acdc_shared_state runner
  4. Freeze byte-exact RAM + cropped screen out of the env at a frame — snapshot(env::StellaEnvironment, frame::Integer) jutari

The computation

  1. Pick the corrupted resample value per source (donor byte where it diverges, else base+17) — resample_value(clean_val::Int, donor_val::Int) runner
  2. ACDC edge-effect matrix E[i,j] = |child_j(resample-ablate source_i) - child_j(clean)|: one real-ROM re-run per source via intervene_continue (write source cell, continue tail) — acdc_edge_effects(checkpoint, tail, cands, at_target, corrupt_at_target) -> intervene_continue -> intervene_ram! runner intervene_continue @ acdc.jl:290 -> intervene_ram! @ acdc.jl:274; base = continue_from(checkpoint, tail) @ acdc.jl:281
  3. Discovered circuit at threshold tau: edge i->j iff E[i,j] > tau (diagonal forced off) — discovered_at(E::Matrix{Float64}, tau::Float64) runner
  4. Threshold sweep over tau (the ACDC pruning schedule) feeding the ROC/AUC against the true data-flow graph — tau_sweep(E::Matrix{Float64}) runner

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

Implementation
tools/xai_study/phaseC_mechanistic/acdc.jl
Reference
Conmy et al. 2023
Record
acdc_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.