Transcoders find interpretable LLM feature circuits

Jacob Dunefsky, Philippe Chlenski, Neel Nanda

Mechanistic interpretability aims to reverse-engineer the "circuits" of computation within neural networks. While attention heads have become relatively transparent, Multi-Layer Perceptron (MLP) sublayers remain a significant hurdle. These layers are dense, nonlinear, and composed of "polysemantic" neurons that fire for multiple unrelated concepts.

A new research paper introduces transcoders, a powerful tool designed to crack the MLP black box. By replacing dense MLP layers with sparse, interpretable approximations, researchers can now trace feature circuits through the entire model using weight-based analysis.

The Challenge of MLP Interpretability

In mechanistic interpretability, the goal is to find sparse subgraphs (circuits) that explain specific model behaviors. While Sparse Autoencoders (SAEs) have successfully identified interpretable features in the residual stream, they struggle with MLPs. Standard SAEs reconstruct activations at a single point, but understanding how a feature before an MLP influences a feature after it requires accounting for thousands of dense, nonlinear interactions. This complexity often makes circuits either intractably large or impossible to disentangle.

The Transcoder Architecture

Transcoders are a variation of SAEs designed to "imitate" an MLP layer's input-output behavior. Unlike a standard SAE that reconstructs its own input, a transcoder takes the input to an original MLP layer and predicts that layer's output.

Architecture of a transformer block with an MLP transcoder.

Key technical aspects include:

  • Sparsity: The transcoder is trained with an $L_1$ penalty on its hidden activations, forcing it to use only a few active "features" to explain the transformation.
  • Linearity: Because transcoders are linear (aside from the ReLU activation), attributions between features in different layers can be computed via the dot product of their weights.
  • Factorization: This architecture allows for a clean factorization of model behavior: $\text{Attribution} = (\text{Input-Dependent Activation}) \times (\text{Input-Invariant Weight Connection})$.

Weight-Based Circuit Discovery

By focusing on the dot product of transcoder weights, researchers can identify "input-invariant" connections—relationships that exist in the model's weights regardless of the specific input. This enables the discovery of general rules for model behavior rather than just observations of a single prompt.

To find these circuits, the authors employ a greedy recursive algorithm that identifies the most important paths of features through the model.

The six-step greedy algorithm for finding feature circuits.

This method allows for "blind" discovery: researchers can look at which tokens in the vocabulary most strongly activate a feature's encoder weights to guess its function without ever seeing it in a real sentence.

Key Results and Case Studies

Evaluated on models ranging from GPT2-small (120M) to Pythia-1.4B, transcoders demonstrated several advantages:

  • Superior Sparsity-Accuracy Tradeoff: Transcoders achieve better reconstruction accuracy for a given level of sparsity compared to standard SAEs, particularly as models scale.
  • High Interpretability: In blind human studies, transcoder features were found to be just as interpretable as SAE features, despite the more difficult task of approximating a layer's transformation.
  • Circuit Analysis: The researchers successfully reverse-engineered complex behaviors, such as the "greater-than" circuit in GPT2-small. They showed that the model's ability to predict that "1737 to 17" should be followed by a year greater than 37 relies on specific features that fire on year ranges and boost the probability of subsequent years.

Limitations and Future Work

While promising, transcoders are still approximations. Some subtle model behaviors may be lost in the reconstruction error. Current circuit-finding methods also treat attention patterns as fixed; future work could extend transcoders to explain how models decide where to attend. Nonetheless, transcoders represent a significant step toward making the dense "black box" of MLPs as interpretable as the rest of the transformer architecture.

Summary updated

BibTeX
@inproceedings{dunefsky2024transcoders,
  author = {Jacob Dunefsky and Philippe Chlenski and Neel Nanda},
  title = {{Transcoders find interpretable LLM feature circuits}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=J6zHcScAo0},
}
Figure