↑↓ move Enter open ⌘K find from any page 256 of 256 tabs
Loading the recording…

Why neurons are not enough

A language model's residual stream is a vector of a few thousand numbers per token, 2,304 for Gemma 2 2B. One would like each number, or each MLP neuron, to stand for one thing, but most respond to many unrelated contexts. The superposition hypothesis explains why: a model can represent far more features than it has dimensions if each feature is a direction, the directions are nearly orthogonal, and only a few features are active on any one token. Elhage et al. reproduced this in small toy models trained on sparse inputs.

If that is how the stream is organised, the features can be recovered by dictionary learning: find an overcomplete set of directions such that every activation vector is a sparse, non-negative combination of a few of them. A sparse autoencoder (SAE) learns that dictionary. This page runs one of Google DeepMind's Gemma Scope SAEs, 16,384 features wide, on the stream after block 12 of Gemma 2 2B (the 13th of 26 blocks, counting from 0), for four prompts and a sample of 24,576 WikiText-2 tokens.

Encoder: which features are on

The encoder maps the residual vector to one pre-activation per feature and keeps only those above that feature's own threshold , a JumpReLU:

A plain ReLU would keep every positive , and a small positive value is usually noise. The Encoder · JumpReLU panel shows the gap: on each token several hundred pre-activations are above 0 (between 561 and 1,369 over the prompts' tokens) but only tens clear their thresholds. The bars give the largest pre-activations with each feature's as a tick, including near misses that stay under it.

The number of active features is the L0. It varies from token to token, from 9 to 158 on these prompts, with a mean of 69.6; the Features on (L0) chart draws it along the prompt. The beginning-of-sequence token is left out because Gemma Scope's SAEs were not trained on it.

Decoder: putting the vector back

Each feature owns a decoder direction of unit length, and the reconstruction is the sum of the active ones, scaled by their activations, plus a bias:

The Decoder · back to 2304 numbers heat map draws , , the error , the largest terms and as rows of 2,304 numbers on one colour scale. Below it the page reports and the cosine of with ; over the prompts' tokens the relative error ranges from 3 % to 53 %, so a part of the stream is left unexplained.

Training balances the two goals: reconstruct well and use few features. JumpReLU SAEs penalise the count itself,

which has no useful gradient, so Rajamanoharan et al. train with straight-through estimators. This SAE's file name, average_l0_82, records the average L0 it reached in Gemma Scope's own evaluation.

Does the reconstruction keep what matters?

A small error can still remove exactly what the later blocks need, so the page also splices into the model in place of and lets blocks 13 to 25 run on it. The model on x̂ compares the next-token candidates with the real residual and with , and the strip draws both ways along the prompt. Averaged over the four prompts the next-token loss is 2.14 nats clean and 2.10 with : on these prompts the reconstruction keeps what the rest of the model uses, though four prompts are too few to measure the cost precisely. Gemma Scope measures it on far more text, as the rise in loss when every token is spliced.

What one feature means

An SAE feature has no name, only behaviour. The Which followed features fire where strip follows the three strongest features of each prompt, twelve in all, over every token: most rows stay white on the other prompts, because each fires on a few tokens and is off elsewhere. The feature card then shows what the recording knows about one of them: on what share of the WikiText-2 sample it fires (under 3 % for most of the followed features, above 40 % for two, and never for one), the paragraphs where it fires hardest, shaded by its activation, and What its direction pushes: its decoder direction read through the unembedding, the tokens it raises and lowers if nothing after block 12 changed it.

Naming a feature from such evidence is interpretation, and the page leaves it to the reader. Cunningham et al. scored features by how well a language model could predict their activations from a written explanation; Bricken et al. checked them by hand and by intervening on them. Either way, a feature is a hypothesis about the model, tested by how well it predicts activations and how much the model's behaviour changes when it is removed.

Where it came from

Sparse coding goes back to Olshausen and Field (1996), who found that a sparse code learned from natural images gives filters like those of simple cells in the visual cortex. Elhage et al. (2022) argued that language models store features in superposition, and in 2023 Cunningham et al. and Bricken et al. independently showed that sparse autoencoders trained on a language model's activations find features that are more interpretable than its neurons. Later work scaled them up and changed the activation: Gemma Scope (Lieberum et al., 2024) released JumpReLU SAEs for every layer of Gemma 2 2B and 9B, the source of this page's SAE. The Steering tab works with one direction found without an SAE; the Probes tab finds a direction from labels instead of sparsity.

Papers

  1. Sparse Autoencoders Find Highly Interpretable Features in Language Models Hoagy Cunningham, Aidan Ewart, Logan Riggs, Robert Huben, Lee Sharkey · ICLR 2023 Trains sparse autoencoders on a language model's activations and finds features more interpretable than neurons, scored automatically.
  2. Towards Monosemanticity: Decomposing Language Models With Dictionary Learning Trenton Bricken et al. · Transformer Circuits Thread 2023 Concurrent work: a sparse autoencoder on a one-layer transformer's MLP, with each feature checked by hand and by intervention.
  3. Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2 Tom Lieberum et al. · arXiv 2024 The open suite of JumpReLU SAEs this page's layer-12, 16k-feature SAE comes from, with their training recipe and evaluations.
  4. Jumping Ahead: Improving Reconstruction Fidelity with JumpReLU Sparse Autoencoders Senthooran Rajamanoharan et al. · arXiv 2024 The JumpReLU activation with a learned threshold per feature and an L0 penalty trained through straight-through estimators.
  5. Toy Models of Superposition Nelson Elhage et al. · Transformer Circuits Thread 2022 Small models trained on sparse features that store more features than dimensions, the hypothesis SAEs set out to undo.
  6. Gemma 2: Improving Open Language Models at a Practical Size Gemma Team · arXiv 2024 Gemma 2, whose 2B model's residual stream this page decomposes.
  7. Emergence of simple-cell receptive field properties by learning a sparse code for natural images Bruno A. Olshausen, David J. Field · Nature 1996 Sparse coding: a dictionary learned so that each input uses few of its elements, the idea behind sparse autoencoders.

See also