Attention Is More Than You Need: Spectral Redundancy in Multi-Head Routing

Charles CaoNeurIPS 2026

TL;DR

Modern transformers save memory by letting multiple attention heads share keys and values, yet each query head still burns quadratic compute calculating its own token-to-token "routing" map. This paper proves that, in the worst case, sharing keys and values gives you zero shortcut around that compute bottleneck—even though real-world models like Llama 3 and Qwen3 exhibit massive redundancy, using only a tiny fraction of their routing capacity in practice. This clash between mathematical worst-cases and empirical laziness defines both the opportunity and the core obstacle for next-generation attention compression.

What Problem Does This Paper Address?

Every time a transformer processes a sequence of $N$ tokens, its attention mechanism builds $N \times N$ routing matrices to decide which tokens read from which. Recent theoretical work proved that for standard multi-head attention, evaluating every head independently is essentially optimal—you cannot cleverly pool work across heads to beat that quadratic arithmetic cost.

However, modern LLMs rarely use vanilla multi-head attention anymore. Instead, they rely on Multi-Query Attention (MQA) and Grouped-Query Attention (GQA), which share keys and values across query heads to relieve memory bandwidth bottlenecks. This leaves a nagging open question: does sharing keys and values let us bypass the compute barrier and share the expensive $N \times N$ routing calculations too? And if worst-case math says no, are trained models actually using all those independent routes anyway?

Methods

To investigate both theory and reality, the author pairs fine-grained complexity proofs with a new diagnostic tool: the calibration-stacked spectral framework.

Instead of looking at attention weights in isolation, this framework treats a layer as a combined routing-and-message operator—capturing both where a head looks (the $N \times N$ routing matrix) and what it transmits (its value-output projection, or "message map"). Crucially, looking at one prompt at a time can be deceiving; a layer might look simple on individual inputs while requiring incompatible message channels across different prompts. To prevent this illusion, the author stacks hundreds of calibration prompts together.

Analyzing a stacked matrix of 50 million rows directly via Singular Value Decomposition (SVD) is intractable, so the paper introduces a neat Gram-matrix trick: reducing the massive problem to a tiny $H \times H$ eigenproblem (e.g., $32 \times 32$ for a 32-head layer) comparing head-by-head similarities. Finally, the framework carefully separates three levels of compression difficulty:

Hierarchy of route compression classes, from unconstrained real matrices (Signed) to attention-realizable projections (Softmax).

Datasets

Because this is a diagnostic and theoretical study rather than a model-training paper, datasets are used strictly for calibration and evaluation across 14 open-weight models (from Qwen3, Llama 3, Gemma 2, and Mistral, spanning 0.6B to 70B parameters). No new benchmarks are introduced. The authors use:

  • C4 (validation set prompts for primary spectral calibration and bootstrap stability tests)
  • WikiText-103 and CodeParrot (to test robustness across domains and sequence lengths)
  • WikiText-2 (to measure perplexity impacts when greedily merging routes)

Key Insights and Ideas

  • KV sharing is not compute sharing: Even in a single-layer MQA setup where all heads share one key-value pair, worst-case query heads still require full, independent quadratic routing computations (assuming the Strong Exponential Time Hypothesis).
  • Algebraic simplicity doesn't mean easy compute: Remarkably, the exact mathematical construction used to prove computational hardness has an algebraic "stochastic route width" of just 1! Knowing that an aggregate route exists in low dimensions doesn't mean you can compute it cheaply from raw token embeddings via a softmax function.
  • Giant models are shockingly redundant: In practice, trained models leave most of their routing capacity on the table. Effective rank can even drop below the number of KV heads, meaning heads in different KV groups are quietly doing overlapping work.
  • Compilers face a hard puzzle: Even if you just want to greedily reassign existing heads to reuse a smaller subset of representative routing patterns (a setup the paper calls PATTERNMERGE), finding the optimal assignment is NP-hard.

Key Results

Measuring 14 GQA checkpoints reveals stark, widespread spectral decay across layers:

Table 1: Layer-median routing-message spectrum statistics for fourteen GQA models. Hq: query heads; Hkv: KV heads; reff: effective rank; TR: fraction of squared singular-value energy in ranks > R.
  • Low effective rank: Against 8 to 64 query heads, layer-median effective rank ($r_{\text{eff}}$) sits between just 4.3 and 11.7. Llama-3-70B has 64 query heads and 8 KV heads, yet operates at a median effective rank of 4.3, with a single direction capturing ~97% of its signed energy ($T_1 = 0.026$).
  • Eight directions rule them all: On C4 at length $N=512$, just 8 signed route-message directions capture >90% of the calibration energy in every single tested model. Across 126 domain-by-length combinations, 8 directions capture at least 87.9% everywhere (and >90% in 121 of them).
  • Diagnostic ranking works, naive merging doesn't: When forcing heads to share routes (PATTERNMERGE), picking routes using the paper's joint routing-message metric beats pure attention-similarity baselines in >97.5% of layers. However, brute-force patching degrades language modeling quality (e.g., Qwen3-8B WikiText-2 perplexity jumps from 12.87 unpatched to 20.7 with 16 routes, and collapses completely at 4 routes).

Limitations and Future Work

The author is refreshingly candid about what this paper doesn't do: it diagnoses redundancy, it does not build a faster attention kernel. Measuring high algebraic compressibility ("signed" relaxation) only proves that redundancy is present—it does not solve the "softmax realizability" hurdle of generating those shared routes cheaply on new inputs without computing the original heads first. Turning this spectral map into an actual wall-clock speedup will require new training recipes or learned routing compilers that bridge the gap between algebraic low-rank structure and efficient softmax execution, validated on downstream tasks.

Summary updated

Abstract

Recent direct-sum hardness results show that computing multi-head attention by evaluating each head independently is essentially optimal under standard complexity assumptions, but leave open whether the key-value sharing in modern MQA and GQA architectures can circumvent this barrier. We prove that it cannot: even one-layer MQA with a single shared key-value head requires one full quadratic routing computation per query head in the worst case. To assess the routing redundancy of deployed models, we develop a calibration-stacked spectral framework that measures the effective number of independent routing-message directions in a layer, carefully separating signed, stochastic, and softmax-realizable compression; we also prove tight error-compounding bounds and NP-hardness of the natural route-merging compiler problem. We measure fourteen open-weight GQA checkpoints from four model families (0.6B–70B parameters); pooled across families, larger models tend to use a smaller fraction of their theoretical routing capacity, though not monotonically within every family. On C4 calibration at $N=512$, eight directions capture more than 90% of the signed calibration energy in every model; across a 126-setting domain × length grid they capture at least 87.9%, and more than 90% in 121 of the 126 settings. These results diagnose a signed calibration relaxation: they identify where route sharing is worth testing, but do not establish a realizable compressed attention module or wall-clock speedup.
BibTeX
@inproceedings{cao2026attention,
  author = {Charles Cao},
  title = {{Attention Is More Than You Need: Spectral Redundancy in Multi-Head Routing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=8I6ozAPipF},
}
Figure