Superposition
Superposition is how a neural network stores more features than it has dimensions. A feature is a property of the input that the network keeps track of, such as "this text is Korean" or "this image contains a cat face". The network gives each feature its own direction in a layer's space of activations. When there are more features than dimensions, those directions cannot all be at right angles, so reading out one feature picks up a little of the others. That leak costs little when features are rarely active at the same time, and a ReLU with a small negative bias after the readout removes most of it.
The idea explains a puzzle that blocks the simplest way of reading a network. Pick one neuron in the MLP of a small language model and collect the text that makes it fire hardest. Bricken et al. (2023) did this for a one-layer Transformer whose MLP has 512 neurons. One neuron responds to academic citations, English dialogue, HTTP requests, and Korean text. Vision models do the same. Neuron 4e:55 of the image classifier InceptionV1 fires for cat faces, cat legs, and the fronts of cars (Olah et al. 2020). Images synthesized to excite it show that it looks for each of these separately (eyes and whiskers, furry legs, shiny car fronts), not for one property they share. A neuron that responds to several unrelated things is called polysemantic.
Polysemantic neurons have already caused trouble in this chapter. In §23.1, neuron 221 in the last layer of BERT seemed to mean song titles on one dataset and dates on another, because its top-activating sentences changed with the data. In §23.4, circuits through attention heads came out clean, while circuits through MLP neurons were hard to describe at all. A unit that mixes four unrelated concepts looks like a bug. This section shows that it is a compression scheme, and that a layer that compresses this way must have polysemantic neurons.
Here is the plan. We define features and superposition, and ask which layers have meaningful coordinates. We prove that a linear model cannot compress features this way. Then we study the smallest model that can, a toy that squeezes features through dimensions and decodes them with a ReLU (Elhage et al. 2022). We solve its two-feature case exactly, train it and watch features arrange themselves into opposite pairs and pentagons, and measure how large the leak is at the width of a real model. We connect the story to compressed sensing, the mathematics of recovering a sparse signal from few measurements. We end with the evidence that real models are in superposition. Interviews for interpretability roles ask about each of these steps, most often the two-feature derivation and the link to sparse autoencoders.
How strong is the evidence for all this? §23.1 ranked interpretability evidence on a ladder, from association (some quantity tracks a concept) up to mechanism (a full account confirmed by the interventions it predicts). This section is a theory of how features are stored. In the toy model, where we know the true features, it is confirmed at the level of mechanism. In real models it is supported only indirectly.
As in the rest of this chapter, vectors are rows and a matrix acts on the right, . The papers we follow write columns, and we translate where it matters.
Features, polysemantic neurons, and superposition
§23.2 stated the linear representation hypothesis. It says that a concept a model uses is a direction in its space of activations. How strongly the concept is present is how far the activation points along that direction. Superposition takes this as given and asks a counting question. If a layer has dimensions, how many such directions can it use?
Start with a tiny case. A layer has two neurons and must represent three features. Give feature 1 the direction , feature 2 the direction , and feature 3 the direction , halfway between them. If only feature 3 is present, with strength 1, the activation is , and both neurons fire. So neuron 1 responds to features 1 and 3, and neuron 2 responds to features 2 and 3. Packing three features into two neurons made both neurons polysemantic.
It also made the features leak into each other. Feature 3's direction has a cosine of 0.71 with each of the others. So if we read feature 1 by projecting onto , we get 0.71 when only feature 3 is on.
In plain words, features are the variables the model computes with, neurons are the places where the model's nonlinearity looks, and superposition means there are more variables than places. In the tiny case, , , and has rows , , and . Each column of has two nonzero entries, so each neuron is polysemantic.
Nobody has an agreed definition of a feature, and the definition above sidesteps the question. Elhage et al. (2022) list three candidates. A feature could be any function of the input, but then "cat or car" counts as much as "cat". It could be a property a human can name, but that excludes concepts we have no words for. Or it could be a property that a large enough network would reliably give a neuron of its own, which matches the intuition but is hard to test. Most work, including this section, uses the decomposition in item 1 and stays agnostic about the rest.
Superposition forces polysemantic neurons by a counting argument.
Proof. Suppose every neuron is monosemantic, so each of the columns of has at most one nonzero entry. Then has at most nonzero entries, so at most of its rows can be nonzero. Since , some feature has , a contradiction. ∎
The converse fails. A layer with features can still have polysemantic neurons, if the feature directions are rotated away from the neuron axes. Whether that can happen depends on whether the neuron axes are special at all, which is the next question. In practice, the theorem is why counting neurons never counts features. An interviewer who asks "why are neurons polysemantic?" wants this counting argument first.
Privileged and non-privileged bases
When we say "neuron 4e:55" we read one coordinate of a layer. That makes sense only if the coordinates mean something. §5.1 showed with a small example that in the residual stream, the running vector that every Transformer block reads from and adds its output to, they do not. Take a stream that a sublayer reads with the column , so it reads . Rotate the stream by a quarter turn to , and rotate the read column to match, . The sublayer still reads . Nothing downstream can tell that the coordinates changed.
A ReLU applied before the read would notice. The ReLU, applied to each coordinate, leaves unchanged, so the original stream still reads 5. It turns the rotated stream into , which reads 3. An operation that looks at each coordinate on its own is what makes coordinates special.
Two layers of a Transformer behave very differently under this test. Recall that an orthogonal matrix satisfies , so it is a rotation or reflection and preserves lengths.
In plain words, the residual stream has no preferred axes. Anything the model does in one basis it can do equally well in a rotated one. An MLP's hidden layer has axes that the ReLU looks at one by one, and the only harmless changes are relabeling the neurons and rescaling each by a positive number. So "neuron " is a meaningful unit and "residual coordinate " is not, at least in principle. Both proofs are short and sit in the derivations below.
∂ Proof that rotating the residual stream changes nothing
Write the stream at position after blocks as . We claim that the new network's stream is . It holds at , since the embedding row becomes (fold a learned position embedding the same way).
Suppose the claim holds before some sublayer. RMSNorm without its gain is . Since preserves length, , so the normalized new stream is the normalized old stream times . Every read then gives , because . So queries, keys, values, and MLP inputs are unchanged, and so is everything computed from them. Every write is , the old write times , and adding it keeps the claim true. At the end the logits are .
LayerNorm also subtracts the mean, which is multiplication by . This commutes with exactly when . The division by the standard deviation then sees the same length, since preserves lengths. Its per-coordinate gain and shift fold into the next read as before. ∎
∂ Why only scaled permutations commute with ReLU
If is a permutation with positive entries, permutes and positively rescales the entries of before the ReLU. Since for , doing it after the ReLU gives the same result.
For the converse, let be row of and the -th basis row vector. Taking gives , so every row is nonnegative. Taking for gives . Look at one column . If , then means , so . So no column has two positive entries. An invertible matrix has a nonzero entry in every row. With at most one positive entry per column and rows, each row has exactly one positive entry and each column receives exactly one. That is a permutation with positive entries.
GELU and SiLU are not positively homogeneous, so for them only permutations survive. Either way, a neuron basis is privileged up to relabeling the neurons (and, for ReLU, rescaling them).
Trained models are less symmetric than the theorem suggests. Large Transformers have a few residual coordinates whose values are up to 20 times larger than any other. These outlier features are what make 8-bit quantization of activations hard (Dettmers et al. 2022, §20.2). Elhage, Lasenby, and Olah (2023) asked where they come from, with a clean test.
The test treats the coordinates of one token's activation as samples and computes their kurtosis. Kurtosis is the average fourth power of the deviations from the mean, divided by the squared variance. A Gaussian has kurtosis 3, and heavy tails push it higher. If features pointed in random directions, each coordinate would be a sum of many random projections, so it would look Gaussian and the kurtosis would be about 3. The cell runs the test on made-up activations in which 30 of 768 coordinates are 8 times larger than the rest, and then on the same activations after a random rotation.
The stored basis gives a kurtosis of about 37, and the rotated one gives almost exactly 3. The rotation mixes every outlier coordinate into all 768 coordinates, so the heavy tail disappears. A kurtosis well above 3 therefore means that the activations line up with the basis they are stored in. The converse does not hold. If the feature values were themselves Gaussian, basis-aligned features would also give 3.
In a 200-million-parameter model with , Elhage, Lasenby, and Olah found 20 to 60 outlier coordinates in a typical layer and a kurtosis far above 3. After a fixed random rotation of the same activations, the kurtosis fell to almost exactly 3, as in the cell. So the stream really does favor its own coordinates. Their provisional culprit is the optimizer. Adam gives every parameter its own step size, dividing by the root of that parameter's running average of squared gradients (§0.6). That per-coordinate scaling is the one operation in training that depends on the basis. This is an empirical finding about training, not a property of the architecture.
In practice this decides where to look for meaning. Neurons are worth reading in MLPs, never in the residual stream. Outlier coordinates in the stream are a training artifact to handle in quantization, not a concept. An interviewer will ask whether the residual stream has a privileged basis, and why outlier dimensions appear anyway.
Room for more features than dimensions
Why is possible at all? §1.3 proved the geometric fact. In dimensions, the cosine between two random unit directions has mean 0 and variance exactly , so it is typically about . At that is . And there are at least directions whose pairwise cosines are all smaller than in size. At and that is about 28,000 directions, seven times , and the count grows exponentially with . So a layer can give far more than features nearly orthogonal directions.
The catch is the leak. Reading feature back by projecting onto its direction picks up a little of every other active feature. This leak is called interference, and the question is whether the model can live with it.
A linear model cannot do anything clever about interference. The proof is worth seeing, because it shows exactly what a nonlinearity buys. Here is the idea on one feature. Take a feature that is zero 90 percent of the time and otherwise uniform on . Its mean is , and its variance is . A Gaussian feature with the same mean and variance is never zero. Yet any linear reconstruction has exactly the same expected squared error on both, because that error depends only on means and covariances. The sparsity is invisible to it.
The proof uses the Frobenius norm , the square root of the sum of the squares of all entries of a matrix. It also uses the Eckart-Young theorem of §0.10, which says that the best rank- approximation of a matrix in this norm keeps its largest singular values.
∂ Proof that a linear model sees only two moments
Let and write the error as . Its mean is and its covariance is , so
which involves only and . The best makes . With , the trace is with . The subtracted matrix has rank at most . By Eckart-Young, the trace is at least the sum of the squares of the smallest singular values of the diagonal matrix , which are the smallest . Keeping the top coordinates ( diagonal with ones) attains it. ∎
In plain words, a linear model sees only means and covariances, and a sparse feature has the same mean and variance as some dense feature. So however sparse the features are, a linear model represents at most of them, the most important ones. That is what principal component analysis does, keeping the directions of largest variance. To exploit sparsity the model must be nonlinear. An interviewer who asks "what exactly does the ReLU add?" is looking for this argument.
The toy model of superposition
Elhage et al. (2022) built the smallest model that can exploit sparsity. It compresses features into dimensions with a linear map. It decompresses with the transpose of the same map, adds a bias, and applies a ReLU.
In plain words, each feature gets an arrow in a small space. The hidden vector is the sum of the arrows, each scaled by its feature's value. Each feature is read back by projecting onto its own arrow, adding a bias, and clipping at zero. Entry of the matrix is the dot product , so the readout of feature is
That is the signal, plus interference from every other active feature, plus a bias. The importance stands in for how much the downstream loss cares about feature .
Two details matter. First, the hidden layer has no nonlinearity, so by the section on privileged bases its basis is not privileged. Replacing by for an orthogonal leaves , and hence the model, unchanged. That is why we always look at and at angles between rows, never at single hidden coordinates. Second, the bias lets the model set a feature it does not represent to that feature's mean, and, as we will see, subtract small amounts of interference.
The ReLU is what makes sparsity useful, and the smallest example shows why.
The two arrows point in opposite directions, so we call this arrangement an antipodal pair. The cell reproduces the three cases, with and without the ReLU.
The hand example generalizes into one formula that explains most of this section. When features are very sparse, the inputs with two or more active features are rare, and the loss is dominated by inputs with exactly one feature on. On those inputs only positive overlaps cost anything.
Proof. With only nonzero, the readout formula gives and for . The true value of every inactive feature is 0, so its error is . ∎
The input with every feature off costs , which is zero whenever no bias is positive. So in the sparse limit the loss is a weighted sum of these one-feature-on errors.
In plain words, the first term rewards representing feature , which Elhage et al. (2022) call the feature benefit. The second term charges for interference, but a negative overlap costs nothing, because the ReLU clips it to zero. A negative bias also cancels small positive overlaps. A linear model has no ReLU, so it pays for overlaps of both signs. This is why sparse features push a ReLU model toward arrangements whose overlaps are mostly negative, such as the antipodal pair and the pentagon we will meet below.
Reading a toy model's weights
Before training anything, we need ways to read a trained that do not depend on the arbitrary hidden basis. The first is itself. Its diagonal holds the squared lengths , which say whether a feature is represented at all (about 1 if it is, about 0 if it was dropped). Its off-diagonal entries are the interference weights. The second is a measure of how much of a dimension each feature gets.
Take the antipodal pair again, with rows and . Feature 1 has squared length 1. The total squared weight lying along its direction is from itself plus from feature 2, which is 2. Feature 1 owns half of what lies on its axis, so we say it gets half a dimension. A feature alone on its axis would own all of it, one full dimension.
In plain words, the numerator says how strongly feature is represented. The denominator says how much total weight, feature 's own included, lies along feature 's direction. A feature alone on its axis gets . Every represented feature has , so roughly counts the represented features. So is the number of dimensions divided by the number of features stored. Rotations of the hidden space change neither quantity. Scaling every row by the same factor leaves unchanged but changes .
How do these numbers add up across features? The answer needs one more term. A set of directions is a tight frame if it spreads evenly over the space, so that every unit direction receives the same total squared weight, . In matrix form that is . An antipodal pair, a regular pentagon in the plane, and a regular tetrahedron in three dimensions are all tight frames.
∂ Proof that the dimensionalities add up to at most m
Let . The denominator of is . Assume first that is invertible. For a unit vector , the Cauchy-Schwarz inequality applied to and gives , so . Therefore
If has rank , every row lies in the -dimensional row space of , and the same argument inside that subspace gives . For a tight frame the denominator is . Taking the trace of gives , which is for unit rows, so . ∎
Equality in the Cauchy-Schwarz step holds exactly when is parallel to , that is, when every feature direction is an eigenvector of . Tight frames satisfy this. It is the precise version of the observation in Elhage et al. (2022) that the dimensionalities add up to when features are packed efficiently.
In plain words, a model has dimensions to hand out and never hands out more. When features are packed as evenly as possible, each gets an equal share.
Read a toy model's weights
Write three functions that read a toy model's weights W, an array of shape (n, m) with one row per feature.
interference(W)returns the matrix with its diagonal set to zero, so that only the overlaps between different features remain.feature_dims(W)returns the vector of dimensionalities , with for a zero row.dims_per_feature(W)returns .
Two features in one dimension, solved exactly
The hand example showed that the antipodal pair is perfect when at most one feature is active. When is that worth the cost of the times both are on? With two features and one hidden dimension we can answer exactly.
Let feature 1 have importance and feature 2 importance . Relabeling the features swaps their roles, so we may take , which makes feature 2 the less important one. The two features are independent, each 0 with probability and otherwise uniform on , with density .
We need three moments of one feature. With probability it is a variable , with and , and otherwise it is 0. So
Now compare two candidate solutions.
Dedicated. Give feature 1 the dimension, , with . Then is always exact. Feature 2 is not represented, so , a constant. The best constant under squared error is the mean, , and its error is the variance. The loss is
With instead, the loss would be , which is worse. The bias is part of the solution.
Antipodal. Take and . When at most one feature is on, the output is exact, as in the hand example. Both are on with probability . Say . Then , so and . Both errors equal , and the weighted squared error is . The case is the mirror image.
For two independent uniforms, , so the minimum has density on and
So the loss is
Antipodal wins when . Divide by and multiply by 12 to get , that is, .
In plain words, store the second feature on top of the first, pointing the other way, whenever the features are sparse enough that they are seldom on together. For equal importance the switch is at density , that is, . For it is at (), and for at (). The less a feature matters, the sparser it must be to earn a share of the dimension.
The cell checks both formulas by computing the expected loss exactly. It splits on which features are on (both, only one, or neither) and integrates each case on a fine grid. Then it asks a numerical optimizer for the best it can find, starting from each candidate.
The formulas match to four decimals. The optimizer adds a caveat. At , it finds a loss of 0.0763, below both candidates, with and small positive biases . When both features are on, the antipodal readout comes out too small, and the positive bias lifts it. That costs a little when a feature is off or alone. The two candidates explain the shape of the answer, and the full optimum refines it.
The change from one solution to the other is abrupt. At the best shrinks from about at density 0.32 to about at 0.385, and then jumps to exactly 0 by 0.39. Physics calls this a first-order phase change. The optimal loss is the smaller of two smooth curves, so the loss itself is continuous. Its slope jumps where the curves cross, and the optimal weights jump with it.
The widget draws the whole plane of densities and importances. Its shading shows which of three candidates wins in closed form, keeping feature 1, keeping feature 2, or the antipodal pair. The line is the boundary from the theorem. The dots mark where the best solution an optimizer finds drops a feature. At the ring you drag, the side panel compares the losses and weights of the closed-form winner with those of that best solution.
This derivation is a favorite interview question, because it fits on a whiteboard and tests probability, optimization, and judgment at once. The judgment part is saying that it compares candidate solutions, not all solutions.
The two-feature phase boundary
Work out the two-feature, one-dimension toy model in closed form. The two features are independent, each 0 with probability and otherwise . Feature 1 has importance 1 and feature 2 has importance , for any .
expected_losses(S, I)returns the pair (dedicated loss, antipodal loss), the expected weighted squared errors of two solutions. The dedicated solution gives the dimension to the more important feature, with weight 1 and bias 0, and outputs the other feature's mean through its bias. The antipodal solution is with .boundary_density(I)returns the density below which the antipodal solution has the smaller loss.
The setup provides mc_two_feature_losses(S, I), a Monte Carlo estimate of both losses with standard errors, to compare against.
Watching superposition form
Two features in one dimension fit in a box of algebra. For more features we train the model, and training needs the gradient. The gradient of the toy model is a classic interview problem, because is used twice, once to encode and once to decode, and the chain rule has to collect both uses.
Forward and backward of the toy model
Write toy_loss_and_grads(W, b, X, I). The inputs are a batch X of shape (B, n), weights W of shape (n, m), a bias b of shape (n,), and importances I of shape (n,). The model is , and the loss is .
Return (loss, dW, db), where dW is and db is . Use no loops and no autograd. The trainer in the next cell contains one solution, so try this first.
The trainer below runs four models at once, with a leading batch dimension on every array. It uses Adam (§0.6) and keeps the best of the four runs, since small toy models often settle in worse arrangements. Our first experiment is the one in Elhage et al. (2022), five features of equal importance in two dimensions at density 0.05.
Now play with it. The widget trains the same model in your browser, four runs at a time, and replays the training of the best one. Watch features appear as the density falls, and see how unequal importances deform the picture.
Next comes the larger experiment of Elhage et al. (2022), twenty features in five dimensions with importances . Feature 0 matters most, and feature 19 matters about as much. We train one model at each of four densities and show .
At density 1 the model behaves like the linear model of the theorem above. It represents exactly the five most important features, orthogonally ( is a identity block), with . It sets the other features to their means through positive biases. As the density falls, the count of represented features grows to 8, 9, and 10, and drops to 0.62, 0.55, and 0.48. Off-diagonal blocks appear in . The most negative bias goes from 0 to about , as the model pays to filter interference.
Which features share? Computing for these runs with the functions of Exercise 23.5a answers it. At density 0.3, features 0 and 1 still have , while features 2 to 7 have between 0.44 and 0.55, mostly antipodal pairs. At density 0.1 only feature 0 keeps a dimension of its own. At 0.03 all ten represented features have , five antipodal pairs. So the features that enter superposition first are the less important ones. That ordering is the two-feature theorem again. A feature of small importance must be sparse to earn a share of a dimension, and the important features keep a dimension of their own as long as they can.
What about many equal features? Elhage et al. (2022) trained features into dimensions and plotted against sparsity. It does not fall smoothly. It sits at 1, then at over a wide range, and the weights show why, since they are antipodal pairs. Beyond that it keeps falling, and the individual cluster at a few special values.
The PyTorch version below sweeps the density for fifty equal features in five dimensions and prints , so you can see the plateau at one half.
In our run, is 1.02 at density 1 and 0.89 at 0.66. It is 0.505 and 0.490 at densities 0.43 and 0.29, where exactly ten rows (five antipodal pairs) are represented. It then falls through 0.35, 0.28, and lower as more features crowd in.
The run also shows why is the right measure when features are dense. At density 1 only two rows have norm above 0.5, yet . With equal importances and dense data, one five-dimensional subspace of feature space is nearly as good as any other. So the model spreads its capacity over many features with small weights, rather than choosing five of them. Counting rows assumes that the model singles out individual features, which it need not do when they are dense. counts the dimensions in use, whichever directions the model chose.
How much interference, and what the bias does
The toy models are small. How large is interference in a layer the size of a real model's? Suppose features have random unit directions in . Feature is off, and other features are on, with values . Feature 's readout before the ReLU is then pure interference, . It is a sum of small random cosines, each scaled by its feature's value.
Proof. Each cosine has mean 0 by symmetry. Its variance is , because the squared coordinates of a uniform unit vector have equal means that sum to 1 (§1.3). The terms are independent, each with mean and variance , so the variances add to . ∎
For features of value 1, . For the toy's values, . The cell checks both, and then computes the numbers for the real-scale example below.
This is where the bias earns its place. The ReLU deletes interference that comes out negative. Interference that comes out positive passes through, unless the bias is negative enough to cut it off. A negative bias turns the readout into . That is a threshold detector, which reports feature only when its projection clears . The cost is that true activations below are lost, and those above are shrunk by . The model offsets the shrinkage by lengthening , as the pentagon showed.
In practice, is the number to carry into a design review. It says how many features a layer can keep active at once before readouts drown. An interviewer may hand you , , and a firing rate and ask for it.
Superposition is compressed sensing with a cheap decoder
The toy model solves a compression problem. The hidden vector is linear measurements of an -dimensional sparse vector, and the decoder must recover from them. Recovering a sparse signal from few linear measurements is the subject of compressed sensing, a major line of applied mathematics since the mid-2000s.
Without sparsity, recovery is impossible. With measurements, there is an -dimensional set of inputs that measure to zero (the null space), and any two inputs that differ by such a vector look identical. Sparsity changes this. If two -sparse vectors had the same measurements, their difference would be a -sparse vector in the null space. So every -sparse vector is determined by its measurements exactly when every rows of (columns, in the usual column notation) are linearly independent, which needs .
Finding the vector by trying every possible set of active features is a combinatorial search. The remarkable fact is that a convex program finds it. Among all vectors with the right measurements, pick the one with the smallest sum of absolute values, the norm. This program is called basis pursuit.
How does the toy decoder compare with minimization? It is exactly one step of the standard iterative algorithm for it. For nonnegative signals, the penalized form of the problem is , where trades fit against sparsity.
Proof. At the gradient of is , so the gradient step gives . The nonnegative shrinkage subtracts and clips at 0. ∎
So the toy model decodes by correlating once and thresholding once, with no further iterations. The correlation step leaves every bit of interference in place, and only the threshold removes any of it. Iterating would subtract the interference that the current estimate explains, which is how ISTA converges to the solution. Stopping after one step is why the toy needs much sparser features than compressed sensing does. The step size is also off. The standard convergence guarantee for ISTA asks for a step , where is the largest singular value. For unit rows, , so the toy's unit step is larger than the safe one.
The cell shows the gap. It uses random measurement matrices and nonnegative -sparse signals. It compares exact recovery by basis pursuit with the best one-step decoder we can give the toy, which correlates once and keeps the largest entries. That decoder is even told the true , which the toy is not.
With 24 measurements of 64 features, minimization recovers every 1- to 4-sparse signal in these trials and 95 percent of the 6-sparse ones. The one-step decoder already fails on a third of the 2-sparse signals, and on every signal from on. Compressed sensing says the information survives the compression. The toy model says how much of it a single ReLU layer can extract, and the answer is much less.
This also frames §23.6. A sparse autoencoder learns an encoder , trained so that its sparse code reconstructs the activations through a dictionary of directions. Its encoder again correlates once and thresholds once, but with learned weights that need not be the transpose of the dictionary. It does sparse recovery with a trained network in one pass, instead of with an iterative solver for each input. Neuroscience met the same problem for natural images and solved it with sparse coding (Olshausen and Field 1996). An interviewer will ask how superposition relates to compressed sensing and why the toy needs more sparsity. The one-step-of-ISTA theorem is the answer.
Sparse recovery with ISTA
Write the three pieces of ISTA for , in the column notation of compressed sensing. Here has shape (m, n) and has shape (m,), and the signal may have either sign.
soft_threshold(u, t)returns elementwise. It shrinks every entry toward zero by .ista(Phi, y, lam, steps)starts at . Each step is a gradient step of size , with the largest squared singular value, followed by soft-thresholding at .recovery_rate(n, m, k, trials, rng, lam=0.01, steps=1000, tol=0.1)runstrialsrandom trials. Each draws with independent entries and a -sparse with standard normal nonzeros on a random support, then runs ISTA on . Return the fraction of trials with .
Correlated features, computation, and memorization
Everything so far assumed independent features. Real features are often correlated (fur, ears, and eyes appear together) or anticorrelated (a token is French or Korean, rarely both). Elhage et al. (2022) modeled both. In a correlated set, one random draw decides whether all of the set's features are on together. In an anticorrelated set, the set is active with probability , and then exactly one of its features, chosen at random, is on. Their findings are empirical but consistent, and the readout formula makes each one easy to understand.
- Correlated features prefer to be orthogonal. They are often on together, so any overlap between them is paid for often. A model in superposition overall can still give a correlated group a nearly orthogonal local basis. So within one context, a layer may look free of superposition.
- When there is no room, correlated features collapse onto their principal component. Two correlated features and get one shared direction that encodes . That is what principal component analysis, and so a linear model, would do.
- Anticorrelated features prefer to share a direction with opposite signs. They are never on together. So the negative interference between them, which the ReLU deletes, costs nothing, and an antipodal anticorrelated pair is reconstructed exactly.
The next exercise has you build both distributions and check these findings, in trained weights and in the loss itself.
Correlated and anticorrelated features
Write sample_pairs(rng, B, n_pairs, S, mode). It returns a batch of shape (B, 2 * n_pairs) in which features and form pair .
- With
mode="correlated", one draw per pair decides whether both members are on (probability ). Each active member gets its own value. - With
mode="anticorrelated", the pair is active with probability . Then exactly one member, chosen with probability one half each, gets a value.
Then write pair_geometry(W, pairs, tol=0.2), which labels each pair by how rows and of W sit and returns a list of labels, one per pair, in order. A pair's label is "absent" if either row has norm below 0.1. Otherwise it is "parallel", "antipodal", or "orthogonal" when the cosine of the two rows is within tol of , , or , and "other" if none applies.
The setup provides fit_toy_model and weights it trained (best of three restarts at ) on two correlated pairs, on two anticorrelated pairs, and on four correlated pairs in two dimensions. After the tests pass, try fit_toy_model(lambda r, B: sample_pairs(r, B, 2, 0.9, "anticorrelated"), 4, 2) with several seeds, and see how often plain training finds the best arrangement.
In the four-pair weights, each correlated pair shares one direction of length about 0.7, close to . That is the collapse onto the principal component, and the four shared directions form two antipodal pairs. Plain training on anticorrelated pairs often stops in the orthogonal arrangement, with a small positive loss, instead of the exact antipodal one. The toy's loss has many local minima, which is also why the cells keep the best of several runs.
The toy model so far only stores and retrieves. Can a network compute while in superposition? Elhage et al. (2022) trained a model with a ReLU hidden layer and separate encoder and decoder weights to output for sparse inputs in . The task needs the nonlinearity, since takes two neurons per feature without superposition. With 100 features, 40 neurons, and sparse enough inputs, the model computed absolute values for more features than it had neurons.
Here the hidden ReLU makes the neuron basis privileged, so features tend to line up with neurons. With dense features each neuron carries one feature. Once features are sparse, many neurons carry one primary feature with a large weight plus secondary features with small weights. Such a neuron's strongest activations all come from its primary feature, while its weaker activations are polysemantic, which is what researchers report for many real language-model neurons.
This led the authors to the hypothesis that motivates §23.6. A real network may be "noisily simulating" a much larger and sparser network, computing on far more features than it has neurons. How far computation in superposition extends is much less understood than storage.
Are real models in superposition?
The toy model proves that superposition can happen and shows what it looks like. Whether real networks use it has to be argued from indirect evidence, since we do not know their true features. Four lines of evidence point the same way.
- Polysemantic neurons are common. The neuron that mixes citations, dialogue, HTTP, and Korean, and InceptionV1's cat-and-car neuron, are typical, not exceptions. The image-text model CLIP has multimodal neurons that respond to one concept across photos, drawings, and written text (Goh et al. 2021). The typographic attacks of §30.6, which fool CLIP with a handwritten label, exploit them.
- Sparse probing finds superposition in early layers and dedicated neurons later. A sparse probe is a linear probe allowed to use only neurons, so varying measures how many neurons a feature needs. Gurnee et al. (2023) trained such probes on the MLP neurons of seven models, from 70 million to 6.9 billion parameters, for over 100 features in 10 categories. Early layers represented many features as sparse combinations of neurons, which is superposition. Middle layers had seemingly dedicated neurons for higher-level features of the context. On average, representations became sparser with scale.
- Sparse dictionaries recover far more features than neurons. A sparse autoencoder trained on the 512 neurons of a one-layer model's MLP found interpretable features at every dictionary size up to 131,072 (Bricken et al. 2023). Dictionaries of up to 34 million features extract interpretable directions from the middle-layer residual stream of a frontier model, Claude 3 Sonnet (Templeton et al. 2024). §23.6 gives the numbers and the caveats.
- Basis alignment is a training artifact, not a necessity. The privileged-basis experiments above show residual streams with no architectural reason for special coordinates. That is the setting in which features are free to take any direction.
What the evidence does not show is the toy model's exact structure. Its clean polytopes, pentagons and tetrahedra, have not been shown to organize the features of a large language model. Real features are not independent, not uniformly distributed, and not equally sparse, and some are not one-dimensional at all.
The circular day and month features of Engels et al. (2024), which §23.2 met as a counterexample to the linear representation hypothesis, are the clearest case. Each lives on a circle in a two-dimensional subspace and is used for arithmetic that wraps around, such as "two days after Friday". Gurnee et al. (2025) found that Claude 3.5 Haiku tracks the character count of a line, which it needs to decide where to break fixed-width text, on a curved one-dimensional manifold. That manifold can equally be read as a family of discrete features. Multidimensional features break the one-feature-one-direction picture that the toy model assumes, and they are a live research question.
What the toy model leaves out, and how to read a layer
The toy is a model of storage, with independent one-dimensional features and a one-step decoder. Every one of those assumptions fails somewhere in a real Transformer. Features are correlated and hierarchical, and some are multidimensional. Most of what a layer does is computation rather than reconstruction. The decoder is the rest of the network, many layers deep. The definition of a feature is open. And the toy is trained to reconstruct its input, while a language model's layers are trained only for what they contribute to next-token loss. So the importance of a feature is something the network chooses, not a number we set.
What the toy gets right is the logic, and that logic decides how to study a layer. If a layer is in superposition, its natural units are directions, not neurons, and there are more of them than dimensions. The table compares the units an interpreter can choose.
| Unit of analysis | Basis it reads in | Needs labels? | Handles superposition? | Main failure mode | Where |
|---|---|---|---|---|---|
| Single neuron | The neuron basis (privileged in MLPs only) | No | No, a polysemantic neuron mixes features | Top activations show one feature and hide the rest | This section, §23.1 |
| Supervised direction (probe, difference of means) | A direction we choose by training on a labeled concept | Yes | Partly, it finds one known feature among many | Finds decodable information the model may not use | §23.2 |
| Dictionary feature (sparse autoencoder) | An overcomplete set of learned directions | No | Yes, by design | Reconstruction error, dead and split features, seed dependence | §23.6 |
| Subspace or manifold | A low-dimensional subspace found by a method | Usually | Yes, for multidimensional features | Hard to find without knowing what to look for | Open research (Engels et al. 2024) |
Superposition also changes engineering decisions.
- Pruning. Removing a neuron removes a little of many features rather than one feature.
- Quantization. The few large coordinates that training produces have to be protected (§20.2).
- Steering. Pushing the activations along one feature's direction (§23.7) also nudges every feature that interferes with it.
- Disentanglement. A variational autoencoder trained with a heavier penalty on its latent code tries to give each factor of variation its own latent (§32.4). That is a different goal from finding features in superposition, since there are more features than latents. A vector-quantized code (§32.5) is the extreme case of a sparse dictionary, with exactly one active element at a time.
Read more
- Elhage et al. (2022). Toy Models of Superposition. The toy model, the two-feature phase diagram, uniform polytopes and sticky fractions, correlated features, computation in superposition, and the adversarial link (interactive version at transformer-circuits.pub).
- Olah et al. (2020). Zoom In: An Introduction to Circuits. Polysemantic neurons in InceptionV1 and the first use of the word superposition for features spread across neurons.
- Elhage, Lasenby, and Olah (2023). Privileged Bases in the Transformer Residual Stream. The kurtosis test for basis alignment and the experiments that point at Adam.
- Henighan et al. (2023). Superposition, Memorization, and Double Descent. The toy model on finite data, where memorization means storing data points in superposition.
- Gurnee et al. (2023). Finding Neurons in a Haystack: Case Studies with Sparse Probing. Sparse probes over seven models showing superposition in early layers and dedicated neurons in middle layers.
- Engels et al. (2024). Not All Language Model Features Are One-Dimensionally Linear. Circular features for days and months, and a definition of irreducible multidimensional features.
- Candès, Romberg, and Tao (2006). Robust Uncertainty Principles: Exact Signal Reconstruction from Highly Incomplete Frequency Information. Exact recovery of a sparse signal from a small random set of its Fourier coefficients by minimization, one of the papers that founded compressed sensing.
- Donoho (2006). Compressed sensing. The companion founding paper that named the field, showing that a few nonadaptive measurements of a compressible signal allow near-optimal reconstruction by minimization.