Finding Neurons in a Haystack: Case Studies with Sparse Probing

Wes Gurnee, Neel Nanda, Matthew Pauly, Katherine Harvey, Dmitrii Troitskii, Dimitris Bertsimas

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 that 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.

Introduction

Large Language Models (LLMs) are often treated as "black boxes" due to the complexity of their internal representations. A central debate in mechanistic interpretability is whether the model's neurons represent single, clean concepts (monosemanticity) or if concepts are compressed across many neurons in a state called superposition. Standard probing techniques often use dense layers that can "read" information even if it is scattered, obscuring the true sparsity of the representation. This study introduces sparse probing to identify whether specific "needles" (individual neurons) own high-level concepts.

Methodology: $k$-Sparse Probing

The researchers focused on the Multi-Layer Perceptron (MLP) layers of the Pythia model suite. They employed $k$-sparse linear probes, which are forced to select only the $k$ most informative neurons for prediction. To find these optimal neurons, they used two primary methods:

  1. Optimal Sparse Probing (OSP): A combinatorial optimization approach to provably find the best $k$ neurons for small $k$ values.
  2. Adaptive Thresholding: A fast heuristic for larger $k$ values that iteratively prunes less useful neurons.

By sweeping $k$ from 1 to 256, the study measured how features are distributed across the model's architecture for over 100 unique features, including linguistic, contextual, factual, and textual categories.

Monosemanticity and Interpretability Illusions

A key finding is the rise of monosemanticity in middle layers, where models dedicate individual neurons to high-level context features, such as specific programming languages or geographic regions. However, the authors caution against "interpretability illusions" caused by examining only max-activating examples. A neuron that appears to be a dedicated "German" neuron may, upon broader inspection, reveal polysemantic behavior by firing for unrelated n-grams.

Comparison between a monosemantic French neuron (left) and a polysemantic neuron (right) that activates on unrelated n-grams.

The De-tokenization Motif and Scaling

In early layers (the first 25%), features are typically held in superposition. These layers act as "de-tokenizers," using sparse combinations of polysemantic neurons to assemble raw tokens into meaningful n-grams. As models scale, these representations undergo two primary dynamics: Quantization, where a feature in superposition "crystallizes" into a dedicated neuron, and Splitting, where a general neuron (e.g., "athlete") divides into more specific sub-features (e.g., "baseball player").

Evidence of the 'social-security' feature in superposition and scaling trends across Pythia models.

Key Results and Causal Evidence

  • Sparsity vs. Accuracy: For many high-level features, a 1-sparse probe achieved F1 scores nearly identical to dense probes, particularly in larger models.
  • Causal Validation: Ablation studies confirmed the functional importance of these neurons. Deleting a single "French" context neuron in a 70M parameter model caused an 8% increase in loss for French text while leaving other languages unaffected.
  • Model Coverage: These trends were consistent across the Pythia suite, from 70M to 6.9B parameters, though larger models showed increased redundancy.

Limitations and Future Work

While sparse probing provides a powerful lens into model internals, it remains a correlational technique and may be susceptible to dataset biases where probes pick up on correlates rather than the intended feature. Furthermore, it is less effective at identifying features built incrementally across multiple layers. Future work aims to build a comprehensive library of probing datasets to automate the evaluation of safety and bias in emerging models.

Summary updated

BibTeX
@article{gurnee2023finding,
  author = {Wes Gurnee and Neel Nanda and Matthew Pauly and Katherine Harvey and Dmitrii Troitskii and Dimitris Bertsimas},
  title = {{Finding Neurons in a Haystack: Case Studies with Sparse Probing}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=JYs1R9IMJr},
}
Figure