Superposition: how feature directions share a small space
In what a weight matrix does, we followed inputs through a small neural network. Each row of a matrix read a weighted combination of the inputs, and the resulting numbers became the coordinates of a new vector. Bias and ReLU changed what the next layer received.
We can use those same operations to investigate another question: how can a layer represent more features than it has neurons? Our learned bottleneck experiment investigated two features sharing one signed number. Here we’ll move into a plane, where the angles between several feature directions reveal new kinds of interference.
Imagine five feature strengths, labeled cat, dog, car, tree, and boat. We want to squeeze them into two hidden numbers and then reconstruct the five strengths. Two numbers cannot preserve every possible combination of five independently varying inputs. But suppose most examples contain just one or two active features. Could sharing the two numbers still be useful?
We’ll choose a small matrix by hand and follow its calculations. The geometry will show what causes interference, how a negative bias can remove some unwanted responses, and why larger spaces offer more room for features to coexist. The model’s architecture follows the tied-weight model studied in Toy Models of Superposition. We choose the five feature arrows and input strengths ourselves to make the arithmetic visible; these are not results from a training run.
Five inputs become two hidden numbers
Our inputs are nonnegative strengths, with zero meaning absent. The labels make the example easier to follow: these are synthetic numbers supplied directly to the network, not measurements extracted from photographs.
Put the strengths in a column vector, always in the order cat, dog, car, tree, boat. Cat alone at strength gives
The encoder is a matrix with two rows and five columns:
Each row produces one hidden coordinate. For this input, : two numbers now carry the cat input.
The column view tells us how that happened. Each column specifies where one input feature sends the hidden vector. Call these columns . Then
This is the familiar rule that a matrix builds its output by adding scaled columns. Here each column has an additional interpretation: it is a feature vector, describing how an input feature contributes to the hidden representation.
We chose five unit-length arrows spaced evenly around a circle, with between neighbors. The matrix displays rounded coordinates; calculations below use the exact angles.
Dog at strength , for example, produces approximately . Both hidden neurons respond to that one feature. Cat happens to lie on an axis because we drew it there; rotating all five arrows together would preserve their lengths and pairwise angles.
Five arrows fit easily in a plane. The difficult part is reading their contributions back out.
Why perpendicular directions make readout easier
Before reading all five features, let’s isolate what an angle does in a separate two-feature example. Put the dog direction along the first coordinate and the cat direction along the second:
Both directions have length one. Dog strength and cat strength produce
Reading with the dog direction gives ; reading with the cat direction gives . Each reader recovers its own feature strength because the other feature contributes a dot product of zero.
Now turn only the cat direction to , keeping its length and both feature strengths fixed:
The dog reader returns , although dog strength is still . The extra comes from cat: its strength multiplies the overlap .
In the widget, select , then move toward . Watch the unwanted contribution shrink while the original strengths remain fixed.
Change the angle, keep the feature strengths fixed
Dog strength = 3 · Cat strength = 2 · Both feature directions have length 1
The orange projection shows how much of the cat direction the dog reader picks up. Changing the angle changes that readout, not the original feature strengths.
This is interference in a reader that uses the same direction as the feature being written. It does not mean nonorthogonal directions always lose information. In this two-dimensional example, a different decoder can recover cat strength as , then dog strength as . The two directions are still linearly independent. Why a dot product does not automatically recover a feature develops this distinction.
Orthogonality makes these simple dot-product readers exact. It is not a requirement imposed by the training objective, and it is not available to every feature when we have more features than dimensions. Return now to our five arrows in a plane, where we must manage their overlaps.
Reading along an arrow picks up its neighbors
For the decoder, transpose the encoder matrix:
Transposing turns each feature column into a reader row. Cat’s output is , dog’s is , and so on. Reusing the encoder weights this way is called tying the weights. In the language of read with a key, write with a value, the same hidden-space arrow serves as a writing direction during encoding and a reading direction during decoding. It makes the example easy to inspect, but is not an inverse of ; other architectures can learn different readers and writers.
With cat alone, , so every output has the form
Cat reads its own arrow and returns . Dog’s arrow partly points in the same direction, so dog responds too. Car points mostly the other way and produces a negative response.
| Output | Angle to cat | Raw output, approximately |
|---|---|---|
| Cat | ||
| Dog | ||
| Car | ||
| Tree | ||
| Boat |
Only cat was present, yet all five readers respond. The unwanted responses are interference: one feature affects another feature’s readout.
The dot product explains the signs:
At , the cosine is zero, so neither arrow contributes to the other’s readout. Smaller angles produce positive contributions; larger angles produce negative ones. This is why perpendicular directions are useful here.
But in a two-dimensional space, at most two nonzero vectors can be mutually perpendicular. We cannot give all five features that protection. Orthogonality is a stronger condition than linear independence: cat and dog are linearly independent, yet their angle produces interference. The subspaces article explains the dimension count: we can draw arbitrarily many directions in a plane, but at most two can be linearly independent.
ReLU removes the negative outputs
Our target strengths are nonnegative. Apply ReLU to the raw outputs:
The cat example now reconstructs approximately as
Car and tree disappear from the reconstruction. Cat survives unchanged. Dog and boat remain as false positive responses.
Notice where the nonlinearity sits: ReLU acts on the five decoder outputs. The two hidden coordinates remain signed. Clipping them would change the encoding and erase some of our arrows’ contributions.
ReLU also acts on each output’s total score. It does not inspect the separate contributions and remove every negative one. When several features are active, a negative contribution can reduce a desired positive signal before ReLU sees it. We’ll encounter that limitation shortly.
A negative bias sets a threshold
Dog and boat respond weakly. Could we require a stronger score before allowing an output through?
Add a bias of to each output, then apply ReLU:
Now a raw score must exceed to produce a positive output.
| Output | Raw score | After bias | After ReLU |
|---|---|---|---|
| Cat | |||
| Dog | |||
| Car | |||
| Tree | |||
| Boat |
The threshold removes all four unwanted responses. But cat is now too small: we supplied and recovered .
The bias cannot tell which part of a score we wanted. It subtracts the same amount from cat’s response as from dog’s. This is the cost of using a threshold to suppress interference.
Longer arrows compensate, with another cost
For cat alone, its own raw score is
The length appears twice: once when the encoder writes cat into the hidden space, and again when the decoder reads it. That is why the length is squared.
To recover after subtracting , we need
Suppose we lengthen all five arrows to this value, preserving their directions. Each isolated feature at strength then gets its desired self-response back.
However, the neighboring responses grow too. Dog’s raw response to cat becomes
After the bias, about remains. Lengthening the arrows restores cat, but lets a little positive interference through again.
Nor does this length correct every possible cat strength. With these same weights and bias, cat’s own output is approximately for input , and for input . An isolated cat strength at or below produces no cat output at all: the threshold erases a genuine weak signal. We calibrated the compensation for one strength, .
Training can adjust directions, lengths, and individual biases together. The useful compromise depends on which features occur, their strengths, and the cost of reconstruction errors. There is no single arrow length or threshold that solves every input distribution.
Activate two features and watch their contributions mix
Return to the original unit-length arrows and remove the bias so we can isolate the interference. Activate cat and dog at strength each:
Cat’s reader now measures
Dog’s reader also returns about . Both outputs are too large because each active feature adds a positive contribution to the other’s readout.
Now replace dog with car, keeping both strengths at . Their angle is , so each reads
Both features remain positive after ReLU, but most of their strength has disappeared from the reconstruction. Their sum also produces a false dog response of about : dog’s arrow lies between them. A bias of would suppress the two genuine features completely while leaving that false response positive.
These comparisons explain why which features occur together matters. Nearby arrows can inflate each other’s outputs. Widely separated arrows can suppress them. A threshold that worked for one active feature need not work for a mixture.
Sparse inputs help by limiting how many contributions arrive at once. Here sparsity means few nonzero entries in the five input strengths, not necessarily zeros in the hidden coordinates. Dog alone already uses both hidden coordinates.
Rare features can also be tightly correlated: two features might appear only occasionally but always appear together. Their interference would occur whenever either was present. The learned bottleneck experiment varies frequency and co-occurrence separately to investigate that distinction.
Put all the interference in one matrix
Substituting into the decoder gives
The entry in row , column of is . Diagonal entries measure each feature’s response to itself. Off-diagonal entries measure how one feature affects another’s reader.
For an arbitrary output , the score before ReLU is
This equation collects everything we observed. Length changes the self-response. Angles and lengths determine the cross-responses. The active input strengths determine which terms enter the sum. The bias shifts the total before ReLU clips it.
If all five columns were orthonormal, would be the five-dimensional identity matrix, and the unbiased decoder would reconstruct every input. But our has only two rows, so has rank at most two. It cannot be that identity matrix.
Nonlinearity allows different responses in different regions of the hidden space. It does not remove the bottleneck’s ambiguity: if two allowed inputs produce the same , any decoder receiving only must give them the same answer.
Higher dimensions give us more nearly perpendicular directions
In our plane, neighboring arrows are only apart. What happens if the hidden layer has 1,024 coordinates?
We can then choose 1,024 mutually orthogonal nonzero vectors. We still cannot choose more than 1,024 that are all exactly orthogonal. But approximate orthogonality is much less restrictive.
To see why, we’ll switch from our carefully spaced arrows to randomly chosen directions. This gives us a simple baseline: even without arranging the arrows to avoid each other, high-dimensional geometry makes most pairs nearly perpendicular. Learned directions need not follow this random model.
The dot product adds coordinate-wise contributions. Under this random model, positive and negative contributions tend to cancel. The high-dimensional geometry chapter of Foundations of Data Science develops the connection between random directions, concentration, and random projection.
For independently sampled, uniformly random unit vectors and in dimensions,
The spread of their dot products shrinks as dimension increases. At , the standard deviation is . Since unit vectors’ dot products are their angle cosines, most pairs are nearly perpendicular. Near , that spread corresponds to an angular standard deviation of approximately .
Imagine generating 102,400 such directions: one hundred times as many directions as coordinates. A histogram of sampled pairwise angles would still concentrate around . Having more vectors adds more pairs; it does not change the distribution for an independently chosen distinct pair.
This is a statement about typical pairs. With billions of possible comparisons, some pairs will overlap more strongly. A narrow histogram does not establish that every angle falls within a particular interval.
For an experiment, sampling pairs is enough to estimate that histogram. Constructing the full matrix of pairwise dot products would require over ten billion entries, about 84 GB in float64 before calculating the angles.
Optional: why a ball’s volume concentrates near its boundary
Another high-dimensional effect concerns distance from the origin. If a point is sampled uniformly from the interior of a unit ball in dimensions, the fraction of volume inside radius is , for . The outermost 10% of the radius therefore contains a fraction
of the total volume. At , that is about . Change below to compare it with lower-dimensional balls.
How much volume lies in the outer 10% of the radius?
The bar shows fractions of volume, not a cross-section of the ball. Very small inner volumes may be too narrow to see.
This statement assumes a uniform distribution inside a ball. It does not say that arbitrary model activations lie on a sphere. It also concerns radius, while our feature-interference argument concerns angles between directions. The two concentration effects are discussed in Foundations of Data Science, chapter 2.
Small overlaps can still add up
Suppose feature is absent, while other unit-length feature vectors are active with strength one. Its raw readout is
Under the independent random-direction model, the terms have mean zero and variance . Their signs fluctuate, so their typical accumulated size grows like the square root of the number of terms:
| Other active features | Raw interference standard deviation in 1,024 dimensions |
|---|---|
These numbers describe variability across random constructions for a fixed active set. They are not reconstruction errors after thresholding, worst-case bounds, or measured results from a trained model. Different strengths change the variance to under the same assumptions.
The table makes the roles of dimension and sparsity visible. More dimensions weaken typical individual overlaps. Fewer active features limit how much overlap accumulates. Bias and ReLU then act on the remaining total, trading false positives against weakened or missed true features.
Compare dimensions in the widget below. At 1,000 dimensions, one pair’s dot product has standard deviation about , but summing contributions from 1,000 other active features gives standard deviation . Keep fixed and reduce to see why sparsity matters even when individual overlaps are small. Select 1,024 dimensions to reproduce the table above.
More dimensions, fewer active features
Independent, uniformly random unit directions · Other active features have strength 1
Bars use one linear scale from 0 to 1 and show 1/√d. These are theoretical standard deviations, not sampled angles or bounds on every pair.
Both readouts are standard deviations around zero. The accumulated value is for one absent feature's raw readout before bias or ReLU; it can exceed 1 because it is a sum, not a cosine.
With many inactive features, there are also many opportunities for an unwanted response. Good behavior for one reader does not guarantee good behavior for all readers at once.
Going further: what the Johnson–Lindenstrauss lemma adds
The random-pair observation has a stronger geometric relative. The Johnson–Lindenstrauss lemma says that a finite set of points can be mapped into a space with
dimensions while preserving all pairwise squared distances within multiplicative factors and . The original space may have many more dimensions. A suitably scaled Gaussian random matrix supplies one construction; see these lecture notes on random projection.
To connect this to feature arrows, start with the origin and many orthogonal unit vectors. Each vector is distance one from the origin, and every pair of distinct vectors has squared distance two. Preserve those distances approximately, and the images retain approximately unit length and small pairwise dot products, because
The logarithm means that the number of approximately separated directions can grow exponentially with dimension for a fixed nonzero tolerance, with constants and tolerance determining the rate. It does not give an exact feature capacity for a neural network.
In particular, preserving this finite collection of points does not establish recoverability of every weighted sum of them. The input combinations and the decoder still matter. Our five-arrow example already showed that individually distinguishable features can interfere when combined.
What the two neurons mean
Return to our encoder. Its first hidden coordinate is approximately
A change in this neuron alone does not identify which feature changed. Several features can raise it, and several can lower it. Their effects on the second coordinate provide more context.
This is a concrete way polysemanticity can arise: one coordinate responds to several features. Our five-directions-in-two-dimensions construction also exhibits superposition, although mixed neuron responses alone do not establish that there are more features than dimensions.
We knew the five arrows because we chose them. In a trained model, finding useful feature directions is a separate problem, as is testing what those directions mean. Directions, sparse features, and how sparse autoencoders find them explores how a learned dictionary can recover ingredients from examples. The practical SAE article takes that question to activations collected from a trained network.
To see how an objective selects a representation, return to the geometry learned by the bottleneck experiment. Its trained weights show why feature co-occurrence and the decoder matter. Geometry also needs to be interpreted together with the reader: changing the geometry without changing predictions demonstrates that angles alone do not uniquely determine a model’s behavior.
Our construction makes the geometric opportunity and its cost explicit: a small activation space can hold many candidate feature directions, while the combinations we can read reliably depend on their overlaps, their activity, and the decoder.