Skip to content

Toy Models of Superposition

main track #8corefundamentalpaperrubric 11/122022 · ~60 min

Nelson Elhage, Tristan Hume, Catherine Olsson, …, Christopher Olah

Status

TL;DR. The authors train tiny autoencoders that squeeze n sparse features into m < n dimensions and reconstruct them through a ReLU. A linear model just keeps the top m features. The ReLU model instead stores many more features in superposition, as nearly-orthogonal directions that interfere a little. Whether a feature gets its own dimension, is superposed, or is dropped changes through sharp phase changes. The superposed features arrange themselves into regular shapes: antipodal pairs, triangles, pentagons and tetrahedra.

Why it matters now. Superposition explains why neurons in LLMs are polysemantic and why you cannot just read off neurons. It is the main motivation for sparse autoencoders, transcoders and attribution graphs. For IR, it is a useful lens on dense embeddings, which must hold far more concepts than they have dimensions.

Each input feature is xi=0x_i = 0 with probability SS (the sparsity), and otherwise uniform on [0,1][0,1]. Each feature has an importance IiI_i. The model and loss are

x′=ReLU(W⊤Wx+b),L=∑x∑iIi (xi−xi′)2,x' = \mathrm{ReLU}(W^\top W x + b), \qquad L = \sum_x \sum_i I_i \,(x_i - x'_i)^2,

where W∈Rm×nW \in \mathbb{R}^{m \times n} and column WiW_i is feature ii‘s direction. Group the expected loss by how many features are active:

L=(1−S)nLn+⋯+(1−S)Sn−1L1+SnL0.L = (1-S)^n L_n + \dots + (1-S)S^{n-1} L_1 + S^n L_0 .

As S→1S \to 1, the 1-sparse term L1L_1 dominates. It splits into a feature-benefit term that rewards representing feature ii and an interference term:

∑j≠iIj ReLU((Wj⋅Wi) xi+bj)2.\sum_{j \ne i} I_j\, \mathrm{ReLU}\big((W_j \cdot W_i)\, x_i + b_j\big)^2 .

The ReLU makes negative interference free, so features prefer to point away from each other. A small negative bias also clips small positive interference.

To measure how much of a dimension a feature gets, the paper defines feature dimensionality:

Di=∥Wi∥2∑j(W^i⋅Wj)2.D_i = \frac{\lVert W_i \rVert^2}{\sum_j (\hat W_i \cdot W_j)^2}.
Toy Models of Superposition: the ReLU output model and the geometry of features in a small hidden space Left: n sparse input features are compressed to m hidden dimensions by W and reconstructed with ReLU of W-transpose W x plus b, trained with an importance-weighted squared error. Right: three ways to place feature directions in a two-dimensional hidden space. With dense features the model keeps only two features on orthogonal axes, each with dimensionality one. With sparse features two features can share one axis as an antipodal pair, each with dimensionality one half, and five features can sit on a pentagon, each with dimensionality two fifths. Bottom: the sticky dimensionality values observed, from tetrahedron three quarters down to square antiprism three eighths. ReLU output model x ∈ ℝⁿ sparse h ∈ ℝᵐ m < n x′ ∈ ℝⁿ W Wᵀ x′ = ReLU(WᵀWx + b) L = Σₓ Σᵢ Iᵢ (xᵢ − x′ᵢ)² xᵢ = 0 with prob. S, else uniform in [0, 1] Iᵢ = importance of feature i Columns Wᵢ in a 2-D hidden space dense: 2 features D = 1 each antipodal pairs: 4 D = 1/2 each pentagon: 5 D = 2/5 each dense (S = 0) sparse (S → 1) more features per dimension as sparsity grows Dᵢ = ‖Wᵢ‖² / Σⱼ (Ŵᵢ · Wⱼ)² sticky values: 3/4 tetrahedron, 2/3 triangle, 1/2 antipodal, 2/5 pentagon, 3/8 square antiprism, 0 not learned
Original sketch. Left: the ReLU output model compresses n sparse features to m dimensions. Right: dense features get orthogonal axes (D = 1); sparse features share space as antipodal pairs (D = 1/2) or a pentagon (D = 2/5).
  • Linear vs ReLU (n = 20, m = 5, Ii=0.7iI_i = 0.7^i). The linear model learns the 5 most important features. The ReLU model represents more and more features in superposition as sparsity rises.
  • Phase diagrams. For 2 features in 1 dimension, and 3 in 2, both trained models and closed-form solutions show sharp regime boundaries over sparsity × relative importance.
  • Uniform geometry (n = 400, m = 30). D∗=m/∥W∥F2D^* = m / \lVert W \rVert_F^2 sticks at 1 and ½. Individual features cluster at the polytope values listed above. At density 0.05 with uniform importance, n = 5, m = 2 gives a regular pentagon, which deforms as one feature becomes sparser.
  • Bias and norms. Features in superposition use a slight negative bias and set ∥Wi∥=1/(1−bi)\lVert W_i \rVert = 1/(1-b_i) to compensate.
  • Adversarial link. Vulnerability to adversarial examples rises sharply (by more than 3×) as superposition forms.
  • Computation. A toy that computes absolute value (n = 100, m = 40, Ii=0.8iI_i = 0.8^i) shows that models can compute in superposition, not just store.

