Skip to main content
QUICK REVIEW

[Paper Review] Sparse Autoencoders Find Highly Interpretable Features in Language Models

Hoagy Cunningham, Aidan Ewart|arXiv (Cornell University)|Sep 15, 2023
Explainable Artificial Intelligence (XAI)Computer Science40 citations
TL;DR

The paper uses sparse autoencoders to learn a dictionary of features from language model activations, producing more interpretable, monosemantic directions that can causally influence model outputs and reduce superposition.

ABSTRACT

One of the roadblocks to a better understanding of neural networks' internals is extit{polysemanticity}, where neurons appear to activate in multiple, semantically distinct contexts. Polysemanticity prevents us from identifying concise, human-understandable explanations for what neural networks are doing internally. One hypothesised cause of polysemanticity is extit{superposition}, where neural networks represent more features than they have neurons by assigning features to an overcomplete set of directions in activation space, rather than to individual neurons. Here, we attempt to identify those directions, using sparse autoencoders to reconstruct the internal activations of a language model. These autoencoders learn sets of sparsely activating features that are more interpretable and monosemantic than directions identified by alternative approaches, where interpretability is measured by automated methods. Moreover, we show that with our learned set of features, we can pinpoint the features that are causally responsible for counterfactual behaviour on the indirect object identification task \citep{wang2022interpretability} to a finer degree than previous decompositions. This work indicates that it is possible to resolve superposition in language models using a scalable, unsupervised method. Our method may serve as a foundation for future mechanistic interpretability work, which we hope will enable greater model transparency and steerability.

Motivation & Objective

  • Motivate mechanistic interpretability by addressing polysemanticity and superposition in language models.
  • Develop an unsupervised method to extract interpretable feature directions from internal activations.
  • Show that learned dictionary features achieve higher autointerpretability than baselines.
  • Demonstrate causal relevance of dictionary features to model behavior on specific tasks.

Proposed method

  • Train sparse autoencoders with a sparsity penalty on hidden activations to learn a dictionary of features from language model activations (residual stream, MLP sublayer, or attention head sublayer).
  • Use tied encoder/decoder weights and row-wise normalization of dictionary features.
  • Optimize reconstruction loss with an L1 sparsity term to recover ground-truth features (L2 reconstruction loss + alpha * ||c||1).
  • Evaluate interpretability with autointerpretability scores derived from language-model explanations of dictionary feature activations.
  • Compare against baselines (default basis, random directions, PCA, ICA) for interpretability of learned features.
  • Apply activation patching and Automated Circuit Discovery (ACDC) to localize causal influence of dictionary features on Indirect Object Identification (IOI) task.
Figure 1: An overview of our method. We a) sample the internal activations of a language model, either the residual stream, MLP sublayer, or attention head sublayer; b) use these activations to train a neural network, a sparse autoencoder whose weights form a feature dictionary; c) interpret the res
Figure 1: An overview of our method. We a) sample the internal activations of a language model, either the residual stream, MLP sublayer, or attention head sublayer; b) use these activations to train a neural network, a sparse autoencoder whose weights form a feature dictionary; c) interpret the res

Experimental results

Research questions

  • RQ1Do sparse dictionary features reduce polysemanticity and increase interpretability compared to other decompositions?
  • RQ2Can sparse dictionary features be used to precisely localize and causally influence model outputs on a targeted task?
  • RQ3How do dictionary features perform relative to PCA/ICA/random baselines in terms of interpretability and causal effect on outputs?
  • RQ4What is the role of sparsity level and dictionary size in the quality and usefulness of learned features?

Key findings

  • Dictionary features are more interpretable on average than neurons and several baselines as measured by autointerpretability scores.
  • Sparse dictionaries localize causal features for IOI more efficiently (fewer patches) and with smaller edits than PCA-based decompositions.
  • Monosemantic dictionary features emerge that activate for narrow linguistic tokens (e.g., apostrophes, periods) and have predictable effects on next-token logits.
  • Activation patching with sparse dictionaries achieves a better Pareto frontier of edit magnitude versus thoroughness of editing compared to non-sparse dictionaries.
  • Case studies show features that correspond to interpretable linguistic phenomena and reveal upstream/downstream causal relationships across layers.
Figure 2: Average top-and-random autointerpretability score of our learned directions in the residual stream, compared to a number of baselines, using 150 features each. Error bars show 95% confidence intervals around means. The feature dictionaries used here were trained for 10 epochs using $\alpha
Figure 2: Average top-and-random autointerpretability score of our learned directions in the residual stream, compared to a number of baselines, using 150 features each. Error bars show 95% confidence intervals around means. The feature dictionaries used here were trained for 10 epochs using $\alpha

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.