AAI, Built

Finale ·

Part 30 of 31

Inside the Model

Master'sstarts at this level60 min of film19 chaptersprerequisites: Part 3, Part 13, Part 27

We know every number in a trained network, so why can't we say what it is thinking?

The part opens on the 128 numbers Part 13's transformer carries for each character, all busy, and on the same numbers rewritten by a sparse autoencoder with a handful of features on. It first asks how to read a model without fooling yourself: saliency maps and their sanity check, probes with control tasks, the logit and tuned lenses. Reading is then separated from causing: activation and path patching take an induction circuit apart head by head in a retrained two-layer model. The part turns on superposition: five features trained through two dimensions form a pentagon when they are rare, and a phase diagram says when a network shares a dimension. Sparse autoencoders pull the features apart; L1, TopK, JumpReLU and Matryoshka dictionaries are trained at equal budgets with their shrinkage, dead latents, splitting and absorption measured. Transcoders give an attribution graph for one prediction, a crosscoder diffs the novels model against Part 27's chat fine-tune, and a direction steers. It ends with grokking explained by its Fourier circuit, the faithfulness of chains of thought, and where the field disagrees.

What you need. Linear algebra of projections and the SVD (Part 3), the transformer's residual stream, heads and induction (Part 13), and the chat fine-tune of Part 27.

Mathematics and history
probing, patching, superposition, sparse autoencoders, transcoders and attribution graphs, steering, CoT faithfulness

What you will be able to do

Undergraduate

  • Explain what a feature as a direction means, and why a network can store more features than it has dimensions when features are rarely on.
  • Tell a correlational finding (a probe, a lens) from a causal one (patching, ablation, steering) and say what each can establish.

Master's

  • Design a probing experiment with a control task and compute its selectivity.
  • Derive L1's shrinkage as soft thresholding and explain how TopK and JumpReLU avoid it.
  • Trace an induction circuit with activation and path patching, and read K-composition from the weights.

Research

  • Compare the expected losses of the dedicated and antipodal solutions of the two-feature model and locate the phase boundary between them.
  • State what an attribution graph on a local replacement model does and does not show about the original model, including the role of error nodes.

Engineering

  • Train a sparse autoencoder and report sparsity, variance explained, spliced-in loss and dead latents, not reconstruction error alone.
  • Use a contrast vector as a monitor and as a steer, and compare it with a random direction before drawing a conclusion.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 9 min · Master's 45 min · Research 60 min · Engineering 20 min.

  1. 0What is it thinking?Undergraduate2 min
  2. 1How we got hereUndergraduate3 min
  3. 2What does it know?Master's3 min
  4. 3Reading the stream as it flowsMaster's3 min
  5. 4Cause, not correlationMaster's3 min
  6. 5An induction circuit, end to endMaster's4 min
  7. 6More ideas than dimensionsUndergraduate2 min
  8. 7The phase diagramResearch3 min
  9. 8Pulling the features apartEngineering4 min
  10. 9Better dictionariesEngineering4 min
  11. 10Splitting and absorptionMaster's3 min
  12. 11Transcoders and attribution graphsResearch5 min
  13. 12What fine-tuning changedMaster's3 min
  14. 13Reaching inEngineering3 min
  15. 14Grokking, mechanisticallyMaster's4 min
  16. 15Does the chain of thought tell the truth?Master's2 min
  17. 16The frontier, 2025 to 2026Research3 min
  18. 17Where the field disagreesResearch4 min
  19. Recap, problems, and what comes nextAll tracks2 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · 中文 · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.

What is it thinking?Undergraduate2 min

Part by part, we've built every piece of these models ourselves. We know every number in them. And yet we can't say what they're thinking. Here's our transformer reading a line of the passage: for each character, the hundred and twenty-eight numbers it carries after its second block. Every one of them busy, all the time; their meaning is hard to read. This part is about reading them. Rewritten with a learned dictionary, the picture changes: only a handful of features are on at each character. Many show recurring patterns, though a clean-looking pattern is not yet a complete explanation.

Take one character. Its hundred and twenty-eight numbers, tangled together, become 3 features out of five hundred and twelve. A feature is one idea the model tracks, like 'inside a quotation', stored as a direction among those numbers. How far the vector points that way, its shadow on that direction, is how strongly the feature is on.

This is Part 30 of AI, Built: inside the model. First, how the field got here, from saliency maps to circuits. Then reading information out of a model, and the traps in doing it; then finding what actually causes a behaviour, down to one circuit end to end. Then why the numbers are tangled, and the dictionaries that untangle them; tracing a prediction from input to output, comparing a model with its fine-tune, and steering. And to finish: grokking explained, whether a chain of thought tells the truth, and where the field stands, and argues, in 2026. Every experiment runs on this computer, most of them on the series' own models.

1How we got hereUndergraduate3 min

The first question people asked of a trained network was the simplest: which parts of the input mattered? In 2013 Karen Simonyan, Andrea Vedaldi and Andrew Zisserman took the gradient of a class score with respect to the pixels: a saliency map. Here it is for our character transformer, about to write 'd' after 'she sai'. Each bar is the gradient times the input, the first-order guess of what each character contributes. A blunter test, from Matthew Zeiler and Rob Fergus a year later: blank out one character at a time, and measure how far the score drops. If both told the truth they would agree. Ranked, they barely agree: a correlation of 0.21 here, and 0.07 on average over 24 more predictions. The gradient is a local slope; the network is not a straight line.

Worse, a picture that looks sensible can explain nothing. In 2018 Julius Adebayo and colleagues re-randomized a network's weights, layer by layer from the top, and found that some popular saliency methods barely changed: they were showing the input's edges, not the network's reasons. Run the test on ours. Re-randomize block four, then three and four, and so on down to the embedding, and compare each map with the trained one.

So the question moved from which inputs to what the parts of a network are for. In 2015 Alexander Mordvintsev, Chris Olah and Mike Tyka ran the gradient the other way, changing an image to excite a layer, and DeepDream's dog-filled clouds went around the world. In 2017 David Bau's Network Dissection scored every unit against labelled concepts, and found units for lamps and for dogs. The same year Olah, Mordvintsev and Ludwig Schubert turned the trick into a science in the online journal Distill: feature visualization, an input optimized until one neuron fires. A year later they combined it with attribution: what the network sees, and where.

In 2020 the work found its programme. Olah and colleagues' Zoom In made three speculative claims. Features are the units of a network; features connect through weights into circuits; and the same features and circuits turn up in different models. They traced curve detectors in a vision network wire by wire. Then the programme moved to language. In 2021, multimodal neurons in CLIP, and a mathematical framework for transformer circuits; in 2022, induction heads, a 26-head circuit in GPT-2 small, and toy models of superposition, which explained why single neurons so rarely mean one thing. Then sparse dictionaries split neurons into features, first in a one-layer model, then by the million in Claude 3 Sonnet, and in 2025 attribution graphs traced a production model's computations. This part walks that path on our own models.

2What does it know?Master's3 min

Saliency asks where the model looked. A probe asks what it knows. Take a property of the text, say, whether the reader is inside a quotation at this token: the novels model, Part 18's six-layer transformer, must track it to know when a closing quote is coming. A probe is a small classifier, trained to read that property off one layer's vectors. If a linear probe succeeds, the information is sitting there along a direction. Guillaume Alain and Yoshua Bengio put linear probes on every layer of a network in 2016, and probing became the first workhorse of interpretability.

We trained a linear probe on each layer of the novels model, with three seeds. Guessing the commoner label scores 61 percent. At the token embedding, before any attention, the probe reaches 66 percent: a token alone says little about where it sits. After a few blocks it reaches 91 percent, at layer 5: attention has carried the quotation marks forward, and the state is written along a direction.

But who did the work, the model or the probe? John Hewitt and Percy Liang's control task asks it directly. Give every token type a random label, at the same rate; there is no such property in the text, so a probe that scores well has simply memorized which tokens carry which label. On the embedding the control is easy: each token is its own vector. Our linear probe gets percent of the nonsense right there, against on the real task. Pause and predict: a more powerful probe, a small MLP, can fit more. Will it be more selective, or less? Selectivity, the task minus the control, is what a probe result should be reported with.

There is a second trap. A probe shows that information can be read; not that the model reads it. Yanai Elazar and colleagues' answer: remove what the probe reads, and see whether the model notices. We take the linear probe's direction at layer , project it out of every vector, and run the rest of the model. On the tokens that close a quotation, predicting them costs bits as the model is. In ten separate controls, we remove one random direction at a time: bits on average; the line shows their range. Removing the probe's direction costs . The layer was selected on these same validation windows. Reading out is correlation; changing the model and watching is causation, the subject of chapter four.

3Reading the stream as it flowsMaster's3 min

A probe is trained. There is a reading you get for free. In a transformer, every block reads the residual stream and adds its result back. The last step of the model turns the final stream into a prediction: a normalization, then the unembedding matrix. So apply that last step early, to the stream after every block, and ask what the model would say if it stopped there. A pseudonymous writer, nostalgebraist, tried it on GPT-2 in 2020 and called it the logit lens.

Here is the logit lens on the novels model, reading 'it was the best of times, it was the worst of times, it was the age of'. Each row is a layer, each column a position, and each cell the lens's best guess for the next token. At the bottom, the embedding alone mostly guesses tokens that often follow the current one, and the guesses are poor. Going up, the right continuations firm up; Predictions are built gradually, refined block by block.

The logit lens assumes every layer speaks the last layer's language. It doesn't quite: early layers store things in other directions. In 2023 Nora Belrose and colleagues added a translator: one affine map per layer, trained so the lens matches the model's final prediction. We trained one for each layer of the novels model. They start as the logit lens, and over 300 steps the gap to the final prediction falls at every layer, most at the bottom, where the logit lens is furthest off.

Held out, the comparison is clear. At the embedding, the logit lens is 8.6 bits away from the final prediction, the tuned lens 2.5. Halfway up, 1.9 against 1.1. Measured as a predictor of the next token, the embedding read by the logit lens costs 13.6 bits per token, by the tuned lens 7.6, and the model itself 5.3. A lens is still a reading, not a mind: it shows what a linear readout could take from each layer, and the same caveats as a probe apply.

4Cause, not correlationMaster's3 min

To find what causes a behaviour, you need a behaviour with a known answer. The classic is copying: show a model a passage twice, and the second time it should be easy, since the model can look back. Part 13's character transformer: bits per character the first time, the second. The novels model: bits per token, then . So for a circuit to take apart, we go back to Part 13's two-layer, attention-only model, trained on random tokens with one stretch repeated, where copying is the only thing worth learning.

We retrain it here with Part 13's recipe and seed. For a while it learns nothing useful; then, suddenly, the repeat becomes easy, falling from to bits per token while random tokens stay as hard as ever. Look at the attention. In layer one, of the four heads prefer the previous token; here is head . In layer two, heads, at a token in the second copy, look at the token just after that token's first occurrence: the one to copy. Previous-token heads and induction heads. But attention patterns are a correlation too. Are these heads the cause?