The data are synthetic and assume independent features, uniform marginals and linear one-dimensional features. Real activations have correlated features, heavy-tailed frequencies and many layers. The paper itself flags that the polytope results may be “too elegant to be true” for real models. Open questions include:

  • how to measure superposition in a real network without a ground-truth feature list;
  • whether computation in superposition scales;
  • how much interference real models tolerate.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Using the feature dimensionality Dᵢ = ‖Wᵢ‖² / Σⱼ (Ŵᵢ · Wⱼ)², compute Dᵢ for (a) a feature on its own orthogonal axis, (b) one half of an antipodal pair, and (c) one vertex of a regular pentagon of unit vectors in 2-D. Then check your pentagon answer against the uniform-case quantity m / ‖W‖²_F.

    What a strong answer covers
    • (a) Only j = i contributes: Σ = ‖Wᵢ‖² so Dᵢ = 1.
    • (b) Wⱼ = −Wᵢ adds (Ŵᵢ · Wⱼ)² = 1 for unit vectors, so Σ = 2 and Dᵢ = 1/2.
    • (c) Five unit vectors at 72° spacing: Σₖ cos²(2πk/5) over k = 0..4 equals 5/2 (cos² averages to 1/2), so Dᵢ = 1 / (5/2) = 2/5.
    • Check: m = 2 and ‖W‖²_F = 5 for five unit columns, so m/‖W‖²_F = 2/5, matching; these are the "sticky" values seen in training (1, 1/2, 2/5).
  2. Derive / compute

    Write the toy model's loss on 1-sparse inputs (only feature i active, with value xᵢ) for the ReLU output model x′ = ReLU(WᵀWx + b). Split it into a "feature benefit" term and an "interference" term, and use it to explain why ReLU makes negative interference free and why a negative bias helps.

    What a strong answer covers
    • With only xᵢ active, x′ᵢ = ReLU(‖Wᵢ‖² xᵢ + bᵢ) and for j ≠ i, x′ⱼ = ReLU((Wⱼ · Wᵢ) xᵢ + bⱼ).
    • L₁ = Σᵢ E[ Iᵢ (xᵢ − ReLU(‖Wᵢ‖² xᵢ + bᵢ))² + Σⱼ≠ᵢ Iⱼ ReLU((Wⱼ · Wᵢ) xᵢ + bⱼ)² ]: the first part rewards representing feature i, the second penalises leaking into other outputs.
    • If Wⱼ · Wᵢ < 0 and bⱼ ≤ 0, the ReLU clips the leak to zero, so negative interference costs nothing; this is why antipodal pairs are cheap.
    • A negative bⱼ also clips small positive interference; the model compensates by scaling ‖Wᵢ‖ = 1/(1 − bᵢ) so the true feature still reconstructs. The interference term then resembles a generalised Thomson problem of packing points on a sphere.
  3. Mechanism

    Explain why the linear model x′ = WᵀWx + b never uses superposition, while the ReLU model does as sparsity increases. Use the n = 20, m = 5, Iᵢ = 0.7ⁱ experiment.

    What a strong answer covers
    • In the linear model every interference term (Wᵢ · Wⱼ)² is paid in full regardless of sign or sparsity, so the optimum is to represent the m most important features orthogonally, like PCA, and drop the rest.
    • In the ReLU model, sparse inputs mean features rarely co-occur, so interference is rarely paid, and negative interference is clipped.
    • As sparsity rises, the ReLU model first adds features in antipodal pairs, then other structures, representing more than m features at the cost of some interference.
    • Importance decides the order: the most important features keep dedicated dimensions longest; less important ones are superposed or dropped first.
  4. Critique

    The paper is careful to call its results "toy". Name three ways real language-model activations differ from the toy setting, and for each say whether you would expect more or less superposition, or a different geometry.

    What a strong answer covers
    • Real features are not independent. The paper's correlation experiments show that correlated features prefer to be orthogonal and, when space runs out, collapse into their principal component, while anti-correlated features prefer to share space with negative interference.
    • Real features vary hugely in sparsity and importance; the uniform polytope results rely on uniform importance and sparsity.
    • Real models compute in superposition through many nonlinear layers and attention, not a single reconstruct-the-input step; the toy computation (absolute value) is only a hint.
    • Features may not be one-dimensional or linear; the linear representation hypothesis is assumed, not tested, in the toy.
  5. What if…

    The 2-features-in-1-dimension experiment shows a phase diagram over sparsity and relative importance. Describe the three candidate solutions and what experimental observation shows the change between them is a true phase change, not a smooth trade-off.

    What a strong answer covers
    • Candidates: W = [1, 0] (drop the extra feature), W = [0, 1] (drop the first feature), and W = [1, −1] (store both as an antipodal pair in superposition).
    • Vary the extra feature's importance (0.1 to 10) and the sparsity of both features.
    • Both the trained models and the closed-form "toy model of the toy model" show the optimal solution jumping discontinuously in weight magnitude and in whether superposition is used.
    • A smooth trade-off would show gradually changing weights; instead the regions have sharp boundaries, like a first-order phase change.
  6. Research idea

    Embedding models for dense retrieval must represent a very large number of sparse concepts (entities, topics, facets) in a few hundred dimensions. Design an experiment that tests whether a bi-encoder stores concepts in superposition and whether that explains retrieval failures.

    What a strong answer covers
    • Train an SAE on the embedding outputs (or final hidden states) to recover sparse concept directions, and measure features per dimension, as in feature dimensionality.
    • Measure interference: cosine similarity between concept directions, and test whether queries that activate rare concepts retrieve documents for interfering concepts.
    • Vary embedding dimension and concept frequency; predict that rare concepts are superposed more and fail more, in line with the importance-sparsity phase diagram.
    • Connect to known limits of single-vector retrieval and compare with multi-vector (late-interaction) models, which have more dimensions per document.

Done with this page?

Status