Part II, Sparse autoencoders
A wide, sparse dictionary
The sparse autoencoder in its original form, how it is trained, the three numbers every paper reports, and what the first experiments on language models found in 2023.
Assumes the previous piece; cross-entropy loss.
A sparse autoencoder takes an activation , say 512 numbers from one layer, maps it to a much wider vector of latents, say 4,096, and maps that back to numbers. A ReLU in the middle sets most latents to exactly zero.
The columns of are the dictionary. Each is a candidate feature direction, and says how strongly it is present in .Subtracting before encoding centres the input. Decoder columns are usually constrained or normalised to unit length, so that the sparsity penalty cannot be dodged by shrinking and growing .
Training
The original objective is reconstruction error plus an L1 penalty on the latents:
What we actually want to penalise is the number of active latents, . The L1 norm is its convex stand-in, and the substitution has a cost. L1 charges for size as well as activity, so the optimum pulls every active latent toward zero. This bias is called shrinkage, and most of the architecture work in later pieces sets out to remove it. The coefficient trades sparsity against reconstruction, so every trained SAE is one point on a sparsity–fidelity frontier.
What gets reported
| Measure | Definition | Reading |
|---|---|---|
| average active latents per token | ||
| FVU | fraction of variance unexplained | |
| loss recovered | splice into the forward pass; share of the gap to zero- or mean-ablation that is closed |
The third measure is the one that tests whether the dictionary keeps what the model uses. A reconstruction can explain most of the variance and still damage next-token prediction, if the variance it misses is the variance that matters. Interpretability is then scored separately, usually by a language model that writes an explanation of a latent from its top-activating examples and is then tested on predicting new activations from that explanation.
The first results, 2023
Two papers in the autumn of 2023 established the method.
Cunningham and colleagues trained ReLU+L1 SAEs on the residual stream and MLP outputs of Pythia-70M and Pythia-410M.Cunningham, Ewart, Riggs, Huben and Sharkey, Sparse Autoencoders Find Highly Interpretable Features in Language Models, ICLR 2024. The proceedings list the authors as Huben, Cunningham, Smith, Ewart and Sharkey. Residual dictionaries were mostly twice the activation width, with . By automated interpretability scores their features beat the neuron basis, PCA, ICA and random directions in early layers. By layer 4 of Pythia-70M, ICA was comparable. Fidelity was the weak point: splicing the reconstruction into Pythia-70M at layer 2 raised Pile perplexity from 25 to 40. On the indirect-object identification task in Pythia-410M, patching SAE features made smaller and more targeted edits than patching PCA directions. That advantage disappeared when the sparsity penalty was removed.
Bricken and colleagues at Anthropic worked with a one-layer transformer with a 512-neuron MLP, about 8 billion activation samples, and dictionaries from 512 to 131,072 features, studying a 4,096-feature run in depth.Bricken et al., Towards Monosemanticity, Transformer Circuits Thread, October 2023. Their most consequential observation was feature splitting. As the dictionary grows, a feature such as one for base64 text divides into several narrower, related features. Dictionaries of different sizes give overlapping, partly hierarchical vocabularies, and nothing singles out one size as correct.
An SAE on a 4,096-wide residual stream has latents and . How many parameters does it have, ignoring biases? Per token, how many multiply–adds does the decoder need if it exploits sparsity, and how many does the encoder need?
Solution
M parameters. The decoder touches only active columns: K. The encoder cannot know in advance which latents are active, so it computes all of them: M.