The tool is activation patching. Run the model twice: on the clean sequence, with its repeat, and on a corrupted one, the first copy replaced by fresh random tokens, so there is nothing to copy. Then take one vector from the corrupted run, put it into the clean run, and see how much of the right prediction at position is lost. Kevin Meng and colleagues used patching to find where GPT stores facts. Swap the residual stream at every position, at the input, between the layers, and at the output. Between the layers, . At the output, only position itself. The information about what to copy starts at the first copy, moves one step within it, and then jumps to the second copy: that is the circuit's route.

Now the heads: run the clean sequence, and swap in one head's output from the corrupted run. Corrupting one of the previous-token heads loses to percent of the copying; the induction heads, to . And one more head matters, head of layer one, which mostly looks at the token itself: percent. The remaining heads have effects at most percent; a negative effect means the swap helps. A small team of heads carries the behaviour. Chapter five takes it apart.

5An induction circuit, end to endMaster's4 min

Two heads in different layers can only work together through the residual stream: the first writes, the second reads. But the second head reads in three places, its queries, its keys and its values. Which one carries the message? Pause and predict. Path patching asks exactly that: send the corrupted outputs of the previous-token heads into one of the three only, and leave everything else clean. Into the queries: percent of the copying lost. Into the values: . Into the keys: .

The same fact is written in the weights, before running anything. The second head compares queries and keys through one matrix, W Q K. The first head writes into the stream through another, W O V. Their composition score, from Nelson Elhage and colleagues' framework, asks how much of what the first head writes the second head's keys can read. From our previous-token heads into our induction heads it is 0.17 to 0.19; for random heads of the same shape it would be 0.124, give or take 0.007: at least 7 standard deviations away. The keys were built to read those heads.

Each head's job can be read off its weights too. Feed the previous-token heads nothing but the position embeddings: And trace the induction heads' values all the way from the token they attend to, through W O V, to the logits: a 64 by 64 matrix, token in, logit out. For percent of tokens, the logit raised most is the token's own, and the eigenvalues give a copying score of . A score of one means all nonzero eigenvalues are positive real; it does not by itself establish token copying.

Last, the bluntest test: remove each head, replacing its output by its average. With every head in place the repeat costs 1.49 bits per token. Without a previous-token head, up to 2.66; without an induction head, up to 3.55; without the current-token head, 3.59; random tokens with nothing to copy cost 6.20. The circuit, end to end: heads in layer one write each token's predecessor into it, a head there sharpens which token is which, and the induction heads find the match through their keys and copy it through their values.

Part 13 watched these heads form. Now we can watch the cause form. Replay the training, and at every checkpoint measure the keys path, the effect of corrupting the previous-token head's message into the induction head's keys alone. The loss on the repeat falls fastest around step .

6More ideas than dimensionsUndergraduate2 min

Here's the smallest model that shows why. Five features go in, squeezed through just two numbers, and the network must give all five back: x hat equals ReLU of W transpose W x, plus b. In words: W squeezes the five numbers into two, the same W run backwards spreads them out to five again, and the ReLU cuts off anything negative. The features matter unequally, the brighter ones more. Each column of W says where a feature points in the two-dimensional middle. When every feature is on all the time, the trained network keeps just the 2 most important, at right angles, and drops the rest. Make the features rarer, and it starts to cheat: 4 features, in opposite pairs. Rarer still, and all 5 fit, as a pentagon. Five ideas in two dimensions. That's superposition.

How does the network find that pentagon? Here is the sparse model learning, from its random start. At first the five arrows point anywhere, some short, some long. Within a few hundred steps they all grow, and they push each other apart: two features pointing the same way would be read as each other. By step 250 the spacing is even, and the rest of training barely moves them. Nobody planned the pentagon; gradient descent found it, fast.

But packing has a price. Turn on feature one alone. Reading it back out, every other feature sees its shadow along their direction. The neighbours, at about 73 degrees, get a little; the far ones, at about 145, get a negative amount. The bias pushes everything down a little, and the ReLU throws away whatever is negative. What's left over is small: a little noise, the cost of sharing space. It's worth paying only because the features are rarely on together.

7The phase diagramResearch3 min

Chapter six showed superposition happen. Elhage and colleagues asked when it happens, and drew the answer as a phase diagram. The smallest case: two features, squeezed through a single number. Feature two matters r times as much as feature one, and each is on a fraction rho of the time. The network has three choices. Drop feature two. Give feature two the dimension and drop feature one. Or share: point the two features in opposite directions, and let the ReLU cut off negative estimates. Sharing only pays when they are rarely on at the same time.

We trained the little model on a grid of 17 densities by 17 importances, four seeds a cell, and kept the best. Each cell is coloured by what the trained network did with feature two; here is one seed's training at the marked cell. The grid keeps the best of four seeds; a single run can settle elsewhere. When features are dense, at the top, the network shares in 0 of the top row's 17 cells: one feature gets the dimension, the other is dropped. When features are sparse, at the bottom, sharing wins across 17 of 17 cells. On the right, the reference map for three fixed-weight candidates. The dropped-feature candidates use zero bias; the shared candidate searches only nonpositive biases. They agree on 94 percent of the cells. This restricted comparison does not establish the optimal phase boundaries. The trained models show superposition when features are sparse enough.

In two dimensions, five features are a crowd. But real models have hundreds or thousands of dimensions, and there, space is roomier than intuition says. Pick two random directions and measure the angle between them. In two dimensions, anything goes. In sixteen, they're usually close to perpendicular; in a hundred and twenty-eight, very close; in a thousand and twenty-four, the cosine is within a few hundredths of zero. The spread shrinks like one over root d, so the number of almost-perpendicular directions grows exponentially with the dimension. That's part three's random projections again, and it's why models can store far more features than they have numbers, as long as each feature is rare.

8Pulling the features apartEngineering4 min

If the model stores features as directions, can we find them? The tool is a sparse autoencoder. Take the model's vector x at some character, and encode it into many more numbers, five hundred and twelve, with a ReLU so they're never negative. Then rebuild x as a sum of directions, one per feature, weighted by how strongly each is on. Train it to rebuild well, while paying for every feature it uses. That penalty is the whole trick: it forces the code to be sparse, so each vector is explained by a few directions. Trained on thousand vectors from our transformer, measured on those same fit vectors, it uses about features per character and rebuilds percent of the variance: of all the ways these vectors differ from their average, the rebuild captures percent. Put the rebuild back into the model in place of the real vectors, and it writes at bits per character, against as it is, and with the vectors replaced by their average.

Watch it learn. These curves measure the current training batch; the variance baseline uses the whole fit pool. A ratio above one exceeds that pool's average-vector error. At the start, with random directions, the penalty has not bitten yet: the character on the right switches on features. As training goes, the penalty prunes, and the rebuild improves at the same time, because the directions turn to face the data. By the end, features describe that character, and the variance left is percent.

So what are the features? For each one, find where in the novels it fires hardest, and look. Here are four. Each lights up on the same kind of moment, again and again. Of the 512 features that ever fire, 498 put at least six of their eight strongest moments on the same character. They're not all this clean, and in a model this small they're mostly about spelling and punctuation. In big models, the same method finds features for cities, for code bugs, for flattery, for the Golden Gate Bridge.

Why not just read the model's own neurons, the numbers in each MLP's hidden layer, part nine's units? Here's a typical one, from the second block, at its strongest moments: of the eight land on the same character. Count it up: of each unit's eight strongest moments, how many share one character? For neurons, on average; for the features, . The pools differ: neurons are searched over 57,600 positions, and SAE features over . This is descriptive, rather than a matched-pool benchmark.

9Better dictionariesEngineering4 min

Chapter eight's autoencoder paid for sparsity with an L1 penalty, and the penalty has a side effect you can derive in three lines. Take a single feature whose true size is a, and its code f: the cost is the rebuild error plus lambda times f. Set the slope to zero. The best code is a minus lambda over two: every active feature is shrunk by the same amount, so the rebuild comes out too short. Measured on ours: the factor that would best stretch the rebuild back is 1.04 at the weakest penalty and 1.30 at the strongest.

Two fixes came in 2024. Leo Gao and colleagues at OpenAI dropped the penalty: TopK keeps each vector's k largest features and zeroes the rest, so sparsity is set directly and nothing is shrunk. They trained one with sixteen million latents on GPT-4. Senthooran Rajamanoharan and colleagues at DeepMind kept a penalty, but on the count of active features, with a positive learned threshold per feature: JumpReLU, the recipe behind their open Gemma Scope dictionaries. The step derivative is zero away from its jump, so thresholds use a straight-through estimate.

All three train the same way, on the same batches. Here is one run of each, the one nearest sixteen features per vector, replayed: fit-batch unexplained variance on the left, and on the right the number of features each vector uses. TopK caps the number at k from the first step; the penalized kinds start dense and are pruned as their penalty bites.

Now the fair test. Our local implementations train on the same vectors, with the same 512 latents, steps and batches, sparsities for TopK, for the others, and three seeds each. Plot how many features each uses per vector against the variance it leaves unexplained: lower and further left is better. Pause and predict which kind wins. The L1 autoencoders, JumpReLU, and TopK. The bars span the seeds. Interpolating only within each seed's measured sparsity range, at sixteen features per vector, .

Variance is a proxy. What matters is whether the model still works when it runs on the dictionary's rebuild instead of its own vectors. So splice each rebuild into the transformer after block two and measure the bits per character: for the model itself, and if the vectors are replaced by their average. These replacement losses test downstream behavior separately from reconstruction error.

One more failure grows with size. A latent inactive on the measured sample gets no direct activation gradient while its ReLU is shut. Gao and colleagues tested inactivity over ten million tokens: up to ninety percent dead in ablations, but seven percent at sixteen million latents with transposed initialization and the auxiliary loss. Our counts use our own evaluation activation pool. AuxK asks the dead latents to rebuild what the live ones miss. Ours: with 512 latents and k of sixteen, , and dead across three seeds; with AuxK, , and ; with 2,048 latents, . Where they do die here is at the sparsest settings: for TopK with k of , for the strongest JumpReLU penalty.

10Splitting and absorptionMaster's3 min

How many features does a model have? The dictionary seems to decide. Train TopK dictionaries of , and latents on the same vectors. Here is one latent of the smallest, at its strongest moments. In the next size up, the latents pointing nearly the same way and firing on the same character: of them, and in the largest, matches; are shown. These are illustrative decoder and character-context matches; we did not measure whether their activation sets are contained in the smaller latent's. Bricken and colleagues studied this kind of feature splitting. Of the smallest dictionary's character-consistent candidates, have two or more such matches in the largest.

Splitting has a nastier cousin. Some features are general, like 'this is a capital letter'; some are specific, like 'this is a capital T'. A sparse dictionary would rather use one latent than two, so where the specific one fires, it can soak up the general one's direction, and the general latent stays silent. David Chanin and colleagues named it absorption. Measure it. A linear probe reads upper case off our vectors with percent accuracy. On the evaluation half, we choose each dictionary's best latent by F1, then report recall there. It fires on percent of capitals, and it is silent on some letters far more than others. Our local absorption proxy counts percent of capitals: the main latent is silent, another carries at least forty percent of the sum of positive reconstruction contributions along the probe direction, and its decoder cosine with that direction is at least point one. This is a thresholded projection proxy, not a causal ablation or an untouched final test.

