project: modelmap document: Phase 1 notes — §4.4 Circuits and computational graphs author: Simon-Pierre Boucher contact: contact@spboucher.ai website: https://modelmap.io created: 2026-08-12 status: draft
§4.4 — Circuits and computational graphs
Cost classes: L (laptop-trivial), M (hours + tens of GB), H (multi-day / >64 GB / cluster-typical).
B1. Induction heads
- Key paper: Olsson et al. (Anthropic) 2022, https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html
- Claims: Two-head circuit (previous-token + induction head) implements [A][B]…[A]→[B] copying; forms in a phase change coincident with in-context learning.
- Type: Both — pattern-based detection plus ablations ("medium-confidence" causal per the paper itself).
- Cost: L. Prefix-matching scores on any model that fits memory; classic first map layer for modelmap (cheap, replicable, cross-model).
- Implementation: TransformerLens https://github.com/TransformerLensOrg/TransformerLens (MPS works, occasional dtype/op fallbacks); trivially portable to MLX hooks.
- Failure modes: "Induction head" is behaviorally defined — heads heterogeneous and multifunctional; ICL attribution contested for large models.
- Epistemic status: Established (most-replicated finding in mech interp).
B2. IOI circuit and attention-head taxonomies
- Key papers: IOI: Wang et al. 2022, https://arxiv.org/abs/2211.00593 ; Copy suppression: McDougall et al. 2023, https://arxiv.org/abs/2310.04625 ; Successor heads: Gould et al. 2023, https://arxiv.org/abs/2312.09230
- Claims: 26-head circuit computes indirect-object identification in GPT-2-small; established faithfulness/completeness/minimality criteria. Copy suppression explains "negative heads" and self-repair. Successor heads recur across families 31M–12B on shared "mod-10" numeric features.
- Type: Causal (path patching, ablations) + observational weight analysis.
- Cost: L–M. GPT-2-small path patching laptop-trivial; head-taxonomy scans across a 7B model are M on 32–64 GB.
- Failure modes: Backup heads / self-repair make ablation-based importance unstable (Hydra effect — McGrath et al. 2023, https://arxiv.org/abs/2307.15771); IOI only ~87% faithful, node-level; taxonomy labels are task-distribution-relative.
- Epistemic status: Established (IOI heavily replicated cross-model); taxonomy generality contested at margins.
B3. MLP layers as key–value memories
- Key papers: Geva et al. 2021, https://arxiv.org/abs/2012.14913 ; Geva et al. 2022, https://arxiv.org/abs/2203.14680
- Claims: MLP input weights = pattern detectors (keys), output weights = vocabulary-space updates (values); predictions built by additive sub-updates.
- Cost: L — weight-only plus light forward passes; pairs naturally with Experiment E (weight-space cartography) and logit lens.
- Implementation: simple to reimplement; baukit https://github.com/davidbau/baukit for hooks. MPS/MLX trivial.
- Failure modes: Vocabulary projection misleads in early/mid layers; neuron-level keys polysemantic; "memory" metaphor overclaims vs editing critiques (Hase et al. 2023, https://arxiv.org/abs/2301.04213).
- Epistemic status: Established as a lens; literal KV-memory reading contested.
B4. Activation patching / attribution patching
- Key papers: causal tracing: Meng et al. 2022, https://arxiv.org/abs/2202.05262 ; attribution patching: Nanda 2023, https://www.neelnanda.io/mechanistic-interpretability/attribution-patching ; best practices: Heimersheim & Nanda 2024, https://arxiv.org/abs/2404.15255
- Claims: Swapping activations between clean/corrupted runs localizes causally necessary components; attribution patching approximates all components in 2 forward + 1 backward pass.
- Cost: Patching scans M at 7B (thousands of forwards); attribution patching L–M — the key trick making circuit scans Mac-feasible, but needs gradients (MLX autodiff or PyTorch-MPS backward; memory ≈ 2–3× inference).
- Implementations: TransformerLens, nnsight https://github.com/ndif-team/nnsight , pyvene.
- Failure modes: Corrupted-baseline choice changes conclusions (noising vs denoising, zero vs mean vs resample); gradient approximation fails near zero-gradient (fixed by IG); localization ≠ editability.
- Epistemic status: Established core method; interpretation pitfalls well-documented.
B5. Attribution graphs / circuit tracing (Anthropic 2025)
- Key papers: Ameisen, Lindsey et al., Circuit Tracing, 2025, https://transformer-circuits.pub/2025/attribution-graphs/methods.html ; Lindsey et al., On the Biology of a Large Language Model, 2025, https://transformer-circuits.pub/2025/attribution-graphs/biology.html ; QK follow-up: https://transformer-circuits.pub/2025/attention-qk/index.html
- Claims: Replace MLPs with cross-layer transcoders → per-prompt linear attribution graph (nodes = features/errors/tokens, edges = direct causal contributions). Revealed planning-in-poetry, multilingual shared circuits, multi-step reasoning, unfaithful CoT, refusal mechanics.
- Type: Hybrid — graph construction is attributional through a lossy proxy model; hypotheses validated with steering/suppression interventions (the modelmap Level-2→Level-3 pattern).
- Cost: With pretrained CLTs (Gemma-2-2B, Llama-3.2-1B, Qwen3-4B): M — community reports ~15–40 GB for Gemma-2-2B graphs → 64 GB Mac plausible, 16 GB not. Training own CLTs for 7B: H.
- Implementations: circuit-tracer https://github.com/safety-research/circuit-tracer (announcement: https://www.anthropic.com/research/open-source-circuit-tracing); Neuronpedia hosts interactive graphs; frontend https://github.com/anthropics/attribution-graphs-frontend . CUDA-oriented; MPS port is a concrete modelmap engineering task.
- Failure modes: Error nodes are unexplained dark matter; attention patterns frozen (QK side has substantial interference); replacement-model faithfulness varies by prompt; per-prompt graphs need aggregation to become "maps"; many graphs unreadable.
- Epistemic status: Established methodology with candid limitation reporting; individual findings Level 2–3.
B6. Automated circuit discovery: ACDC → EAP → EAP-IG → edge pruning
- Key papers: ACDC: Conmy et al., NeurIPS 2023, https://arxiv.org/abs/2304.14997 ; EAP: Syed, Rager, Conmy 2023, https://arxiv.org/abs/2310.10348 ; EAP-IG: Hanna et al., COLM 2024, https://arxiv.org/abs/2403.17806 ; Edge pruning: Bhaskar et al., NeurIPS 2024, https://arxiv.org/abs/2406.16778
- Claims: ACDC: greedy edge removal recovers known circuits. EAP: gradient attribution scores all edges in ~3 passes. EAP-IG: integrated gradients fix zero-gradient failure; circuits must be selected by faithfulness, not node-overlap. Edge pruning: continuous masks; half-size circuits at equal faithfulness; scaled to CodeLlama-13B.
- Cost: ACDC M–H (slow beyond GPT-2). EAP/EAP-IG: L–M — the Mac-feasible default for 0.5B–8B. Edge pruning M–H (~1 GPU-day class; marginal on 64 GB Mac, feasible on M3U96a-class nodes).
- Implementations: https://github.com/ArthurConmy/Automatic-Circuit-Discovery ; https://github.com/hannamw/EAP-IG ; https://github.com/princeton-nlp/Edge-Pruning . PyTorch; MPS-workable (edge pruning assumes CUDA-scale memory).
- Epistemic status: Established tooling; "which method is right" contested — see B7.
B7. Faithfulness metrics for circuits — and their critiques
- Key papers: Miller, Chughtai, Saunders 2024, https://arxiv.org/abs/2407.08734 ; Shi et al. 2024, https://arxiv.org/abs/2410.13032 ; subspace-patching illusion: Makelov, Lange, Nanda 2023, https://arxiv.org/abs/2311.17030
- Substance: Measured faithfulness swings wildly with ablation type (zero/mean/resample), direction, token positions, and metric (logit diff vs KL) — the same circuit can look faithful or unfaithful by experimenter choice. Shi et al. formalize equivalence/independence/minimality tests; published circuits pass only partially. Subspace patching can activate dormant pathways → illusory localization.
- Cost: L–M at ≤2B — running a battery of ablation variants is exactly the charter §8.4 multi-control discipline.
- Implementations: auto-circuit https://github.com/UFO-101/auto-circuit (efficient multi-ablation); https://github.com/blei-lab/circuitry
- Consequence for modelmap: report faithfulness curves across ablation schemes, never single numbers.
- Epistemic status: Critiques established; no consensus null for "faithful enough".
B8. Sparse feature circuits
- Key paper: Marks et al., ICLR 2025, https://arxiv.org/abs/2403.19647
- Claims: Circuits over SAE features are far more interpretable than head/neuron circuits; SHIFT removes spurious signals; unsupervised discovery at scale.
- Type: Causal — IG attribution patching validated by ablation.
- Cost: M on Pythia-70M/Gemma-2-2B with public SAEs (Mac-feasible); needs SAEs for every stream, so capture cost multiplies.
- Implementation: https://github.com/saprmarks/feature-circuits (dictionary_learning + nnsight). MPS-workable.
- Failure modes: Inherits SAE pathologies — circuits over non-replicating features inherit their fragility.
- Epistemic status: Established method, actively extended; robustness contested.
B9. Weight-sparse transformers (OpenAI 2025) — circuits by construction
- Key paper: Gao, Rajaram et al. 2025, https://arxiv.org/abs/2511.13653 (toolkit: https://github.com/openai/circuit_sparsity)
- Claims: Training at ~1/1000 weight density yields compact, human-legible, causally-verifiable task circuits.
- Relevance: applies only to models trained this way — useful to modelmap as a planted-ground-truth benchmark for validating discovery methods, not for mapping existing checkpoints.
- Epistemic status: Established for tiny models; scaling unresolved.
2024–2026 developments
- Mar 2025: attribution-graph diptych reorients field from head-level to feature-level circuits; May 2025 circuit-tracer open-sourced; Aug 2025 Neuronpedia "Circuits Research Landscape" https://www.neuronpedia.org/graph/info
- Nov–Dec 2025: OpenAI weight-sparse circuits; 2026 follow-up on interpretable individual parameters (https://arxiv.org/abs/2607.02964)
- 2026: ADAG — automated attribution-graph description (https://arxiv.org/abs/2604.07615); Circuit Insights — interpretability beyond activations toward weights (https://arxiv.org/abs/2510.14936); Anthropic Circuits Updates May/June 2026 apply features+graphs to safety auditing (https://transformer-circuits.pub/2026/june-update/index.html)
Implications for modelmap
- Induction-head and head-taxonomy maps are the cheapest replicable cross-model map type — good Experiment B/D substrate.
- EAP-IG is the default Mac-feasible circuit-discovery method; ACDC only for validation on tiny models.
- Faithfulness must be published as curves across ablation schemes (charter §8.4 alignment).
- An MPS/MLX port of circuit-tracer (or a minimal reimplementation) is a concrete high-value engineering contribution.
- The Hydra effect / self-repair is a first-class threat to any ablation-based localization map — Experiment C must include backup-head detection.