NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

When Exact Token Importance Is Not Enough: Limits of Top-K Selection in LLM Attention

Irmaan MirzanejadarXiv 2026

TL;DR

When Large Language Models (LLMs) trim down long histories to save memory, they usually rank past tokens one by one and keep the "Top-$K$" most important ones. This paper proves that even if you had a magical oracle telling you the exact importance of every individual token, picking the top $K$ can still give you an arbitrarily terrible combination. Because attention weights get renormalized over the survivors, choosing tokens is like picking a basketball team: five star centers don't make the best starting lineup.

What Problem Does This Paper Address?

As an LLM reads a massive document, keeping every past token in its Key-Value (KV) cache eats up enormous memory and bandwidth. A standard fix is sparse attention: score each past token's importance, keep the Top-$K$ winners, and discard the rest.

Up until now, a lot of research assumed the main bottleneck was coming up with better, faster approximations of individual token importance. The author steps back to ask a deeper, structural question: Is ranking individual tokens even the right abstraction?

Here’s the catch: attention is a weighted average computed via a softmax function. Once you throw away tokens, softmax renormalizes the weights of the survivors so they still sum to 1. Two tokens that look crucial on their own might pull the final representation in the same extreme direction when combined, whereas pairing a top token with a lower-ranked "balancing" token might recreate the full context almost perfectly.

Methods

To separate scoring errors from the flaw of Top-$K$ selection itself, the author introduces several clean analytical and diagnostic tools:

  • Exact Singleton Oracle: Instead of using heuristics (like raw attention weights), each candidate token is scored by actually deleting it from the full context, running the rest of the frozen LLM, and measuring the exact Kullback–Leibler (KL) divergence—a measure of how much the model's next-word probability distribution shifts.
  • Exhaustive Candidate-Universe Audits: Because checking every subset of thousands of tokens is impossible, the author isolates a controlled pool of $M=24$ top attention positions in frozen LLM heads and brute-forces all $\binom{24}{4} = 10,626$ possible 4-token combinations to find the true global optimum.
  • SwapCert: A lightweight, constructive diagnostic. Starting from a chosen $K$-token set, it checks all $K(M-K)$ single-token swaps (80 checks instead of 10,626) to see if trading one token in and one out yields a verifiable drop in KL divergence ("headroom").
  • KL–Margin Certificate & Multi-Layer Decoding: A mathematical bound using Pinsker's inequality that guarantees when a small KL divergence preserves the dense model's #1 next-token choice, paired with larger-budget ($K \in \{128, 256\}$) multi-layer experiments comparing standard attention Top-$K$ against a value-aware geometric score.

Datasets

No models are trained in this study; all experiments audit frozen off-the-shelf models (SmolLM2-1.7B-Instruct, gemma-2-2b, and Qwen3.5-4B). For evaluation, the author uses LongBench-E, a standard long-context benchmark, drawing 30 examples per model across three tasks: 2WikiMultihopQA, HotpotQA, and PassageRetrieval-en (with inputs up to 2,048 tokens for larger-budget runs, and supporting 2K/4K screens). No new datasets are introduced.

Key Insights and Ideas

  • Even perfect individual scores fail—badly: In a tiny, 4-token toy attention head, exact singleton ranking picks tokens $\{1, 4\}$, which incurs 133.2$\times$ more downstream KL error than the true optimal pair $\{3, 4\}$. By tweaking one value parameter, the author proves this multiplicative gap is mathematically unbounded.
Figure 1: Exact marginal ranking versus joint support quality. Left: objective-matched downstream singleton-deletion KL (dj). Right: downstream KL of the two size-2 supports. Exact singleton Top-2 selects {1, 4}, while the optimal pair is {3, 4}; the loss ratio is 133.2×. Both supports use the same cardinality and the same dense reference distribution.
  • Token value is context-dependent (Preference Reversals): Through an exact algebraic exchange identity, the paper proves that for any budget $K \ge 2$, whether token $A$ is better than token $B$ can completely flip depending on which other $K-1$ tokens are sitting alongside them. No static scalar ranking can capture this.
  • Better individual scores don't guarantee better sets: Counterintuitively, upgrading from raw attention-weight Top-$K$ to exact downstream-KL Top-$K$ actually made the joint 4-token set worse in 48 out of 120 SmolLM2 test cases (improving only 38).