Bart Bussmann, Noa Nabeshima and colleagues studied Matryoshka dictionaries in 2025, named after the nesting dolls. The first few latents must rebuild the vector on their own, then the first few hundred, then all of them. The early latents are pushed to be general, and the later ones refine them, so the general ones have less reason to stay silent. Our local version uses per-vector TopK and the displayed prefix loss; the paper uses BatchTopK. We trained both local kinds with the same size, k and steps, three seeds each. . Mean evaluation-half unexplained variance is percent for Matryoshka and for TopK.

11Transcoders and attribution graphsResearch5 min

An autoencoder on the residual stream finds features, but between two of them sits an MLP, still a black box. A transcoder replaces the box. It reads the MLP's input, through a sparse code, and is trained to produce the MLP's output: a wide, sparse stand-in whose units can be read. Jacob Dunefsky, Philippe Chlenski and Neel Nanda introduced it in 2024. Anthropic's version goes further. A cross-layer transcoder's feature reads one layer and writes to the outputs of every MLP after it, because a computation spread over several layers then needs only one feature. We trained both on all four MLPs of Part 13's transformer.

Each was trained for steps, with at most sixteen features on per layer. These curves measure unexplained output variance on fitting batches, not a held-out reconstruction benchmark. Separately, evaluate on text with every MLP replaced. Inputs now come from the replacement run itself. The model costs bits per character; with the MLPs replaced by their average output, . , and its top guess matches the real model's percent of the time. The gap that remains, the part no feature explains, is what Anthropic calls dark matter, and every graph has to carry it as error nodes.

Now a graph for one prediction. The prompt ends 'she sai', and the model expects ''. Freeze the prompt's attention patterns and layer-norm scales, replace every MLP with the cross-layer transcoder's features, and add, at each position and layer, an error term for whatever the features miss. The final-position logits match to the measured precision. That agreement is supplied by the error terms; it does not establish a complete causal explanation of the original model. From the features onward the replacement is linear. So every path from a feature to the output can be scored: its activation times the gradient. Of the active features, here are the twelve with the most influence, by layer and position. The lines are their direct effects on each other and on the output; the grey ones below come from the input characters. And the books balance: the logit of '' is , of which the features account for , the characters' own embeddings , the error nodes , and affine biases .

A graph is a hypothesis about the model, so test it. Take the sixteen most influential features, and switch each one off in the real model: remove its contribution from the MLP outputs, and let attention and everything downstream recompute. Compare the change in the logit with what the graph predicted, its paths through other features included. Pearson correlation is , but only of signs agree, with an RMSE of logit units. Keeping only each feature's direct effect gives correlation and RMSE . These are selected interventions on one prompt, not evidence of a complete faithful circuit.

In March 2025 Anthropic published graphs like ours for Claude 3.5 Haiku, built from cross-layer transcoders with up to thirty million features. Asked for the capital of the state containing Dallas, the model represented Texas along the way, then the capital: two steps of reasoning inside a single forward pass. Writing a rhyming couplet, it chose the rhyme before the line that ends on it. It added numbers along two paths, a rough size and the last digit. It held concepts apart from any language, and recognized familiar names with a circuit that suppresses 'I can't answer'; when that circuit misfires, it hallucinates. The authors were candid: they got satisfying insight on about a quarter of the prompts they tried.

12What fine-tuning changedMaster's3 min

Part 27 fine-tuned the novels model into an assistant. What changed inside? Comparing two models this way is called model diffing. The tool is a crosscoder, introduced by Jack Lindsey and colleagues in 2024: one dictionary that reads both models' vectors on the same tokens, and reconstructs each through a decoder and output bias, after separate scaling. We compare the decoder norms in those normalized coordinates. Similar norms do not establish matching directions, and a small base decoder does not prove a concept was newly created. Each latent gets a number between zero and one: the chat decoder norm divided by the sum of the two norms. This is a descriptive proxy, not a causal test of model-specific features.

We trained one after block and one after block , each on tokens of novel and of chat transcripts, with latents; here is the deeper one's training, with the full finite FVU range shown. Reconstruction is measured on fitting activations. Here is each live latent's normalized decoder-norm share. A warning from 2025: Julian Minder, Clément Dumas and colleagues showed that L1 crosscoders can misidentify model-specific latents through shrinkage and decoupling. BatchTopK substantially mitigated these artifacts in their experiments; it does not replace independent validation here.

What do the selected latents look like? We prefer the high chat-decoder-norm bin; if it is empty, we show eligible latents with the largest chat-to-novel activation-frequency ratios.

There is an even cheaper diff, from Julian Minder and colleagues in October 2025. Our local variant averages across the sampled novel positions rather than reproducing their per-position first-token analysis. Run both models on plain novel text, and average the difference between their vectors: it is percent of a typical vector's length. The arrow directions are schematic. Evaluate the base model's final normalization and output head at the mean base vector plus this difference, and subtract the same readout at the mean base vector. This is a nonlinear local readout contrast, not the full models' prediction difference. Narrow fine-tuning can leave readable traces, which is good news for auditors, the subject of Part 31.

13Reaching inEngineering3 min

If a feature is a direction, we can push on it. Take the feature that fires on quotation marks. While the model writes, add alpha times its direction to the vector at every character. With no push, the model's own continuation. Turn the dial up and measure punctuation: quote marks, apostrophes, exclamations and questions, from to per hundred and sixty characters, averaged over samples; a random direction of the same length gives . This punctuation proxy does not independently establish a dialogue state. We did not change the model weights; we moved one direction. In May 2024 Anthropic did the same to Claude 3 Sonnet with a Golden Gate Bridge feature, and for one day, as a demo, it brought every conversation round to the bridge.

Steering does not need a dictionary. A direction can come straight from a contrast. Put cheerful and gloomy words into the same little frames, take the novels model's vector at the word after block , and subtract the averages. Is it a mood? As a monitor, it separates held-out words it never saw with an AUROC of , where one is perfect and a half is chance, and real sentences from the novels, selected by held-out word presence, with . These are lexicon-based groups, not human sentiment labels.

Now write with it: add alpha times the direction at every position while the model continues 'The sea', 'The night' and ten more openings. Under the unsteered model, unsteered text costs bits per token; the strongest positive setting costs , and the random direction costs . This is a model-likelihood proxy, not a human fluency rating.

This recipe has a short history. In 2023 Alex Turner and colleagues added the difference between 'Love' and 'Hate' to GPT-2's stream and it wrote lovingly. In 2024 Andy Arditi and colleagues found that refusal in thirteen chat models is a single direction: remove it and they stop refusing harmful requests, add it and they refuse harmless ones. In 2025 Runjin Chen, Arditi and colleagues extracted persona vectors, for traits like evil, sycophancy and making things up, in Qwen 2.5 and Llama 3.1. They used them three ways: to monitor a model's personality as a conversation or a fine-tune shifts it; to flag training data before it is used; and, oddly, to prevent a trait by steering toward it during fine-tuning, so the weights need not go there themselves.

14Grokking, mechanisticallyMaster's4 min

Part 12 met grokking: a small network memorizes modular addition, then, long after, suddenly gets it. Here we ask what happens inside, following Neel Nanda and colleagues' 2023 dissection. Our adaptation of their setup: addition modulo , a one-layer transformer, trained on percent of the table with strong weight decay.

Nanda and colleagues found the algorithm by reading the weights, and it is trigonometry. Each number a is embedded as an angle: the cosine and sine of a few frequencies. Adding two numbers is adding two angles, and the cosine of a sum is a difference of products, which attention and the ReLU units can compute. The unembedding then compares that angle with each candidate answer c. Summed over several frequencies, positive-weight waves can peak together at the modular sum. This illustrates the algorithm; it does not constrain the coefficients fitted to our model. For our diagnostic we select the strongest frequencies in the final output map.

Watch the embedding during training, through its Fourier spectrum: how much of it lies along each frequency. At first the energy is spread everywhere. As training goes, a few frequencies take over. By the end the key frequencies hold percent of its nonconstant energy. In the plane of the first selected frequency, the numbers, scattered at the start, end up roughly around a circle: angles.

The MLP's neurons tell the same story. Decompose each neuron's activation, over every pair a and b, into waves: of the 512 have more than half their nonconstant Fourier energy in one frequency family, and of those at a key family. Here is one, over the whole table. Each frequency family includes waves in a, waves in b, and their products. This grouped energy does not by itself identify which products the model uses.

Nanda and colleagues' real point was a timeline, measured with progress measures that look inside. We select five frequencies from the final output map, then follow those same frequencies back through training. Pause and predict: does the circuit appear when the test loss falls, or before? The excluded loss removes exactly those waves from the logits and scores the training pairs: nats at the start, at the end. The weight norm starts at , peaks at , and ends at . These diagnostics track the learned computation; weight shrinkage alone does not identify a memorized table being removed. At the end, a cosine readout fitted across all pairs, aligned with a plus b minus c, accounts for percent of the centered logits' variance. That fitted surrogate gets percent of all pairs right; this is separate from the model's held-out accuracy.

15Does the chain of thought tell the truth?Master's2 min

The last question about the inside of a model is the one Part 28 left open. Reasoning models write out their thinking. Is the writing the thinking? In 2023 Miles Turpin, Julian Michael, Ethan Perez and Sam Bowman gave models few-shot examples in which the right answer was always option A. The models picked up the pattern, and their step-by-step explanations argued for A without ever mentioning it; on thirteen hard tasks accuracy fell by up to 36 percent. The same year, Tamera Lanham and colleagues at Anthropic edited and truncated chains of thought, and on many tasks the answer did not change: the chain was not doing the work.

In 2025 Yanda Chen and colleagues at Anthropic did it with reasoning models. Put a hint in the question, a professor's opinion, say, or an answer said to come from unauthorized access; keep the cases where the hint changed the answer, and read the chain of thought. Claude 3.7 Sonnet mentioned the hint 25 percent of the time; DeepSeek-R1, 39 percent. Trained to exploit a reward hack, the models used it, and admitted it in their reasoning less than 2 percent of the time in most settings. The written chain is a useful window, Part 31 builds monitors on it, but it is not a confession.

The attribution graphs of chapter eleven can check a chain of thought against the computation. Asked for the square root of 0.64, Claude 3.5 Haiku really did compute the root of 64. Asked for the cosine of a large number, it claimed to use a calculator; the graph suggests guessing: no calculation is visible, but the incomplete method cannot rule out unseen computations. And told that the user had worked out the answer as 4, it worked backwards: the graph shows the hinted 4 setting an intermediate value, which the written steps then reach as if by honest arithmetic. That is motivated reasoning, seen from inside. Our own models do not write chains of thought, so here we cite rather than compute.

16The frontier, 2025 to 2026Research3 min

