ARENA Chapter 1: Transformer Interpretability
TL;DR. ARENA (“Alignment Research Engineer Accelerator”) Chapter 1 is a set of coding notebooks with exercises, tests and solutions. They take you from a transformer written from scratch to replicating published circuits. Neel Nanda’s guide calls them “fantastic” and tells newcomers to just do them, prioritising ruthlessly. The current home is learn.arena.education. The older streamlit URL quoted in many posts now redirects there.
Key idea
Section titled “Key idea”You learn interpretability by re-implementing it. Each section has learning objectives, then exercises where you write functions such as induction_score_hook, residual-stream patching and head-to-head path patching. Tests check your code against reference solutions.
| Section | What you build | Priority (Nanda’s guide) |
|---|---|---|
| 1.1 Transformers from Scratch | GPT-2 in PyTorch, loading pretrained weights | Essential background |
| 1.2 Intro to Mech Interp | TransformerLens, induction heads, hooks, direct logit attribution, ablations, QK/OV and K-composition circuits | Essential (first 3 sections) |
| 1.3.1 Linear Probes | probes for deception in a model playing Coup | Useful |
| 1.3.2 Function Vectors & Model Steering | nnsight, task-encoding vectors, function vectors, GPT2-XL steering vectors | Steering is nice to have |
| 1.3.3 Interpretability with SAEs | decompose activations, monitor and steer with SAE latents | Worthwhile |
| 1.3.4 Activation Oracles | reveal hidden knowledge with activation oracles | Frontier |
| 1.4.1 Indirect Object Identification | logit attribution, activation patching, path patching, minimal circuit (faithfulness, completeness, minimality) | Recommended |
| 1.4.2 SAE Circuits | trace SAE features across layers | Later |
| 1.5.x Toy models | brackets, grokking, OthelloGPT, superposition | Pick by interest |
Why it matters for this track. Every causal page on this site assumes you can run a patching sweep. ARENA 1.4.1 is where you actually build one, on the IOI circuit. For IR, the same pipeline transfers almost directly to rankers, as MechIR shows. The main change is that the metric becomes a relevance score.
Connections
Section titled “Connections”- Nanda’s guide decides which ARENA sections to do first.
- Induction heads and the IOI circuit are the papers that 1.2 and 1.4.1 replicate.
- Activation patching and activation addition give the theory behind 1.4.1 and 1.3.2.
- TransformerLens and nnsight are the two libraries the chapter uses.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Mechanism
In the 1.4.1 IOI exercises, explain the logit-difference metric, the difference between noising and denoising patches, and what a residual-stream patching sweep over layers and positions reveals.
What a strong answer covers
- The metric is logit(IO) minus logit(S), e.g. Mary vs John; the model puts almost all its mass on these two names, so the difference measures task performance.
- Denoising patches clean activations into a corrupted run and asks what is sufficient to restore behaviour; noising patches corrupted activations into a clean run and asks what is necessary.
- A sweep over layers and positions shows information moving from the S2 and name positions in early and middle layers to the final position in later layers.
- Results are usually normalised so 0 means corrupted performance and 1 means clean performance.
- Derive / compute
In 1.2 you compute an induction score with a hook. For a sequence of random tokens repeated twice, derive which attention offset an induction head attends to and how to turn the attention pattern into one score per head.
What a strong answer covers
- With a random sequence of length T repeated, the token at position i in the second half matches position i minus T.
- An induction head attends from i to the token after the earlier match, at position i minus T plus 1, so it sits on the diagonal offset by T minus 1.
- Score: hook the attention pattern (hook_pattern), take that off-diagonal stripe in the second half and average it per head.
- Heads above a chosen threshold are candidate induction heads; confirm by ablating them and checking that the loss on the repeated half goes back up.
- Design
Adapt ARENA's IOI pipeline to a BERT cross-encoder that scores a query–document pair. What replaces the logit difference, the clean and corrupted inputs, and path patching's senders and receivers?
What a strong answer covers
- Metric: the relevance logit, normalised between the clean (relevant) and corrupted (term removed or swapped) runs.
- Clean and corrupted inputs must have the same length: e.g. the document with a query term versus one with a non-query token of the same length.
- Residual and head patching locate the positions and heads that carry the term-match signal.
- Path patching: senders are candidate matching heads, receivers are the heads or the final classifier position, to separate direct and mediated effects.