WorksComputer Science
When Exact Token Importance Is Not Enough: Limits of Top-K Selection in LLM Attention
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.
Introduction
Consider a large language model (LLM) answering a question about a long document. To reduce attention cost at a decoding step, it may attend to only earlier token positions. A natural shortcut ranks the positions one by one and retains the highest-scoring ones. The complication is that attention is a weighted combination: after positions are discarded, softmax recomputes the relative weights of all survivors. Two positions that appear highly influential when tested separately can therefore pull the retained representation away from the model’s full-attention representation. A lower-ranked position may instead complete a much better set.
A four-position example. The effect already occurs in a small, exactly solvable attention head. Its full-attention output is 2.15. Measuring each of four positions by the exact change in downstream Kullback–Leibler (KL) divergence when that position alone is deleted ranks positions 4 and 1 highest. But keeping only produces an output of 3.071, while the lower-ranked pair produces 2.214, much closer to the full-attention output. After the same frozen binary next-token predictor, the first pair has 133.2 times the downstream KL of the second (§ 4.2). The example illustrates the central distinction: *The surprising implication is that even perfect knowledge of individual token importance can lead to a substantially inferior retained set. The failure arises from the selection rule itself, rather than from errors in estimating importance. As we subsequently prove, this discrepancy can be arbitrarily large in relative terms.
Why this matters for long-context inference. As context grows, attention requires increasing key–value (KV) cache storage, memory traffic, or both. Sparse-attention and KV-retention systems limit the active history through eviction, retrieval, query-conditioned masks, and related mechanisms [12, 11, 7, 9] (Li et al. 2024). Many such systems construct a support by assigning a scalar score to each position and selecting the Top-. Improving a scorer is valuable, but the resulting support is jointly renormalized. The central problem is therefore: which set of exactly positions best preserves the downstream next-token distribution?
An exact-score test of the ranking abstraction. We isolate this problem from errors in importance estimation. Imagine an oracle that measures the actual change in the frozen language model’s next-token distribution whenever one position is deleted from the full attention support. These are exact, objective-matched singleton-deletion scores. We ask whether ranking them is sufficient for fixed-budget support selection. The four-position counterexample shows a large finite loss gap; a continuous family strengthens this to unbounded multiplicative suboptimality. In addition, an exact exchange identity demonstrates that the outcome of replacing one retained position depends on the current set’s total weight and weighted output. We prove that the preference between the same two candidates can reverse when their accompanying retained positions change, at every budget .
From the structural result to a measurable diagnostic. For a fixed support budget, we call the reduction in downstream loss achievable by choosing a better support headroom. We measure it against exact global optima inside a candidate universe: a prespecified pool of eligible positions from which the retained are selected. Complete enumeration is feasible in this controlled setting. Across frozen full-softmax attention heads from three LLM families, exact downstream-singleton Top-4 frequently leaves at least 10% relative headroom. We measure its absolute KL scale and the conditioned exchange preferences underlying the gap. SwapCert then examines the one-exchange neighborhood of any incumbent support. An issued witness identifies an incoming position, an outgoing position, and a verifiable decrease in the same downstream loss. We calibrate its empirical detection rate against the fully enumerated optimum. The contribution of this diagnostic is its transparent measurement of remaining support headroom; the mathematical novelty lies in the objective-matched ranking/support separation.
Connecting support quality to model behavior. We also examine the predictive consequences of changing a support. A KL–margin condition guarantees preservation of the dense model’s top next-token prediction whenever the downstream divergence is sufficiently small. A standard autoregressive KL chain rule extends the interpretation to distributions over generated sequences. At larger active budgets , we measure multi-layer cached-decoding fidelity using a practical geometric score, attention-based selection, and position-based controls. We report dense-reference KL, reference-token negative log-likelihood (NLL), and observed generated continuations. These complementary measures distinguish distributional fidelity, discrete predictions, and task outcomes under clearly specified interventions.
Contributions
Fundamental limits of exact token ranking. We establish that even exact singleton importance, measured under the target downstream prediction objective, can yield arbitrarily inferior
fixed-budget supports. A constructive counterexample and an unbounded approximation-gap theorem establish this limitation already at (§ 4).
Mathematical characterization of support dependence. We derive an exact support-exchange identity and prove that preferences between candidate positions can reverse as a function of their retained context for every . These results characterize the structural mechanism underlying the separation between individual importance and joint support quality (§ 4.4).
Exact empirical characterization and certified improvement. Through exhaustive support evaluation in three LLM families, we quantify the prevalence and magnitude of the ranking–support gap, examine its underlying mechanism, and validate SwapCert as a constructive certificate of available same-budget improvement. We further connect support quality to predictive decisions through KL–margin certification and larger-budget, multi-layer decoding experiments (§ 5–§ 7).
Together, these contributions establish a theoretical and empirical foundation for downstream-aware support selection under computational, memory, and temporal constraints, connecting the fundamental limitations of independent ranking with the broader problem of joint support optimization in LLMs.
Related Work
Ranking, retrieval, and KV budgets. Heavy-Hitter Oracle (H2O) combines heavy-hitter and recent-token retention ([12]); StreamingLLM maintains attention sinks and a recent window ([11]); SparQ and Quest selectively retrieve KV history ([7, 9]); and SnapKV uses prompt-derived per-head selection ((Li et al., 2024)). Ada-KV optimizes the allocation of retention budgets across attention heads ([2]). These systems operate at different granularities and cost models. The common evaluation question is the quality of the support actually activated by a particular query.
Value-aware scores and conditional guarantees. CriticalKV analyzes output perturbations beyond raw attention mass ([3]). AnDPro motivates token scoring through value-space geometry ([4]). DropKV studies residual-output perturbation and derives a constant-factor selection guarantee under an explicit cone condition ([13]). These positive results illustrate when economical scores can be justified by structure. We instead test an assumption-free implication for the same downstream KL objective that evaluates the final set: even granting exact singleton-deletion KL, can independent Top- optimize the jointly renormalized support? Our unbounded-ratio result establishes why useful approximation guarantees require additional structure.
Set-aware selection and exact subset reconstruction. BumbleBee explicitly formulates streaming KV summarization through submodular subset selection ([5]); AnDPro also begins from a retained-set objective. Trust the Mass examines forced renormalization, exact restricted subset optimization, and head-output reconstruction ([8]). Our study is complementary in both objective and oracle: the evaluated loss is downstream next-token KL after the frozen Transformer remainder, and the ranker is supplied exact downstream singleton effects. The exhaustive candidate-universe optimum calibrates how much that specific ranking can leave on the table. Head-output reconstruction and downstream-KL support losses can exhibit different relative gaps; the absolute scale and outcome metrics must be considered alongside relative headroom.
| Approach | Object of evaluation | Mathematical or computational role |
| Value-aware selectors | Head-output perturbation | Efficient approximations of token importance |
| DropKV | Renormalized head-output residual | Conditional approximation guarantee |
| Set-aware methods | Subset utility and reconstruction | Support-dependent optimization |
| Exact singleton oracle (this work) | Downstream KL of each deletion | Objective-matched ranking sufficiency test |
| SwapCert (this work) | Downstream KL of exchanged support | Checkable one-sided headroom witness |
Table 1. Related methodological perspectives. The fidelity object and type of guarantee distinguish support-level diagnosis from deployed KV selection.
Fixed-Budget Support Selection and Theory
Softmax supports and an objective-matched singleton oracle
Let denote the set of valid past positions in a frozen softmax-attention head ([10]), the unnormalized attention score (logit) of position , and its value vector. With every valid position retained, the dense weights and head output are
For a retained support , sparse-softmax renormalization yields
Here is the original dense attention mass retained by , and is the resulting renormalized head output. Let be the dense model’s next-token distribution and the distribution after replacing the target head output with and propagating through the unchanged downstream model. The joint support loss is
For a prespecified candidate universe of eligible positions and a support budget , define and . To eliminate importance-estimation error, give each candidate its exact downstream singleton-deletion loss
Write for the highest-scoring candidates (with a fixed tie-breaking rule). The central question is whether always minimizes (3) over .
Three quantities with different meanings. The singleton score evaluates one deletion from the dense context. The support loss evaluates a jointly renormalized retained set. The headroom of an incumbent support measures how much lower that same support loss can become at fixed cardinality. The distinction concerns their mathematical relationship, independently of any particular ranking heuristic. For an open-ended prompt, is simply the frozen model’s next-token distribution at the observed prefix; its KL against is computable without a reference answer (Eq. (8)).
An exact objective-matched counterexample
Consider four dense weights , scalar values , and downstream binary logits . The dense head output is . Direct evaluation of all four singleton-deletion KL values gives
Thus exact-singleton Top-2 selects . Exact enumeration of all six size-2 supports gives , with
a 133.2-fold loss ratio.
Proposition 1 (Exact singleton ranking is insufficient). Even exact, objective-matched downstream singleton-deletion KL scores do not generally identify a jointly optimal fixed-cardinality support under softmax renormalization.
The values above establish the proposition by construction; all singleton and pair evaluations appear in Appendix § 10. Figure 1 makes the central distinction visible: the singleton ordering is exact, yet the two selected tokens form a poor pair after renormalization.
Figure 1. Exact marginal ranking versus joint support quality. Left: objective-matched downstream singleton-deletion KL (). Right: downstream KL of the two size-2 supports. Exact singleton Top-2 selects , while the optimal pair is ; the loss ratio is 133.2×. Both supports use the same cardinality and the same dense reference distribution.
An unbounded approximation gap
The finite 133.2× example has strictly positive optimum and captures an experimentally checkable case. The structural limitation is stronger: the ranked support can have arbitrarily worse downstream KL than the optimal support under the same budget.
Proposition 2 (No uniform multiplicative approximation for exact-singleton Top-2). For every , there exists a four-position softmax head with a binary frozen downstream predictor such that the exact downstream singleton-deletion scores have a strict Top-2 ordering, the best size-two support has positive loss, and
Figure 2. Unbounded loss ratio with a fixed exact singleton ordering. The four-token perturbation family preserves the Top-2 support while the jointly optimal pair approaches the dense downstream prediction. The ratio diverges as . The curve illustrates the exact construction established analytically in Proposition 2.
Consequently, exact objective-matched singleton Top- has no instance-uniform multiplicative approximation factor over this class, already at .
Proof sketch. Keep the rational weights and binary logits , and set . At , the dense output and the output of support both equal 2, while exact singleton scores strictly order the candidates as . Hence the ranked support is and has strictly positive KL. For sufficiently small , continuity preserves the strict singleton ordering. Meanwhile , so the KL of this feasible support tends to zero quadratically, whereas the KL of ranked support tends to a positive constant. All six size-two supports have positive KL for sufficiently small . Thus the ratio exceeds any . Appendix A.2 gives the exact inequalities and an independent verifier.
This establishes a precise boundary between measuring singleton relevance perfectly and approximating support quality uniformly. Structural assumptions such as those underlying positive approximation guarantees in related work are therefore substantively meaningful.
Support-conditioned exchange value
For , with and , the restricted outputs satisfy
The exact displacement depends jointly on retained mass , current output , and both exchanged positions. For fixed , the resulting downstream preference is conditioned on the accompanying support.
Proposition 3 (Preference reversal for every $K\ge 2). For every fixed support budget , the same pair of candidate positions can reverse downstream-KL preference solely because the other retained positions change. A context-independent scalar ranking cannot encode every fixed-budget exchange preference.
Proof. Use uniform attention on values consisting of zeros and the four values , , , . Let the shared -element context contain the zeros and either or . Under a symmetric binary downstream map with dense output , KL is strictly increasing in the absolute retained output. In the negative context, appending gives , while appending gives ; is preferred. In the positive context, the corresponding outputs are and ; is preferred. The two candidate preferences therefore reverse for every .
A certified exchange in the four-token construction. The counterexample makes the exchange geometry directly observable. Starting from exact-singleton Top-2, , replacing by preserves the support budget and changes the restricted output from to . The corresponding downstream loss decreases by 0.01707905 (a 99.25% relative reduction). Thus one verified same-budget exchange connects the objective-matched ranking failure to the constructive witness returned by SwapCert; the exact four-token optimum is attained in this single step.
Predictive fidelity and next-token stability
For any frozen prefix, the downstream KL is the expected log-score regret under the dense predictive distribution:
The reference distribution is defined directly by the frozen model at that prefix, including open-ended questions. This identifies a label-free objective for predictive fidelity; reference-answer NLL offers a complementary, task-related measurement.
Proposition 4 (KL–margin top-token guarantee). Let be unique with margin . If , then .
Proof. Pinsker’s inequality gives . For , .
From one step to a generated sequence. Let and denote dense and support-policy distributions over generated tokens, with conditional predictions defined at the same prefixes. The standard autoregressive KL chain rule gives
For any measurable event on complete continuations—including an answer satisfying a specified correctness rule—Pinsker’s inequality implies
These classical identities clarify how fixed-prefix fidelity can control sequence-level distribution changes when evaluated along the dense-prefix distribution. They also distinguish closeness to the dense model from improving benchmark accuracy, which requires direct outcome evaluation. A proof and the required conditional-distribution assumptions are given in Appendix § 11.
SwapCert: Constructive Same-Budget Headroom Auditing
Define . For , the global candidate-universe headroom and best one-swap witness are
For , both are set to zero. At threshold , SwapCert evaluates neighbor supports, returns the best exchange and its evaluated KL, and fires if .
Theorem 1 (One-sided witness soundness). For any feasible support and , implies .
Proof. Since , the minimum of over is no greater than its minimum over . Hence .
The mathematical result concerns the ranking/support boundary. SwapCert operationalizes it as a verifiable diagnostic: its witness is the evaluated improvement itself, while its recall is an empirical property of the audited candidate universes. At , , a certificate inspects equally sized candidate supports, compared with the 10,626 supports evaluated by the exact offline oracle. Its reported improvement is directly checkable by reevaluating the original and exchanged supports under the same downstream KL.
Oracle-call complexity and diagnostic workflow. The exact singleton oracle in Eq. (4) evaluates one-deletion interventions to build an objective-matched ranking. Once an incumbent -support is available, exhaustive one-exchange auditing evaluates restricted supports; the full candidate-universe oracle requires evaluations. At the primary , setting this is 80 versus 10,626 support evaluations, a factor of 132.8 in candidate count. Each loss evaluation consists of a fixed-head intervention followed by downstream model propagation, so evaluation count and total model-forward cost are distinct accounting units. A positive witness reports the entering and leaving positions and two evaluated predictive distributions, which permits direct independent verification. These computational quantities explain how exhaustive calibration and local certification complement each other within a controlled frozen-model audit.
Experimental Design
Primary exact audit. We evaluate HuggingFaceTB/SmolLM2-1.7B-Instruct, google/gemma-2-2b, and Qwen/Qwen3.5-4B with 30 frozen examples per family from LongBench-E, a long-context evaluation benchmark (ten each from the 2WikiMultihopQA and HotpotQA question-answering tasks and the English PassageRetrieval-en task [1]). We intervene on the first and last heads of the deepest ordinary full-softmax layer (zero-indexed layers 23, 25, and 31). For each head, is the largest valid dense-attention positions. The support contains the highest scores from Eq. (4). Every one of the feasible supports is evaluated, totaling 1,912,680 support evaluations over 180 primary prompt–head cells. The head-output displacement is injected into the frozen downstream model. The headroom threshold was fixed prior to outcome evaluation. Prompt-cluster bootstrap confidence intervals (CIs) resample prompts and retain both heads from each prompt.
Supporting exact audits. Five outcome-independent candidate-universe constructions test universe sensitivity; exact panels and a descriptive panel test budget sensitivity. Additional approximately 2- and 4-context tests screen prespecified same-budget exchanges across more heads (Appendices § 13–§ 20).
Larger-budget cached decode. The new protocol uses 2,048-token inputs, , and all heads in the last three eligible full-softmax layers. Model prefill is dense; selected attention is sparsified during subsequent single-query cached decoding. At each active step we compare attention-weight Top- with a geometric singleton score
This is the exact head-output singleton displacement magnitude; the primary impossibility and exhaustive experiments use the distinct downstream-KL singleton score . We evaluate dense-reference KL, reference-answer NLL, recency and sink–recency controls, and matched positive-exchange screens. Precision and backend parity follow model-specific validated protocols; details are in Appendix § 22. The intervention changes the active per-query attention support over a resident KV cache; the full cache remains available to the evaluator. Thus the experiment isolates predictive consequences of support choice, while physical memory reduction, cache eviction and end-to-end serving latency define a separate systems evaluation.
Results
Exact singleton ranking leaves substantial candidate-universe headroom
Figure 3 and Table 2 report the primary audit. Proposition 2 describes the worst-case theoretical boundary; the following measurements quantify its finite-model manifestation and absolute size. In all three families, exact singleton Top- frequently leaves relative headroom , although absolute KL scales and rates vary by family. The global qualifier refers to the enumerated universe.
Figure 3. Primary exact support-selection audit at , . Left: proportion of prompt–head cells whose exact downstream-singleton Top-4 support has at least 10% relative headroom; whiskers resample the 30 prompt clusters, retaining both heads within each prompt. Right: median relative headroom against the exact best size-4 support in the frozen 24-position universe.
| Model | Median [95% CI] | Median KL [95% CI] | |
| SmolLM2 | 55/60 | .926 [.807,.984] | [,] |
| Gemma-2-2B | 49/60 | .561 [.346,.658] | [,] |
| Qwen3.5-4B | 60/60 | .954 [.942,.964] | [,] |
Table 2. Primary exact , audit. Intervals are 95% prompt-cluster bootstrap intervals. KL .
Five outcome-independent candidate universes yield rates of 88.1%, 87.2%, 86.0%, 96.4%, and 99.2% (Appendix § 13). In lower-budget exact audits at , rates are 107/120 SmolLM2, 49/120 Gemma, and 118/120 Qwen. The descriptive panel finds 12/12 cells with at least 10% headroom in each family. A paired SmolLM2 panel compares attention Top- against exact downstream-singleton Top-: the latter lowers joint-support KL in 38/120 cells, ties in 34, and raises it in 48. This directly illustrates why more accurate marginal scoring does not monotonically improve the final support.
Exchange geometry and the reach of the local witness
Across the mechanism analysis, 216 cells yield 900 conditioned contexts and 6,512 improving one-swap witnesses. At , strict preference reversals occur in 100% of oracle-positive SmolLM2 cells, 100% of Gemma cells, and 98.3% of Qwen cells. The median Kendall (tie-adjusted rank correlation) between ranking and conditioned preferences is respectively .025, .062, and .116. Best-one-swap oracle headroom capture medians are 97.16%, 96.40%, and 78.10%, with greedy one-swap search reaching the global oracle in 41.82%, 69.39%, and 25.00% of positive cells, respectively (Appendix § 16). Figure 4 shows the source-level paired measurements across all 180 primary cells.
Figure 4. Support-conditioned ranking instability and joint-support headroom. Each point is an exact , model/prompt/head cell. The horizontal axis summarizes context-dependent pairwise inversions; the vertical axis is exact candidate-universe headroom. This descriptive plot illustrates the exchange mechanism rather than a population-level causal relation.
What the certificate detects. SwapCert fires on 52/55, 48/49, and 57/60 primary supports whose exact candidate-universe headroom satisfies . These correspond to 157/164 oracle-positive supports pooled descriptively across models; the prompt-cluster 95% recall intervals are [88.1%,100%], [93.2%,100%], and [88.3%,100%], respectively. Every firing returns the actual exchanged support and an evaluated loss reduction of at least 10% relative to the incumbent. Among the seven oracle-positive non-firings, six have an improving one-swap below 10%, and one Qwen support has global headroom beyond its immediate improving neighborhood. These two mechanisms distinguish threshold sensitivity from one-swap locality and make the diagnostic outcomes interpretable (Figure 6; Appendix § 17).
Figure 6. Constructive diagnosis and observed token decisions at , . Left: SwapCert recall at against the exact candidate-universe headroom-positive cells (prompt-cluster 95% intervals). Right: observed agreement with the unmodified dense next-token top-1; all four exact-singleton flips are corrected by the best evaluated same-budget one-swap.
Larger-budget multi-layer predictive fidelity
Absolute fidelity at matched active-support budgets. Table 3 compares four explicit -token selection rules under the same 2,048-token input, dense prefill, and three-layer cached-decode intervention. Attention- and geometric-score supports consistently give smaller mean dense-reference KL than the position-based recent and sink-plus-recent supports in the six tested model/budget settings. For example, at , Gemma’s mean KL is under attention selection and under geometric selection, compared with for recent and for sink-plus-recent. These absolute losses ground the paired improvements in the magnitude of the actual predictive distortion.
| Model | Attention | Geometric | Recent | Sink+recent | |
| SmolLM2 | 128 | .0011103 | .0009981 | .1794272 | .0425540 |
| SmolLM2 | 256 | .0006785 | .0006863 | .1704914 | .0403637 |
| Gemma-2-2B | 128 | .0006760 | .0006308 | .0419478 | .0134970 |
| Gemma-2-2B | 256 | .0003143 | .0002836 | .0362449 | .0122437 |
| Qwen3.5-4B | 128 | .0011924 | .0011308 | .2587330 | .2472465 |
| Qwen3.5-4B | 256 | .0006270 | .0006127 | .2447003 | .2159831 |
Table 3. Four fixed-budget baselines at 2K context. Mean dense-reference next-token KL over 30 paired prompts; lower is better. Every method uses the same active support cardinality in all heads of the three selected full-attention layers.
Paired KL and gold-answer likelihood. Table 4 adds prompt-paired uncertainty to the geometric-versus-attention comparison and reports reference-answer negative log likelihood alongside KL. The NLL is calculated on up to eight answer tokens per prompt, complementing the label-free dense-reference objective with a measured reference-token score. Gemma at has 22/30 KL wins and 24/30 NLL wins; its mean KL difference is and mean NLL difference is , with exploratory paired 95% intervals below zero for both. At , Gemma’s KL interval also lies below zero. Relative to the corresponding attention-KL means, Gemma’s reductions are 6.68% and 9.77% at and , respectively. SmolLM2 and Qwen exhibit smaller or more variable differences on their matched prompts. Across models, reporting both metrics reveals how a support’s dense-predictive fidelity relates to the likelihood of observed answer tokens.
| Model | dense-reference KL [95% CI] | gold-answer NLL [95% CI] | |
| SmolLM2 | 128 | [] | [] |
| SmolLM2 | 256 | [] | [] |
| Gemma-2-2B | 128 | [] | [] |
| Gemma-2-2B | 256 | [] | [] |
| Qwen3.5-4B | 128 | [] | [] |
| Qwen3.5-4B | 256 | [] | [] |
Table 4. Paired geometric minus attention Top- differences. Negative values favor geometric scoring. Each interval is an exploratory prompt-bootstrap 95% CI (; 20,000 resamples). NLL uses up to eight gold answer tokens. The two support budgets reuse each model’s prompt panel.
Figure 5. Paired larger-budget dense-reference KL differences. Geometric singleton Top- minus attention Top- on the same 30 prompts per model; negative favors geometric scoring. Whiskers are exploratory 95% prompt-bootstrap intervals, unadjusted for multiple comparisons. Both budgets share the same prompt panel.
Constructive exchanges at larger . A separate panel evaluates up to eight same-budget exchanges per configuration against equal-count randomized proposals. Positive improving witnesses appear in 39/72 model–budget–prompt configurations, across all three families and both budgets (Appendix § 22). The guided-minus-random paired intervals contain zero in each configuration, characterizing the current resolution of the proposal comparison. These observations extend the presence of improving fixed-budget exchanges to the larger-support setting, with the exact candidate-universe oracle reserved for the experiment.
Next-token and generated-output behavior
In the matched next-token behavioral panel, exact-singleton selection changes the dense top-1 in 1/60 SmolLM2, 2/60 Gemma, and 1/60 Qwen cells; in all four, the best same-budget one-swap and the candidate-universe oracle restore the dense decision. The improvement intervals contain zero, consistent with the low frequency of boundary crossings (Figure 6). Proposition 4 clarifies the connection: a small enough dense-reference KL relative to the dense probability margin certifies a stable top-1 prediction.
Certified preservation of the dense top-1. We additionally apply Proposition 4 to every cell of the next-token behavioral audit. With dense top-token probability and top-two logit difference , the probability margin is computed as . Each evaluated support satisfying therefore has a proved dense top-1 match. Table 5 reports this deterministic test next to observed changes. Across the 180 model–prompt–head cells, the number of mathematically certified matches increases from 152 with exact-singleton ranking to 159 after the best same-budget swap; full candidate-universe optimization certifies 161. All four observed top-1 deviations of the initial ranker are corrected by the best swap. These guarantees are computed at the same frozen prefixes and downstream KL objective as the exact support audit.
| Model | Ranked certified | Best-swap certified | Oracle certified | Ranked flips |
| SmolLM2 | 56/60 | 59/60 | 60/60 | 1/60 |
| Gemma-2-2B | 39/60 | 41/60 | 41/60 | 2/60 |
| Qwen3.5-4B | 57/60 | 59/60 | 60/60 | 1/60 |
| Total | 152/180 | 159/180 | 161/180 | 4/180 |
Table 5. KL–margin certification and observed dense top-1 changes for the exact , next-token panel. Certified cells satisfy . Each entry is out of 60 model–prompt–head cells.
In the new diagnostic, geometric and attention-ranked supports produce identical 24-token greedy continuations on all 90 paired model–prompt cases (30 per family). They match dense continuations in 30/30 SmolLM2, 28/30 Gemma, and 28/30 Qwen cases. The restricted response budget frequently truncates an answer before a substantive final response: 19/30 SmolLM2 decoded strings are empty and all 30 Qwen strings contain a reasoning tag. The 90 paired continuations therefore characterize decoding stability at this horizon, alongside the gold-token NLL and KL measurements; Appendix § 22 records the task-output details.
Implications and Discussion
A general principle for sparse attention. The unit of optimization matters. An individual relevance score asks how much a candidate influences the dense computation under a singleton intervention. Joint support selection asks which candidates produce the smallest downstream deviation after collective renormalization. The finite counterexample, unbounded-ratio family, and all-budget preference reversals establish a sharp mathematical separation between the two. The gap persists even when the singleton score is evaluated exactly under the eventual set-level objective. This provides a clear reason to evaluate both the marginal ranker and the jointly selected support.
When a support-quality gap becomes useful. The exhaustive oracle makes relative headroom measurable, while absolute downstream KL quantifies its predictive scale. A high relative gap can arise from small absolute KL values, so both are reported in the main experiments. SwapCert adds a local, inspectable certificate: the proposed outgoing and incoming positions, their evaluated support losses, and the exact size- replacement. Its candidate evaluations provide a controlled audit cost; the oracle provides independent calibration. The standard neighborhood enumeration is deliberately transparent. Its scientific role is to expose support-level information that a singleton ranking alone cannot certify.
From KL to decisions and generated answers. The expected-log-score identity connects the loss directly to predictive distributions at open-ended prefixes. The KL–margin test certifies dense top-1 preservation in 152/180 exact-singleton supports, increasing to 159/180 after the best one-swap and 161/180 under the candidate-universe optimum. In the four observed rank-induced top-token changes, the best one-swap restores the dense decision. The trajectory chain rule gives a formal route from conditional KL along dense continuations to sequence-event stability. At the larger budgets, paired gold-answer NLL offers a reference-token metric beside the dense-reference KL. The short greedy test shows that probability changes and discrete outputs need not move together: attention and geometric rankings produce identical short continuations in the matched 90 cases. This combination defines a principled assessment hierarchy: support loss, token decisions, sequence-distribution fidelity, and actual answer quality.
A broader open problem: budgeted, downstream-aware support policies. In deployed inference, supports vary by layer, head, prefix, and generation time. A natural research target is a support policy selecting at layer , head , and decoding step , under a resident-memory budget and runtime budget :
Here the conditional predictor includes all interacting layers, measures actual resident KV bytes, and includes scoring, support selection, and inference time. This formulation separates the quality of a support policy from the cost of constructing and deploying it. It connects to submodular selection, value-aware scoring, adaptive budget allocation, and systems-level KV management, but imposes the downstream predictive objective and sequence coupling explicitly.
The structural results motivate three concrete challenges: finding economical surrogates for support-conditioned loss; deriving useful bounds or pruning certificates that improve on direct neighborhood enumeration; and validating such policies with physically enforced cache budgets, inference cost, and full-answer evaluation. The present exact and cached-decode audits make these challenges quantitatively testable rather than merely conceptual.
Conclusion
Exact downstream singleton importance is an informative measurement of individual relevance, yet it does not generally approximate the best jointly renormalized fixed-budget support: the multiplicative gap can be unbounded. We prove this boundary, derive the exchange mechanism and all-budget preference reversals, and measure its finite-model consequences through exhaustive downstream-KL audits. SwapCert turns remaining candidate-universe headroom into a checkable same-budget witness, while KL–margin certification and larger-budget cached decoding link support quality to predictive behavior. The resulting foundation places joint downstream support quality alongside ranking accuracy as an essential object of study for sparse LLM inference. It opens a precise agenda for support-aware algorithms and end-to-end evaluation under real memory, compute, and generation constraints.
Reproducibility and Use of Computational Tools
All reported original experiments use the fixed protocols and candidate universes detailed in the appendices. The accompanying numerical artifacts include the exact counterexample verifier, raw model/prompt/head audit records, larger-budget outputs, figure-source data, and the KL–margin audit. Automated tools, including generative AI systems, assisted literature discovery, editing, source-code inspection, and proof cross-validations. The author is responsible for the mathematical and empirical claims.
Exact Constructions and Proof Details
Every singleton-deletion and size-two support
Let , and . Deleting candidate and renormalizing gives . With the logistic sigmoid , define and
The exact singleton scores are:
| 1 | 1.687500 | 0.00918668148 |
| 2 | 2.611111 | 0.00536906759 |
| 3 | 2.437500 | 0.00228497479 |
| 4 | 1.600000 | 0.01374411597 |
Table 1 (PDF p. 16).
The jointly renormalized size-two supports yield:
| 2.000000 | 0.000796590380 | |
| 2.500000 | 0.003276210803 | |
| 3.071429 | 0.017208222670 | |
| 0.000000 | 0.593430803601 | |
| 1.916667 | 0.002026829576 | |
| 2.214286 | 0.000129168300 |
Table 2 (PDF p. 16).
Ranking selects ; exact minimization selects , with ratio 0.017208222670/0.000129168300 133.2.
Unbounded multiplicative suboptimality: exact construction
The following perturbation family establishes Proposition 2 analytically. Use fixed weights , values , and binary downstream logits with . Then
so . When , , giving support loss zero, whereas , giving positive loss .
The singleton-deletion outputs at , in the order , are
Write and . The exact Bernoulli KL of a sigmoid-logit shift from to is the Bregman expression
Since strictly decreases for positive , a negative shift of magnitude produces greater KL than a positive shift of the same magnitude from , as long as the shifted logits remain positive. The negative shifts for deletions 4 and 1 have magnitudes 1.26 and 0.9; the positive shifts for deletions 2 and 3 have magnitudes 0.8 and 0.7875. Monotonicity of the Bregman expression along each side therefore gives the strict exact singleton ordering
For reference, the KL values in the same order are
The ordering in Eq. (15) persists for all sufficiently small by continuity. For such , the ranked support remains , and its KL converges to 0.02830090151079275 as . Meanwhile
To justify strict positivity of the left side, observe that at the only size-two supports reproducing are and . For , their output differences from are and , both nonzero; the other four differences remain nonzero in a neighborhood of zero. The downstream sigmoid is strictly monotone, so zero KL is equivalent to equal head outputs. The optimal positive loss can therefore be arbitrarily small while ranked loss remains bounded below. This proves the unbounded ratio with strictly positive numerator and denominator.
| Loss ratio | |||
| 0.02655013167 | 8,958.9 | ||
| 0.02812162715 | 916,190.3 | ||
| 0.02828293148 | 91,822,039.0 |
Table 6. Illustration of the analytically established perturbation family. The support ranking is and the best pair is at each listed positive . The unbounded conclusion follows from the proof, not from finite numerical search.
Exchange and reversal calculations
For , substituting and proves Eqs. (6)–(7) directly. In Proposition 3, the dense output is zero. With symmetric binary logits , loss is , increasing strictly with . The two contexts and formed from shared zeros plus or yield completed support means and for candidates and . The preference reverses in the two contexts.
One-sided soundness
For any , , hence . Dividing by gives . At , the quantities are defined to be zero. This proves Theorem 1.
Autoregressive Predictive-Fidelity Bridge
Consider a fixed initial prompt and two autoregressive conditional predictors whose conditional next-token distributions are defined on every continuation prefix. Denote the dense predictor by and the support-policy predictor by . Their induced finite-length laws are
Assume finite vocabulary and strictly positive softmax probabilities. Expanding the log ratio into a sum of conditional log ratios and taking expectation with respect to gives the chain-rule identity in Eq. (9). In particular, if the dense-prefix expected sum of conditional KL divergences is at most , Pinsker’s inequality yields for every event on length- continuations. The guarantee concerns the probability of an event under the two generative distributions; a benchmark prediction is evaluated by the actual sampled or decoded response and its task-specific scoring rule. The conditional KL in this identity is evaluated on prefixes sampled from the dense sequence law, so independent one-step prefix probes serve as empirical building blocks rather than a substitute for the full expected sum.
Experimental Definitions and Statistical Units
Every primary exhaustive statement refers to , within a frozen candidate universe. Each model has 30 prespecified LongBench-E prompts, 10 from each of 2WikiMultihopQA, HotpotQA, and PassageRetrieval-en. The first and last full-softmax heads are examined at the deepest eligible softmax layer: zero-indexed 23 for SmolLM2, 25 for Gemma and 31 for Qwen. Each prompt contributes two correlated head measurements; prompt-cluster bootstrap resamples prompts with their heads together. The 10% threshold and primary evaluation design were fixed before the primary outcomes.
Candidate-Universe Sensitivity
Let denote the attention head’s output-projection matrix. Candidate universes are formed independently of downstream support-loss outcomes: U1 retains the top 16 attention positions and 8 remaining positions with the largest ; U2 uses the top 24 attention positions; U3 uses top 12 attention plus 12 uniformly sampled remaining valid positions (two seeds); U4 samples 24 valid positions uniformly (two seeds); U5 samples 6 from each of four contiguous attention-rank quartiles.
| Construction | Cells | Rate | 95% cluster CI | Median |
| U1 hybrid | 360 | .8806 | [.8250,.9306] | .8329 |
| U2 attention | 360 | .8722 | [.8167,.9222] | .8275 |
| U3 mixed, two seeds | 720 | .8597 | [.8028,.9139] | .8272 |
| U4 random, two seeds | 720 | .9639 | [.9389,.9847] | .8851 |
| U5 stratified | 360 | .9917 | [.9750,1.0000] | .8948 |
Table 7. Exact candidate-universe sensitivity, across three models.
| Model | 95% cluster CI | Median | Median | |
| SmolLM2 | 107/120 | [.825,.950] | .83058 | |
| Gemma | 49/120 | [.325,.4917] | .004078 | |
| Qwen | 118/120 | [.950,1.000] | .92994 |
Table 8. Exact , cross-model audit (120 cells/model).
Exact Lower-Budget Replication
The Gemma lower- behavior differs markedly from its results, underscoring model–budget interactions.
Primary Statistical Audit
Cluster-bootstrap median global headroom estimates are SmolLM2 .92591 [.80678,.98388], Gemma .56094 [.34624,.65773], and Qwen .95385 [.94152,.96414]. Median absolute-KL improvement estimates are respectively [], [], and []. Independent recomputation of the primary support losses has maximum absolute discrepancy zero.
Support-Conditioning Mechanism Audit
Across 216 cells, the mechanism audit evaluates 900 conditioned contexts and records 6,512 improving one-exchange witnesses. High one-swap capture can coexist with incomplete greedy convergence
| Model | Reversal | Median | Median inversion | Best-swap capture | Greedy oracle |
| SmolLM2 | 100% | .0250 | 48.75% | 97.16% | 41.82% |
| Gemma | 100% | .0619 | 46.90% | 96.40% | 69.39% |
| Qwen | 98.33% | .1155 | 44.23% | 78.10% | 25.00% |
Table 9. Support-conditioned mechanism at ; reversal and greedy figures refer to cells with .
because a single strong exchange and a path to the global optimum are different properties.
SwapCert Positive-Witness Accounting
| Model | Oracle positives | Hits | Misses | Recall [95% CI] |
| SmolLM2 | 55 | 52 | 3 | 94.55% [88.14%,100%] |
| Gemma | 49 | 48 | 1 | 97.96% [93.18%,100%] |
| Qwen | 60 | 57 | 3 | 95.00% [88.33%,100%] |
Table 10. All , positive-certificate outcomes.
The 157/164 pooled recall is descriptive. The seven misses consist of six cases with positive one-swap gain below threshold and one Qwen cell whose best one-swap is not improving despite more than 10% global candidate-universe headroom. All issued certificates are sound by Theorem 1.
Next-Token Behavioral Audit and Numerical Consistency
The original one-step audit contains 180 cells. Exact-singleton Top-4 changes dense top-1 in one SmolLM2, two Gemma, and one Qwen cells. Each is repaired by the best one-swap and the exact candidate-universe oracle. Prompt-cluster agreement-gain intervals are [0,5%], [0,8.33%], and [0,5%]. In the primary bfloat16 (BF16) implementation, batch-shape dependence affected four Gemma behavioral cells (maximum KL discrepancy relative to the primary calculation’s tolerance). Recomputing behavioral quantities at batch size one and independently reproducing primary exhaustive scores preserved the original values exactly.
Descriptive Stress Test
The fixed descriptive extension includes 12 cells/model. All 12/12 cells per model exhibit candidate-universe headroom of at least 10%. Median is .9751 SmolLM2, .6179 Gemma, and .9364 Qwen. These observations complement the primary analysis.
Larger-Context Swap Screens and Marginal Ranking
A separate exact SmolLM2 panel uses an outcome-independent hybrid universe (top 16 attention positions, plus eight geometric-leverage positions), 30 prompts, two heads, and , comparing attention, head-output singleton magnitude, and exact downstream singleton KL. Another approximately 2K-token swap screen spans three models, three layer-depth settings, two sparsity settings, 1,512 heads, and 48,384 prespecified exchanges; an approximately 4K-token last-layer replication spans 504 heads and 16,128 exchanges. Each head is tested against 32 same-budget exchanges. These report observed improving swaps rather than candidate-universe global optima. In the paired SmolLM2 exact panel, exact downstream-singleton Top- has lower support KL than attention Top- in 38 cells, ties in 34 and higher KL in 48; headroom occurs in 108/120 exact-singleton and 104/120 attention-ranked supports.
Reproducibility and Protocol Integrity
The supplementary source package includes numerical verifiers for the exact counterexample and reversal construction, machine-readable primary enumeration and sensitivity evidence, the witness audit, and the secondary cached-decode scripts and raw prompt-level results. The primary results use the frozen prompt/model/head/budget settings stated above. Separate output files and analysis rules distinguish exact enumeration, descriptive supporting evaluations, and larger-budget controls; protocol-dependent model precision and native-attention backend details are recorded with each measurement.
Controlled multi-layer, larger-budget cached-decode audits
Purpose and experimental unit. The primary paper exhaustively evaluates a single full-softmax head over candidates at small . This appendix describes an additional fixed-budget comparison at 2,048-token prompt length. The common paired unit is a prompt, not an individual decoded token, attention head, layer, support budget, or swap. The 30 LongBench-E prompts comprise 10 examples each from 2WikiMultihopQA, HotpotQA, and PassageRetrieval-en. Prompt hashes are matched across methods and budgets. The model revisions, experimental scripts, and raw JSON Lines (JSONL) evidence are distributed separately with the supplementary artifact.
Intervention and ranking rules. A standard dense prefill produces cached states. Each subsequent single-query decode invocation is evaluated with the last three eligible full-softmax attention layers sparsified at all heads. Earlier layers and non-softmax blocks remain as in the frozen model. Support selection is recomputed per active head and decode step using the same budget or 256. In addition to the unmodified dense path, we compare attention-weight Top-, geometric singleton Top- , recent-token selection, and sink-plus-recent selection. The geometric score measures an exact singleton head-output displacement norm; the original exact-enumeration study uses the downstream singleton KL of Eq. (4). All surviving softmax weights are renormalized.
| Model | Precision | dense-reference KL [95% CI] | gold NLL [95% CI] | KL wins | |
| SmolLM2 | BF16 | 128 | [, ] | [, ] | 17/30 |
| SmolLM2 | BF16 | 256 | [, ] | [, ] | 17/30 |
| Gemma-2-2B | FP16 | 128 | [, ] | [, ] | 22/30 |
| Gemma-2-2B | FP16 | 256 | [, ] | [, ] | 24/30 |
| Qwen3.5-4B | BF16 | 128 | [, ] | [, ] | 18/30 |
| Qwen3.5-4B | BF16 | 256 | [, ] | [, ] | 16/30 |
Table 11. Controlled 2K core results. Both columns are geometric-singleton Top- minus attention Top-; negative values favor geometric ranking. Intervals are exploratory prompt-bootstrap 95% CIs.
The intervention modifies per-head active attention supports over cached values; cache residency is held fixed. Effective active budget and actual resident bytes are thus separate quantities in this protocol.
Controls, precision, and uncertainty. The controlled decode panel computes dense-reference next-token KL and observed gold-answer NLL for up to eight answer tokens, with 30 prompts per model/budget setting. Gemma uses half-precision floating point (FP16) after a dense comparison between eager attention and scaled dot-product attention (SDPA); SmolLM2 and Qwen core results use BF16. Independent Qwen native-dtype/FP16 generation is kept separate. Head-output reconstruction is checked by comparing the reconstructed full-attention head output with the model’s native output; backend parity is checked at the prompt level in the strict runs. Exploratory 95% confidence intervals below use 20,000 prompt-level paired percentile-bootstrap replicates with fixed seed 2027. The intervals are descriptive, unadjusted for the six tested configurations; both budgets share the same prompt panel.
Additional selection baselines. The full four-method absolute-KL comparison appears in Table 3 of the main text. Recent-only and sink-plus-recent selectors use the same head/layer intervention, prompt panel, and active-support budget as attention and geometric selection. The full core paired KL/NLL table above additionally records numerical precision and KL wins per configuration.
Exchange-witness study. For each of the six model/budget settings, we evaluate a separate set of 12 prompts and at most eight prespecified exchange candidates per configuration, including equal-budget randomized controls. Strictly improving one-swap witnesses occur in 7/12, 7/12, 8/12, 7/12, 5/12, and 5/12 prompt configurations (SmolLM2 ; Gemma ; Qwen ), respectively: 39/72 total tested configurations. The 95% intervals for best-guided-minus-best-randomized KL include zero in each configuration. Together these measurements document both the availability of positive same-budget exchanges and the sampling uncertainty in proposal selection. Gemma witness experiments use BF16 and are analyzed separately from Gemma FP16 core experiments.
24-token greedy-generation diagnostic. At , 30 prompts per model are decoded for up to 24 greedy tokens. Dense, attention Top-, and geometric Top- are paired within each prompt. The geometric and attention selectors yield the same decoded continuation in 30/30 SmolLM2, 30/30 Gemma, and 30/30 Qwen prompts (90/90 total). This is an exact observed equality on the frozen 24-token panel, directly indicating that the paired KL/NLL changes did not alter these short greedy output strings. Reported answer exact match is zero for every selector on this restricted panel; mean geometric/attention question-answering token-overlap F1 (QA-F1, the harmonic mean of token precision and recall) is 0.0425, 0.1154, and 0.0656, respectively. Of the short decoded outputs, 19/30 SmolLM2 outputs are empty strings and 30/30 Qwen outputs contain a <think> segment. These protocol features affect the interpretation of short-answer scores; the unchanged continuation finding directly describes only this 24-token diagnostic. Qwen generation uses FP16 with the validated native-dtype reconstruction path.
Relationship to the exact theory and original audits. Theorem 1 and the objective-matched counterexample address the mathematical gap between exact downstream singleton ranking and the combinatorial optimum of a fixed universe. The 2K extension measures a related output-geometric singleton rule at larger budgets during cached decoding; the exact candidate-universe oracle and one-sided certificates are evaluated in the study. The two protocols therefore provide complementary observations at their respective experimental scales. The appendix reports precision-specific numerical controls and the full outcomes, including near-ties, to facilitate independent interpretation.
KL–Margin Decision Certification on the Exact Behavioral Panel
For each of the 180 next-token model–prompt–head cells, let be the dense top-token probability and let be the recorded difference between the largest and second-largest dense logits. The dense probability margin is , since . Applying Proposition 4 to each saved support gives the deterministic criterion . Within the SmolLM2/Gemma/Qwen panels of 60 cells each, this criterion holds for 56/39/57 exact-singleton ranked supports, 59/41/59 best one-swap supports, and 60/41/60 exact candidate-universe oracle supports. The corresponding pooled counts are 152/180, 159/180, and 161/180. The ranked supports change the dense top-1 in 1/2/1 cells by model; best swaps and oracles preserve it throughout the panel. The supplementary program margin_certificate_audit.py recomputes each margin, tests all three strict inequalities, confirms agreement for every certified cell, and writes the complete 180-row derived table. The counts refer to fixed recorded interventions and do not require statistical estimation of a model population.
References
- [1]Bai, Y., Lv, X., Zhang, J., et al. LongBench: A bilingual, multitask benchmark for long context understanding. In ACL, 2024.arxiv.org/abs/2308.14508
- [2]Feng, Y., Lv, J., Cao, Y., Xie, X., and Zhou, S. K. Ada-KV: Optimizing KV cache eviction by adaptive budget allocation for efficient LLM inference. In NeurIPS, 2025.arxiv.org/abs/2407.11550
- [3]Feng, Y., Lv, J., Guo, H., Cao, Y., Zhou, S. K., and Xie, X. CriticalKV: Optimizing KV cache eviction from an output perturbation perspective. In Proceedings of the 43rd International Conference on Machine Learning, PMLR 306, pp. 30221–30246, 2026.arxiv.org/abs/2502.03805
- [4]Geng, Z., Wang, J., Liu, Z., et al. Accurate KV cache eviction via anchor direction projection for efficient LLM inference. In NeurIPS, 2025.DOI
- [5]Kumari, L., Wang, S., Zhou, T., Sarda, N., Rowe, A., and Bilmes, J. BumbleBee: Dynamic KV-cache streaming submodular summarization for infinite-context transformers. In COLM, 2024.
- [7]Ribar, L., Chelombiev, I., Hudlass-Galley, L., et al. SparQ attention: Bandwidth-efficient LLM inference. In ICML, 2024.arxiv.org/abs/2312.04985
- [8]Shi, J. and Gu, J. Trust the mass: Forced weights in KV-cache eviction. arXiv:2608.25230, 2026.arxiv.org/abs/2608.25230
- [9]Tang, J., Zhao, Y., Zhu, K., Xiao, G., et al. Quest: Query-aware sparsity for efficient long-context LLM inference. In ICML, 2024.arxiv.org/abs/2406.10774
- [10]Vaswani, A., Shazeer, N., Parmar, N., et al. Attention is all you need. In NeurIPS, 2017.arxiv.org/abs/1706.03762
- [11]Xiao, G., Tian, Y., Chen, B., Han, S., and Lewis, M. Efficient streaming language models with attention sinks. In ICLR, 2024.arxiv.org/abs/2309.17453
- [12]Zhang, Z., Sheng, Y., Zhou, T., et al. H2O: Heavy-hitter oracle for efficient generative inference of large language models. In NeurIPS, 2023.arxiv.org/abs/2306.14048
- [13]Zhang, A., Gurses, S., Deng, Y., et al. DropKV: Decoupling residual-output perturbation for near-optimal KV-cache eviction. arXiv:2610.22130, 2026.arxiv.org/abs/2610.22130