Key Results

  • Prevalence of the Ranking Gap: In the primary $M=24, K=4$ audit across 180 prompt–head cells, exact-singleton Top-4 left at least 10% relative KL improvement on the table in 55/60 (SmolLM2), 49/60 (Gemma-2-2B), and 60/60 (Qwen3.5-4B) cases, with median relative headroom of 92.6%, 56.1%, and 95.4%, respectively.
  • SwapCert Efficiency: Checking just 80 single swaps detected 157 out of 164 cases that had $\ge 10\%$ headroom.
  • Next-Token Stability: Across the 180 exact audit cells, exact-singleton Top-4 flipped the model's top next-token prediction 4 times; a single SwapCert exchange fixed all 4 flips and raised mathematically certified top-1 matches from 152/180 to 159/180.
  • Larger-Budget Decoding ($K=128, 256$): Attention and geometric Top-$K$ crushed simple recency and sink+recent baselines in KL fidelity (e.g., $\sim 6.3 \times 10^{-4}$ vs. $1.35 \times 10^{-2}$ on Gemma at $K=128$). Geometric scoring beat raw attention on Gemma by 6.68% ($K=128$) and 9.77% ($K=256$) in mean KL, though short 24-token greedy continuations remained identical across all 90 paired cases.

Limitations and Future Work

The author is refreshingly transparent about what these experiments do not claim:

  • Diagnostic vs. Systems Deployment: Exact enumeration and SwapCert require running downstream model evaluations, making them scientific auditing tools rather than fast, deployable KV-eviction algorithms. Furthermore, the cached-decode tests mask attention over a resident cache rather than physically evicting memory or measuring wall-clock speedups.
  • Small Absolute Errors & Short Horizons: High relative headroom (like 95%) sometimes happens when absolute KL divergences are already tiny ($\sim 10^{-4}$), meaning discrete token outputs don't always change. Also, the 24-token greedy generation test often cut off before models finished reasoning tags or full answers.
  • Future Directions: The paper frames an open optimization problem for the community: designing cheap, set-aware surrogates that optimize joint downstream predictions across layers and time steps under strict physical memory and latency budgets.

Summary updated

Abstract

Long-context language models often retain only a limited set of past token positions for an attention query. A common strategy scores positions individually and keeps the highest-ranked K. Yet attention weights are renormalized over the chosen set: two individually important positions need not form the best pair. We ask whether independent ranking suffices even when each importance score measures the exact downstream change in next-token predictions caused by deleting that position alone. It does not. A four-position construction makes the ranked pair incur 133.2 times the Kullback-Leibler (KL) divergence of the optimal pair, and a parametric family proves that this multiplicative gap is unbounded. An exact exchange identity and preference reversals for every K >= 2 explain the interaction. In exhaustive frozen-model audits of SmolLM2, Gemma, and Qwen, exact-singleton Top-4 leaves at least 10% relative improvement within a fully enumerated 24-position candidate pool in 55/60, 49/60, and 60/60 cases, respectively. SwapCert, a same-budget one-swap audit, detects 157/164 such cases and returns directly checkable improving supports. A KL-margin certificate relates support fidelity to next-token stability; larger-budget, multi-layer cached-decoding experiments measure predictive fidelity at K = 128 and 256. These results establish joint support quality as an essential object of analysis for sparse attention and motivate downstream-aware support selection under inference constraints.
BibTeX
@misc{mirzanejad2026when,
  author = {Irmaan Mirzanejad},
  title = {{When Exact Token Importance Is Not Enough: Limits of Top-K Selection in LLM Attention}},
  year = {2026},
  eprint = {2611.32324},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32324},
}
Figure