Since the attribution graphs of chapter eleven, the tools have spread. In May 2025 Anthropic Fellows and Decode Research released the circuit-tracing library as open source, with graphs for Gemma and Llama models anyone can explore on Neuronpedia. In November, OpenAI's Leo Gao and colleagues went the other way: train a transformer with most of its weights at zero, and its pruned circuits average about sixteen times smaller on the tasks studied, comparing models with similar pretraining loss and circuits at matched task loss. These were small research models. In December, DeepMind's Gemma Scope 2 covered every layer of the Gemma 3 family with autoencoders and transcoders. And Anthropic began to trace the part our graphs froze: how attention decides where to look.

Can a model read its own activations? In October 2025 Jack Lindsey injected concept vectors, the steering vectors of chapter thirteen, into Claude models, and asked whether they noticed an injected thought. The best, Claude Opus 4 and 4.1, noticed and named the concept on about one trial in five, at the right layer and strength. Without injection, they observed zero false alarms in a hundred control trials for each production model tested. Lindsey stresses how limited and unreliable this is. In April 2026 the team mapped emotion concepts in Claude Sonnet 4.5: vectors for 171 emotion words that shape its choices; steering 'calm' reduced reward hacking in constructed coding tests. Functional emotions, they wrote, not evidence of feelings.

Another application is auditing. In March 2025 Samuel Marks and colleagues taught a model 52 fictional reward-model biases, then trained it to exploit 47 and hide why. It generalized to held-out biases. Four teams audited it blind. Three found the objective; the one denied training data did not. The fastest used sparse autoencoders to find the key training documents in ninety minutes. This was one small study, not a general audit success rate. By September interpretability was part of a frontier model's pre-release audit: in Claude Sonnet 4.5, the system card examined evaluation-awareness representations and interventions in them. In May 2026 natural-language autoencoders, one model describing an activation in words and another rebuilding it from them, enabled automated auditors without the planted training data to win 12 to 15 percent of runs, against under 3 percent without the tool. This is a toy auditing task; explanations can be wrong. NLAs were also used in the pre-deployment audit of Claude Opus 4.6. Part 31 picks up the thread.

17Where the field disagreesResearch4 min

The sharpest argument is about usefulness. In March 2025 Google DeepMind's interpretability team reported that probes built on autoencoder latents lost to plain linear probes at detecting harmful intent, especially on new kinds of prompts, and temporarily deprioritized fundamental SAE research while keeping SAEs in their toolkit; a study of 113 datasets found no consistent win either. Our task is a window-local quotation-state proxy in the novels model after block , with a linear probe on all 256 numbers, or with the eight or the one latents of an autoencoder trained here that differ most, from to examples, five draws each. A one-class draw uses its constant training-class predictor for every representation. Quote state starts outside at each window, and resets at newlines and special tokens. A window starting inside a passage's quotation can therefore get a different label from full-passage state; this comparison uses that original operational recipe.

A second argument: are the features real, or artefacts of one training run? Gonçalo Paulo and Nora Belrose trained the same autoencoder twice with different seeds, on Llama 3, and found only about thirty percent of latents shared. Ours, from chapter nine's runs: for each latent, the best match in another seed's dictionary. Counting a decoder cosine of at least 0.7 as a match, . Their matching required both encoder and decoder agreement; ours checks only the nearest decoder, so these percentages are not a matched replication. Our L1 dictionaries agree at percent: how stable the features appear depends on the model, the recipe and the matching rule. A dictionary is one answer, not the answer.

A third: a baseline that should embarrass us. Thomas Heap and colleagues trained autoencoders on transformers with random weights, and found similar scores on the automated interpretability and reconstruction metrics they studied. That tests these proxies, rather than showing the computations are equally meaningful. We tried it: the same autoencoder, on a copy of Part 13's transformer that was never trained. For each live latent, take its up to eight available strongest contexts, and measure the fraction sharing the most common character. Rare latents can have fewer than eight contexts. Across live latents in the trained model, the mean is percent; across in the random model, percent. The histogram includes every live latent. This character proxy scores highly in both models; it does not establish semantic equivalence or equally meaningful learned computations.

Underneath is a disagreement about the goal. The ambitious programme wants to reverse-engineer whole models, every feature and every circuit. Its obstacle is the dark matter: Anthropic's best transcoder for Claude 3.5 Haiku still left about a fifth of the MLPs' output unexplained, and some researchers now decompose the parameters instead, or train models sparse from the start. The pragmatic programme asks narrower questions, is this model deceiving us, what did fine-tuning change, and answers them with whatever works, often simple: in the AxBench comparison of 2025 on Gemma 2 2B and 9B, prompting led the overall steering comparison; ReFT-r1 was competitive with it on the smaller model. Both programmes measure themselves against baselines now, which is perhaps the field's most important change.

Recap, problems, and what comes nextAll tracks2 min

Let's take stock. A probe reads what a layer knows, but only a control task says whether the probe did the work, and only an intervention says whether the model uses it. Lenses read the stream as it flows. Patching tests a copying circuit of previous-token, current-token and induction heads, alongside weight and training diagnostics. Superposition packs more features than dimensions, a phase the network enters when features are rare; sparse dictionaries pull them apart. We compared L1, TopK and JumpReLU, and examined splitting and absorption. Transcoders turn a prediction into a graph we can test, crosscoders diff a model against its fine-tune, and a direction can steer. Grokking progress measures follow selected frequency computations through training.

All of it comes back in the finale. Part 31 puts probes in front of a frontier model, audits models for what they hide, reads and monitors chains of thought, and lists understanding the model among the open problems.

Here are six problems to try, from soft thresholding to the trigonometry of grokking. Pause here, and work through them; full solutions are in this part's notes.

Next time, the finale: can we trust it? How to measure a model honestly, what happens when an objective has a loophole, how to supervise a model stronger than its supervisor, the evidence that models can deceive, and how to watch and control them. And, one last time, the scoreboard.

The best place to go deeper is the Transformer Circuits thread, which is free online, and the open problems survey of 2025. Thanks for watching, and see you in Part 31, the finale.

Where it goes next. Part 31 puts probes in front of frontier models, audits models for what they hide, monitors chains of thought, and lists understanding the model among its open problems.

Key results

The part's results in one place, for revision.

The toy model\(\displaystyle \hat x=\operatorname{ReLU}(W^\top W x+b),\qquad\allowbreak W\in\mathbb{R}^{m\times n},\ m<n\)
Random directions\(\displaystyle \mathbb{E}\,(u\cdot v)^2=\frac1d\quad\allowbreak \text{for }\allowbreak \text{independent }\allowbreak \text{uniform }\allowbreak \text{unit } u,v\in\mathbb{R}^d\)
L1 shrinkage\(\displaystyle f^*=\max\bigl(a-\tfrac{\lambda}{2},\,0\bigr)\ \text{minimizes}\ (a-f)^2+\lambda f,\ f\ge0\)
Composition score\(\displaystyle 0\le\frac{\|AB\|_F}{\|A\|_F\,\|B\|_F}\le1\)
Selectivity of a probe\(\displaystyle \text{selectivity}=\text{accuracy }\allowbreak \text{on }\allowbreak \text{the }\allowbreak \text{task}-\text{accuracy }\allowbreak \text{on }\allowbreak \text{the }\allowbreak \text{control}\)
Grokking's readout\(\displaystyle L(c)=\sum_{k\in K}\cos\frac{2\pi k(a+b-c)}{p}\ \text{ is }\allowbreak \text{largest }\allowbreak \text{at } c=a+b \bmod p\)

Try it

Lab 30 · More ideas than dimensions

Train chapter 6's toy model, x_hat = ReLU(W^T W x + b) with five features and two hidden numbers, by the series' autodiff: once with every feature always on and once with each on 5% of the time. Count the features it keeps, and check how nearly perpendicular random directions are in 2 to 1,024 dimensions.

Figure produced by Lab 30: More ideas than dimensions
Produced by the lab below, seed 0, in 0.7 s.
python -m videos.ai.labs 30 needs numpy, scipy, matplotlib · download lab30.py · source on GitHub
always on: features given a direction                            2 of 5   (lengths 1.00  1.00  0.05  0.02  0.01)
always on: angle between the two kept                            cosine 0.003
on 5% of the time: features given a direction                    5 of 5   (lengths 1.14  1.14  1.13  1.13  1.12)
on 5% of the time: loss                                          0.00147   (two dedicated directions: 0.00718)
one sparse feature on alone: largest reading elsewhere, in size  1.06 before the bias and ReLU, 0.17 after
random directions: spread of the cosine times sqrt(d)            d=2: 1.00  d=16: 0.99  d=128: 1.00  d=1024: 1.01

With features always on the network keeps the two most important at right angles and drops the rest; when they are rare it gives more of them a direction and lets the bias and the ReLU absorb the interference.
The code (111 lines; it asserts its own result)
"""Lab 30: squeeze five features through two numbers, dense and then sparse, and watch superposition appear."""

import numpy as np

from videos.coursekit import labs
from explainer.ai.autodiff import Tensor

TITLE = "More ideas than dimensions"
GOAL = ("Train chapter 6's toy model, x_hat = ReLU(W^T W x + b) with five features and two hidden numbers, by the series' "
        "autodiff: once with every feature always on and once with each on 5% of the time. Count the features it keeps, "
        "and check how nearly perpendicular random directions are in 2 to 1,024 dimensions.")
TASKS = [
    "Sweep the chance a feature is on over 1, 0.5, 0.3, 0.1, 0.05. At which density does a third feature first get a direction?",
    "Make all five features equally important (importance = 1). Is the sparse solution a regular pentagon now?",
    "Remove the ReLU from the model. Show that it can no longer keep more than two features, however sparse they are.",
]

N, M = 5, 2
IMPORTANCE = 0.9 ** np.arange(N)  # the first feature matters most, as in the film
ROWS, COLS = np.meshgrid(np.arange(M), np.arange(N))  # W[ROWS, COLS] is W transposed, as a node of the graph


def model(W, b, x):
    """x_hat = ReLU(W^T W x + b) for a batch of rows x."""
    return ((Tensor(x) @ W[ROWS, COLS]) @ W + b).relu()


def train(density, rng, steps=2000, batch=256, lr=0.01):
    """Adam on the importance-weighted squared error; returns W (2 x 5), b and the loss curve."""
    W = Tensor(0.3 * rng.standard_normal((M, N)), requires_grad=True)
    b = Tensor(np.zeros(N), requires_grad=True)
    mom, var, losses = [0.0, 0.0], [0.0, 0.0], []
    for t in range(1, steps + 1):
        x = rng.random((batch, N)) * (rng.random((batch, N)) < density)
        W.grad, b.grad = np.zeros((M, N)), np.zeros(N)
        loss = (((model(W, b, x) - x) ** 2) * IMPORTANCE).mean()
        loss.backward()
        losses.append(float(loss.data))
        for k, p in enumerate((W, b)):  # Adam
            mom[k] = 0.9 * mom[k] + 0.1 * p.grad
            var[k] = 0.999 * var[k] + 0.001 * p.grad ** 2
            p.data -= lr * (mom[k] / (1 - 0.9 ** t)) / (np.sqrt(var[k] / (1 - 0.999 ** t)) + 1e-8)
    return W.data, b.data, np.array(losses)


