Interpretability: what is happening inside
Circuits, features, superposition and sparse autoencoders
Everything so far treats the model as a function we train and measure from the outside. Mechanistic interpretability tries to open it: which attention heads implement in-context learning, how facts are stored in MLPs, why neurons mean several things at once, and whether we can read a model's plan before it acts. It is the research frontier that most directly addresses the trust problems of 8.12 Safety, risks and responsible AI, it explains behaviors you met in 8.4 Prompting as programming and 8.6 Reasoning models and test-time compute, and its central tool — sparse dictionary learning — is linear algebra from 1.1 Vectors, dot products and norms and 1.3 Eigen-things, SVD and low rank.
You'll be able to
- Describe the residual stream view and use the logit lens to read intermediate predictions
- Explain QK and OV circuits and how induction heads implement in-context copying
- Define polysemanticity and superposition and explain why sparse autoencoders can recover features
- Describe probing, activation steering and attribution graphs and what each can and cannot show
- Summarize what interpretability has established and where it remains open
Key ideas
- Mechanistic interpretability asks what algorithm the weights implement; the residual stream is the shared workspace that every layer reads and writes.
- The logit lens unembeds intermediate residual states to watch predictions form layer by layer.
- Heads factor into a QK circuit (where to attend) and an OV circuit (what to move); induction heads implement [A][B]…[A] → [B] and drive in-context learning.
Show 4 more key ideas
- Neurons are polysemantic because of superposition: sparse features are stored as nearly orthogonal directions, more features than dimensions.
- Sparse autoencoders (wide, ℓ1/top-k) recover monosemantic features; clamping a feature steers behavior, but reconstruction and feature splitting limit the method.
- Probes show information is present; steering shows it is causal; attribution graphs trace how outputs were produced and have exposed unfaithful chains of thought.
- No frontier model is understood end to end; interpretability as a safety audit is promising but early.
Suggested path through this lesson
The question
Saliency maps (5.9 Interpretability, robustness and adversarial examples) tell you which inputs mattered; mechanistic interpretability asks what algorithm the weights implement. The ambition is to reverse-engineer a network into human-understandable parts — circuits built from features — the way one reverse-engineers a compiled program.
The residual stream and the logit lens
In a transformer (7.4 Inside the block: residuals, LayerNorm, FFN and embeddings) every layer reads from and writes to the same vector per token — the residual stream. Attention heads move information between positions; MLPs transform it in place; the final unembedding reads the stream as logits. Because every layer writes in the same coordinate system, you can apply the final LayerNorm and unembedding to an intermediate residual state — the logit lens — and watch the model's prediction form layer by layer: early layers guess syntax, middle layers settle facts, late layers refine. Tuned variants (fitting a small affine map per layer) make the readout more reliable.
Attention heads as circuits
Decompose a head into two circuits (7.2 Scaled dot-product and multi-head attention, fully derived). The QK circuit decides where to attend (which source positions match the query); the OV circuit decides what to copy from the attended position into the residual stream. Heads compose across layers: a later head's query can depend on what an earlier head wrote.
The canonical example is the induction head. If the context contains the pattern [A][B] … [A], the model predicts [B]. Two heads cooperate: a previous-token head in an earlier layer writes "my predecessor was A" into each position's residual stream; the induction head in a later layer uses that to attend from the current [A] to the token after the earlier [A], then copies it. Induction heads appear abruptly during training as a phase change, coincide with a sharp drop in loss, and account for much of in-context learning (8.4 Prompting as programming) — including on patterns never seen in training. More complex circuits (indirect-object identification, copy suppression) have been mapped in small models.
MLPs, neurons and superposition
MLP layers behave like key–value memories (7.4 Inside the block: residuals, LayerNorm, FFN and embeddings): the first matrix matches patterns in the residual stream, the second writes associated vectors — many factual associations live here, which is why editing a few MLP weights can change a fact. But individual neurons are usually polysemantic — one neuron fires for academic citations, Korean text and a specific HTTP header. The explanation is superposition: the model represents more features than it has dimensions by assigning them nearly orthogonal directions (recall from 1.1 Vectors, dot products and norms that high-dimensional space holds exponentially many almost-orthogonal vectors). Interference is tolerable because features are sparse — few are active at once. Toy models (Anthropic, 2022) show superposition appearing exactly when features are sparse and the model is capacity-limited.
Sparse autoencoders: pulling features apart
If features are sparse directions in superposition, a dictionary-learning problem recovers them. Train a wide autoencoder on residual-stream activations :
with far more latent units than input dimensions and an (or top-) sparsity penalty (3.6 Regularization and generalization — the same geometry that gives lasso its zeros). The learned decoder columns are candidate features; many turn out to be monosemantic and human-interpretable — a feature for the Golden Gate Bridge, for code bugs, for sycophantic praise. Scaled to production-size models (Scaling Monosemanticity, 2024), SAEs found millions of features, and clamping one changes behavior predictably (the model that could not stop talking about the Golden Gate Bridge). Limitations are real: reconstruction is imperfect, features split or merge as the dictionary size changes, some latents are dead, and "interpretable" is judged by humans or LLMs with their own biases.
Probing, steering and attribution graphs
- Linear probes train a classifier on activations to detect a concept (truth vs falsehood, position in a board game). A good probe shows the information is linearly present — not that the model uses it.
- Activation steering adds a direction to the residual stream at inference (a "refusal direction", a sentiment vector) and shifts behavior without retraining — evidence that features are causal, and a potential control tool.
- Attribution graphs (2025) use replacement models built from features to trace how a specific output was produced across layers and tokens. Case studies showed models planning rhymes several tokens ahead, performing multi-step factual reasoning internally, sharing circuits across languages — and producing chains of thought that did not match the actual computation, a direct check on the faithfulness worries of 8.6 Reasoning models and test-time compute.
What we know, what we don't
Established: circuits exist and can be mapped in small models; features are directions, often in superposition; SAEs recover many interpretable features; models sometimes plan ahead; stated reasoning is not always faithful. Open: no frontier model is close to fully understood; SAE features explain only part of the variance; methods scale poorly in human effort; and using interpretability as a reliable safety audit (e.g. detecting deception) is early-stage. The debate between "ambitious" mechanistic interpretability and pragmatic, top-down methods (probes, steering, behavioral evals) is ongoing and healthy.
How to start
Tools: TransformerLens for cached activations and hooks, SAELens and public SAE dictionaries, Neuronpedia for browsing features. Curricula: Neel Nanda's quickstart guide and the ARENA program's interpretability track. The classic entry exercise is to find induction heads in a two-layer attention-only model yourself.
Where this shows up later
- Faithfulness of reasoning and the limits of alignment — 8.6 Reasoning models and test-time compute, 8.12 Safety, risks and responsible AI.
- Residual-stream and attention mechanics — 7.2 Scaled dot-product and multi-head attention, fully derived, 7.4 Inside the block: residuals, LayerNorm, FFN and embeddings; the sparse geometry — 1.1 Vectors, dot products and norms, 3.6 Regularization and generalization.
- Interpretability as a research direction — 11.6 Frontier 2026: where the field is heading.
Common pitfalls (4)
- Reading a high-accuracy probe as proof that the model uses that information.
- Treating an SAE feature's auto-generated label as ground truth.
- Assuming attention weights alone explain behavior — the OV circuit decides what is actually moved.
- Expecting mechanistic interpretability to deliver complete explanations of frontier models today.
Recap: all 7 key points
- Mechanistic interpretability asks what algorithm the weights implement; the residual stream is the shared workspace that every layer reads and writes.
- The logit lens unembeds intermediate residual states to watch predictions form layer by layer.
- Heads factor into a QK circuit (where to attend) and an OV circuit (what to move); induction heads implement [A][B]…[A] → [B] and drive in-context learning.
- Neurons are polysemantic because of superposition: sparse features are stored as nearly orthogonal directions, more features than dimensions.
- Sparse autoencoders (wide, ℓ1/top-k) recover monosemantic features; clamping a feature steers behavior, but reconstruction and feature splitting limit the method.
- Probes show information is present; steering shows it is causal; attribution graphs trace how outputs were produced and have exposed unfaithful chains of thought.
- No frontier model is understood end to end; interpretability as a safety audit is promising but early.
Watch
Residual stream, QK/OV circuits and induction heads explained by one of the field's leaders. Long; watch the first hour at least.
Read
Exercises
- Logit lens on GPT-2
With TransformerLens, run GPT-2 small on 20 sentences and apply the unembedding to the residual stream after each layer. Plot the rank of the correct next token across layers. Expected: the correct token rises to the top in the middle-to-late layers; some tokens are 'decided' early.
- Find an induction head
Feed a model a random token sequence repeated twice. Compute, for every head, the average attention from each token in the second half to the token following its earlier copy. Heads with scores near 1 are induction heads. Expected: a few heads in early-middle layers stand out sharply.
- Train a tiny SAE
Collect residual-stream activations from one layer on 1M tokens, train an SAE with 8× expansion and an penalty, and inspect the top-activating examples for 20 random features. Expected: several clearly monosemantic features (specific tokens, languages, formats) and several that are hard to label.
- Steer a behavior
Compute the mean activation difference between prompts with and without a property (e.g. positive vs negative sentiment) at one layer, add a multiple of that direction during generation, and read the outputs. Expected: a visible behavioral shift at moderate scales and incoherence at large ones.
Quiz
Flashcards
These cards are now in your spaced-repetition queue. Review all due cards →