Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet

Eight months ago, we demonstrated that sparse autoencoders could recover monosemantic features from a small one-layer transformer. At the time, a major concern was that this method might not scale feasibly to state-of-the-art transformers and, as a result, be unable to practically contribute to AI safety. Since then, scaling sparse autoencoders has been a major priority of the Anthropic interpretability team, and we’re pleased to report extracting high-quality features from Claude 3 Sonnet,

1

For clarity, this is the 3.0 version of Claude 3 Sonnet, released March 4, 2024. It is the exact model in production as of the writing of this paper. It is the finetuned model, not the base pretrained model (although our method also works on the base model). Anthropic’s medium-sized production model.

We find a diversity of highly abstract features. They both respond to and behaviorally cause abstract behaviors. Examples of features we find include features for famous people, features for countries and cities, and features tracking type signatures in code. Many features are multilingual (responding to the same concept across languages) and multimodal (responding to the same concept in both text and images), as well as encompassing both abstract and concrete instantiations of the same idea (such as code with security vulnerabilities, and abstract discussion of security vulnerabilities).

Some of the features we find are of particular interest because they may be safety-relevant – that is, they are plausibly connected to a range of ways in which modern AI systems may cause harm. In particular, we find features related to security vulnerabilities and backdoors in code; bias (including both overt slurs, and more subtle biases); lying, deception, and power-seeking (including treacherous turns); sycophancy; and dangerous / criminal content (e.g., producing bioweapons). However, we caution not to read too much into the mere existence of such features: there’s a difference (for example) between knowing about lies, being capable of lying, and actually lying in the real world. This research is also very preliminary. Further work will be needed to understand the implications of these potentially safety-relevant features.

Key Results

  • Sparse autoencoders produce interpretable features for large models.
  • Scaling laws can be used to guide the training of sparse autoencoders.
  • The resulting features are highly abstract: multilingual, multimodal, and generalizing between concrete and abstract references.
  • There appears to be a systematic relationship between the frequency of concepts and the dictionary size needed to resolve features for them.
  • Features can be used to steer large models (see e.g. Influence on Behavior). This extends prior work on steering models using other methods (see Related Work).
  • We observe features related to a broad range of safety concerns, including deception, sycophancy, bias, and dangerous content.

Scaling Dictionary Learning to Claude 3 Sonnet

Our general approach to understanding Claude 3 Sonnet is based on the linear representation hypothesis (see e.g.

  • Linguistic regularities in continuous space word representations [PDF]

    T. Mikolov, W. Yih, G. Zweig.

    Proceedings of the 2013 conference of the north american chapter of the association for computational linguistics: Human language technologies, pp. 746–751. 2013.

[1]

) and the superposition hypothesis (see e.g.

  • Linear algebraic structure of word senses, with applications to polysemy

    S. Arora, Y. Li, Y. Liang, T. Ma, A. Risteski.

    Transactions of the Association for Computational Linguistics, Vol 6, pp. 483–495. MIT Press. 2018.

  • Decoding The Thought Vector [link]

    G. Goh. 2016.

  • Toy Models of Superposition [HTML]

    N. Elhage, T. Hume, C. Olsson, N. Schiefer, T. Henighan, S. Kravec, Z. Hatfield-Dodds, R. Lasenby, D. Drain, C. Chen, R. Grosse, S. McCandlish, J. Kaplan, D. Amodei, M. Wattenberg, C. Olah.

    Transformer Circuits Thread. 2022.

[2, 3, 4]

). For an introduction to these ideas, we refer readers to the Background and Motivation section of Toy Models

  • Toy Models of Superposition [HTML]

    N. Elhage, T. Hume, C. Olsson, N. Schiefer, T. Henighan, S. Kravec, Z. Hatfield-Dodds, R. Lasenby, D. Drain, C. Chen, R. Grosse, S. McCandlish, J. Kaplan, D. Amodei, M. Wattenberg, C. Olah.

    Transformer Circuits Thread. 2022.

[4]

. At a high level, the linear representation hypothesis suggests that neural networks represent meaningful concepts – referred to as features – as directions in their activation spaces. The superposition hypothesis accepts the idea of linear representations and further hypothesizes that neural networks use the existence of almost-orthogonal directions in high-dimensional spaces to represent more features than there are dimensions.

If one believes these hypotheses, the natural approach is to use a standard method called dictionary learning

  • Sparse and redundant representations: from theory to applications in signal and image processing

    M. Elad. Vol 2(1). Springer. 2010.

  • Sparse coding with an overcomplete basis set: A strategy employed by V1?

    B.A. Olshausen, D.J. Field.

    Vision research, Vol 37(23), pp. 3311–3325. Elsevier. 1997.

[5, 6]

. Recently, several papers have suggested that this can be quite effective for transformer language models

  • Transformer visualization via dictionary learning: contextualized embedding as a linear superposition of transformer factors [PDF]

    Z. Yun, Y. Chen, B.A. Olshausen, Y. LeCun.

(Excerpt: opening summary, feature examples and key results; full text at source URL.)