Interleaved Head Attention
Organizations: UT Austin · MIT · Harvard University · UC Berkeley ·
Abstract
Multi-Head Attention (MHA) is the core computational primitive underlying modern Large Language Models (LLMs). However, MHA suffers from a fundamental linear scaling limitation: attention heads produce exactly independent attention matrices, with no communication between heads during attention computation. This becomes problematic for multi-step reasoning, where correct answers depend on aggregating evidence from multiple parts of the context and composing latent token-to-token relations over a chain of intermediate inferences. To address this, we propose Interleaved Head Attention (IHA), which enables cross-head mixing by constructing pseudo-heads per head (typically ), where each pseudo query/key/value is a learned linear combination of all original queries, keys and values respectively. Interactions between pseudo-query and pseudo-key heads induce up to attention patterns per head with modest parameter overhead . We provide theory showing improved efficiency in terms of number of parameters on the synthetic Polynomial task (IHA uses parameters vs. for MHA) and on the synthetic order-sensitive CPM-3 task (IHA uses heads vs. for MHA). On real-world benchmarks, IHA improves Multi-Key retrieval on RULER by 10-20% (4k-16k) and, after fine-tuning for reasoning on OpenThoughts, improves GSM8K by 5.8% and MATH-500 by 2.8% (Majority Vote) over full attention.
Figures & tables
| Model | GSM8K P@1 | GSM8K Maj@16 | MATH-500 P@1 | MATH-500 Maj@16 | MBPP P@1 | MBPP P@10 | Avg. Rank | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| IHA (Ours) | 34.3% | + 4.8 | 54.2% | + 5.8 | 10.0% | + 1.2 | 18.4% | + 2.8 | 15.5% | + 0.8 | 41.6% | + 0.4 | 1.5 |
| Global Attention | 29.5% | – | 48.4% | – | 8.8% | – | 15.6% | – | 14.7% | – | 41.2% | – | 3.8 |
| Global+Local | 26.5% | – 3.0 | 46.9% | – 1.5 | 7.6% | – 1.2 | 15.0% | – 0.6 | 15.0% | + 0.3 | 41.9% | + 0.7 | 4.3 |
| Talking Heads | 29.3% | – 0.2 | 49.4% | + 1.0 | 7.8% | – 1.0 | 18.2% | + 2.6 | 15.9% | + 1.2 | 43.1% | + 1.9 | 2.5 |
| Diff Transformer | 31.6% | + 2.1 | 53.5% | + 5.1 | 9.0% | + 0.2 | 18.0% | + 2.4 | 15.3% | + 0.6 | 39.2% | – 2.0 | 2.8 |
| Model | GSM8K EM | GSM8K Maj@5 | MATH-500 EM | MBPP P@1 | HumanEval P@1 | Avg. Rank | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| IHA (Ours) | 8.34% | + 2.73 | 8.42% | + 2.81 | 3.54% | + 0.66 | 24.5% | + 1.1 | 17.1% | – 0.1 | 1.4 |
| Global Attention | 5.61% | – | 5.61% | – | 2.88% | – | 23.4% | – | 17.2% | – | 2.9 |
| Global+Local | 6.82% | + 1.21 | 6.90% | + 1.29 | 2.26% | – 0.62 | 23.6% | + 0.2 | 16.0% | – 1.2 | 2.9 |
| Talking Heads | 5.46% | – 0.15 | 5.38% | – 0.23 | – | – | 23.8% | + 0.4 | 16.0% | – 1.2 | 4.0 |
| Diff Transformer | 5.46% | – 0.15 | 5.61% | – | – | – | 25.0% | + 1.6 | 15.4% | – 1.8 | 3.5 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Multi-Head Attention
Multi-head attention uses parallel attention heads to route and combine information in Transformers, shaping their capacity, interpretability, and efficiency.
See all 74 papers