Skip to content
DAH

Mechanistic circuits and causal interventions

Methods that locate the subgraph of a network's components responsible for a behaviour, using activation patching and attribution, and check the result by intervention.

On this page15 sections
Why other work relies on it

Circuit-level explanations are the standard for claiming to understand how a model performs a task, and activation patching is the common causal test used across interpretability research.

Finding the small set of parts inside a model that actually produce one of its behaviours.

  1. 1Pick a behaviour
  2. 2Run clean and corrupted inputs
  3. 3Swap internal parts between runs
  4. 4Keep parts that change the output

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.

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:

effect=mpatched−mcorruptmclean−mcorrupt,\text{effect} = \frac{m_{\text{patched}} - m_{\text{corrupt}}}{m_{\text{clean}} - m_{\text{corrupt}}},

where mm 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.

Go deeper

The full technical text.

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.

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.

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.

Words on this page (10)
Words on this page
circuit
A small set of network components that together carry out one behaviour.
activation patching
Swapping internal numbers from one run into another to test which component causes an output.
activation
The numbers a layer of the network produces while it processes an input.
attention
The operation by which each token decides which other tokens to read from, and how much.
transformer
The neural-network design behind modern chatbots, in which every word looks at every other word through attention.
residual connection
A shortcut that adds a layer's input to its output, so information and gradients can skip layers.
feature
A direction in a network's internal numbers that seems to stand for a human-understandable concept.
attention head
A part of a transformer layer that lets each token gather information from chosen earlier tokens.
induction head
A pair of attention heads that completes repeats: after seeing A then B, on seeing A again it predicts B.
ablation
Removing or disabling a part of a network to see how its behaviour changes.
New to this? Read first (3)
New to this? Read first

Understanding map

map of the whole wiki →

What to read before Mechanistic circuits and causal interventions (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.

  1. Start with
  2. Step 2
  3. Step 3
  4. Then

Open problems & questions

Progress timeline

  1. Apr 17, 2025
    MIB benchmark

    Mueller et al. introduce a benchmark with circuit-localization and causal-variable tracks.

    source
  2. Apr 17, 2025
    MIB released
    Related to: Beating the best circuit-localization method on the MIB benchmark

    Benchmark with circuit-localization and causal-variable tracks introduced.

    source
  3. Apr 28, 2023
    ACDC

    Conmy et al. automate circuit discovery by pruning the computational graph.

    source
  4. Nov 1, 2022
    IOI circuit in GPT-2 small

    Wang et al. reverse-engineer a circuit for indirect-object identification.

    source
  5. Sep 24, 2022
    Induction heads

    Olsson et al. present evidence that induction heads underlie in-context learning in small transformers.

    source