Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2

Tom Lieberum, Senthooran Rajamanoharan, Arthur Conmy, Lewis Smith, Nicolas Sonnerat, Vikrant Varma, Janos Kramar, Anca Dragan, Rohin Shah, Neel Nanda

TL;DR

Gemma Scope is a massive, open-access suite of over 400 JumpReLU Sparse Autoencoders (SAEs) spanning every layer and sublayer of Gemma 2 (2B and 9B), alongside select layers of 27B and instruction-tuned variants. By amortizing the colossal compute and storage costs of training SAEs at scale, this release enables the broader research community to reverse-engineer modern language model internals and analyze full feature circuits.

What Problem Does This Paper Address?

Language model representations are dense and notoriously difficult to interpret, likely bundling thousands of overlapping concepts into "superposition." While Sparse Autoencoders (SAEs) offer an unsupervised way to disentangle these activations into human-interpretable, sparse directions (latents), training them across an entire model is prohibitively expensive.

Prior open-weight SAE releases were largely restricted to smaller, older architectures (like GPT-2 or Pythia-70M) or isolated single layers of larger models. Gemma Scope bridges this gap by releasing an exhaustive, production-grade suite of SAEs on modern, competitive open-weight LLMs (Gemma 2).

Methods

The authors train SAEs across three sites per transformer layer:

  1. Attention head outputs (concatenated before the output projection $W_O$ and RMSNorm),
  2. MLP outputs (post-RMSNorm), and
  3. Residual stream (post-MLP).

Key architectural and systems techniques include:

  • JumpReLU Activations: Instead of standard TopK or $L_1$-penalized ReLU, the authors use JumpReLU, which zeroes activations below a learned positive threshold $\theta$ using straight-through estimators (STEs). This decouples latent selection from magnitude estimation and allows dynamic latent counts per token.
  • Transcoders: For Gemma 2 2B, the team trains transcoders that directly map MLP inputs to MLP outputs, replacing nonlinear MLP sublayers with linear feature combinations for easier circuit discovery.
  • Inference Standardization: Activation scaling constants and decoder biases are mathematically folded into encoder weights post-training, allowing downstream users to plug SAEs directly into raw model activations with zero normalization overhead.
  • High-Throughput Streaming: Training used over 20% of GPT-3’s compute budget and required saving ~20 PiB of activations to disk. To prevent I/O bottlenecks exceeding 1 GiB/s per run, the authors built a multi-client shared server buffer, achieving ~50.8% Model FLOP Utilization (MFU) on TPUv3.

Datasets

  • Training Data: Activations sampled from the pretraining text distribution of Gemma 1, using sequences of length 1,024 (excluding BOS, EOS, and padding tokens).
  • Evaluation Data: The same pretraining distribution, validation subsets of The Pile (including DeepMind Mathematics, Europarl, Wikipedia, and HackerNews), and a sample of Gemini 1.0 Ultra SFT data used for rollout evaluations of the Gemma 2 9B IT model.

Key Insights and Ideas

  • Base-to-IT Transfer: SAEs trained purely on base pretraining activations faithfully reconstruct activations of instruction-tuned (IT) models. The increase in downstream language model loss is nearly identical to SAEs trained directly on chat data, suggesting finetuning mostly re-weights existing base features rather than inventing completely disjoint representations.
  • The Residual Stream Bottleneck: While fraction of variance unexplained (FVU) is relatively uniform across sublayers, delta LM loss is significantly higher when reconstructing the residual stream than when reconstructing attention or MLP outputs. Because the residual stream directly carries cross-layer communication, small errors there cascade heavily into next-token predictions.
  • Transcoder Regression on Modern Architectures: While prior work on GPT-2 showed transcoders outperforming standard SAEs, Gemma Scope found that transcoders caused higher loss degradation than MLP SAEs at matched sparsity on Gemma 2. This suggests transcoders may face architectural hurdles with modern innovations like gated MLPs.

Key Results

  • Scale of Release: More than 400 SAEs covering all layers of Gemma 2 2B and 9B (and over 2,000 checkpoints sweeping different sparsity levels $L_0$), encompassing over 30 million learned latents trained on 4B to 16B tokens each.
  • Precision Invariance: Evaluating SAEs with bfloat16 weights instead of float32 produces virtually no regression in reconstruction loss or delta LM loss, enabling memory-efficient multi-SAE splicing during circuit analysis.
  • Domain Discrepancies: On Pile subsets, Gemma Scope SAEs perform best on structured text (DeepMind Mathematics) and worst on multilingual data (Europarl), reflecting the English-heavy distribution of the underlying pretraining data.

Limitations and Future Work

  • Non-Linear "Dark Matter": Current SAEs operate linearly; they struggle to capture circular feature manifolds or complex non-linear structures efficiently.
  • Feature Splitting vs. Composition: Wider SAEs often fragment existing concepts into hyper-specialized sub-features or learn frequent feature co-occurrences rather than discovering brand new concepts.
  • Downstream Safety Utility: While the suite establishes the groundwork for scalable circuit discovery and jailbreak detection, demonstrating robust real-world improvements over simpler baselines (like steering vectors or sparse probing) remains an open challenge.

Summary updated

BibTeX
@inproceedings{lieberum2024gemma,
  author = {Tom Lieberum and Senthooran Rajamanoharan and Arthur Conmy and Lewis Smith and Nicolas Sonnerat and Vikrant Varma and Janos Kramar and Anca Dragan and Rohin Shah and Neel Nanda},
  title = {{Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2}},
  booktitle = {BlackBoxNLP @ EMNLP},
  year = {2024},
  url = {https://openreview.net/forum?id=XkMrWOJhNd},
}

Loading related content...

Figure