Skip to content
DARC
■ Change #49 · wiki.edited

Mechanistic circuits and causal interventions: Normalize Markdown to canonical form

by DARC wiki2026-10-22 20:31:02 UTCOpen the page →
body
## The framework
− Elhage et al. (Anthropic, 2021) described a transformer as a set of components that read from and write to a shared residual stream, with attention heads as independent circuits whose behaviour can be analysed in terms of query-key and output-value matrices. A *circuit* is a subgraph of components and connections that implements a behaviour. Olsson et al. (2022) identified *induction heads*, pairs of attention heads that complete patterns of the form [A][B] ... [A] to [B], and gave evidence that they underlie much in-context learning in small models. Wang et al. (2022) reverse-engineered a 26-head circuit for indirect-object identification in GPT-2 small, the most-cited worked example.
+ Elhage et al. (Anthropic, 2021) described a transformer as a set of components that read from and write to a shared residual stream, with attention heads as independent circuits whose behaviour can be analysed in terms of query-key and output-value matrices. A _circuit_ is a subgraph of components and connections that implements a behaviour. Olsson et al. (2022) identified _induction heads_, pairs of attention heads that complete patterns of the form \[A]\[B] ... \[A] to \[B], and gave evidence that they underlie much in-context learning in small models. Wang et al. (2022) reverse-engineered a 26-head circuit for indirect-object identification in GPT-2 small, the most-cited worked example.
## Methods
- **Activation patching** replaces a component's activation from a clean run with its value on a corrupted run (or the reverse) and measures the effect on the output. It gives causal, not merely correlational, evidence. Zhang and Nanda (2024) examine metrics and methods for it, including how the choice of corruption and metric changes conclusions.
- **Automated circuit discovery.** ACDC (Conmy et al., 2023) prunes edges of the computational graph by patching; faster attribution-patching approximations use gradients.
- **Circuit tracing** with learned replacement models and attribution graphs (Ameisen et al., Anthropic, 2025) extends the idea to features rather than heads.
## Evaluation
− Two questions matter for a claimed circuit: *faithfulness* (does the circuit alone reproduce the model's behaviour?) and *completeness* (does removing it remove the behaviour?). The Mechanistic Interpretability Benchmark (Mueller et al., ICML 2025) standardises circuit localization across four tasks and five models and reports that attribution-based and mask-optimisation methods perform best, which makes methods comparable on a shared leaderboard.
+ Two questions matter for a claimed circuit: _faithfulness_ (does the circuit alone reproduce the model's behaviour?) and _completeness_ (does removing it remove the behaviour?). The Mechanistic Interpretability Benchmark (Mueller et al., ICML 2025) standardises circuit localization across four tasks and five models and reports that attribution-based and mask-optimisation methods perform best, which makes methods comparable on a shared leaderboard.
## Caveats
Circuits found with a particular input distribution and corruption may not describe the model elsewhere, and the minimal circuit is not unique. Scaling manual analysis to frontier models is the central unsolved difficulty.
explainer.student
− **The goal.** Mechanistic interpretability tries to explain how a neural network computes an answer, step by step, the way an engineer explains a circuit diagram, rather than only measuring what it outputs. A *circuit* is the small set of internal parts and connections that carries out one behaviour.
+ **The goal.** Mechanistic interpretability tries to explain how a neural network computes an answer, step by step, the way an engineer explains a circuit diagram, rather than only measuring what it outputs. A _circuit_ is the small set of internal parts and connections that carries out one behaviour.
− **The parts of a transformer.** A transformer keeps a vector for each token, the *residual stream*, which every layer reads from and adds to. Two kinds of parts write into it: *attention heads*, which move information between token positions (for example, copying something from an earlier word), and feed-forward layers, which transform the vector at one position. Because each part adds its output to the stream, the final result is a sum of contributions, which makes it possible to ask which parts mattered.
+ **The parts of a transformer.** A transformer keeps a vector for each token, the _residual stream_, which every layer reads from and adds to. Two kinds of parts write into it: _attention heads_, which move information between token positions (for example, copying something from an earlier word), and feed-forward layers, which transform the vector at one position. Because each part adds its output to the stream, the final result is a sum of contributions, which makes it possible to ask which parts mattered.
− **A worked example.** Given the text "When Mary and John went to the store, John gave a drink to", a small model answers "Mary". Researchers traced this indirect-object behaviour in GPT-2 small to a circuit of 26 attention heads: some notice that "John" is repeated, others suppress the repeated name, and others copy the remaining name to the output. Another well-studied circuit, the *induction head*, completes repeated patterns: having seen "Harry Potter" once, on seeing "Harry" again it predicts "Potter".
+ **A worked example.** Given the text "When Mary and John went to the store, John gave a drink to", a small model answers "Mary". Researchers traced this indirect-object behaviour in GPT-2 small to a circuit of 26 attention heads: some notice that "John" is repeated, others suppress the repeated name, and others copy the remaining name to the output. Another well-studied circuit, the _induction head_, completes repeated patterns: having seen "Harry Potter" once, on seeing "Harry" again it predicts "Potter".
**The main tool: activation patching.** Correlation is not causation, so circuits are tested by intervention, as in a lab experiment with a control. Run the model on a clean input (the Mary/John sentence) and on a corrupted one (names swapped). Then rerun the corrupted input, but replace the output of one component with its value from the clean run, and measure how far the answer moves back:
− $$\text{effect} = \frac{m_{\text{patched}} - m_{\text{corrupt}}}{m_{\text{clean}} - m_{\text{corrupt}}},$$
+ $\text{effect} = \frac{m_{\text{patched}} - m_{\text{corrupt}}}{m_{\text{clean}} - m_{\text{corrupt}}},$
where $m$ is a chosen measure of the model's preference for the right answer. An effect near 1 means that component alone carries the needed information; near 0, it does not matter. Automated methods repeat this across the whole network's connections, or approximate it with derivatives to save time.
**An analogy.** It is like debugging a circuit board by swapping one chip from a working board into a faulty one and seeing whether the fault clears. The analogy breaks because a network's parts overlap in function, so swapping one part can understate its role.
− **Limits.** A good circuit explanation must be *faithful* (the circuit alone reproduces the behaviour) and *complete* (removing it removes the behaviour). Results depend on the inputs and corruptions chosen, minimal circuits are not unique, and a shared benchmark (MIB) now compares methods. Scaling this analysis from small models to frontier models is the central unsolved difficulty.
+ **Limits.** A good circuit explanation must be _faithful_ (the circuit alone reproduces the behaviour) and _complete_ (removing it removes the behaviour). Results depend on the inputs and corruptions chosen, minimal circuits are not unique, and a shared benchmark (MIB) now compares methods. Scaling this analysis from small models to frontier models is the central unsolved difficulty.
hash 688f0a133ab84f3e15ce5f19f730e88bf33618a4cdbe8b2ab039aa6a530fc00c
previous 576d30e3ed3d7465016c1ad2ff0a5eefbe7a290344bf801946f7453dddb7c593