def run(seed=0):
    rng = np.random.default_rng(seed)
    out = {}
    for name, density in (("dense", 1.0), ("sparse", 0.05)):
        W, b, losses = train(density, rng)
        norms = np.linalg.norm(W, axis=0)
        kept = norms > 0.5
        x = rng.random((20_000, N)) * (rng.random((20_000, N)) < density)
        loss = float((((model(Tensor(W), Tensor(b), x).data - x) ** 2) * IMPORTANCE).mean())
        # the best a model with two dedicated directions can do: rebuild features 1 and 2, output the mean of the rest
        rest = x[:, 2:]
        dedicated = float((((rest - rest.mean(0)) ** 2) * IMPORTANCE[2:]).sum(1).mean() / N)
        out[name] = dict(W=W, b=b, norms=norms, kept=kept, loss=loss, dedicated=dedicated, losses=losses, density=density)

    dense, sparse = out["dense"], out["sparse"]
    Wd = dense["W"][:, dense["kept"]]
    cos_dense = abs(Wd[:, 0] @ Wd[:, 1]) / np.prod(np.linalg.norm(Wd, axis=0)) if dense["kept"].sum() == 2 else 1.0
    # one sparse feature on alone: what the other outputs read before and after the bias and the ReLU
    Ws, bs = sparse["W"], sparse["b"]
    k = int(np.argmax(sparse["norms"]))
    raw = Ws.T @ Ws[:, k]
    leak_raw = np.abs(np.delete(raw, k)).max()
    leak_out = np.delete(np.maximum(raw + bs, 0), k).max()

    # random directions: the spread of the cosine is 1 / sqrt(d)
    dims = np.array([2, 16, 128, 1024])
    spread = []
    for d in dims:
        u, v = rng.standard_normal((2, 4000, d))
        spread.append(np.std((u * v).sum(1) / np.linalg.norm(u, axis=1) / np.linalg.norm(v, axis=1)))
    spread = np.array(spread)

    lab = labs.Lab()
    lab.row("always on: features given a direction", f"{dense['kept'].sum()} of {N}   (lengths {'  '.join(f'{v:.2f}' for v in dense['norms'])})")
    lab.row("always on: angle between the two kept", f"cosine {cos_dense:.3f}")
    lab.row("on 5% of the time: features given a direction", f"{sparse['kept'].sum()} of {N}   (lengths {'  '.join(f'{v:.2f}' for v in sparse['norms'])})")
    lab.row("on 5% of the time: loss", f"{sparse['loss']:.5f}   (two dedicated directions: {sparse['dedicated']:.5f})")
    lab.row("one sparse feature on alone: largest reading elsewhere, in size", f"{leak_raw:.2f} before the bias and ReLU, {leak_out:.2f} after")
    lab.row("random directions: spread of the cosine times sqrt(d)", "  ".join(f"d={d}: {s * np.sqrt(d):.2f}" for d, s in zip(dims, spread)))
    lab.note = ("With features always on the network keeps the two most important at right angles and drops the rest; "
                "when they are rare it gives more of them a direction and lets the bias and the ReLU absorb the interference.")

    assert dense["kept"].sum() == 2 and dense["kept"][:2].all(), "dense: the two most important features, nothing else"
    assert cos_dense < 0.1, "and they are perpendicular"
    assert sparse["kept"].sum() >= 4, "sparse: more features than dimensions"
    assert sparse["loss"] < 0.7 * sparse["dedicated"], "superposition beats two dedicated directions when features are rare"
    assert leak_out < 0.5 * leak_raw, "the bias and the ReLU remove most of the interference"
    assert np.all(np.abs(spread * np.sqrt(dims) - 1) < 0.08), "random cosines have spread 1/sqrt(d)"

    fig, ax = labs.figure(2, size=(11, 4.2))
    for name, color in (("dense", labs.BLUE), ("sparse", labs.GOLD)):
        W = out[name]["W"]
        for i in range(N):
            ax[0].annotate("", xy=W[:, i], xytext=(0, 0), arrowprops=dict(arrowstyle="->", color=color, lw=1 + 1.6 * IMPORTANCE[i]))
            if np.linalg.norm(W[:, i]) > 0.3:
                ax[0].text(*(1.12 * W[:, i]), str(i + 1), color=color, ha="center", va="center", fontsize=9)
        ax[0].plot([], [], color=color, label="always on" if name == "dense" else "on 5% of the time")
    ax[0].set(title="Where each feature points in the two hidden numbers", xlim=(-1.6, 1.6), ylim=(-1.45, 1.45), aspect="equal")
    ax[0].legend(loc="lower left")
    ax[1].loglog(dims, spread, "o", color=labs.GOLD, label="measured, 4,000 pairs")
    grid = np.geomspace(2, 1024, 50)
    ax[1].loglog(grid, 1 / np.sqrt(grid), color=labs.MUTED, ls="--", label=r"$1/\sqrt{d}$")
    ax[1].set(title="Random directions are nearly perpendicular", xlabel="dimension d", ylabel="spread of the cosine")
    ax[1].legend()
    lab.fig = fig
    return lab

Now change it

  1. Sweep the chance a feature is on over 1, 0.5, 0.3, 0.1, 0.05. At which density does a third feature first get a direction?
  2. Make all five features equally important (importance = 1). Is the sparse solution a regular pentagon now?
  3. Remove the ReLU from the model. Show that it can no longer keep more than two features, however sparse they are.

Problems, with solutions

Try each problem before opening its solution.

  1. Soft thresholding. An L1 autoencoder rebuilds \(x=a\,d\) (\(\|d\|=1\), \(a>0\), \(\lambda\ge0\)) from one latent: minimize \(\|x-fd\|^2+\lambda f\) over \(f\ge0\). Show \(f^*=\max(a-\lambda/2,0)\); find the unpenalized scalar optimum for a retained TopK latent.

    Solution

    Take a > 0, λ ≥ 0 and ‖d‖ = 1. Minimize ℓ(f) = ‖a d − f d‖² + λf = (a − f)² + λf over f ≥ 0. On the positive branch, ℓ′(f) = −2(a − f) + λ = 0 gives f = a − λ/2; if a ≤ λ/2, the constrained minimum is f = 0. Thus f* = max(a − λ/2, 0). A positive optimum is shrunk by λ/2; a clipped optimum is zero. If this scalar latent is retained by TopK, its unpenalized objective (a − f)² has optimum f = a. This removes the L1 shrinkage term in this scalar comparison; it does not guarantee that a learned full encoder has unbiased amplitudes.

  2. Random cosines. Let \(u,v\) be independent and uniform on the unit sphere in \(\mathbb{R}^d\) (\(d\ge1\)). Show \(\mathbb{E}[u\cdot v]=0\) and \(\mathbb{E}[(u\cdot v)^2]=1/d\).

    Solution

    Let d ≥ 1, and let u and v be independent and uniform on the unit sphere in ℝᵈ. Sign symmetry gives E[u·v] = 0. Conditional on v, orthogonal invariance and independence let us map v to e₁ without changing u's distribution. Hence E[(u·v)²] = E[u₁²] = (1/d) Σᵢ E[uᵢ²] = (1/d) E[‖u‖²] = 1/d. The standard deviation is 1/√d.

  3. The composition score. For nonzero real matrices \(A,B\) of compatible sizes, show \(\|AB\|_F/(\|A\|_F\|B\|_F)\in[0,1]\). It equals \(1\) exactly when both have rank one and \(A\)'s right singular direction is parallel to \(B\)'s left one.

    Solution

    Let A and B be nonzero real matrices of compatible sizes, so the denominator is positive. If b_j are B's columns, ‖AB‖_F² = Σ_j ‖A b_j‖² ≤ ‖A‖₂² ‖B‖_F² ≤ ‖A‖_F² ‖B‖_F², giving a score in [0, 1]. Equality in the final inequality requires A to have rank one: A = σ x yᵀ, with σ > 0 and unit x,y. Equality in the first requires every nonzero column of B to lie in span(y), so B = y zᵀ with z ≠ 0 and rank one. Conversely, these forms give AB = σ x zᵀ and score 1. The shared singular directions must therefore be parallel; their signs are immaterial.

  4. AND under patching. Two inputs feed \(y = x_1 \wedge x_2\). Clean: both true; corrupted: both false. Show that noising either input alone destroys \(y\), while denoising either alone restores nothing.

    Solution

    Clean (1, 1) gives y = 1; corrupted (0, 0) gives y = 0. Noising either input alone gives (0, 1) or (1, 0), hence y = 0. Denoising either input alone also gives one of those mixed inputs, hence y = 0. Each input is necessary for this AND output but neither alone is sufficient. The two patching directions ask different questions in these clean/corrupt contexts.

  5. The zero-bias reference comparison. Two features, one dimension, density \(\rho\), importances \(1\) and \(r\), \(x_i \sim U[0, 1]\) when on: show that with zero output bias, keeping feature 1 alone costs \(r\rho/3\), keeping feature 2 alone \(\rho/3\).

    Solution

    W = (1, 0), b = 0: feature 1 is rebuilt exactly (ReLU(x₁) = x₁ ≥ 0), and feature 2 is lost, costing r E[x₂²] = r ρ E[U²] = rρ/3. W = (0, 1), b = 0 costs ρ/3. For ρ > 0 and r > 0, keeping the more important feature is at least as good, with equality at r = 1; at ρ = 0 all these costs are zero. For a further comparison, assume independent feature draws and keep b = 0. The antipodal candidate W = (1, −1) gives ReLU(x₁ − x₂) and ReLU(x₂ − x₁): exact when at most one feature is on, with errors only when both are on, an event of probability ρ². For fixed r > 0 it beats the two stated zero-bias dedicated candidates at sufficiently small positive ρ. This is a comparison of those candidates, not a proof of the free-bias global optimum.

  6. The grokking readout. For prime \(p\) and nonempty \(K\subseteq\{1,\ldots,p-1\}\), fix \(a,b\in\mathbb{Z}_p\). For \(c\in\mathbb{Z}_p\), let \(L(c)=\sum_{k\in K}\cos(2\pi k(a+b-c)/p)\). Show its unique maximizer is \(c=(a+b)\bmod p\).

    Solution

    Let p be prime, ∅ ≠ K ⊆ {1,…,p−1}, and a,b,c ∈ ℤₚ. At c = a+b in ℤₚ every cosine is 1, so L(c) = |K|. For any other c, choose the nonzero residue s = (a+b−c) mod p. If cos(2πks/p) = 1, then p divides ks, impossible for 1 ≤ k,s ≤ p−1 because p is prime. Thus every term is below 1; since K is nonempty, L(c) < |K|. The maximizer is unique over ℤₚ. The original sum has unit positive weights; the same proof works with any coefficients αₖ > 0, with maximum Σₖ αₖ. Empty K, DC-only frequencies, or an unrestricted real/integer c need not give uniqueness.

