Interactive · Interpretability

More features than dimensions

A toy model of superposition in which five features have to share two dimensions.

The puzzle

If every neuron in a network meant one thing, interpretability would be easy: read off the neurons. They don't. Real neurons fire for mixtures of unrelated concepts. One explanation is superposition. The world has more useful features than the model has dimensions, so the model stores them as directions that are almost orthogonal and puts up with some interference between them.

The toy model below is the smallest setting where this happens. An input x has n features. It is squeezed into m = 2 hidden dimensions and then reconstructed:

h = W x  ·  x′ = ReLU(Wᵀ h + b)

Each column Wi is a 2D arrow: the direction where feature i lives. The loss is reconstruction error weighted by each feature's importance. We have two controls here: density, which is how often each feature is non-zero, and importance, which decays from feature 1 to feature n.

features

Feature directions, the columns of W

WᵀW and bias b

Probe: switch on one feature (xi = 1, others 0) and read the output

Training runs live with Adam, about 4,000 steps on batches of 512. Arrow shade shows importance; darker arrows are more important. Each setting change trains a fresh model. Some runs get stuck with a dead feature; retraining usually fixes it.

What to try

  1. Dense (density 1). The model keeps the two most important features at right angles and drops the rest. This is just PCA. WᵀW has two bright diagonal cells.
  2. Drag density down. Around 0.1, a third and fourth feature appear. They point in opposite directions to the existing ones (antipodal pairs). Two features on one line interfere only when both are active, which is rare.
  3. Very sparse (0.03 or below). All five spread into a pentagon 72° apart. WᵀW gains off-diagonal entries; that is the interference.
  4. Probe a feature in the pentagon. Its neighbours light up slightly. Features pointing the other way get a negative pre-activation, and the negative bias plus ReLU clips it to zero. The nonlinearity makes this work. Without the ReLU, no superposition.
  5. Steep importance (0.5). Even when sparse, the model may still ignore the least important features. Superposition happens only when a feature is worth the interference it adds.

A bigger sweep

The same experiment with 20 features in 5 dimensions. Each point is a fresh model trained in your browser at one density. A feature counts as stored if ‖Wi‖ > 0.5.

n = 20, m = 5, importance 0.9i, 3,000 steps per model. When dense, the model stores 5 features, one per dimension. When sparse, it stores all 20, at about a quarter of a dimension each. Hover a point for dimensions per feature, m / ‖W‖²F.
DensityFeatures storedDims per feature

Why it matters

If real models do this at scale, individual neurons are the wrong unit of analysis. A neuron is a basis direction, and features need not line up with the basis. That is the motivation behind sparse autoencoders and dictionary learning: they try to recover the overcomplete set of feature directions that the model packed into its activations.

Based on Elhage et al., Toy Models of Superposition, Anthropic, 2022. The model, loss and metrics follow the paper; the training code is ~100 lines of plain JavaScript in model.js.