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

Tom Lieberum, Senthooran Rajamanoharan, Arthur Conmy, Lewis Smith, Nicolas Sonnerat, Vikrant Varma, János Kramár, Anca D. Dragan, Rohin Shah, Neel Nanda

Abstract

Sparse autoencoders (SAEs) are an unsupervised method for learning a sparse decomposition of a neural network's latent representations into seemingly interpretable features. Despite recent excitement about their potential, research applications outside of industry are limited by the high cost of training a comprehensive suite of SAEs. In this work, we introduce Gemma Scope, an open suite of JumpReLU SAEs trained on all layers and sub-layers of Gemma 2 2B and 9B and select layers of Gemma 2 27B base models. We primarily train SAEs on the Gemma 2 pre-trained models, but additionally release SAEs trained on instruction-tuned Gemma 2 9B for comparison. We evaluate the quality of each SAE on standard metrics and release these results. We hope that by releasing these SAE weights, we can help make more ambitious safety and interpretability research easier for the community.

Introduction

Large Language Models (LLMs) are notoriously "black boxes." While we can see their inputs and outputs, understanding how they arrive at a specific answer—the internal logic and conceptual representations—remains a grand challenge. Previous research suggests that model activations are composed of sparse, linear combinations of "features" (e.g., a specific concept like "Python programming" or "deceptive intent"). Sparse Autoencoders (SAEs) are the leading unsupervised method to extract these features.

However, training a comprehensive suite of SAEs for a modern, high-performing model is prohibitively expensive, often costing a significant fraction of the original model's training budget. Consequently, most interpretability research has been limited to small toy models or single layers of proprietary systems. To address this, Google DeepMind has released Gemma Scope, a massive open-source suite of over 400 SAEs covering nearly every layer of the Gemma 2 2B and 9B models. This release provides the research community with a "microscope" to inspect the internal features of state-of-the-art language models, significantly lowering the cost and technical barriers to mechanistic interpretability research.

Methodology

The Gemma Scope suite utilizes the JumpReLU SAE architecture. Unlike standard SAEs that use a ReLU activation with an L1 penalty to enforce sparsity, JumpReLU uses a shifted Heaviside step function as a gating mechanism. This allows the model to effectively "jump" to a threshold, providing a Pareto improvement over other methods and allowing for a variable number of active features per token.

Architecture of a Gemma 2 layer with integrated Sparse Autoencoders (SAEs) at multiple sites.

As shown in the architecture diagram above, SAEs were trained on the residual stream, MLP outputs, and attention head outputs for almost every layer of Gemma 2 2B and 9B, plus select layers of the 27B model. The scale of this project involved training over 30 million learned features across more than 2,000 total SAE weights. Training was primarily conducted on the same pre-training text data distribution used for Gemma 1, with evaluations performed on diverse subsets of The Pile (e.g., mathematics, GitHub) and instruction-tuned (IT) model rollouts.

Key Insights

Analysis of the Gemma Scope suite revealed several critical properties of LLM internals:

  1. The Residual Stream as a Bottleneck: SAEs trained on the residual stream show a significantly higher "delta loss" (the increase in model error when the SAE is spliced in) compared to those on MLP or Attention layers. This confirms that the residual stream acts as the primary communication channel between layers; any error introduced there propagates through the entire network.
Delta Loss vs. L0 sparsity for different SAE sites across Gemma 2 2B and 9B models.
  1. Base-to-IT Transferability: Surprisingly, SAEs trained on base models reconstruct the activations of instruction-tuned models remarkably well. This suggests that "chat-tuning" primarily re-weights existing features rather than creating entirely new ones.
  2. Feature Splitting: As SAE width increases (from 16K to 1M latents), features "split." A single general feature in a narrow SAE might become several highly specialized features in a wider one.
  3. Robust Interpretability: Evaluations showed that JumpReLU, TopK, and Gated SAE architectures all produce features of similar interpretability, allowing researchers to focus on efficiency and reconstruction quality.

Conclusion and Future Work

Gemma Scope represents a significant step toward transparent AI. By open-sourcing over 400 high-fidelity SAEs, DeepMind enables researchers to perform deep "circuit analysis" and safety red-teaming. However, challenges remain. Even the best SAEs do not capture 100% of activations, leaving "dark matter" (non-linear or superposed features) hidden. Future work will focus on shrinking reconstruction error, exploring quantization for SAE weights, and applying these tools to real-world safety problems like detecting deceptive behavior.

Weights and a tutorial can be found at Hugging Face and an interactive demo is available at Neuronpedia.

Summary updated

BibTeX
@inproceedings{lieberum2024gemma,
  author = {Tom Lieberum and Senthooran Rajamanoharan and Arthur Conmy and Lewis Smith and Nicolas Sonnerat and Vikrant Varma and János Kramár and Anca D. 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},
}
Figure