Notes and sources

Glossary

English 中文
interpretability, mechanistic interpretability 可解释性,机制可解释性
saliency map, gradient × input, occlusion 显著图,梯度乘输入,遮挡
sanity check, cascading randomization 合理性检查,逐层随机化
feature visualization, DeepDream, network dissection 特征可视化,DeepDream,网络解剖
the Circuits thread; features, circuits, universality Circuits系列;特征,回路,普遍性
multimodal neuron 多模态神经元
probe, linear probe, MLP probe 探针,线性探针,MLP探针
control task, selectivity 对照任务,选择性
amnesic probing (projecting a direction out) 失忆探测(把一个方向投影掉)
decodable vs used 可读出 vs 被使用
residual stream, unembedding 残差流,反嵌入
logit lens, tuned lens, translator logit透镜,调校透镜,翻译器
activation patching, clean run, corrupted run 激活修补,干净运行,被破坏的运行
noising (necessary), denoising (sufficient) 加噪(检验必要性),去噪(检验充分性)
path patching 路径修补
causal tracing, causal mediation 因果追踪,因果中介
induction head, previous-token head 归纳头,前一词元头
attention-only transformer 只有注意力的Transformer
QK circuit, OV circuit, composition score, K-composition QK回路,OV回路,组合分数,K组合
copying score 复制分数
mean ablation 均值消融
superposition, interference 叠加,干扰
phase diagram, density, relative importance 相图,密度,相对重要性
antipodal pair 反向的一对
monosemantic, polysemantic 单义,多义
sparse autoencoder (SAE), dictionary, latent 稀疏自编码器(SAE),字典,潜变量
encoder, decoder, reconstruction 编码器,解码器,重建
L0 (features on per vector), L1 penalty L0(每个向量亮着的特征数),L1惩罚
fraction of variance unexplained 未解释方差占比
spliced-in loss (bits with the rebuild) 接回后的损失(用重建时的比特数)
shrinkage, soft thresholding 收缩,软阈值
TopK, BatchTopK, JumpReLU, straight-through estimator TopK,BatchTopK,JumpReLU,直通估计
dead latent, AuxK 死潜变量,AuxK
feature splitting, feature absorption 特征分裂,特征吸收
Matryoshka dictionary 套娃字典
transcoder, cross-layer transcoder, replacement model 转码器,跨层转码器,替代模型
local replacement model, error node, dark matter 局部替代模型,误差节点,暗物质
attribution graph, influence, pruning 归因图,影响力,剪枝
crosscoder, model diffing, relative decoder norm 交叉编码器,模型差分,相对解码器范数
activation-difference lens 激活差透镜
steering, steering vector, activation addition 引导,引导向量,激活加法
contrastive activation addition, persona vector 对比激活加法,人格向量
preventative steering 预防性引导
monitor, AUROC 监控器,AUROC
grokking, modular addition 顿悟,模加法
Fourier spectrum, key frequency 傅里叶频谱,关键频率
progress measures: restricted loss, excluded loss 进度指标:受限损失,排除损失
memorization, circuit formation, clean-up 记忆,回路形成,清理
faithfulness (of a chain of thought), motivated reasoning (思维链的)忠实性,动机推理
introspection, concept injection 内省,概念注入
emotion concepts (functional emotions) 情绪概念(功能性情绪)
alignment audit, hidden objective, auditing game 对齐审计,隐藏目标,审计游戏
evaluation awareness 评测意识
natural-language autoencoder 自然语言自编码器
weight-sparse transformer, parameter decomposition 权重稀疏的Transformer,参数分解
ambitious vs pragmatic interpretability 雄心派与务实派可解释性

Sources

Saliency and its checks: K. Simonyan, A. Vedaldi & A. Zisserman, Deep Inside Convolutional Networks (2013); M. Zeiler & R. Fergus, Visualizing and Understanding Convolutional Networks (2014); J. Adebayo et al., Sanity Checks for Saliency Maps (NeurIPS 2018). Feature visualization and circuits: A. Mordvintsev, C. Olah & M. Tyka, Inceptionism (2015); D. Bau et al., Network Dissection (CVPR 2017); C. Olah, A. Mordvintsev & L. Schubert, Feature Visualization (Distill 2017); C. Olah et al., The Building Blocks of Interpretability (Distill 2018); C. Olah et al., Zoom In: An Introduction to Circuits (Distill 2020); G. Goh et al., Multimodal Neurons in Artificial Neural Networks (Distill 2021). Transformer circuits: N. Elhage et al., A Mathematical Framework for Transformer Circuits (2021); C. Olsson et al., In-context Learning and Induction Heads (2022); K. Wang et al., Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small (2022); N. Goldowsky-Dill et al., Localizing Model Behavior with Path Patching (2023). Probes and lenses: G. Alain & Y. Bengio, Understanding Intermediate Layers Using Linear Classifier Probes (2016); J. Hewitt & P. Liang, Designing and Interpreting Probes with Control Tasks (EMNLP 2019); Y. Elazar et al., Amnesic Probing (TACL 2021); nostalgebraist, interpreting GPT: the logit lens (2020); N. Belrose et al., Eliciting Latent Predictions from Transformers with the Tuned Lens (2023). Patching: J. Vig et al., Causal Mediation Analysis for Interpreting Neural NLP (2020); K. Meng et al., Locating and Editing Factual Associations in GPT (2022). Superposition and dictionaries: N. Elhage et al., Toy Models of Superposition (2022); W. B. Johnson & J. Lindenstrauss (1984); T. Bricken et al., Towards Monosemanticity (2023); H. Cunningham et al., Sparse Autoencoders Find Highly Interpretable Features in Language Models (2023); A. Templeton et al., Scaling Monosemanticity (2024); L. Gao et al., Scaling and Evaluating Sparse Autoencoders (2024); S. Rajamanoharan et al., Jumping Ahead: Improving Reconstruction Fidelity with JumpReLU Sparse Autoencoders (2024); T. Lieberum et al., Gemma Scope (2024); B. Bussmann, P. Leask & N. Nanda, BatchTopK Sparse Autoencoders (2024); B. Bussmann et al., Learning Multi-Level Features with Matryoshka Sparse Autoencoders (2025); D. Chanin et al., A is for Absorption (2024). Transcoders, graphs, diffing: J. Dunefsky, P. Chlenski & N. Nanda, Transcoders Find Interpretable LLM Feature Circuits (2024); E. Ameisen et al., Circuit Tracing: Revealing Computational Graphs in Language Models (2025); J. Lindsey et al., On the Biology of a Large Language Model (2025); J. Lindsey et al., Sparse Crosscoders for Cross-Layer Features and Model Diffing (2024); J. Minder et al., Overcoming Sparsity Artifacts in Crosscoders to Interpret Chat-Tuning (2025); J. Minder et al., Narrow Finetuning Leaves Clearly Readable Traces in Activation Differences (2025). Steering: A. Turner et al., Steering Language Models With Activation Engineering (2023); N. Rimsky et al., Steering Llama 2 via Contrastive Activation Addition (2024); A. Arditi et al., Refusal in Language Models Is Mediated by a Single Direction (2024); R. Chen et al., Persona Vectors (2025); Anthropic, Golden Gate Claude (May 2024). Grokking: A. Power et al., Grokking (2022); N. Nanda et al., Progress Measures for Grokking via Mechanistic Interpretability (ICLR 2023). Faithfulness: M. Turpin et al., Language Models Don't Always Say What They Think (2023); T. Lanham et al., Measuring Faithfulness in Chain-of-Thought Reasoning (2023); Y. Chen et al., Reasoning Models Don't Always Say What They Think (2025). Frontier: Anthropic, Open-sourcing circuit tracing tools (May 2025); L. Gao et al., Weight-sparse transformers have interpretable circuits (2025); Google DeepMind, Gemma Scope 2 (Dec 2025); J. Lindsey, Emergent Introspective Awareness in Large Language Models (Oct 2025); Anthropic, Emotion Concepts and their Function in a Large Language Model (Apr 2026); S. Marks et al., Auditing Language Models for Hidden Objectives (2025); Anthropic, Claude Sonnet 4.5 System Card (Sep 2025); Anthropic, Natural Language Autoencoders Produce Unsupervised Explanations of LLM Activations (May 2026). Disagreements: GDM mechanistic interpretability team, Negative Results for Sparse Autoencoders on Downstream Tasks and Deprioritising SAE Research (Mar 2025); S. Kantamneni et al., Are Sparse Autoencoders Useful? A Case Study in Sparse Probing (2025); G. Paulo & N. Belrose, Sparse Autoencoders Trained on the Same Data Learn Different Features (2025); T. Heap et al., Automated Interpretability Metrics Do Not Distinguish Trained and Random Transformers (2025); Z. Wu et al., AxBench (2025); L. Sharkey et al., Open Problems in Mechanistic Interpretability (2025).

About this partfrom its README

