Topic 2 of 6 · 5 min read
Sparse autoencoders and feature dictionaries
Goal: Read a feature's top activating examples and judge whether its label is supported by them.
A sparse autoencoder (SAE) learns a large dictionary of directions so that each activation is rebuilt from just a few of them, and those directions are often easier to read than neurons.
Check yourself · 1 of 3
What do the two training pressures on a sparse autoencoder do?
Why it matters
Superposition hides features inside neurons. An SAE is the main tool for pulling them back out. Anthropic's Towards Monosemanticity paper applied it to a small one-layer transformer. Later work by Anthropic and Google DeepMind scaled the approach to larger models. Neuronpedia lets you browse the resulting features for open models, so you can inspect them without training anything.
How it works
- Collect activations from one layer of the model, for example the residual stream, over a large pile of text.
- Encode: a linear layer plus a ReLU turns each activation into a much wider vector, much wider than the original, where almost all entries are zero.
- Decode: another linear layer rebuilds the original activation from those few active entries. Each column of the decoder is one dictionary direction, a candidate feature.
- Train with two pressures: rebuild the activation accurately, and keep the number of active entries small (an L1 penalty, or a top-k rule).
The result is a table of features. For each one you can list the tokens and passages where it fires most strongly, and what it does to the model's output when changed.
Reading a feature honestly
A feature card shows its top activating examples. Judge a label with three checks:
- Coverage: do the weaker activations, not just the top ten, fit the label?
- Specificity: does the feature stay quiet on text that is close to the label but not the same?
- Effect: does turning the feature up or down change the model's output the way the label predicts?
Before and after. Weak: "Feature 8,812 top examples are all about Paris landmarks, so it is the Paris feature." Better: "The top examples are Paris landmarks, but the mid-range ones include London bridges and French menus. Label it 'European travel places, strongest for Paris' until a test says otherwise."
What goes wrong
- Labels written from top examples only. They overstate how clean a feature is.
- Reconstruction error. The SAE does not rebuild the activation perfectly. What it misses may matter, and swapping the SAE output into the model usually costs some accuracy.
- Feature splitting. A wider dictionary can split one feature into several narrower ones, so there is no single correct count.
- Dead and dense features. Some never fire, and some fire on nearly everything.
An SAE is a lens that makes parts of the model readable. It is not a full decoding of it.
Examples
A label that the data does not support
| Rank | Top activating text | Activation |
|---|---|---|
| 1 | "the Eiffel Tower at night" | 9.1 |
| 2 | "Louvre queue times" | 8.7 |
| 3 | "Big Ben tickets" | 7.9 |
| 4 | "Colosseum guided tour" | 7.2 |
The proposed label is "Paris landmarks". Two of four examples are not in Paris, so the data supports "famous European tourist sites" at best.
Checking a feature by steering it
A feature labelled "formal register" is clamped to a high value while the model writes a message to a friend. The reply becomes stiff and uses "Dear Sir". That supports the label in a way the examples alone could not, because the feature changed the output as predicted.
Key points
- A sparse autoencoder rebuilds activations from a wide dictionary where only a few directions are active per token.
- Each decoder direction is a candidate feature that often reads more cleanly than a single neuron.
- A feature label is a hypothesis; check weak activations, near-miss text and the effect of editing the feature.
- SAE reconstruction is imperfect, and what it misses can matter for any conclusion drawn from it.
- Dictionary size changes how features split, so there is no single right number of features.
Common mistakes
- Naming a feature from its top ten examples without reading weaker activations.
- Treating the SAE's features as the model's true and complete concept list.
- Ignoring reconstruction error when claiming the SAE explains behaviour.
- Expecting the same features to appear at different dictionary sizes.
Check yourself · 2 of 3
A feature's top 5 examples are all about dogs, but its weaker activations include wolves, leashes and the word "fetch". What is the best label?
Check yourself · 3 of 3
Why do researchers measure SAE reconstruction error before trusting conclusions from its features?
Practice items, not counted towards your mastery.
Start here
- Transformer Circuits Thread (Anthropic) (opens in a new tab)ArticleFree
The main publication venue for this research, in reading order.
- Zoom In: An Introduction to Circuits (Distill) (opens in a new tab)ArticleFree
The claims behind circuits research: features, circuits and universality.
- Toy Models of Superposition (Anthropic) (opens in a new tab)PaperFree
Small models that show features packed into fewer dimensions, with the maths and plots.
More for this topic
- Towards Monosemanticity (Anthropic) (opens in a new tab)PaperFree
The first sparse autoencoder study on a small transformer, with feature examples you can browse.
- Neuronpedia (opens in a new tab)ToolFree
Browse sparse autoencoder features and their top activating text for open models.