Talking Heads: Understanding Inter-Layer Communication in Transformer Language Models

Jack Merullo, Carsten Eickhoff, Ellie Pavlick

Abstract

Transformers process information through complex interactions between layers, yet the precise mechanisms of this communication remain opaque. This paper investigates inter-layer communication by decomposing attention head weight matrices using Singular Value Decomposition (SVD). We identify that communication is often mediated through low-rank, low-dimensional subspaces—specifically 1D and 3D "channels." By analyzing these channels, we uncover a geometric explanation for model failure in long-context tasks, termed the "crowding" effect. Furthermore, we demonstrate that manually steering these channels can improve model accuracy on recall tasks by over 20%, providing a path toward more interpretable and editable language models.

1. Introduction

Large Language Models (LLMs) often exhibit "arbitrary sensitivities," where minor changes in prompt structure—such as reordering a list or changing punctuation—lead to drastically different outputs. These sensitivities suggest that our understanding of the internal "mechanics" of LLMs is incomplete. While previous research into "circuits" has identified groups of attention heads that work together, the specific signals passed between these heads are often noisy and difficult to interpret. This study moves beyond identifying which heads communicate to analyze how they communicate, aiming for a mechanistic understanding that allows for the prediction and editing of model behavior.

2. Methodology: SVD and Low-Rank Channels

The core innovation of this work is the application of Singular Value Decomposition (SVD) to the weight matrices ($W_{QK}$ and $W_{OV}$) of attention heads. In a model like GPT-2 Small, these matrices are 768x768 but possess a maximum rank of only 64. By breaking these matrices down into individual rank-1 components (singular vectors), the researchers isolated specific communication channels.

This approach allows for:

  1. Channel Isolation: Identifying specific 1D or 3D directions in the residual stream that dominate inter-layer communication.
  2. Weight Editing: Scaling or zeroing out specific singular vectors to causally test their importance to the model's functional behavior.
  3. Static Analysis: Predicting head-to-head interactions directly from the weights without the need for active data inference.

3. Experimental Framework

The study utilizes three primary data sources to validate these communication channels:

  • Indirect Object Identification (IOI): A benchmark for tracking entities and relationships within a sentence.
  • Laundry List Task: A new synthetic benchmark where the model must identify a missing item from a second, slightly shorter list. This task specifically tests the model's ability to handle "crowding" as list length increases from 3 to 20 items.
  • OpenWebText-10K: Natural language data used to ensure that discovered mechanisms, such as inhibition, are active in real-world contexts.

4. The Geometry of Communication: Crowding and Subspaces

A key discovery is the existence of a 3D subspace in GPT-2 that functions as a positional index for lists. This space acts as a geometric coordinate system; however, it is finite. As the number of items in a list grows (typically beyond 9 or 10), this 3D space becomes "crowded" and "fractured." This provides a clear geometric explanation for why LLMs lose track of items in long contexts: the internal representations begin to overlap and interfere with one another.

Furthermore, many of these channels appear to be "content-independent." Rather than passing specific semantic information (e.g., the word "apple"), they pass abstract structural signals, such as "inhibit the item at position 2." This suggests that during pretraining, models learn to implement abstract, program-like operations.

5. Results and Causal Interventions

The researchers provided strong causal evidence for the importance of these low-rank channels:

  • Performance Steering: By identifying the "inhibition channel" and manually steering activations toward the correct "wedge" in the 3D indexing space, accuracy on the Laundry List task improved by over 20%.
  • Ablation Studies: Removing the single most significant singular component from an inhibition head reduced its ability to suppress incorrect tokens by 7-14%.
  • High Fidelity: In GPT-2 Small, patching these specific 1D subspaces accounted for a 97.5% Fractional Logit Difference Decrease (FLDD), indicating that these tiny channels represent nearly the entire functional behavior of the circuit.

6. Limitations and Future Directions

While promising, the study notes several limitations. The experiments were primarily conducted on smaller models (GPT-2 Small, Pythia-160m). Although some patterns hold up to 6.9B parameters, it remains to be seen if these channels remain as "clean" in frontier-scale models. Additionally, the current methodology for calculating composition scores is incompatible with models using Rotary Positional Embeddings (RoPE), such as Llama or Mistral, due to their non-linear nature. Future work aims to automate the discovery of these channels to reduce the need for human-in-the-loop analysis.

Summary updated

BibTeX
@inproceedings{merullo2024talking,
  author = {Jack Merullo and Carsten Eickhoff and Ellie Pavlick},
  title = {{Talking Heads: Understanding Inter-Layer Communication in Transformer Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=LUsx0chTsL},
}
Figure