Finding Neurons in a Haystack: Case Studies with Sparse Probing

Wes Gurnee, Neel Nanda, Matthew Pauly, Katherine Harvey, Dmitrii Troitskii +1 more
5/2/2023
cs.LGcs.AI

No official code found. Best implementation: EleutherAI/pythia (2,968 stars, Apache-2.0, last commit 2025-11-15). 1 more below.

Abstract

Despite rapid adoption and deployment of large language models (LLMs), the internal computations of these models remain opaque and poorly understood. In this work, we seek to understand how high-level human-interpretable features are represented within the internal neuron activations of LLMs. We train $k$-sparse linear classifiers (probes) on these internal activations to predict the presence of features in the input; by varying the value of $k$ we study the sparsity of learned representations and how this varies with model scale. With $k=1$, we localize individual neurons which are highly relevant for a particular feature, and perform a number of case studies to illustrate general properties of LLMs. In particular, we show that early layers make use of sparse combinations of neurons to represent many features in superposition, that middle layers have seemingly dedicated neurons to represent higher-level contextual features, and that increasing scale causes representational sparsity to increase on average, but there are multiple types of scaling dynamics. In all, we probe for over 100 unique features comprising 10 different categories in 7 different models spanning 70 million to 6.9 billion parameters.

View on arXivView PDF

Code Implementations(2)

EleutherAI/pythiaCommunity100%
Apache-2.0

The hub for EleutherAI's work on interpretability and learning dynamics

2,968225Shell, PythonDec 25, 202111 months agoApache-2.0
MIT

Sparse probing paper full code.

6811Shell, PythonMay 2, 20232 years agoMIT
ai-alignmentai-safetyinterpretabilitymechanistic-interpretability

Similar Papers

Cite this paper

@article{gurnee2023finding,
  title  = {Finding Neurons in a Haystack: Case Studies with Sparse Probing},
  author = {Wes Gurnee and Neel Nanda and Matthew Pauly and Katherine Harvey and Dmitrii Troitskii and Dimitris Bertsimas},
  year   = {2023},
  eprint = {2305.01610},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.01610v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.01610.svg)](https://codeofpaper.com/paper/2305.01610)

Discussion