The Communication Map of a Transformer
Organizations: St. John Fisher University
Abstract
The components of a transformer communicate by writing to and reading from a shared residual stream, and the mechanistic interpretability literature has mapped these connections by hand, one circuit at a time. We present the communication map, which charts every potential communication channel from the geometry of the model's weights alone, generalizing the composition score of Elhage et al. (2021) into a single coupling coefficient covering all 18 connection classes, from head-to-head to neuron-to-neuron and everything in between. We provide an account of the properties of the coupling coefficient, including its geometric interpretation and its exact chance level. The census finds that 70-89% of head pairs are oriented far from chance, some coupled strongly and others actively avoiding each other. We demonstrate the communication map in two novel applications. In Application 1, we recover the known induction circuits blind from the strongest head-to-head couplings and group the heads into communities, and ablating one such community destroys the model's in-context copying. In Application 2, we pool the coupling coefficients of every head to identify a distinct two-dimensional residual stream subspace, whose deletion abolishes the induction capability in six models up to Pythia-6.9B. We show that this subspace is different from those identified by either activation PCA or outlier dimensions. We release the map, the statistical machinery, and the intervention suite.
Figures & tables
| Model | head–head | ifc head | head neuron | ifc neuron | neuron–neuron | Total | Wires |
|---|---|---|---|---|---|---|---|
| GPT-2 | |||||||
| GPT-2-medium | |||||||
| GPT-2-large | |||||||
| GPT-Neo-125M | |||||||
| Pythia-160m | |||||||
| Pythia-2.8B |
| K-composition | Q-composition | V-composition | |
|---|---|---|---|
| Model | above / below | above / below | above / below |
| GPT-2 | / | / | / |
| GPT-2-medium | / | / | / |
| GPT-2-large | / | / | / |
| GPT-Neo-125M | / | / | / |
| Pythia-160m | / | / | / |
| Cosines: ours vs | ||||||
|---|---|---|---|---|---|---|
| Model | RW-PCA (ours) | Activation PCA | Outlier dims | Random | Act. PCA | Outliers |
| GPT-2 | / | / | / | / | ||
| GPT-2-medium | / | / | / | / | ||
| GPT-2-large | / | / | / | / | ||
| Pythia-160m (rotary) | / | / | / | / | ||
| Pythia-2.8B (rotary) | / | / | / | / | ||
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| Matrix | Shape (general) | Shape (GPT-2) | Rank | Role |
|---|---|---|---|---|
| query factor: | ||||
| key factor: | ||||
| value factor: | ||||
| output factor: head space stream, | ||||
| QK circuit: bilinear form on position pairs | ||||
| OV circuit: stream stream operator |
| Expected | Observed | ||
|---|---|---|---|
| Component | Matrix | Gram | Normalizer | Rank |
| Head, reader side (one row per channel) | ||||
| K-composition | — | |||
| Q-composition | — | same as K-composition | ||
| V-composition | — | |||
| Head, writer side (one row serves all three channels) | ||||
| head write | — | |||
| Channel | Reader | Cross factor | |
|---|---|---|---|
| K-composition | |||
| Q-composition | |||
| V-composition |
| Connection class | Mask | Count formula |
|---|---|---|
| head head {K,Q,V} | ||
| embedding head {K,Q,V} | always | |
| positional head {K,Q,V} | always | |
| head unembedding | always | |
| head neuron | ||
| neuron head {K,Q,V} |
| Model | Community (holds) | Five heads | Comm. minus five | Whole comm. | Ctrl median |
|---|---|---|---|---|---|
| GPT-2 | (5/5) | ||||
| GPT-2-medium | (5/5) | ||||
| GPT-2-large | (4/5) | ||||
| GPT-Neo-125M | (5/5) | ||||
| Pythia-160m | (3/5) | ||||
| Pythia-2.8B | (4/5) |
| Ablated set | Gain destroyed | Ctrl median | Ctrl max | Pile NLL | |
|---|---|---|---|---|---|
| five induction heads | 5 | ||||
| previous-token head L4H11 | 1 | ||||
| remaining community heads | 24 | ||||
| community minus induction heads | 25 | ||||
| whole community | 30 |
| layer separation | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| eligible pairs | 1584 | 1440 | 1296 | 1152 | 1008 | 864 | 720 | 576 | 432 | 288 | 144 |
| wired pairs | 102 | 88 | 77 | 65 | 59 | 69 | 83 | 68 | 48 | 40 | 18 |
| wired (%) | 6.4 | 6.1 | 5.9 | 5.6 | 5.9 | 8.0 | 11.5 | 11.8 | 11.1 | 13.9 | 12.5 |
| Term | Definition |
|---|---|
| residual stream | the -dimensional per-position vector every component reads from and adds to (Eq. 1 ) |
| QK / OV circuit | a head’s pair-scoring form / content-transforming operator |
| K/Q/V-composition | the three channels by which one head’s writes enter another’s keys / queries / values |
| potential connectivity | a wired channel: write/read subspaces aligned in the weights, regardless of use |
| edge; wire | a head pair selected by Application 1 (FDR ); a neuron neuron pair with |
| bands | leading eigendirections of the pooled coupling matrix, the directions most components read and write |
Transformer Interpretability
Transformer interpretability studies how attention, feed-forward layers, and hidden representations support model predictions and behavior.
See all 339 papers