Interpretability: What did it learn?
Here is the uncomfortable fact at the center of this book: we do not write these models, we grow them. A frontier LLM is on the order of a trillion floating-point numbers, arranged by gradient descent into something that writes poetry and finds bugs in your code — and no one can point to where any of it lives. The weights are, in the standard phrase, inscrutable.
Mechanistic interpretability is the young field trying to fix that: to reverse-engineer trained networks the way you’d reverse-engineer a binary without source. It gets a full chapter for two reasons. First, it has produced the best mental models we have for thinking about what happens inside a transformer — useful even if you never read another interpretability paper. Second, it’s the part of LLM theory that feels most like natural science — experiments and microscopes and genuine surprises. The chapter builds in four steps:
- Features — the units of meaning are directions in activation space (the vectors flowing through the network at each layer), not neurons.
- Superposition — models pack far more features than they have dimensions, which is why you can’t read the code by looking at one wire.
- Sparse autoencoders — the learned decompressor that unpacks superposition into interpretable, steerable features.
- Circuits — the algorithms built out of features, including one small program we can read end to end.
Features: the units of meaning
The field’s founding bet is that trained networks contain features: directions in activation space that correspond to meaningful concepts. Chapter 2 already showed you the prototype: in the city-embedding example, “coastal-ness” wasn’t any single coordinate, it was a direction you could move along, and word2vec’s king − man + woman ≈ queen demonstrated the same thing discovered rather than designed. The founding bet — sometimes called the linear representation hypothesis — is that this keeps being true deep inside the network: in the residual stream (Chapter 3), concepts live as directions, and the model “uses” a concept by adding or reading off its direction.
The bet has paid out. Researchers have found, first in vision models (the Circuits thread at Distill) and then in LLMs, activation directions that fire for curve detection, for base64-encoded text, for Python type errors, for sycophancy, for the Golden Gate Bridge. And the strongest evidence is causal: find the direction, intervene on it, and behavior follows. The cleanest example: refusal in chat models is mediated by a single direction — subtract one vector from the residual stream and the model stops refusing harmful requests; add it and the model refuses harmless ones. One concept, one direction, surgically manipulable.
The residual stream framing from Chapter 3 now completes. The stream is a bus — and what travels on the bus, at any given token, is a sum of feature directions: a bit of “subject position,” a bit of “feline,” a bit of “past tense,” each a direction scaled by how strongly it’s present, all added together into one vector. And the sum is sparse: of the millions of features the model knows, almost all have coefficient zero right now, because almost every concept is absent from almost every token. The full picture of the stream, then: a bus carrying a handful of active concepts at a time — which sounds like something you could simply read off. The next section is about why you can’t.
Superposition: why you can’t just look
If features were assigned one-per-dimension — neuron 4,721 means “cats” — interpretability would be easy: read each neuron and label it. It isn’t, and the reason comes from Anthropic’s Toy Models of Superposition .
A model has vastly more things worth representing than it has dimensions — GPT-2’s stream is 768 numbers wide, and the world contains more than 768 concepts. But high-dimensional geometry offers a loophole: an -dimensional space has only perfectly orthogonal directions, yet exponentially many directions that are almost orthogonal. The figure’s 2D toy shows the move at its most cramped — and its stepper walks the whole argument:
One piece of geometry first. The only way anything downstream reads the stream is a dot product: it’s the network’s native operation (attention’s scores in Chapter 3 were dot products; so is every row of a matrix multiply). To ask “how much of some feature C is in this vector?”, you dot the vector against C’s direction. And a dot product measures a shadow: the length one vector casts along another, which shrinks with the cosine of the angle between them. Perpendicular vectors cast no shadow on each other (cos 90° = 0), which is why two orthogonally-stored features have zero crosstalk: each is literally invisible to the other’s readout. Tilt them closer together and a shadow appears. Pack five directions evenly around a 2D circle (360°/5 = 72° apart), and each neighbor leaks cos 72° ≈ 0.31 of its strength into the other’s reading.
Now run the toy’s numbers, because they make the trade concrete. Call the five features A through E, spaced 72° apart around the circle, and let every active feature fire at strength 1.0. Suppose C is active, and you read the stream by projecting onto C’s direction. If C alone is active, you read 1.0 — clean. If its neighbor D fires too, you read 1.0 + 0.31 = 1.31. And B fares worst when its two neighbors fire: with A and C both active, projecting onto B returns
for a feature that isn’t present at all.
Packed representations lie when features co-occur. So why do trained models choose this? Because real-world features are sparse. “Golden Gate Bridge” and “Python type error” are each absent from the overwhelming majority of text; if each is active, say, 1% of the time, a given pair collides only 0.01% of the time. The expected cost of the occasional ghost is tiny; the benefit (representing 5 things where 2 fit, and in a real model’s thousands of dimensions, millions of things) is enormous, so gradient descent takes the deal.
This is superposition, and it has a sharp consequence. A neuron is one coordinate axis of the space, and packed feature directions aren’t axis-aligned — so each feature smears across many neurons, and each neuron participates in many features. So individual neurons are polysemantic: one fires for cats, and car grilles, and a particular Korean suffix, not because the model is confused but because that’s what a compressed encoding looks like from the inside. You cannot read the code by looking at one wire.
How many almost-orthogonal directions fit?
The 2D toy is the worst case: a 0.31 overlap is a lot of interference. But the geometry improves exponentially with dimension: the Johnson–Lindenstrauss flavor of the result says that if you’ll tolerate pairwise overlaps of at most , an -dimensional space fits on the order of such directions. At (GPT-2’s width), tolerating overlaps up to about a third already permits billions of directions (). For a real model (dimensions in the thousands, features active perhaps one time in a thousand), the packing is astronomically profitable: near-zero effective interference in exchange for memory far beyond the dimension count. Superposition is the rational use of the space.
Sparse autoencoders: the decompressor
If superposition is compression, the countermove is to learn the decompressor. A sparse autoencoder (SAE) is a wide, simple network trained to re-express a layer’s activations as a sparse combination of a much larger dictionary of directions — millions of candidate features, only a handful active at a time:
The SAE objective, in one line.
The first term says be accurate; the second says be sparse. Sparsity is what forces the dictionary to align with the model’s real features: the cheapest way to explain an activation using few entries is for entries to correspond to the concepts that are actually, individually present.
The training itself is Chapter 1’s loop with one twist: the dataset is another model’s activations. Freeze the subject model, run it over billions of tokens of text, and save the residual-stream vector at one chosen layer for every token — that pile of vectors is the training set. The SAE is just an encoder ( → , with up to millions, then a ReLU zeroing the negatives) and a decoder ( → ) whose columns become the feature directions; train it on the pile with gradient descent like any network. Two practicalities dominate the engineering: dead features (a dictionary entry that stops activating gets no gradient and never recovers, so training periodically resamples them), and the sparsity knob itself (modern variants often swap the penalty for a hard top-: keep the strongest features, zero the rest). Then comes the only step a human sees: for each learned feature, pull the corpus snippets that activate it most, and name what they share.
Anthropic’s Scaling Monosemanticity ran this on a production model (Claude 3 Sonnet) and extracted millions of interpretable features: one for the Golden Gate Bridge fires on the text in any language, on photos of the bridge, on descriptions of driving across it. Others pick out security vulnerabilities in code; a cluster tracks deception and flattery. You don’t have to take anyone’s word for this — Neuronpedia hosts SAE features for open models in a browser: type a sentence, watch which features light up, read what else makes each one fire. It is the closest thing the field has to a microscope you can play with, and twenty minutes there will do more for your intuition than anything in this chapter.
The demo that settled it was steering: clamp a feature’s activation up, and the model’s behavior changes accordingly. Mechanically it couldn’t be simpler (no weights change): at inference, you add the feature’s direction to the residual stream, mid-forward-pass, at the layer the SAE was trained on. The clamp stays on for as long as you choose, applied at every position of every forward pass — each new token is generated with the direction freshly pinned onto the bus. Because the stream is what every later layer reads, an added direction is indistinguishable from one the model computed itself: downstream heads and MLPs simply find “bridge-ness present” and act on it, token after token. Anthropic briefly released Golden Gate Claude , a version of Claude with the bridge feature pinned high, which worked mentions of the bridge into literally any answer — a wonderful, absurd proof that the extracted features are causal handles. Reading the model and editing the model are two sides of the same discovery.
Circuits: the algorithms
Features are the variables; circuits are the programs — patterns of attention heads and MLP neurons that implement identifiable algorithms across layers. One circuit is understood well enough to walk through completely — the only place in this book where we can watch learned weights implement a legible algorithm:
This is the induction head (In-context Learning and Induction Heads ): two attention heads in different layers composing into “find the last time this token appeared, look at what followed it, and predict that again.”
Take a context that earlier contained the name “Dursley” — tokenized ‘Dur’ + ‘sley’ — and that now ends with a fresh ‘Dur’; the model should predict ‘sley’. What do the queries, keys, and values represent in each head? Nowhere else is Chapter 3’s lookup machinery this legible:
- The previous-token head (earlier layer) runs a lookup about position. Each token’s query asks “who sits at the position right before mine?”; each token’s key advertises “here’s where I sit”; each token’s value carries its own identity. (Where does the position information come from? In GPT-2 the head reads the learned position vectors off the stream. In a RoPE model it’s more direct: the rotation already makes the query–key score a function of relative offset, so the head tunes itself to the fast-rotating planes and peaks at exactly “one back.” That’s Chapter 5’s division of labor, caught in the act.) The head’s write deposits the fetched identity into the stream — after it runs, ‘sley’ carries a tag reading “I follow ‘Dur’.”
- The induction head (later layer) runs a lookup about content — and its ingredients are second-hand. The queries are built from identity: the final ‘Dur’ asks “who is tagged I follow Dur?” The keys, though, are manufactured from the tag the previous-token head just wrote — so, exactly as you’d hope, every token’s key effectively is the token before it. And the values carry each token’s own identity: the thing to copy. Query “I am Dur” matches key “I follow Dur” at ‘sley’; the value delivers ‘sley’ to the prediction.
How do you attend “one back” when no token knows where it is?
A fair objection: RoPE never writes a token’s position into any vector — so how can anything find “the previous token”? The answer is that the score carries the geometry, not the tokens. Recall the mechanism: the query at position is rotated by , the key at position by , and rotations inside a dot product cancel down to their difference — the score only ever sees . Run the dumbest possible example: suppose, in one 2D plane, the head’s raw query and raw key are both for every token, ignoring content entirely. Then:
which peaks at offset 0 — a head that attends to itself. Now let the head bake one constant extra rotation of into its key matrix (a fixed choice of weights, learned once):
peaked at exactly : the previous token — at every position, uniformly, with no token ever learning its address. The attention weights do the selecting; the values then deliver the selected token’s identity. Position never has to live in any vector, because it lives in the angles between them.
And what are the literal weights of such a head? Idealized: and are rank-one — both read the same always-present component of the residual stream and emit fixed vectors, the key’s being the query’s rotated one step back. (A linear map can’t emit a constant from nothing, but streams have always-on channels: the normalization step’s learned offset (LayerNorm — Chapter 3) adds the same vector at every position, and q/k projections often carry bias terms.) Everything else about the token, they ignore. The value matrix is the opposite: it must carry the token’s identity — constant addressing, content-full cargo. Trained heads approximate this split rather than achieving it exactly.
One more objection: couldn’t content hijack the score? Suppose the context is “sleydursley” — the current token ‘sley’ is far more similar to the ‘sley’ two back than to the ‘dur’ one back. Doesn’t the lookalike win the dot product? No — because the dot product only contains what and put into it, and this head’s projections are learned to be (nearly) content-blind: in its slice of the dimensions, it keeps only components every token shares and discards the ones that vary with identity. After the projection, ‘dur’ and the earlier ‘sley’ produce almost identical raw keys (exactly the -for-everyone setup above), so content similarity has been equalized out of the channel, and the rotation is the only differentiator left. The lookalike can’t out-shout a signal it was never admitted into. (A content-matching head, like the induction head one layer up, makes the opposite choice with its projections. That’s what per-head buy: every head is a lens, and each lens decides what it will see. Real previous-token heads leak a little content and misfire occasionally; the circuit tolerates the fuzz.)
The composition is visible right there in the wiring: the induction head’s keys are manufactured from the previous-token head’s output. Neither head alone can do anything interesting; stacked, they’re an algorithm, which is what “circuit” means. And the matching is fuzzy: because it happens on learned vectors rather than exact tokens, the same circuit generalizes (matching synonyms and translations), which upgrades a grep into something closer to pattern completion.
The heads are findable in every trained model. Ablate them (zero out just those heads) and the model’s ability to use repeated context collapses while everything else barely moves. Induction heads also snap into existence at a visible bump in every training run’s loss curve. That bump coincides exactly with the model getting dramatically better at in-context learning (Chapter 4’s capability that appeared abruptly with scale), which now has a mechanistic explanation. Grander behaviors are still mostly unmapped, but there is now an existence proof: emergence isn’t magic; it’s circuits forming, and at least sometimes we can catch them doing it.
The division of labor mirrors Chapter 3’s slogan (attention routes, MLPs compute): attention-based circuits move and copy information; MLP layers act as the model’s key-value store of facts (in the hash-table sense — no relation to attention’s K and V). That is why “where does a model store ‘Paris is the capital of France’” has an actual answer (mid-layer MLPs, distributed but localizable enough that targeted edits can overwrite specific facts).
Try it yourself
A related cheap trick: the logit lens . Take the residual stream at any layer, project it through the final output head that produces the logits (nothing stops you; it’s just a matrix multiply). Then watch the prediction sharpen layer by layer: noise in the early layers, plausible-but-generic tokens in the middle, the actual answer crystallizing near the end. It’s printf debugging for transformers, and it makes the “stream refines toward an answer” picture vividly concrete.
If this is the chapter that hooks you, the barrier to entry is genuinely low. TransformerLens loads GPT-2 into a notebook with every intermediate activation exposed — you can cache the residual stream, run the logit lens, and ablate your way to finding your own induction heads in an afternoon, on a laptop. The field is young enough that an afternoon gets you to the frontier of what’s known about many specific behaviors.
What this buys us
Feature-level handles offer a path to controlling models that’s more surgical than prompting and cheaper than retraining: suppress the sycophancy feature, or ablate the refusal direction. (The refusal trick is also why open-weight models can’t keep their safety training — with the weights public, anyone can run the forward pass themselves and subtract the direction. Early days, but the demos are real.) Auditing follows the same logic: the safety question “is the model being deceptive?” becomes empirical if you can check whether deception features are active, which is a major reason frontier labs fund this work. And the field’s findings should calibrate how you read reasoning models (Chapter 8): they show their work, but interpretability research has documented cases where the stated reasoning and the mechanistic cause of the answer diverge. The transcript is evidence, not ground truth; remember this when you’re tempted to treat a model’s self-explanation as an audit log.
Honest scorecard: the field can fully explain toy models, extract features and some circuits from frontier models, and steer with them — but a complete mechanistic account of “why did the model say that” remains out of reach. It is biology in the decade after the microscope: we can finally see cells; we cannot yet cure much.
So far, though, every model in this book has simply been handed to us — a trillion floats, a done deal, which this chapter learned to probe after the fact. It’s time to watch one get made. The next three chapters are the production line: the month the weights are forged from a copy of the internet, the week they’re given a personality, and the forever after of arguing about whether any of it worked.
Further reading
- Zoom In: An Introduction to Circuits — the field’s founding document, and (on distill.pub) the aesthetic this book aspires to.
- Toy Models of Superposition — the best paper in the field; the toy models are simple enough to reimplement in an afternoon.
- Scaling Monosemanticity — SAEs on a production model, and the Golden Gate Claude story; then browse the results yourself on Neuronpedia .
- In-context Learning and Induction Heads — the most complete story we have connecting a circuit to a capability.
- Interpreting GPT: the Logit Lens — a two-page trick that will permanently improve your mental model of the residual stream; TransformerLens to try it yourself.