When Exact Token Importance Is Not Enough: Limits of Top-K Selection in LLM Attention
Irmaan Mirzanejad in Inference & systems
Can exact token scores choose a worse attention pair?
When Exact Token Importance Is Not Enough: Limits of Top-K Selection in LLM Attention
Why exact individual scores can mislead
- 1
Measure one deletion
Delete each position alone from dense attention; measure exact KL from the dense next-token distribution to the result.
- 2
Rank the deletions
Keep the K highest singleton-deletion KL scores; larger deletion loss means retaining that position.
- 3
Renormalize the survivors
Sparse softmax renormalizes retained positions together; their joint output, then the unchanged downstream model, determines loss.
A lower-ranked token completes the better pair

In the four-position example, left ranks exact singleton-deletion KL; right compares equal-size pair losses. Top-2 picks {1,4}, while {3,4} is optimal under the same dense reference.
The gap can grow without bound
The finite example proves failure but says little about the worst-case gap for fixed-budget ranking.
For K=2, a four-position perturbation keeps the singleton order strict: as it shrinks, ranked loss tends to a positive constant while the best pair's positive loss tends to zero.
Exact singleton Top-2 therefore has no uniform multiplicative approximation factor over this class.
An exchange depends on its companions
- 1
The current set has context
Its retained mass AS and renormalized output hS summarize the current set.
- 2
Swap one position
Replacement output depends on current mass AS, current output hS, and the exchanged positions' weights and values; downstream KL measures its predictive effect.
- 3
Change the companions
For every K≥2, the same candidate pair can reverse downstream-KL preference as the other retained positions change.
Exhaustive audits reveal support headroom

At M=24, K=4, left is the fraction with ≥10% lower-KL alternatives to exact-singleton Top-4; right is median headroom to the pool optimum. Counts: 55/60 SmolLM2, 49/60 Gemma-2-2B, 60/60 Qwen3.5-4B.
SwapCert turns improvement into a witness
At M=24, K=4, exhaustive search evaluates all 10,626 size-four supports to identify the best set inside the fixed pool.
It checks 80 same-budget one-position exchanges. Any ≥10% downstream-KL reduction certifies at least that much headroom in the M=24 pool; it detected 157/164 supports with at least 10% exact-oracle headroom.
These are support-evaluation counts, not a measured model-forward speedup.
A KL margin can certify the next token
If dense-reference KL is below half the squared probability margin between the dense top token and runner-up, the support must preserve top-1.
In the M=24, K=4 audit, the margin test certified top-1 preservation in 152/180 exact-singleton cells, 159/180 after best one-swap, and 161/180 at the pool optimum.
This certifies agreement with the dense top token, not better task accuracy.
A separate geometric score is tested at larger K

2K, 3-layer cached decode compares geometric Top-K with attention Top-K. Only Gemma's geometric-minus-attention paired 95% dense-reference KL intervals were below zero at both K=128 and 256; n=30/model, exploratory, unadjusted.
What these audits do not establish
Finite candidate universe
The exhaustive optimum is only among 24 eligible positions at K=4, not all context tokens.
Empirical scope
The primary audit uses 30 LongBench-E prompts per model family across three models, with two correlated head measurements per prompt.
Different large-budget score
At K=128/256, cached decoding uses geometric head-output displacement, not exact downstream-KL singleton ranking.
No deployment savings
The full KV cache stayed resident; actual KV-byte savings and end-to-end serving latency were not measured.
Why it matters
- At K=2, exact singleton Top-2 has no uniform multiplicative guarantee under downstream KL.
- For sparse-attention research, measure the retained set's downstream loss and check same-budget swaps, not only per-token ranks.
- Open problem: make support-aware selection cheap under real KV-memory and latency budgets.
11 slides, 3 min
6 days ago