Skip to content
mentoor

Topic 3 of 6 · 5 min read

Circuits and attribution graphs

Goal: Follow a simple circuit description, such as an induction head, and state the computation it performs.

A circuit is a small set of features and attention heads, plus the connections between them, that together carry out one identifiable computation.

Check yourself · 1 of 3

What does an induction head do?

Choose one answer

Why it matters

Features tell you what a model represents. Circuits tell you how it uses them to get from input to output. This is the step from "the model knows about Paris" to "this is how the model decides the next word".

The classic example: the induction head

Give a model the text ... Mr Dursley ... Mr and it predicts Dursley, even if it has never seen the name. Anthropic's work on induction heads shows two attention heads working together:

  1. A previous-token head in an early layer copies information about the token before the current one into each position. After this, the position of the second Dursley carries the note "I came after Mr".
  2. An induction head in a later layer, at the current Mr, looks for earlier positions that carry the note "I came after Mr", finds the first Dursley, and copies that token's identity into the prediction.

In short, the computation is: find where the current token appeared before, and predict whatever came next. Anthropic reported that induction heads form during a sharp point in training, at the same time in-context learning improves. That is evidence and correlation, and the paper discusses where the causal case is strong and where it is weaker.

Attribution graphs

Real model behaviour involves thousands of features. An attribution graph is a diagram for one prompt: nodes are SAE-style features, edges show how much one feature pushed another. Anthropic's Biology of a Large Language Model applies it to a production model. Among the findings: when writing a rhyming line, features for candidate rhyme words were active before the line was written, which suggests planning ahead. In a two-step question, features for the intermediate fact appeared on the way to the answer.

Before and after

Weak: "The model has a rhyme circuit." Better: "On this prompt, the graph shows a feature for the rhyme target active at the end of the first line, with edges to features that favour words leading up to it. We checked by suppressing that feature and the ending changed."

What goes wrong

  • Pictures without interventions. A graph shows attribution on one prompt; ablating or steering nodes is what tests it.
  • Overgeneralising. A circuit found on one prompt may not hold on rephrasings.
  • Missing parts. Graph methods approximate the model and leave an error term; some of the computation, notably attention patterns, is not yet explained.
  • Cost. Doing this by hand takes hours per prompt, so coverage is small.

Examples

Walking through an induction head

Text: The Zorbax engine ... the Zorbax. At the second Zorbax, the induction head searches for earlier positions tagged "came after Zorbax"... It finds the first Zorbax, copies the token that followed it and predicts engine. The model never learned Zorbax in training; it copies the pattern from earlier in the same text, which is why the mechanism supports in-context learning.

A claim that needs an intervention

A graph for the prompt "The capital of the state containing Dallas is" shows a Texas feature feeding an Austin feature. That reads like two-step reasoning. The stronger evidence is the follow-up test: swap the Texas feature for a California one and the answer moves to Sacramento.

Key points

  • A circuit is a small group of features and heads whose connections implement one identifiable computation.
  • An induction head finds an earlier copy of the current token and predicts what followed it.
  • Induction needs two heads: a previous-token head that tags positions and an induction head that matches and copies.
  • Attribution graphs show which features pushed which others on one prompt, using SAE-style features as nodes.
  • A graph is a hypothesis until interventions on its nodes change the output as predicted.

Common mistakes

  • Treating an attribution graph for one prompt as a general account of how the model works.
  • Calling any set of correlated features a circuit without testing edges by intervention.
  • Forgetting the part of the computation the method leaves unexplained.
  • Explaining an induction head as memorisation instead of copy-after-match.

Check yourself · 2 of 3

What is the role of the previous-token head in the induction circuit?

Choose one answer

Check yourself · 3 of 3

A researcher shows an attribution graph for one prompt and says "the model plans rhymes". What is the strongest next step?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic