Skip to content
All papers

Scaling and Evaluating Sparse Autoencoders

OpenAIGao et al., 202415 min readarXiv 2406.04093Read the paper2024-06

Gao et al. replace the usual ReLU plus L1 sparse autoencoder with a TopK activation that keeps exactly k latents per input, which sets sparsity directly, removes the L1 shrinkage bias and, combined with a few training tricks, greatly reduces dead latents. They derive clean scaling laws for SAE size and sparsity, train a 16 million latent SAE on GPT-4 activations, and argue that SAE quality should be judged by downstream metrics rather than reconstruction error alone.

Ready to ace your system design interview?

This article is just one piece. StackSweep gives you structured, interview-focused practice across every topic that comes up in senior engineering rounds.

  • 1,000+ quiz questions across system design and ML/AI
  • Spaced repetition to lock in what you learn
  • Full case study walkthroughs of real interview topics
  • Track streaks, XP, and progress over time

TL;DR

  • A TopK SAE keeps only the k largest encoder pre-activations and zeroes the rest, so the number of active latents (L0) is fixed by design instead of tuned indirectly through an L1 coefficient.
  • Removing the L1 penalty removes activation shrinkage, and TopK SAEs reach a better reconstruction-versus-sparsity trade-off than the ReLU baselines the authors compare against.
  • Initializing the encoder as the transpose of the decoder plus an auxiliary loss on dead latents keeps most latents alive even in very large dictionaries (the authors report about 7% dead in their largest).
  • Reconstruction error follows smooth power laws in the number of latents and in k, which lets the authors scale to a 16 million latent SAE on GPT-4.
  • The paper proposes evaluating SAEs by downstream language-model loss, probe quality on known concepts, explainability, and sparsity of downstream effects, not just mean squared error.

Why this paper matters

TopK and its descendants (BatchTopK, JumpReLU) are now standard SAE architectures, and the evaluation metrics introduced here are what practitioners use to compare SAEs. A research engineer training or debugging SAEs should be able to explain why L1 causes shrinkage, how dead latents arise and are fixed, and why MSE alone is a poor quality measure.

Breakdown

1.The problem with ReLU plus L1

The standard SAE (covered in the earlier lesson) encodes an activation with a linear layer and a ReLU, decodes linearly, and trains with reconstruction error plus an L1 penalty on the latent activations. The L1 term is a convex stand-in for what we actually want, which is few active latents (low L0).

The stand-in has side effects. First, shrinkage: L1 penalizes the size of every active latent, so the SAE learns to under-report activation magnitudes, trading a bit of reconstruction for a smaller penalty. Reconstructions are systematically too small.

Second, indirect control: you do not choose sparsity, you choose an L1 coefficient and see what L0 you get. Comparing SAEs at the same sparsity requires sweeping coefficients.

Third, dead latents: in large dictionaries many latents stop firing entirely and never recover, wasting capacity. The authors note that Anthropic's 34M-latent SAE had only about 12M alive latents, and earlier work needed periodic resampling to revive them.

These are engineering problems, but they limit how far SAEs can be scaled and how much to trust their outputs.

Discussion angle: Ask why shrinkage matters for interpretability, not only for loss. If activations are biased toward zero, small but real features may be suppressed below threshold and disappear, and feature magnitudes used for steering or attribution are off. A good probe: how would you measure shrinkage on a trained SAE?

2.TopK: choosing sparsity directly

The TopK SAE changes one thing in the forward pass. After the encoder computes pre-activations, keep the k largest and set every other latent to zero. (A ReLU is applied too, so kept values are non-negative.) The loss is just reconstruction error. There is no sparsity penalty, because sparsity is enforced by construction.

This fixes the three problems at once. L0 is exactly k, so you choose sparsity directly and compare SAEs fairly. There is no L1 term, so there is no pressure to shrink activations; the kept latents can take whatever magnitude best reconstructs the input. And because only the top k compete, the training dynamics differ in ways that combine well with the dead-latent fixes below.

The authors report that TopK SAEs reach a better trade-off between reconstruction and sparsity than ReLU baselines and compare well against other recent variants they test (ProLU, also known as JumpReLU, and gated SAEs), and that the gap over ReLU grows with scale.

One cost: TopK fixes k for every input, even though some tokens may genuinely involve more or fewer concepts. The authors also study a MultiTopK variant trained at several k values so the SAE degrades gracefully when used at a different sparsity. Later work (BatchTopK) relaxes the per-input constraint by selecting the top activations across a batch.

Discussion angle: Interviewers ask what a fixed k assumes. A token in boilerplate code and a token at a key reasoning step probably involve different numbers of features. Ask what happens to reconstruction on the complex tokens, and what BatchTopK or JumpReLU change about this.

3.Keeping latents alive

A dead latent is one that never activates on any input. Its encoder weights receive no gradient (TopK and ReLU both block gradient to inactive latents), so once dead it stays dead. In large dictionaries this can waste a big share of capacity.

The authors combine two fixes.

First, initialization. The encoder is initialized as the transpose of the decoder. This starts each latent's encoder direction aligned with its own decoder direction, so latents begin in a sensible place and are more likely to fire on inputs resembling what they would reconstruct.

Second, an auxiliary loss (AuxK). Take the latents that have been inactive for a while, select the top few of them on each input, and train them to reconstruct the residual error left by the main SAE. This gives dead latents a gradient signal pointing at what the live latents are failing to capture, pulling them back into use.

With both, the authors report that only 7% of latents are dead even in their largest (16 million latent) SAE. This is what makes the scaling laws clean: you are actually using the latents you pay for.

Discussion angle: A good debugging question: your SAE has many dead latents after a few thousand steps. What do you check? Learning rate, initialization, input normalization, and whether you are tracking activation frequency over enough tokens to call a latent dead. Then ask why training dead latents on the residual is a sensible target.

4.Scaling laws for SAEs

With dead latents under control, the authors study how reconstruction error depends on scale. They report that, when training to convergence, reconstruction loss follows a power law in the number of latents, and that there is a joint scaling relationship in the number of latents and k. They also find that, at fixed k, larger language models need larger SAEs to reach the same MSE.

This lets them extrapolate, and they train a 16 million latent TopK SAE on GPT-4 residual stream activations, among the largest SAEs reported at the time. They also release SAEs for GPT-2 small and code.

Scaling laws are useful for planning but come with a caveat the authors take seriously: lower reconstruction error is not the goal. An SAE could reduce MSE by learning dense, uninterpretable latents, or by spending capacity on directions that do not matter to the model's output. A scaling law for MSE is only as useful as MSE is a proxy for quality, which motivates the evaluation section.

Discussion angle: Ask: if MSE keeps improving with more latents, when should you stop? The answer depends on downstream metrics and on whether extra latents are interpretable or just splitting existing features. Also ask how you would check that a scaling law fit on small SAEs will hold at 100 times the size.

5.Evaluating SAEs beyond reconstruction

The authors argue for metrics that track what we want SAEs for.

Downstream loss. Replace the activation with its SAE reconstruction and measure how much the language model's next-token loss increases. This weights errors by whether they matter to the model, unlike MSE, which treats all directions equally.

Probe loss. For a set of known binary concepts, check whether some single latent works as a good one-dimensional probe. If the SAE has found real features, known concepts should be recoverable from individual latents.

Explainability. Generate simple explanations of each latent's activation pattern and measure how precisely and completely they predict when the latent fires. This checks interpretability at scale without relying on cherry-picked examples.

Ablation sparsity. Ablate a single latent and see whether the effect on output logits is concentrated on few tokens. Sparse downstream effects suggest the latent corresponds to a clean, specific feature.

The authors report that these metrics generally improve with SAE size, and that TopK compares favorably on them. The broader lesson is methodological: an SAE that reconstructs well can still be useless for interpretability, so choose metrics that reflect the use case.

Discussion angle: Expect: 'Two SAEs have the same MSE; how do you pick?' Compare downstream loss, probe performance on concepts you care about, and spot-check interpretability. Ask also whether any of these metrics capture safety use, such as whether a deception-relevant concept gets a clean latent.

Reading the evidence

What it shows

  • TopK SAEs reach a better reconstruction-versus-sparsity trade-off than the ReLU baselines tested, without activation shrinkage.
  • Encoder initialization from the decoder plus an auxiliary loss keeps the large majority of latents alive at large scale (about 93% at 16 million latents).
  • SAE reconstruction error follows smooth scaling laws in the number of latents and in k.
  • SAEs can be scaled to millions of latents on a frontier model (GPT-4).
  • Metrics such as downstream loss, probe loss and ablation sparsity can distinguish SAEs that MSE alone cannot.

What it does not show

  • That TopK latents are the model's true features; better metrics are evidence, not proof.
  • That a fixed k per input matches how many concepts each token actually involves.
  • That the proposed evaluation metrics capture what matters for safety applications such as monitoring.
  • That SAEs explain how features are computed; like other SAE work, it studies representations at chosen layers.

The most boring explanation

A skeptic could say TopK merely moves the sparsity knob from a coefficient to k and that its better curves reflect metric choices. The authors respond by evaluating on several metrics designed around downstream use (model loss, probes, explainability, ablation effects), not only on the reconstruction curves where TopK's design gives it a natural edge, though they acknowledge these metrics remain imperfect proxies for interpretability.

Key Concepts

TopK activation

Keep only the k largest encoder pre-activations and zero the rest, fixing the number of active latents per input.

Analogy: Instead of taxing every word in a summary to keep it short (L1), you simply say 'use exactly k words'. Nobody shortens the words they keep.

L0 sparsity

The number of nonzero latents for an input; TopK sets it to k directly instead of controlling it through a penalty.

Activation shrinkage

The L1 penalty's bias toward smaller latent activations, which makes reconstructions systematically too small.

Dead latents

Latents that never activate and so receive no gradient, wasting dictionary capacity.

AuxK auxiliary loss

A loss that trains the top few dead latents to reconstruct the main SAE's residual error, reviving them.

Analogy: Bench players who never get on the field are assigned to cover whatever the starters keep missing, so they get practice where it is most needed.

Downstream loss

The increase in the language model's next-token loss when an activation is replaced by its SAE reconstruction.

Probe loss and ablation sparsity

Metrics checking that known concepts are captured by single latents, and that ablating a latent has concentrated effects on outputs.

Knowledge Check

10 questions — your answers are saved locally so you can come back anytime.