Out of Sample
about

Part II, Sparse autoencoders

More features than dimensions

Neurons in language models mean several things at once. The superposition hypothesis explains why, and suggests that sparse dictionary learning can recover the meanings.

Assumes pieces 1 to 4, and what the residual stream and MLP layers of a transformer are.

Open up an MLP layer in a language model and look at what makes a single neuron fire. You will often find inputs that have nothing to do with one another: academic citations, Korean text, HTTP requests.This part follows the review Sparse autoencoders for language-model interpretability, bitfilter 0.29, 12 November 2026. Primary sources are cited in the margin as they come up. A neuron like this is called polysemantic, and it is a problem for anyone who wants to explain a model in terms of its parts. A part that means three unrelated things cannot be named, counted or switched off cleanly.

If neurons are the wrong units, what are the right ones? The working answer since 2022 is that the meaningful variables are directions in activation space, and that there are many more of them than there are neurons.

Superposition

A layer of width nn has room for only nn orthogonal directions. But it can hold many more directions that are almost orthogonal, at the cost of some interference between them. If each feature is active only rarely, two features seldom fire together, and the interference seldom matters. Under those conditions it pays to store more features than there are dimensions.Elhage et al., Toy Models of Superposition, 2022. In their small ReLU models, past a sparsity threshold the network switches sharply from storing one feature per dimension to storing many, arranged in regular geometric figures such as the pentagon below.

The figure makes this concrete with fixed weights. There are 5 features, written into two dimensions along evenly spaced directions did_i and read back as x^i=ReLU(di⋅h−t)\hat x_i = \mathrm{ReLU}(d_i\cdot h - t). Compare this with the honest alternative: store two features exactly and drop the rest.

When each feature is active 8% of the time, packing wins clearly. Raise that chance far enough and the curves cross: once several features are often active together, interference costs more than dropping features outright. With five features and the default threshold the crossing comes at about one in two; with three features, at about one in six. The threshold tt is what makes packing work at all. A negative bias filters out the small, spurious readings that interference produces.

If real models behave like this, an activation x∈Rnx \in \mathbb{R}^n is approximately a sparse combination of many directions:

x  ≈  ∑i=1mfi di,m≫n,∥f∥0≪m.x \;\approx\; \sum_{i=1}^{m} f_i\, d_i, \qquad m \gg n, \qquad \lVert f\rVert_0 \ll m .

Finding the did_i and the fif_i from activations alone is a sparse dictionary-learning problem.

Back to dictionary learning

Piece 4 ended with exactly this problem: an overcomplete dictionary and a sparse code, learned from data, with an encoder that produces the code in one forward pass. Dictionary learning has been applied to word embeddings before, where sparse combinations of “discourse atoms” track word senses,Arora et al., 2016 (TACL 2018). and to transformer activations, as “transformer factors”.Yun, Chen, Olshausen and LeCun, 2021. The direct precursor of the SAEs in this part was a one-layer autoencoder with an L1 penalty on its hidden layer, which recovered the ground-truth features of a toy model like the one above.Sharkey, Braun and Millidge, interim report on the AI Alignment Forum, December 2022. Within a year the method was being applied to real language models.

Exercise

In the figure, fix the chance of activity at 5% and raise the number of features from 3 to 9. How does the advantage of packing change? Set the threshold tt to zero and repeat. What role is the threshold playing?

Exercise

With mm features each active independently with probability pp, what fraction of samples have at least two features active? Check your formula against the margin readout.

Solution

1−(1−p)m−mp(1−p)m−11 - (1-p)^m - m p (1-p)^{m-1}. At m=5m = 5, p=0.08p = 0.08 this is about 5.4%.