Skip to main content
QUICK REVIEW

[Paper Review] Llama Scope: Extracting Millions of Features from Llama-3.1-8B with Sparse Autoencoders

Zhengfu He, Wentao Shu|arXiv (Cornell University)|Oct 27, 2024
Video Analysis and SummarizationComputer Science3 citations
TL;DR

This paper introduces Llama Scope, a comprehensive suite of 256 sparse autoencoders (SAEs) trained on every sublayer of the Llama-3.1-8B model with 32K and 128K features. By enhancing Top-K SAEs with norm-informed top-k selection, K-annealing, and JumpReLU post-processing, the authors achieve high-fidelity, sparse, and interpretable features that generalize across contexts and model fine-tuning, enabling scalable mechanistic interpretability research.

ABSTRACT

Sparse Autoencoders (SAEs) have emerged as a powerful unsupervised method for extracting sparse representations from language models, yet scalable training remains a significant challenge. We introduce a suite of 256 SAEs, trained on each layer and sublayer of the Llama-3.1-8B-Base model, with 32K and 128K features. Modifications to a state-of-the-art SAE variant, Top-K SAEs, are evaluated across multiple dimensions. In particular, we assess the generalizability of SAEs trained on base models to longer contexts and fine-tuned models. Additionally, we analyze the geometry of learned SAE latents, confirming that \emph{feature splitting} enables the discovery of new features. The Llama Scope SAE checkpoints are publicly available at~\url{https://huggingface.co/fnlp/Llama-Scope}, alongside our scalable training, interpretation, and visualization tools at \url{https://github.com/OpenMOSS/Language-Model-SAEs}. These contributions aim to advance the open-source Sparse Autoencoder ecosystem and support mechanistic interpretability research by reducing the need for redundant SAE training.

Motivation & Objective

  • Address the challenge of scaling sparse autoencoders (SAEs) to industrial-scale language models like Llama-3.1-8B.
  • Overcome limitations in feature generalizability and latent space geometry by training SAEs across all 32 layers and sublayers.
  • Improve SAE training efficiency and feature quality through architectural and training schedule modifications to Top-K SAEs.
  • Enable mechanistic interpretability research by releasing a complete, open-source SAE suite for reuse and shared analysis.
  • Facilitate circuit discovery and feature analysis by providing a standardized, scalable SAE ecosystem for LLMs.

Proposed method

  • Train 256 SAEs—32 layers × 4 sublayers (post-MLP, attention output, MLP output, Transcoders)—with 32K and 128K features each.
  • Enhance Top-K SAEs by incorporating L2 norm of decoder weights into top-k selection to improve feature quality and stability.
  • Apply post-processing to convert SAEs into JumpReLU variants to enhance feature sparsity and interpretability.
  • Implement a K-annealing schedule during training to gradually increase the number of active features and improve convergence.
  • Use mixed parallelism training infrastructure to reduce disk I/O and memory bottlenecks, enabling large-scale SAE training.
  • Leverage existing SAE evaluation metrics (sparsity-fidelity, firing frequency, interpretability) and extend them to assess generalization across contexts and fine-tuned models.
Figure 1: Four potential training positions in one Transformer Block.
Figure 1: Four potential training positions in one Transformer Block.

Experimental results

Research questions

  • RQ1Can SAEs trained on base Llama-3.1-8B generalize to longer context lengths and fine-tuned models?
  • RQ2Do wider SAEs (128K features) learn entirely new features beyond linear combinations of features from smaller SAEs (32K)?
  • RQ3How does the geometry of learned SAE latents reflect feature disentanglement and splitting?
  • RQ4To what extent do modified Top-K SAEs preserve the feature quality and geometry of vanilla SAEs?
  • RQ5Can a unified, open-source SAE ecosystem reduce redundant training efforts and accelerate mechanistic interpretability research?

Key findings

  • Llama Scope SAEs generalize effectively to longer contexts and fine-tuned models, demonstrating robustness beyond the base model's training distribution.
  • Wider SAEs (128K features) learn distinct, monosemantic features not present in smaller SAEs—e.g., a dedicated Brexit feature in L15R-32x-TopK not found in 8x counterparts.
  • The cosine similarity between decoder columns in Top-K and Vanilla SAEs is significantly higher than random baselines, confirming shared feature geometry.
  • Feature splitting is empirically validated: wider SAEs discover new, non-redundant features, confirming the model's capacity for disentangled representation.
  • The K-annealing schedule and norm-informed top-k selection improve training stability and feature fidelity, reducing mode collapse and improving sparsity.
  • The disk-I/O efficient training infrastructure enables scalable SAE training on 8B-scale models, reducing memory bottlenecks and enabling large-scale deployment.
Llama Scope: Extracting Millions of Features from Llama-3.1-8B with Sparse Autoencoders

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.