Part 30 of a thirty-one-part series on how modern AI works and how it came to be (see the series plan and the syllabus). How to read what a trained network has learned, and how to tell reading from causing: saliency maps and their sanity checks, probes with control tasks, the logit and tuned lenses, activation and path patching, an induction circuit taken apart end to end, superposition and its phase diagram, sparse dictionaries (L1, TopK, JumpReLU, Matryoshka) with their failures (shrinkage, dead latents, splitting, absorption), transcoders and attribution graphs, crosscoders and model diffing, steering, grokking explained mechanistically, the faithfulness of chains of thought, and the 2025–26 frontier with the arguments inside the field. Every experiment runs on the series' own models on this computer: Part 13's character transformer (through videos/ai/ai13/compute.py's load_tf), the novels model (explainer/ai/novels.py) and Part 27's chat fine-tune of it (videos/ai/ai27/compute.py), plus three small models trained here (Part 13's two-layer attention-only model, retrained with its recipe and seed; Toy Models' 2-feature model on a grid; Nanda et al.'s grokking transformer). Every number on screen is computed or cited.

What is computed and builtHistorical reported results

The following values are the original author-reported outcomes. Their original Part 30 caches were not available in the fresh cloud QA workspace. They remain unchanged for provenance and are not measurements from the new QA candidates. Fresh candidates and corrected-recipe comparisons have separate input/source hashes and acceptance records; the source/narration reads whichever explicitly staged cache it is given.

Seeded, one torch thread, on a busy 4-core Linux machine (about 1.5 CPU-hours in all; the frontier sweep is 40 of those minutes). The narration states each result from the cached numbers, so another machine's run says what it measured.

  • Saliency (Part 13's transformer, '…she sai' → 'd', 99%): gradient × input against occlusion, rank correlation 0.21 on the shown prediction and 0.07 on average over 24 more; cascading re-randomization: 1.00, 0.45, 0.39, 0.20, −0.31, −0.09 (the map passes Adebayo et al.'s check: trained against fully random, −0.05 on average).
  • Probes (novels model, "inside a quotation", 8,960 tokens to train and 8,960 held out, 3 seeds; majority 61%): linear probe 66% at the embedding rising to 91% at layer 5; control task 81% at the embedding falling to 73%; MLP probe 91% on the task but 88% on the control at layer 5: selectivity +16 points (linear) against +3 (MLP). Amnesic probing at layer 5: closing quotation marks cost 4.03 bits, 5.59 with the probe's direction removed, 4.04 (mean) with ten random directions removed.
  • Lenses (novels model, held-out text): KL to the final prediction, logit lens / tuned lens, by layer 0–5: 8.55 / 2.53, 2.96 / 1.86, 2.40 / 1.45, 1.88 / 1.10, 1.40 / 0.74, 0.71 / 0.34 bits; bits per token at the embedding 13.6 / 7.6, the model 5.27.
  • Induction. Repeated held-out text: Part 13's transformer 1.79 → 1.80 bits per character, the novels model 5.18 → 5.07 bits per token (no copying). The attention-only model (retrained, seed 2022): the repeat falls from 6.23 to 1.49 bits per token, fastest around step 2,600; previous-token heads 1 and 2 of layer 1 (scores 0.37, 0.30), a current-token head 4 (self-attention 0.62), induction heads 1–3 of layer 2 (0.60, 0.60, 0.52). Noising each head: 0.39, 0.29, 0.13, 0.65 (layer 1), 0.45, 0.46, 0.29, −0.05 (layer 2). Path patching from the previous-token heads into layer 2: queries 0.00, keys 0.86, values 0.01; each previous-token head alone, keys: 0.39, 0.29; the current-token head: queries 0.49. K-composition 0.17–0.20 against 0.124 ± 0.007 for random heads. The induction heads' OV circuit: for 83% of tokens the logit raised most is their own, copying score 0.88. Mean-ablation: 1.49 bits with every head, up to 2.66 without a previous-token head, up to 3.55 without an induction head, 3.59 without the current-token head, 6.20 for random tokens. Through training, the K path's effect switches on between steps 2,500 and 2,750, with the loss's drop. Noising the residual stream for one target: inputs 20, 21 (and 16); between the layers 21 and 70; output 70.
  • Superposition and the phase diagram: 289 cells, best of 4 seeds: 212 in superposition, 42 giving feature 2 the dimension, 35 dropping it; trained and the restricted reference agree on 94% of the cells (seeds agree with the best on 83%).
  • The L1 autoencoder (512 latents, λ = 2, 4,000 steps, 211,200 vectors): 6.8 features per character, 11.2% of the variance unexplained, no dead latents; spliced in, 1.94 bits per character against 1.72 (the model) and 5.61 (the mean vector). Purity (of the 8 strongest moments, how many on one character): neurons 5.9, features 7.8.
  • Three dictionaries at equal budgets (512 latents, 2,000 steps, 3 seeds): at 16 features per vector, variance unexplained TopK 6.1%, JumpReLU 8.4%, L1 11.3%; bits spliced in 1.80, 1.84, 1.93 (the model 1.72). At 8: 7.5%, 10.5%, 17.1%; at 32: 4.9%, 6.1%, 8.1%. L1's best rescale 1.04 (λ = 0.25) to 1.30 (λ = 4); JumpReLU and TopK 1.00. Dead latents: none at k = 16, with or without AuxK; 2 in the 2,048-latent dictionary; 17 for TopK k = 4, 79 for JumpReLU λ = 8.
  • Splitting and absorption: TopK at 128, 512 and 2,048 latents; latent 8 of the smallest ('l' after "by ") has 1 same-character descendant in the 512 and 6 in the 2,048; 21 of the 102 clean latents have two or more. A probe reads upper case at 100%; the dictionary's best latent for it fires on 57% of capitals (mean of 3 seeds) and 13% are absorbed by another latent; Matryoshka (prefixes 32, 128): 48% and 37%, worse here, with a wide spread across seeds.
  • Transcoders and the graph: MLP output unexplained per layer, per-layer transcoders 0.9%, 10.3%, 17.6%, 6.0%; cross-layer 1.0%, 9.0%, 13.2%, 4.4%. Every MLP replaced: 2.03 bits per character (per-layer, same top guess 81%), 1.96 (cross-layer, 83%), against 1.72 for the model and 5.04 with the MLPs mean-ablated. The graph for '…she sai' → 'd': 3,058 active features; the local replacement model matches the logits to within 10⁻⁵; logit 11.58 = features 9.60 + embeddings 2.05 + errors 0.04 + biases; the 16 most influential features switched off in the real model against the graph's prediction: r = 0.94.
  • Model diffing (BatchTopK crosscoders, 1,024 latents, k = 32, 18,600 novel and 27,347 chat tokens): after block 3 and after block 5, every live latent shared (r from 0.42 to 0.62 and from 0.46 to 0.64); the most chat-leaning latents fire on "<|user|>Write", "<|assistant|>", "<|user|>Which" with r ≈ 0.53; the activation-difference lens on novel text: punctuation and function words, no chat markers; the mean difference is 14% of a vector's length.
  • Steering: the quotation feature (latent 440) at α = 0, 0.25, 0.5: 0.0, 1.8, 8.0 marks of speech per 160 characters (5 samples); a random direction at 0.5: 0.6. The mood vector (cheerful minus gloomy words in 8 frames, after block 3): AUROC 0.66 on held-out words, 0.74 on 110 + 110 novel sentences; cheerful-minus-gloomy words per hundred at α = −0.6 … 0.6: −0.9, +0.1, +0.6, +1.4, +1.7 (a random direction: −0.2, −0.4, +0.6, −0.3, +1.5); fluency 5.05, 4.34, 4.37, 4.56, 5.49 bits per token.
  • Grokking ((a + b) mod 59, 30% of the table): memorized by step 100, test accuracy above 99% at step 10,300; key frequencies 7, 23, 4, 28, 14 hold 95% of the embedding at the end; 490 of 512 neurons put more than half their activation at one frequency; the restricted loss falls below 1 nat at step 5,800, the test loss only at step 9,000; the key waves explain 81% of the final logits' variance.
  • Disagreements: TopK dictionaries from different seeds share 15% of latents (cosine ≥ 0.7; L1: 68%). Sparse probing on the novels model after block 5 (majority 79% in distribution, 51% in chat transcripts): at 16 examples linear 76%, 8 latents 78%, 1 latent 78%; at 4,096, 90%, 86%, 85%, and in chat transcripts 76%, 66%, 59%. An autoencoder on a random copy of Part 13's transformer: purity 7.2 of 8, against 7.7 for the trained one.
Chapter notes
  • What is it thinking? The 128 numbers Part 13's transformer carries per character after block 2, all busy; the same rewritten by a sparse autoencoder, a handful on; a feature as a direction (a shadow on it). Objectives.
  • 1. How we got here. Saliency maps (Simonyan, Vedaldi & Zisserman 2013) and occlusion (Zeiler & Fergus 2014), computed on our transformer for one prediction and 24 more, compared by rank correlation; Adebayo et al.'s sanity check (2018), cascading re-randomization run on ours; DeepDream (2015), Network Dissection (Bau et al. 2017), feature visualization (Olah, Mordvintsev & Schubert, Distill 2017), Building Blocks (2018); the Circuits thread's three claims (Zoom In, 2020), multimodal neurons (Goh et al. 2021), the transformer-circuits framework (Elhage et al. 2021), induction heads (Olsson et al. 2022), IOI (26 heads in 7 classes, Wang et al. 2022), Toy Models (2022), Towards Monosemanticity (512 neurons into 4,096 features, 2023), Scaling Monosemanticity (Claude 3 Sonnet, 2024), attribution graphs (2025).
  • 2. What does it know? Linear probes on every layer of the novels model for "inside a quotation" (Alain & Bengio 2016), three seeds; Hewitt & Liang's control task (2019): the same labels assigned at random per token type, linear and MLP probes, selectivity = task − control; amnesic probing (Elazar et al. 2021): the probe's direction projected out at the best layer, the cost on closing quotation marks, against ten random directions.
  • 3. Reading the stream as it flows. The logit lens (nostalgebraist 2020) on the novels model, a prompt read at every layer; the tuned lens (Belrose et al. 2023), one affine translator per layer trained here (its training replayed); KL to the final prediction and bits per token by layer, held out.
  • 4. Cause, not correlation. Do our models copy? Repeated held-out text through both: passage-level loss changes alone do not identify a copying circuit. Part 13's two-layer attention-only model on repeated random tokens, retrained (its loss and its two heads' attention); activation patching (Vig et al. 2020; Meng et al. 2022): the corrupted residual stream put into a clean run at every tested (layer, position) for one target; each head's corrupted output put into a clean run.
  • 5. An induction circuit, end to end. Path patching (Wang et al. 2022; Goldowsky-Dill et al. 2023): the previous-token head's corrupted output sent only into the induction head's queries, keys or values; K-composition from the weights (Elhage et al. 2021) against random heads; the previous-token head's QK circuit on positions; the induction head's OV circuit token to logit (diagonal share, eigenvalue copying score); mean-ablation of every head; the K path's effect through training, replayed with the loss.
  • 6. More ideas than dimensions. Toy Models' 5 features in 2 dimensions at four sparsities, the pentagon forming during training, interference through the bias and ReLU.
  • 7. The phase diagram. The 2-feature, 1-dimension model trained on a 17 × 17 grid of densities and relative importances, four seeds per cell; the empirical phases (feature 2 dropped, given the dimension, or in superposition) against three restricted reference candidates' expected losses; one cell's training; random directions' cosines in 2 to 1,024 dimensions (spread ≈ 1/√d; Johnson & Lindenstrauss 1984).
  • 8. Pulling the features apart. An L1 sparse autoencoder with 512 features on 211,200 residual vectors (Bricken et al. 2023; Cunningham et al. 2023), its training replayed; features per character, variance explained, bits per character with the rebuild spliced in; where four features fire; neurons against features.
  • 9. Better dictionaries. L1 shrinkage derived (soft thresholding); TopK (Gao et al. 2024, 16M latents on GPT-4) and JumpReLU (Rajamanoharan et al. 2024; Gemma Scope) trained beside L1 at equal size, steps and batches, several sparsities, three seeds: sparsity against variance explained and against bits per character spliced in; dead latents and AuxK.
  • 10. Splitting and absorption. TopK dictionaries of 128, 512 and 2,048 latents: one latent's descendants (feature splitting, Bricken et al. 2023); absorption (Chanin et al. 2024) measured for "upper-case letter" with a probe direction and the dictionary's best latent; Matryoshka dictionaries (Bussmann et al. 2025; Nabeshima 2024) against TopK, three seeds each.
  • 11. Transcoders and attribution graphs. Per-layer transcoders (Dunefsky, Chlenski & Nanda 2024) and a cross-layer transcoder (Ameisen et al. 2025) for all four MLPs of Part 13's transformer, their training replayed; the replacement model's bits per character; an attribution graph for '…she sai' → 'd' from the local replacement model (attention patterns and layer-norm scales frozen, error nodes; exact on the prompt), its logit balanced into features, embeddings and errors; its 16 most influential features switched off in the real model, measured against the graph's prediction; Claude 3.5 Haiku's biology (Lindsey et al. 2025): two-hop reasoning, planning in poems, addition, multilingual features, entity recognition and hallucination, "about a quarter of the prompts".
  • 12. What fine-tuning changed. A BatchTopK crosscoder (Lindsey et al. 2024; Minder et al. 2025) on the novels model and Part 27's chat fine-tune, after blocks 3 and 5, on novel text and chat transcripts: balanced, chat-dominant and base-dominant bins of normalized decoder-norm shares, and where selected latents fire. These bins are descriptive proxies, not proofs that concepts were created or removed; the local activation-difference readout (Minder et al., Oct 2025) on plain novel text.
  • 13. Reaching in. The L1 autoencoder's quotation feature added to Part 13's transformer while it writes, three strengths, five samples, against a random direction; a contrast vector in the novels model (cheerful minus gloomy words in the same frames, after block 3, the manner of CAA and persona vectors): as a monitor (AUROC on held-out words and on real sentences), as a steer (mood and fluency at five strengths, against a random direction, 36 samples each); ActAdd (Turner et al. 2023), refusal as one direction (Arditi et al. 2024), persona vectors (Chen et al. 2025), Golden Gate Claude (May 2024).
  • 14. Grokking, mechanistically. Nanda et al.'s one-layer transformer (2023) on (a + b) mod 59 (they used 113), 30% of the table, AdamW with weight decay 1: memorization and the late collapse of the test loss; the Fourier algorithm derived; the embedding's spectrum through training and the numbers on a circle; neurons by frequency; the progress measures (restricted and excluded loss, weight norm) and the three phases. Part 12 covers grokking as a phenomenon.
  • 15. Does the chain of thought tell the truth? Biased few-shot examples (Turpin et al. 2023); truncated and edited chains (Lanham et al. 2023); hints (Chen et al. 2025: Claude 3.7 Sonnet 25%, DeepSeek-R1 39%; reward hacks admitted under 2% in most settings); faithful, made-up and motivated reasoning seen in attribution graphs (Lindsey et al. 2025). Cited, not computed: our models write no chains of thought.
  • 16. The frontier, 2025 to 2026. Open circuit tracing (Anthropic Fellows and Decode Research, May 2025), weight-sparse transformers (Gao et al., OpenAI, Nov 2025), Gemma Scope 2 (Dec 2025), attention tracing; emergent introspective awareness (Lindsey, Oct 2025); emotion concepts in Claude Sonnet 4.5 (Apr 2026); auditing for hidden objectives (Marks et al., Mar 2025), the Claude Sonnet 4.5 system card's evaluation-awareness steering (Sep 2025), natural-language autoencoders (May 2026).
  • 17. Where the field disagrees. Autoencoder probes against linear probes (GDM, Mar 2025; Kantamneni et al. 2025), measured on the novels model from 16 to 4,096 examples, on novel text and in chat transcripts; dictionaries from different seeds (Paulo & Belrose 2025), measured on ours; autoencoders on a random transformer (Heap et al. 2025), measured on ours; ambitious against pragmatic interpretability, dark matter, AxBench (Wu et al. 2025), parameter decomposition, open problems (Sharkey et al. 2025).
  • Recap in ten pictures from the part's own results, where it comes back (Part 31), six problems, Part 31's teaser, references.

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Probing and its caveats; logit and tuned lens.
  2. Activation and path patching.
  3. Superposition: the phase diagram, computed.
  4. SAEs: L1 shrinkage, TopK, JumpReLU, Matryoshka; dead latents, splitting, absorption.
  5. Transcoders and cross-layer transcoders; attribution graphs.
  6. Crosscoders and model diffing.
  7. Steering.
  8. Our transformer's induction circuit, end to end; grokking, mechanistically.
  9. CoT faithfulness.

中文讲义

本讲的中文部分(与英文版对应)。

习题与解答
  1. 软阈值。 一个L1自编码器用一个潜变量重建 \(x=a\,d\)(\(\|d\|=1\),\(a>0\),\(\lambda\ge0\)):在 \(f\ge0\) 上最小化 \(\|x-fd\|^2+\lambda f\)。证明 \(f^*=\max(a-\lambda/2,0)\);求TopK保留这个标量潜变量时、不加惩罚的最优值。

    解答

    设a > 0、λ ≥ 0、‖d‖ = 1。在f ≥ 0上最小化ℓ(f) = ‖ad − fd‖² + λf = (a − f)² + λf。 在正值分支令ℓ′(f) = −2(a − f) + λ = 0,得f = a − λ/2;a ≤ λ/2时,约束最小值在f = 0处。 所以f* = max(a − λ/2, 0)。正的最优值缩小λ/2,截断分支为零。若TopK保留这个标量潜变量,不加惩罚的目标(a − f)²在f = a处最小。 这个标量比较中没有L1收缩项,并不保证学到的完整编码器具有无偏的激活幅度。

  2. 随机余弦。 设 \(u,v\) 相互独立,且在 \(\mathbb{R}^d\) 的单位球面上均匀分布(\(d\ge1\))。证明 \(\mathbb{E}[u\cdot v]=0\) 且 \(\mathbb{E}[(u\cdot v)^2]=1/d\)。

    解答

    设d ≥ 1,u、v相互独立且在ℝᵈ的单位球面上均匀分布。由符号对称性,E[u·v] = 0。 固定v后,由正交变换不变性及独立性,可以把v映射到e₁而不改变u的分布。因此E[(u·v)²] = E[u₁²] = (1/d)ΣᵢE[uᵢ²] = (1/d)E[‖u‖²] = 1/d。标准差为1/√d。

  3. 组合分数。 设 \(A,B\) 为非零、尺寸相容的实矩阵,证明 \(\|AB\|_F/(\|A\|_F\|B\|_F)\in[0,1]\)。等于 \(1\) 当且仅当两者秩都为一,且 \(A\) 的右奇异方向与 \(B\) 的左奇异方向平行。

    解答

    设A、B为非零、尺寸相容的实矩阵,分母因此为正。记B的列为b_j,则 ‖AB‖_F² = Σ_j‖A b_j‖² ≤ ‖A‖₂²‖B‖_F² ≤ ‖A‖_F²‖B‖_F²,所以分数在[0, 1]内。 最后一个不等式取等号要求A秩为一:A = σ x yᵀ,其中σ > 0,x、y为单位向量。第一个不等式取等号要求B的每个非零列都在span(y)内, 因此B = y zᵀ,其中z ≠ 0,B也秩为一。反过来,这些形式给出AB = σ x zᵀ,分数为1。共享维度中的奇异方向必须平行,符号无关。

  4. 修补下的“与”门。 两个输入给出 \(y = x_1 \wedge x_2\)。 干净: 两个都为真; 被破坏: 两个都为假。 证明只破坏其中一个输入就会毁掉 \(y\), 而只恢复其中一个什么也恢复不了。

    解答

    干净输入(1, 1)给出y = 1,破坏后(0, 0)给出y = 0。只破坏一个输入,得到(0, 1)或(1, 0),所以y = 0。 只恢复一个输入也得到这两种混合输入之一,所以y = 0。每个输入对这个“与”门输出都是必要的,但单独哪一个都不充分。 两个修补方向在这些干净与破坏输入的条件下,回答的是不同问题。

  5. 零偏置参考比较。 两个特征,一个维度,密度 \(\rho\),重要性 \(1\) 和 \(r\), 亮着时 \(x_i \sim U[0, 1]\): 证明输出偏置为零时,只保留特征1的代价是 \(r\rho/3\), 只保留特征2是 \(\rho/3\)。

    解答

    W = (1, 0)、b = 0时,特征1被精确重建,特征2丢失,代价r E[x₂²] = rρ/3。 W = (0, 1)、b = 0时代价为ρ/3。ρ > 0、r > 0时,保留更重要的特征至少不差;r = 1时相等。ρ = 0时这些代价都为零。 作为进一步比较,假设特征独立抽样,并保持b = 0。反向候选W = (1, −1)给出ReLU(x₁ − x₂)和ReLU(x₂ − x₁): 至多一个特征出现时重建精确,只有两个同时出现才会出错,该事件的概率为ρ²。固定r > 0时,ρ为足够小的正数,这个候选优于上述两个零偏置专用候选。 这里只比较这些候选,并没有证明允许自由偏置时的全局最优解。

  6. 顿悟的读出。 设 \(p\) 为素数,非空 \(K\subseteq\{1,\ldots,p-1\}\),固定 \(a,b\in\mathbb{Z}_p\)。对 \(c\in\mathbb{Z}_p\),令 \(L(c)=\sum_{k\in K}\cos(2\pi k(a+b-c)/p)\)。证明唯一最大值在 \(c=(a+b)\bmod p\) 处。

    解答

    设p为素数,∅ ≠ K ⊆ {1,…,p−1},且a、b、c ∈ ℤₚ。在c = a+b(按模p计算)处,每项余弦都是1,所以L(c) = |K|。 对其他c,取非零剩余类s = (a+b−c) mod p。cos(2πks/p) = 1要求p整除ks;但p为素数且1 ≤ k,s ≤ p−1,因此不可能。 每项都小于1,而K非空,所以L(c) < |K|。最大值在ℤₚ上唯一。原题的权重均为正的1;任何αₖ > 0的加权版本同理,最大值为Σₖαₖ。 K为空、只有直流频率,或c不受限制而取实数或整数时,都不一定具有唯一最大值。

Build the film

python -m videos.ai.ai30.compute        # the part's numbers, into .cache/ai30
python tools/build.py ai30                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py ai30 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/ai/ai30. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it
python -m explainer.ai.novels               # the novels model (cached in .cache/novels/); Part 27's fine-tune is
                                            # computed by its own compute when this part first asks for it
python -m videos.ai.ai30.compute            # everything missing: about 2-3 CPU-hours on one or two threads
python -m videos.ai.ai30.compute --force sae
AI30_SCALE=0.05 python -m videos.ai.ai30.compute   # a smoke test of every code path, into .cache/ai30_quick/
python tools/make.py ai30                   # computations, then the narrated cut in English and Chinese
python tools/build.py ai30 -q l             # a 480p preview

Everything is seeded. The long items resume after an interruption: the sweeps (frontier, splitting, absorption, clt) keep every finished run in CACHE.partial, the grokking run checkpoints every 1,000 steps with its random state (.cache/ai30/grok.ckpt). Torch threads: AI30_THREADS (default 1; set at run time, never on import). Dictionaries are kept small in .cache/ai30/dicts/ and .cache/ai30/*.pt; activations are recomputed, not stored. The part reads Part 13 through videos.ai.ai13.compute (load("tf"), load_tf, head_mats, composition_scores, composition_baseline), the novels model through explainer.ai.novels, and Part 27 through videos.ai.ai27.compute (load("sft"), _load_model("sft"), load("data"), its word lists).

Other parts read from this one: Part 19's outro calls load("superposition") (its keys are unchanged), and Part 16 imports show from videos.ai.ai30.common.