Manuscript Offprint
arXiv:2608.25230Trust the Mass: Forced Weights in KV-Cache Eviction
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Every deployed sparse-attention or KV-cache-eviction rule keeps a subset of the keys, discards the rest, and renormalizes the attention weights over the kept set. Enumerating the exact best subset under that constraint on 168,192 attention rows from five models shows that keeping the largest weights is already near-optimal, since the best subset closes only a median 2 to 5% of the remaining gap to full attention. If selection closes this little, published margins between eviction methods must come from elsewhere, so we measure the bytes each method holds. In the shared evaluation pipeline, the strongest query-agnostic methods hold the full cache because their per-head selections are stored as masks, and only ragged per-head storage frees that memory. Enforcing a nominal budget on one fixed selection costs 14 to 62 benchmark points. We trace an 87.6-point retrieval margin to rankings computed while the question is visible. ContourKV, a training-free allocator built from the dropped-mass statistic, wins 93 of 160 paired comparisons against that state of the art and loses 22 at the byte count of the budget-enforcing baselines, and it ties the strongest of them.
1 Introduction
The KV cache stores a key and a value vector for every past token at every attention head and dominates serving memory at long context, so deployed systems shrink it by evicting entries. Every deployed eviction or sparse-attention rule keeps a subset of the keys and renormalizes the softmax weights over it, then returns the renormalized average in place of the dense attention output, so the methods differ only in how the subset is chosen ([22, 41, 20, 5]). Classical subset approximation re-solves the weights on the points that it keeps and selects by geometry ([6, 18, 9, 21]). Eviction forces the weights. We quantify the maximum gain any kept set can achieve once the weights are forced, and we identify what published comparisons between eviction methods actually measure.
We enumerated the exact best subset under forced weights on 168,192 attention rows from five models, which revealed that keeping the largest weights is already near-optimal. The best subset improves on it by a median 2 to 5% of the gap to the dense output, and a cheap swap rule recovers that median in full. The weight that selection drops predicts the exceptions (§2). If selection closes this little, the margins published between eviction methods must come from elsewhere. Thus, we run them on the field's own evaluation pipeline and read the bytes that each one holds. The margins decompose into memory, query information and compute. The strongest methods that compress without seeing the question select per attention head, and the pipeline stores that selection as a mask over a non-shrinking cache, so their published quality is selection quality at full memory (§4). Therefore, we find that enforcing a nominal budget on one fixed selection costs 14.1 to 62.2 benchmark points (§4), and an 87.6-point retrieval margin traces to rankings computed while the question is visible (§4).
We deploy ContourKV, our allocation rule. It wins 93 of 160 comparisons against KVzip ([20]), the leading method in that class, while losing 22, with its budget enforced against KVzip's full cache (memory ratios in App. D). At matched memory it ties Compactor ([5]), the strongest baseline
Preprint.
that enforces its own budget. This tie confirms the measurement at deployment scale ( ), since two rules near the subset optimum cannot separate when selection closes only a few percent of the remaining gap. ContourKV is training-free and borrows the compared methods' own importance scores, and its budget is enforced physically before any result is read.
Our contribution is the measurement and the accounting (positioning in §3), and it does not depend on ContourKV winning. Our object is the gap to the dense output—the only quantity a compressor can optimize before the query. We note that optimizing the gap is ideal only when one cache is reused. This is the multi-turn case, where a single compressed cache serves every later query while decode keeps appending to it. Storage that lets each head hold a different number of entries is being built for that cache ([19]). Downstream loss is separate (App. E).
2.1 Operator
Full details and proofs are in Appendix A.
Definition 2.1 (Terminology). An instance is a strictly positive probability vector on with points and mean . A nonempty kept set has , where is the mass of the key , and it has dropped mass and . The top-mass set is a size-s set of largest masses and .
At an attention head, is one query row, are the values, is the dense output, and is what any deployed sparse operator returns. We call the least achievable dropped mass. For , let be the error under re-solved weights and the error under forced weights. Their minima over are and , and .
Lemma 2.1. For ,
and sums to 0 across all . Furthermore, for every , , thus . It also holds that .
The factorization and the last bound are known ([34, 31, 13, 11]), although no prior bound addresses our object, the gap to the best subset. The problem is solved for free weights; in particular, and geometric minimizers that do not depend on (App. A). However, free and forced weights differ in value and argmin (Ex. 2.2), and that difference increases with budget (App. B.3).
Example 2.2 (Free and forced weights). Let , , , . Then, we get and , attained by . The top-mass set gives , a factor above the optimum.
Proposition 2.1 (Computational Hardness). Deciding is NP-complete, even at with uniform masses, integer points and . Unless , no polynomial-time estimate of within any multiplicative factor exists, and none within additive error on the reduction class (App. A).
The objective is not submodular (Ex. A.2), and is a nonconvex combinatorial minimization, so we enumerate over a restricted candidate set and use a cheap subset whose error upper-bounds at any budget. A selector maps an instance and a budget to a size-s kept set (top-mass is the deployed one) and the balancing selector is the greedy alternative that starts at and repeatedly takes the swap of one kept key for one dropped key that most decreases , stopping when no decrease exists. Balancing reads the dense output , so it runs at decode time (where the value-aware criteria of [13, 14] also apply) or as a prefill teacher. Note that we use it only to measure how much of the gap a better kept set can still close—ContourKV itself does not use it (§4).
Even though each query row is its own instance, deployment fixes one kept set per KV head and applies it to the group of query rows that share that head and to all future rows. Since every row could have kept the shared set itself, the best per-row subset can only do better, so the per-row optimum lower-bounds every shared rule's error. One group vote, which keeps the s keys of largest mass summed over the group's rows, costs each row a median to its own top-mass error at s = 8, and the cost rises monotonically with group size: , , , and at sizes 2, 4, 5, and 6. Against each row's own the medians run to . The vote degrades 76 to 90% of rows against their own top-mass sets and improves 7 to 10%, where the improved rows are those whose own top-mass keeps a key that the group vote drops. The multi-head family has group size 1, so the vote reproduces each row's own top-mass selection exactly.
2.2 Enumeration
Definition 2.2. The candidate set of an instance is the top-mass set together with the keys of largest single-key error , and is the exact minimum of es over the size-s subsets of the candidate set, so and the derived estimates are lower bounds. Write , and write for the fraction of the gap that a subset can close, with estimate using . Let be the set that the balancing selector returns. A (layer, head) pair, called a cell, is flat when its median dropped mass at exceeds 0.25.
Balancing recovers the closable share in every family and budget
Per family and budget, the residual is normalized so that top-mass sits at 1 and dense at 0. The cap is the share certified by exact enumeration over the candidate set, and the block below it is the remainder that cannot be closed by any candidate subset.

Since ES_pool >= ES, the cap is a lower bound on the share a subset can close, and the balancing selector searches the same candidate set. Cluster-bootstrap 95% CIs, seed 20250710.
Figure 1: Ceiling across 10 arms. Per family and budget, the reconstruction residual is normalized so that top-mass sits at 1 and dense at 0. The block is the remainder that cannot be closed by any candidate subset, and the cap above it is the share that a subset can close. The mark is the balancing selector's residual, which sits at the floor in every cell. Since , the cap is a lower bound. Whiskers are cluster-bootstrap 95% intervals.
Here, an instance is a sampled query row of a frozen attention head. Four families (Qwen2.5-1.5B, our reference family, Llama-3.2-1B, OLMo-2-1B, Qwen3-1.7B), with six rows sampled per head at every layer over three documents, give 111,744 instances at . We also ran a 7B arm at 16,384 tokens (adding 56,448), and test five further arms under the same protocol. This brings the panel to ten models over five lineages and 0.6B to 14B. We compute by exhaustive enumeration and certify it with cap-widening sweeps and an exact solver, which leave the median under 0.12 at every budget (protocol and certification in App. B). A larger enumeration cap at the worst budget case , from to subsets and four to six keys beyond , moves the median gap by under 1%, and on the depth-spanning head subset of that sweep the fraction with rises from 35.6% to 37.8% and then to 38.7%, with diminishing increments. A solver confirmed the argmin globally optimal on 37% of solved instances and found a materially better subset on 4.9% (every improvement tightens ES).
Penalty. We discover that the cost of forced weights grows with the budget. The ratio analyzes forced weights against the free-weight optimum. On the reference family, the median rises from 1.07 to 1.79 and its 99th percentile from 2.2 to 6.8 as rises from 4 to 32 (App. B.3). Once the weights are renormalized, geometric selection also does worse than top-mass (Table 8).
Selection ceiling. We find a median of 0.021 to 0.047 over eight families and all budgets, with per-budget intervals inside [0.017, 0.051], rising to 0.200 to 0.254 on the instances with . The share is measured against the top-mass-to-dense gap , since we recover when every key is kept, and it is small because large gaps are uncommon ( on 89 to of instances, on at , App. B). Top-mass attains outright on of instances at and at . We show that the balancing selector reaches this bound, recovering a median 1.00 of the closable gap in every family and budget ([1.00, 1.00], Figure 1). Per-family coverage at and spans 0.75 (OLMo-2) to 0.95 (Qwen3-0.6B), and every family clears 0.91 at . Where covered, the median is 1.00 to 1.03 and the 90th percentile is 1.14 to 1.28; since is restricted to the candidate set, these are upper estimates. We cannot search exactly at the deployed to 256 (Prop. 2.1), but no selector gains more than (Lemma 2.1), and this cap falls to a median 28 to of its value at and 8 to at . The balancing subset stays feasible and closes 0.04 to 0.13 of the gap across to 256 on the two audited families, at or above its level, so this share lower-bounds (Table 1, App. B.4). Thus decreases with while the closable fraction stays level.
| median balancing closure | s = 4 | 8 | 16 | 32 | 64 | 128 | 256 |
|---|---|---|---|---|---|---|---|
| Qwen2.5-1.5B | 0.001 | 0.023 | 0.032 | 0.032 | 0.044 | 0.047 | 0.041 |
| OLMo-2-1B | 0.134 | 0.144 | 0.124 | 0.091 | 0.126 | 0.127 | 0.105 |
| pooled | 0.032 | 0.057 | 0.058 | 0.050 | 0.075 | 0.077 | 0.061 |
| median dropped mass | 0.38 | 0.28 | 0.20 | 0.13 | 0.08 | 0.04 | 0.02 |
| gap, share of its s = 8 value | — | 1 | — | — | 0.28/0.34 | 0.16/0.21 | 0.08/0.12 |
Table 1: Native budget: the median share of the top-mass-to-dense gap closed by the balancing subset, which is a lower bound on , in one convention across all budgets (the vertical rule marks the enumeration boundary). The share holds at its small-budget level through while the gap it applies to, capped by the dropped mass (last row, pooled), collapses. Balancing beats top-mass by at least on 21 to of Qwen2.5-1.5B rows and 47 to of OLMo-2 rows across budgets. The last row gives the remaining gap at the deployed budgets as a share of its value on the native-budget records of the two audited families (Qwen2.5-1.5B/OLMo-2-1B, §2.4).
2.3 Prediction
Dropped mass certificate. We find that best predicts whether an instance has and , at AUC 0.76 to 0.85 on the four headline families and 0.76 to 0.89 across the ten arms. We tested an spectral alternative; it does not beat on any arm. The published absolute bounds rank at Spearman up to 0.98 but fall to 0.21 to 0.70 against ([34]). The prediction replicates across content types and retrieval contexts (Table 2, App. B.5). We find that of Lemma 2.1 is a one-pass statistic and tracks at Spearman 0.84 to 0.98 across budgets on the reference family and 0.80 to 0.98 pooled per family (Tables 8 and 6). The mechanism follows from §2, since a row with small caps the selector's gain at while a row with large leaves terms that a swap cancels. Per cell, gives the map of Figure 2, and flat-cell location is architectural, set by query-key normalization and windowing (per-family edge-to-interior ratios in Table 6), so we deploy , since a hard-coded edge rule fails on the query-key normalized and windowed models. On an H100, computing is an increment on work that top-mass selection already does, at to a dense attention layer across to 16,384 (0.12 ms per layer at ).
Task-structured contexts. We registered every bound before any capture, and all of them hold on contexts built to concentrate retrieval. The pooled stays at 0.016 to 0.042 per budget (registered ceiling 0.09), and the 90th percentile headroom ratio of retrieval-critical rows against background is 0.83 to 0.97 (ceiling 2). The case that needs value-aware selection occurs on of retrieval rows at (ceiling ), and the prediction transfers at AUC 0.75 to 0.80 (floor 0.70). We test on
Dropped mass and agree cell by cell (s = 8)
left of each pair: median m is - right: median (exact over the candidate set, )
Qwen2.5-1.5B (no QK-norm)

ms
k
Llama-3.2-1B (no QK-norm)

ms
k
Qwen3-1.7B (QK-norm)

ms
k
OLMo-2-1B (QK-norm)

ms
k
Qwen2.5-7B (no QK-norm)

ms
k
The same map per content type (content-diverse run)

prose (flat 54%)

code (flat 57%)

multi (flat 48%)
model: Qwen2.5-1.5B, 336 cells
flat/non-flat unanimous across contents: 82.1%
rank correlation of cell medians:
code-multi 0.89 · prose-code 0.90 · prose-multi 0.95
flips sit at the threshold (median |m is - 0.25| = 0.025)
fresh-document prose vs the base map: 93.5% agree
median m is
0 · not flat
median k
0.25 · flat
Figure 2: The map. Per cell, the left panel shows the median dropped mass at and the right panel shows the median from the same records. Cell-level AUC is 0.82 to 0.94, and balancing closes the cells whose median reaches 1.11. Since , those cells are certain.
| content type | AUC() span | share |
|---|---|---|
| English prose | 0.78 to 0.85 | 26 to 30% |
| source code | floor of the span, 0.71 | 33 to 37% |
| French text | 0.81 to 0.86 | 20 to 23% |
Table 2: Content diversity on the reference family (72,576 instances). “share” is the fraction of instances with , and the AUC replicates across all three content types. The headroom itself is content-dependent, and code carries the most (median to 1.06), which is consistent with flatter attention leaving a larger tail. Input-level 95% intervals are about percentage points on the share and to on the AUC.
planted needles [28], multi-hop variable chains, and long-document QA, assembled in token space so that needle positions are exact, with retrieval rows at least 20% of instances. The map’s cell labels (flat and non-flat) hold across these contexts (label agreement 0.90 to 0.93, order correlation +0.94 to +0.97).
2.4 Audit
Deployed selectors and loss. The deployed selectors SnapKV, H2O, Quest and StreamingLLM sit well above the optimum at small budgets, at a median 1.4 to 2.1 times at s = 8 against 1.02 to 1.03 for top-mass on the three sharper families, while TOVA's keep set is top-mass itself ([22, 41, 29, 33, 37]). SnapKV's error holds at 1.8 to 2.2 times the same-budget top-mass error through the deployed budgets; ranks each rule's excess at Spearman 0.70 to 0.84 without query-key normalization (App. C).
Switching only the flat cells to balancing lowers held-out continuation cross-entropy at s = 8 by 0.122 to 0.243 nats on five of the eight families (four lineages, 1B to 7B, every interval below zero). We measure loss in the model forward at matched budget, where each head's attention is replaced with the restricted operator , and the same code reproduces the unmodified model up to floating-point error. The switch captures 88 to 98% of what all-cell balancing achieves, and on Qwen2.5-7B at 16,384 tokens the gap doubles while the same switch recovers 63% of it. Keeping each rule on non-flat cells while switching the flat cells to balancing recovers 0.51 to 0.93 of its gap to all-cell balancing on all nine (selector, family) pairs, with each paired 95% interval below zero. We discover that on the three Qwen3 scales, the map selects the wrong cells and keeps 55/15/31% of the all-cell gain, so it supports cell-level conversion only, which must be measured per family. A rank-16 scorer trained on the query and key projections to reproduce the balancing swaps ([36]) recovers at most 5% of the decode-time loss reduction against a 25% bar fixed in advance, because the gain sits in the value-side residual , which lies outside those projections (App. E). Also, the constant that converts a reconstruction gain into a loss gain varies by four orders of magnitude across families; it is smallest where reconstruction gain is largest, and it is not predicted by dropped mass (App. E).
3 Related Work
We claim that forced weights separate this problem from prior work. Approximating a mean by a few of its points is classical. Additionally, every near-optimal answer re-solves the weights on the points that it keeps. Renormalization removes that freedom, since it only rescales the original weights. Resampling keeps the largest weights, which is optimal only for value-agnostic unbiased objectives ([6, 8]). Optimal design relaxes the subset to a re-solved design measure ([18]). Coresets and recombination reweight whatever they retain ([9, 26, 2]). The attention-discrepancy line applies vector balancing, with re-solved weights in [21] and one uniform rescaling of the kept weights in [23]. None of them answers which subset is best when the weights are fixed.
In the eviction literature the objects differ in another way. Value-aware scores rank one decision at decode time and do not certify the set that remains ([13, 14, 11]), and leverage selection builds sets that already contain the high-mass keys ([17]). Retained mass is deployed practice, which stops a budget ([24]) and allocates one across heads ([10]) without stating how far the resulting set sits from the optimum. We supply that statement. The nearest concurrent diagnostic works per block, so it certifies nothing per head ([40]).
On the systems side, ragged paging is being built for the storage constraint that we measure ([19]), and the nominal-to-physical memory gap is posed as an infrastructure problem ([27]), which we measure per method class. The deployed compressors are audited, in particular the reconstruction-scored class ([20]), the observation-window class ([22]), and the strongest budget-enforcing baseline ([5]). ContourKV reuses their importance scores with only the allocator replaced.
4 Deployment
ContourKV. The allocator uses one importance score and one threshold shared by every layer and head, so the budget flows to the cells where dropped mass predicts that selection can still improve ( 2.3). Each cell keeps a recency floor of the last 32 positions plus , where is set so that the cache averages entries per cell, so flat cells retain more. We instantiate with KVzip's context-reconstruction score ([20]), so the two methods differ only in the allocation, and with SnapKV's observation-window score ([22]), which needs no second pass. Both versions are training-free.
| Opponent | Holds | Not enforced (W/T/L) | Enforced (W/T/L) |
|---|---|---|---|
| KVzip | full cache | 146/9/2 | 93/45/22 |
| ExpectedAttention | full cache | 142/15/0 | 61/80/19 |
| FastKVzip | full cache | 74/3/0 | 57/23/0 |
| SnapKV | budget | 137/19/1 | 56/91/13 |
| Compactor | budget | 136/20/1 | 24/96/40 |
| KVzap | budget | 76/2/1 | 38/28/14 |
Table 3: Benchmark record: win/tie/loss for ContourKV against each opponent over paired conditions, without and with its budget enforced.
Setup and measured memory. We run Llama-3.1-8B-Instruct, Qwen2.5-7B-Instruct, Qwen3-8B and Qwen3-14B at 4,096 to 32,768 tokens on RULER ([15]) and LongBench ([1]), through NVIDIA's official kvpress pipeline and its method implementations whenever they exist ([7]). The fourteen library baselines span nine uniform-selection and five per-head methods, with H2O added in our harness, all at the same per-head budget (roster below). In the needle runs, the nine uniform-selection methods shrink the cache to 0.24 to 4.3% of full size, while the five per-head methods, including KVzip, hold all of it at every length and budget, because the pipeline stores each layer's cache as one tensor with equal slots per head and applies the selection as a mask (their own implementations free it with ragged per-head storage, [19]). ContourKV evicts physically in both modes and holds 0.15 to 5.3% of the cache enforced (0.6 to 1.5 times SnapKV's bytes) and 4.0 to 96% without. Since the benchmark setting records no bytes of its own, we replayed its contexts through the same code at the same commit (prefill only, 603 measurements per model), without touching a score. On the replayed benchmark documents, SnapKV and Compactor hold 0.09 to 3.6% of the full cache while KVzip holds all of it at all 56 conditions (ratios in App. D), and enforcement caps every ContourKV head at SnapKV's count.
Compared methods.
| selection | runs in | frees memory | |
|---|---|---|---|
| SnapKV, PyramidKV, TOVA, StreamingLLM, KNorm, KeyDiff, CriticalKV, Compactor, KVzap | uniform | library | yes |
| H2O | uniform | our harness | yes |
| ContourKV, budget enforced (benchmark setting) | uniform | library | yes |
| KVzip, FastKVzip, Ada-KV, ExpectedAttention, DuoAttention | per head | library | no |
| ContourKV, budget not enforced | per head | library | over-keeps |
| ContourKV, budget enforced (retrieval setting) | per head | our harness | yes |
The compared methods are SnapKV ([22]), PyramidKV ([4]), TOVA ([29]), StreamingLLM ([37]), CriticalKV ([11]), Compactor ([5]), KVzip ([20]), Ada-KV ([10]), ExpectedAttention ([7]), DuoAttention ([38]), and four methods shipped with the library, KNorm, KeyDiff, KVzap and FastKVzip. Selection is uniform when every head in a layer keeps the same number of entries, and it is per head when the counts differ. Our harness deletes per head instead, and in the benchmark setting enforcement caps each head before scoring. The unenforced row frees memory but over-keeps to each layer's widest cell, so only the two enforced rows free it fully.
KNorm prunes by key norm, KeyDiff evicts the keys closest to the layer's mean key direction, and KVzap is a learned per-layer scorer shipped with the library. CompressKV is evaluated separately (§4). We configured every method to keep the same fraction of the cache, 0.1 to 3.4% across the grid, so the methods differ only in which keys they keep. We exclude IndexMem ([39]), which releases neither code nor weights, and DBTrimKV ([3]), whose retention gates require training and whose released checkpoints do not cover any of our four models.
Benchmark results. Without enforcement (the reconstruction score), ContourKV beats KVzip in 146 of 157 paired conditions and loses 2, with LongBench margins of 18.1 to 30.3 points, while holding 3.5 to 84% of the cache (full W/T/L grid in Table 3). Enforcing the budget on one fixed selection, with the ranking unchanged, lowers the score in 140 of 157 paired conditions and does not raise it in any—by 14.1 points on average on LongBench , up to 62.2 on RULER . With the budget enforced, ContourKV still beats KVzip in 93 of 160 conditions and loses 22 at the budget-enforcing baselines' byte count (sixteen at RULER , where KVzip's full cache leads
| Opponent | W/T/L | Opponent | W/T/L |
|---|---|---|---|
| SnapKV | 23/23/2 | KVzip | 27/21/0 |
| PyramidKV | 23/23/2 | Ada-KV | 27/17/4 |
| TOVA | 25/23/0 | ExpectedAttention | 27/21/0 |
| StreamingLLM | 23/24/1 | H2O | 12/6/0 (18) |
| KNorm | 27/21/0 | KVzap | 11/8/0 (19) |
| KeyDiff | 21/26/1 | FastKVzip | 8/16/2 (26) |
| CriticalKV | 23/24/1 | DuoAttention | 9/2/2 (13) |
| Compactor | 24/22/2 |
Table 4: Retrieval: win/tie/loss for the window-scored ContourKV with its budget enforced against each compared method over document-paired conditions, with 48 per opponent unless noted in parentheses.
| Re-run | Change in hit rate | Memory |
|---|---|---|
| ranking restricted to document rows | -88.2 [-90.0, -86.4] | 1.02× |
| eviction moved to the document boundary | -87.6 [-89.0, -86.3] | 1.43× |
| difference of the two rows | +0.6 |
Table 5: The condition decomposition of §4, on eight document-paired Llama-3.1-8B cells at . Changes are hit-rate points against the unmodified run, and memory is relative to the run compressed before the question.
every budget-enforcing method). The advantage against SnapKV sits at RULER (+10.8 points). We note that this comes from the score, since the window-scored version ties SnapKV at equal memory and the reconstruction score costs 8.7 to 13.6 times a dense prefill (App. D).
The Compactor tie (24/96/40) is predicted by §2.2, since both sit near the subset optimum and selection closes only a few percent of the remaining gap. We can confirm this by reallocating the same total memory across cells by the window score (4/133/17, 0.13 points below SnapKV over 154 conditions). The reconstruction-scored variant was withheld when its answer-span coverage collapsed at matched memory (App. D).
CompressKV ([25]) is the one extreme-compression challenger with released code. Our port reproduces the official implementation's selection bitwise on all 328 test cases, and the one unavoidable question-time code-path difference moves bfloat16 scores by at most . It matches SnapKV at matched memory (+0.89, 60 of 80 tied) at 1.03 to 1.13 times a dense prefill. On RULER it trails enforced ContourKV by 9.39 points, in a query-agnostic setting that is not measured by its published scores (App. D).
Retrieval. Separation appears from and is widest at on three of four models, at 0.37 to 1.00 against SnapKV's 0.00 to 0.11. At neither method recovers the planted fact; the fourth model, Qwen3-14B, fails on both for reasons specific to that lineage (per-model records in App. D). Over the 48 conditions the tally against SnapKV is 23/23/2, and the ordering holds against the other fourteen methods at comparable bytes (0.82 times SnapKV's at and 1.17 at , Table 4). The kept set is chosen without reading the question, while the ranking behind it runs over question rows, because the harness evicts after the question enters the cache. We re-ran eight matched Llama-3.1-8B conditions to price that: restricting the ranking to document rows costs 88.2 points of hit rate and moving eviction to the document boundary costs 87.6, which is the same to within 0.6 points, and the allocation contributes none of it (Table 5). Although it holds 1.43 times the memory, the re-run that evicts at the document boundary finishes only 2.6 points above the run compressed before the question, so the fall is not a memory effect. The re-run restricted to document rows does evict four to six of the question's thirty-nine rows, but that is far too few to account for an 88-point drop. We report the condition rather than correct for it, and it arises only where decode-time eviction meets prefill compression, so the benchmark results are unaffected.
Discussion. Because selection's ceiling is this low, comparisons between eviction methods need enforced budgets and measured memory. We have not yet shown that a rule that acts before the question arrives can reach the value-side residual.
References
[1] Y. Bai, X. Lv, J. Zhang, H. Lyu, J. Tang, Z. Huang, Z. Du, X. Liu, A. Zeng, L. Hou, Y. Dong, J. Tang, and J. Li. LongBench: A bilingual, multitask benchmark for long context understanding. In Association for Computational Linguistics (ACL), 2024. arXiv:2308.14508.
[2] S. Barman. Approximating Nash equilibria and dense subgraphs via an approximate version of Carathéodory's theorem, 2014. arXiv:1406.2296.
[3] N. Bui, H. T. Nguyen, A. Cohan, and R. Ying. Make each token count: Towards improving long-context performance with KV cache eviction, 2026. arXiv:2605.09649.
[4] Z. Cai, Y. Zhang, B. Gao, Y. Liu, Y. Li, T. Liu, K. Lu, W. Xiong, Y. Dong, J. Hu, and W. Xiao. PyramidKV: Dynamic KV cache compression based on pyramidal information funneling, 2024. arXiv:2406.02069.
[5] V. Chari and B. Van Durme. Compactor: Calibrated query-agnostic KV cache compression with approximate leverage scores, 2025. arXiv:2507.08143.
[6] E. Cohen, N. Duffield, H. Kaplan, C. Lund, and M. Thorup. Stream sampling for variance-optimal estimation of subset sums, 2008. arXiv:0803.0473.
[7] A. Devoto, M. Jeblick, and S. Jégou. Expected attention: KV cache compression by estimating attention from future queries distribution, 2025. arXiv:2510.00636. Library: https://github.com/NVIDIA/kvpress.
[8] P. Fearnhead and P. Clifford. On-line inference for hidden Markov models via particle filters. Journal of the Royal Statistical Society, Series B, 2003.
[9] D. Feldman and M. Langberg. A unified framework for approximating and clustering data. In Symposium on Theory of Computing (STOC), 2011.
[10] Y. Feng, J. Lv, Y. Cao, X. Xie, and S. K. Zhou. Ada-KV: Optimizing KV cache eviction by adaptive budget allocation for efficient LLM inference. In Advances in Neural Information Processing Systems (NeurIPS), 2025. arXiv:2407.11550.
[11] Y. Feng, J. Lv, H. Guo, Y. Cao, S. K. Zhou, and X. Xie. CriticalKV: Optimizing KV cache eviction from an output perturbation perspective. In International Conference on Machine Learning (ICML), 2026. arXiv:2502.03805.
[12] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979.
[13] R. Goel, J. Park, M. Gagrani, D. Jones, M. Morse, H. Langston, M. Lee, and C. Lott. CAOTE: KV cache selection for LLMs via attention output error-based token eviction, 2025. arXiv:2504.14051.
[14] Z. Guo, H. Kamigaito, and T. Watanabe. Attention score is not all you need for token importance indicator in KV cache reduction: Value also matters. In Empirical Methods in Natural Language Processing (EMNLP), 2024. arXiv:2406.12335.
[15] C.-P. Hsieh, S. Sun, S. Kriman, S. Acharya, D. Rekesh, F. Jia, Y. Zhang, and B. Ginsburg. RULER: What's the real context size of your long-context language models? In First Conference on Language Modeling (COLM), 2024. arXiv:2404.06654.
[16] M. Jaggi. Revisiting Frank-Wolfe: Projection-free sparse convex optimization. In International Conference on Machine Learning (ICML), 2013.
[17] R. Kannan, C. Bhattacharyya, P. Kacham, and D. P. Woodruff. LevAttention: Time, space, and streaming efficient algorithm for heavy attentions, 2024. arXiv:2410.05462.
[18] J. Kiefer and J. Wolfowitz. The equivalence of two extremum problems. Canadian Journal of Mathematics, 12, 1960.
[19] H. Kim, M. Kim, H. Kim, and J. Choi. Tangram: Unlocking non-uniform KV cache compression for efficient multi-turn LLM serving, 2026. arXiv:2606.06302.
[20] J.-H. Kim, J. Kim, S. Kwon, J. W. Lee, S. Yun, and H. O. Song. KVzip: Query-agnostic KV cache compression with context reconstruction, 2025. arXiv:2505.23416.
[21] E. Kochetkova, K. Sheth, I. Han, A. Zandieh, and M. Kapralov. Streaming attention approximation via discrepancy theory. In Advances in Neural Information Processing Systems (NeurIPS), 2025. arXiv:2502.07861.
[22] Y. Li, Y. Huang, B. Yang, B. Venkitesh, A. Locatelli, H. Ye, T. Cai, P. Lewis, and D. Chen. SnapKV: LLM knows what you are looking for before generation, 2024. arXiv:2404.14469.
[23] E. Liberty, A. Andoni, and E. Kleiner. Nearly optimal attention coresets, 2026. arXiv:2605.05602.
[24] C. Lin, J. Tang, S. Yang, H. Wang, T. Tang, B. Tian, I. Stoica, S. Han, and M. Gao. Twilight: Adaptive attention sparsity with hierarchical Top-p pruning. In Advances in Neural Information Processing Systems (NeurIPS), 2025. arXiv:2502.02770.
[25] X. Lin, J. Wang, O. Kondrateva, Y. Shi, B. Li, and G. L. Zhang. CompressKV: Semantic retrieval heads know what tokens are not important before generation, 2025. arXiv:2508.02401.
[26] C. Litterer and T. Lyons. High order recombination and an application to cubature on Wiener space. Annals of Applied Probability, 22(4), 2012.
[27] W. Mao, Y. Chen, W. Huang, S. Yang, L. Wang, and S. Han. KV cache compression and its infra problems. NVIDIA Research Efficient AI blog, https://research.nvidia.com/labs/eai/blogs/kv-cache-compression-and-its-infra-problems/, June 2026.
[28] A. Mohtashami and M. Jaggi. Landmark attention: Random-access infinite context length for transformers. In Advances in Neural Information Processing Systems (NeurIPS), 2023. arXiv:2305.16300.
[29] M. Oren, M. Hassid, N. Yarden, Y. Adi, and R. Schwartz. Transformers are multi-state RNNs. In Empirical Methods in Natural Language Processing (EMNLP), 2024. arXiv:2401.06104.
[30] R. T. Rockafellar. Convex Analysis. Princeton University Press, 1970.
[31] Z. Shen, J. Lu, L. Gui, J. Li, Y. He, D. Yin, and X. Sun. SSA: Sparse sparse attention by aligning full and sparse attention outputs in feature space, 2025. arXiv:2511.20102.
[32] S. Sun, A. Canziani, Y. LeCun, and J. Zhu. The spike, the sparse and the sink: Anatomy of massive activations and attention sinks, 2026. arXiv:2603.05498.
[33] J. Tang, Y. Zhao, K. Zhu, G. Xiao, B. Kasikci, and S. Han. Quest: Query-aware sparsity for efficient long-context LLM inference. In International Conference on Machine Learning (ICML), 2024. arXiv:2406.10774.
[34] G. Tzachristas, L. Deng, I. Tzachristas, G. Zhang, and R. Chen. A mathematical theory of Top-k sparse attention via total variation distance, 2025. arXiv:2512.07647.
[35] R. Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge University Press, 2018.
[36] H. Wang, H. Razanajato, Z. Zhang, Y. Yuan, and H. Liu. How much dense attention is necessary? oracle-guided sparse prefill for full/GQA layers in hybrid long-context models, 2026. arXiv:2606.07703.
[37] G. Xiao, Y. Tian, B. Chen, S. Han, and M. Lewis. Efficient streaming language models with attention sinks. In International Conference on Learning Representations (ICLR), 2024. arXiv:2309.17453.
[38] G. Xiao, J. Tang, J. Zuo, J. Guo, S. Yang, H. Tang, Y. Fu, and S. Han. DuoAttention: Efficient long-context LLM inference with retrieval and streaming heads. In International Conference on Learning Representations (ICLR), 2025. arXiv:2410.10819.
[39] X. Yang, H. Gu, B. Xu, L. Li, B. Liu, J. Liu, Q. Zhu, Y. Guo, and S. Han. IndexMem: Learned KV-cache eviction with latent memory for long-context LLM inference. In International Conference on Machine Learning (ICML), 2026. arXiv:2605.25475.
[40] R. Zhang, H. Liang, D. Chang, L. Hu, F. Kong, H. Yin, and Y. Li. When does value-aware KV eviction help? a fixed-contract diagnostic for non-monotone cache compression, 2026. arXiv:2605.08234.
[41] Z. Zhang, Y. Sheng, T. Zhou, T. Chen, L. Zheng, R. Cai, Z. Song, Y. Tian, C. Ré, C. Barrett, Z. Wang, and B. Chen. H₂O: Heavy-hitter oracle for efficient generative inference of large language models. In Advances in Neural Information Processing Systems (NeurIPS), 2023. arXiv:2306.14048.
A Proofs
In this appendix, our goal is to prove Lemma 2.1 and Proposition 2.1 (stated in §2).
A.1 Identities
Proof of Lemma 2.1. Use the law of total expectation to write , so that . Taking norms yields the first identity. For the second form, we have
We know that sums to 0 across all since their expanded form is . Additionally, by definition of convex combination,
so we get . Minimizing does not change this relation. For the bound , note that both and are convex combinations of and lie in , so their distance is at most 2D. Applying the first form at completes the bound.
Remark. We can recover the per-decision eviction error of Goel et al. [13], Feng et al. [11] using the single-key case. That is, for a single dropped key we have , and we use the first form to solve for .
Proposition A.1. Working in , we have
In the worst case, this inequality is tight with . The minimizers are extreme points of the hull that do not depend on the masses.
Proof. By exact Carathéodory [30], for a random supported on the points. Averaging independent copies gives , so at least one of the copies has an average within of , using at most distinct points. Padding the set to exactly points only expands the hull, so . Tightness is classical [2, 35]. Exactness at is Carathéodory.
Example A.1 (Small does not bound ). A small dropped mass does not make the top-mass set near-optimal on a given instance, because is a ratio of two errors that can both be small, and the denominator can shrink faster. A dropped-mass prediction of can therefore only be statistical, which is what §2.3 measures.
Example A.2 (Not submodular). Let , , and , so , and write kept sets by their points. Adding the key at 0 to leaves es at while adding it to the superset raises es from 0 to , so the increment grows on the superset and es is not submodular. Adding the same key to raises es from to 1 while adding it to the superset lowers es from to , so the increment shrinks and es is not supermodular.
A.2 Hardness
Our argument follows by a reduction from the PARTITION problem, which is NP-complete [12]: given nonnegative integers , decide whether some subset satisfies . We reduce in two steps. We first pass to the balanced variant, BALANCEDPARTITION: given an even and , decide whether some with splits the sum equally. We then encode BALANCEDPARTITION into ZEROES: given a rational instance of our problem, decide whether . Instances are rational throughout, with and in binary encoding, and by Lemma 2.1, holds exactly when some size- subset has . We also use one elementary fact: over the rationals,
(‡)
Lemma A.3 (Zero-padding encodes exact cardinality). Map a PARTITION instance to the BALANCEDPARTITION instance with for and otherwise. The map is polynomial-time, and admits an equal split exactly when admits a balanced one.
Proof. Write . First suppose some splits the -sum equally, with . By it has , so has and -sum , and admits a balanced equal split. Conversely, suppose some with splits the -sum equally. Then , and since the padded coordinates carry weight zero, splits the -sum equally by .
Note that BALANCEDPARTITION lies in NP, since a verifier checks and that equals half the total, so it is NP-complete. Given a BALANCEDPARTITION instance , we construct an instance of our problem in the following way: place the integers on the line, one key at with , then give every key the same mass and set the budget to . Formally,
a polynomial-time map.
Lemma A.4. With , the instance has and, for every ,
At , exactly when .
Proof. We expand . At we factor out and apply .
Lemma A.5. For every instance and every with , we have , so or . Also, , so . Hence on every constructed instance.
Proof. Since has integer entries, is an integer for every with , so or . Since , Lemma 2.1 gives
so each es(A) is 0 or . Then, ES(m/2) is the minimum of these, so it lies in with N = m.
Proof of Proposition 2.1. Given a subset A, a verifier checks and tests in exact rational arithmetic. Clearing denominators turns the test into d comparisons of integers with zero, and these integers have bit-length polynomial in the input size. An instance with has such a subset, so ZEROES lies in NP.
Next, BALANCEDPARTITION is NP-complete (Lemma A.3), and reduces it to ZEROES. If A is a balanced equal split, then by Lemma A.4, so and . Conversely, if , the minimum is attained, so some size-m/2 subset has , and by Lemma A.4 that subset splits the sum equally. Every constructed instance has , uniform masses, integer points and .
Now suppose an estimate satisfies for some function . When this forces , and when it forces . Accepting exactly when therefore decides ZEROES ( is never evaluated). Next suppose on the constructed instances. There is either 0 or at least (Lemma A.5), so in the first case and in the second. Accepting exactly when therefore decides ZEROES. In both cases a polynomial-time estimate decides an NP-complete problem, so P=NP follows.
B Per-head Layer
This appendix deals with the approximation behind §2. We bound 's distance above ES two ways. A sweep of the enumeration cap admits more candidate keys and measures how much the gap changes, and an exact solver either confirms the argmin or finds a better subset. We keep track of these derived statistics: , which understates the balancing selector's distance above the optimum because the candidate set restricts the search, and of Lemma 2.1, which is a one-pass statistic.
B.1 Setup
Each sampled row’s output sits within of the model’s own dense forward in float32 expectation; the capture stops if any row disagrees by more than . Models load in bfloat16 with eager attention, and we capture the per-head fields in float32 and run all enumeration arithmetic in float64. Prose inputs are non-overlapping wikitext-103 test chunks.
The first three documents of every re-captured family reproduce the committed records bitwise, and that slice (111,744 instances) is the primary set. One instance is one sampled query row, letting and . We use budgets , six rows per head, every layer, and twenty 4,096-token documents for each headline family, Qwen2.5-1.5B ( layers heads), Llama-3.2-1B ( ), OLMo-2-1B ( ) and Qwen3-1.7B ( ). The corpus is tokenized once.
We further test six more arms to bring the total to ten. Qwen3-0.6B, Qwen3-4B, gemma-2-2b and gemma-3-1b-pt run under the same protocol, and the gemma pair is captured with its deployed attention geometry (Table 6), so captured rows are the model's own windowed softmax. The scale runs cover Qwen2.5-7B at 16,384 tokens (56,448 instances) through a row-streamed capture that bit-matches the eager path, and Qwen3-14B at 4,096 tokens through the same path with a validating five-shard merge. The content run uses prose, code and French sources (72,576 instances).
| Family | QK-norm | AUC() | edge/int [95%] | med | ||
|---|---|---|---|---|---|---|
| Qwen2.5-1.5B | no | 0.83 | 1.89 [1.51, 2.29] | 0.80 | 0.91 | 1.00 |
| Llama-3.2-1B | no | 0.80 | 1.98 [1.72, 2.26] | 0.67 | 0.95 | 1.00 |
| Qwen3-1.7B | yes | 0.85 | 1.21 [0.98, 1.47] | 0.94 | 0.98 | 1.00 |
| OLMo-2-1B | yes | 0.76 | 0.74 [0.62, 0.87] | 0.51 | 0.80 | 1.00 |
| Qwen3-0.6B | yes | 0.85 | 1.31 [1.04, 1.60] | 0.92 | 0.98 | 1.00 |
| Qwen3-4B | yes | 0.76 | 1.26 [1.16, 1.37] | 0.64 | 0.97 | 1.00 |
| gamma-2-2b | no | 0.89 | 1.13 [0.86, 1.41] | 0.97 | 0.82 | 1.00 |
| gamma-3-1b-pt | yes | 0.82 | 1.25 [0.95, 1.56] | 0.79 | 0.90 | 1.00 |
| Qwen2.5-7B (16k) | no | 0.85 | 1.67 [1.47, 1.87] | 0.84 | 0.91 | 1.00 |
| Qwen3-14B | yes | 0.80 | 1.19 [1.11, 1.26] | 0.59 | 0.96 | 1.00 |
Table 6: The ten-arm panel consists of the four headline families, four widening families, and two scale arms. is at (document-cluster intervals within , and the Qwen2.5-7B row is budget-pooled); "edge/int" is the rate of at the network edges over the interior rate, with head-cluster intervals; rank-correlates the per-layer profiles of dropped mass and of the rate; is the pooled Spearman correlation of with ; is the balancing selector's median gap (intervals [1.00, 1.00]; the statistic is discrete, §2.2). gemma-2-2b replaces QK-norm with soft-capping and 4,096-token interleaved windows. gemma-3-1b-pt is QK-normalized with 512-token windows.
B.2 Enumeration
We note that on every instance, so every gap is a lower bound, thus there are no false positives. We evaluate by exhaustive enumeration over the candidate set of Definition 2.2 (24/12/6/4 keys beyond at ). A key of small mass and small deviation moves neither nor , so it cannot lower es.
We formulate as a mixed-integer second-order-cone feasibility problem and solve it by bisection with the argmin as warm start (SCIP, 120 s per solve), on a 960-instance manifest sampled evenly across family, budget and dropped-mass decile. The improvements concentrate at , with the largest at , and 21 unsolved instances hit memory limits.
Per instance, we find that on 89 to of instances and on , over the eight-family grid at .
B.3 Penalty
The estimate of , where is the Frank-Wolfe [16] estimate of , has unsigned bias because its numerator and denominator are both over-estimates. The median of rises with in every family. The same statistic separates the instances with from the rest, since the rank correlation of with is 0.42 to 0.46 in every family while its correlation with is weak and its sign is unstable across families. One family carries massive-activation outliers ([32]) that we measure at radius at its deep layers, but those layers have and almost no instances with .
Let be a minimizer of ef, computed by Frank-Wolfe and padded to size with top-mass keys, and let be the keys of largest ridge leverage . The median of rises to 2.06 with budget and the median of rises to 20.3 (Table 8). The balancing selector achieves at the median in every family and budget after a median of 1 to 2 swaps. Swap costs are in the Cost paragraph below.
B.4 Sensitivity of Certification
Substituting the solver's subset for the argmin where improvement exists, then recomputing every statistic paired, moves the paired manifest median by at most (at , from 0.051 to 0.057) and the median by . Because the balancing selector and the exhaustive search draw from the same candidate set, a subset outside it could beat both. Thus, the solver searched the full key set and found 46 improvements (0/2/8/36 by budget). The median improvement is and the largest is (Table 7). After substitution, the fraction of instances where the found optimum beats balancing materially (by more than ) rises from 1.3 to at and stays below elsewhere. Because raising at most a fraction of a sample moves its median no higher than the old -quantile, the Wilson-95 bound on each improvement rate caps the population median distribution-free (at most 0.108 at ). The balancing median cannot move because exactly on 87.0 to of instances per budget and the worst (family, budget) cell has margin . The last column of the table counts the unsolved instances as improved.
| s | improved | Wilson-95 | median | cap at | cap, unsolved improved |
|---|---|---|---|---|---|
| 4 | 0/237 | 0.016 | 0.018 | 0.022 | 0.027 |
| 8 | 2/234 | 0.031 | 0.040 | 0.047 | 0.057 |
| 16 | 8/234 | 0.066 | 0.047 | 0.064 | 0.073 |
| 32 | 36/234 | 0.206 | 0.046 | 0.108 | 0.119 |
Table 7: Certification substitution at a glance. “improved” counts manifest instances where the solver beat by more than 1%; is the Wilson-95 upper bound on that rate; “median” is the per-budget closable-share median over the four audited families’ full record sets (186,240 instances per budget); the caps are the distribution-free worst-case medians after substitution, at and with the 21 unsolved instances also counted as improved. The corresponding caps on the median are 1.00 everywhere.
Per-budget 95% intervals on the median sit inside [0.017, 0.051]. The fraction of the top-mass-to-dense gap that a better kept set can still remove holds at its small-budget level through , even as the dropped mass falls roughly tenfold (median). At the deployed budgets the per-family medians are 0.04 to 0.13, and the balancing subset beats top-mass by at least 10% on 28 to 58% of rows. Exact enumeration cannot reveal this since it stops at . The anchor (the balancing-subset bound) still applies, because whatever the balancing subset closes, , can also be closed by the best subset. Table 1 analyzes the bound from to 256 on the two audited families.
B.5 Reference tables
| s | med κ | p99 κ | share | med π | p99 π | ρ(Φ, ESpool) | ||
|---|---|---|---|---|---|---|---|---|
| 4 | 1.003 | 2.28 | 23.5% | 1.40 | 6.8 | 1.07 | 2.18 | 0.84 |
| 8 | 1.025 | 2.27 | 25.9% | 1.73 | 9.7 | 1.16 | 2.90 | 0.92 |
| 16 | 1.034 | 2.15 | 26.5% | 1.96 | 13.8 | 1.39 | 4.27 | 0.96 |
| 32 | 1.033 | 1.91 | 23.6% | 2.06 | 20.3 | 1.79 | 6.75 | 0.98 |
Table 8: The per-budget reference profile for the family Qwen2.5-1.5B, with 6,048 instances per budget. “share” is the fraction with . The geometric column is the Frank–Wolfe support padded to size s with top-mass keys, and the padding only helps it under the operator. The leverage column is the ridge-leverage subset. All quantities are restricted to the candidate set, one-sided in the direction stated above. Across families the geometric ratio runs 1.3 to 2.6 and the leverage ratio 7 to 32 at s = 32.
B.6 Other Details
The allocation panel. Re-allocating budget by the map raises pooled reconstruction error in every family, with of +0.044 (Llama-3.2-1B), +0.144 (OLMo-2), +0.255 (Qwen2.5-1.5B) and +1.032 (Qwen3-1.7B) at unit budget 8 under the balancing selector. Cell-cluster intervals exclude zero, and the sign holds at unit budget 16 and under top-mass selection. The deltas are against uniform at matched total budget, with mass-greedy [10] and pyramid-shaped [4] allocators in the same panel. A flat cell's closable part is small ( ), so extra budget there buys little.
Absolute forms. Both prior-art bounds classify the label worse than alone in every family (AUC 0.58 to 0.87 and 0.58 to 0.86 against 0.76 to 0.89). The diameter form and the variance refinement [34] rank the top-mass set's own error at Spearman 0.63 to 0.95 and 0.89 to 0.98 but fall to 0.23 to 0.70 and 0.21 to 0.68 against the gap (bare reaches 0.48 to 0.73). The family ordering at s=8 holds over the central margins of the to 1.43 sweep (Kendall ), and relabeling against the certified optima leaves per-family AUCs at 0.72 to 0.87, with wide intervals that overlap the committed spans.
Cost. One balancing swap round (192 drop-add pairs at ) costs about 2% of the row's at , with a median of 1 to 2 swaps over the 111,744 committed records. The rule deploys at decode, where is the step's already-computed output and the swap is one incremental row. As a batch prefill mask, one balancing swap round is launch-bound at to a dense layer and would further need (one PV matmul, to dense). The map costs one offline dense forward over sixteen documents and amortizes across serving.
C Selector Details
We score each rule’s kept set against the enumerated optimum on the same 111,744 instances as §2.4, joined row by row to the recorded runs. SnapKV runs with window and kernel 7 with max pooling, H2O with accumulated mass and recency , Quest with pages of and a page-16 configuration at , and StreamingLLM with sinks plus recency. TOVA’s per-query keep set is identical to top-mass, and this identity is checked at runtime, so we do not score it separately. Budgets are accounted in two ways: per-query, where a rule re-chooses its set at every query, and cache-faithful, where one evicted cache serves all queries, so the per-query reading is never above the cache-faithful one.
Dropped mass predicts each eviction rule's excess
A. ROC at s=8, Qwen2.5-1.5B

B. Excess AUC by family (95% cluster bootstrap)

Figure 3: The left panel shows the ROC of dropped mass as a predictor of each rule's excess label at s = 8 on the reference family, and the right panel shows the same AUC pooled per family with 95% intervals. The grey band is the AUC range of §2.3 and the dashed line is chance, and the row labeled “certificate” scores itself.
Small budgets. At the four scored rules sit at a median 1.4 to 2.1 times against 1.02 to 1.03 for top-mass on the three sharper families. Top-mass exceeds 1.11 on as few as 19% of instances, while each deployed rule exceeds it on 75 to 99% of instances at , so the label is almost always 1 and its AUC, pooled across families, is 0.49 to 0.64 for mass rules and a positional control alike (Fig. 3). At the deployed budgets the label is 1 on fewer instances, and predicts it, since three of the four mass-based selectors clear AUC 0.70 at and all four clear it at on the reference family. Ranking each rule's excess by reaches Spearman 0.70 to 0.84 on the families without query-key normalization and 0.36 to 0.61 on the two with it. SnapKV's error holds at 1.8 to 2.2 times the same-budget top-mass error through the deployed budgets. Cache-faithful accounting raises every rule's median excess, to about 3.0 for the sequential rules and 4.2 for the frozen-set SnapKV reading at . Quest is evaluated below the page sizes that it was designed for (2 to 8 keys per page at ). At exact enumeration is infeasible, so the references are top-mass and the balancing subset, and OLMo-2-1B reaches AUC 0.70 only at , which is one budget later than the reference family.
Held-out loss. At s = 8 Quest increases it the least and StreamingLLM increases it the most. Per-query loss stays at or below cache-faithful loss (whenever both readings exist). On Qwen3-1.7B the flat-cell switch recovers 0.18 to 0.65 of the gap to all-cell balancing, which is consistent with §2.4 on the same family.
D Deployment Details
D.1 Compared methods
The baselines ran with one all-true mask over the compressed cache and ignored which positions remained after eviction. The per-layer forms mask according to the positions actually kept. We mark every comparison that crosses the two, and the absolute levels in the baseline tables are affected.
D.2 Costs and uncertainty
The byte figures of §4 come from per-layer memory records in our harness. In the replay, SnapKV and Compactor each hold between 0.09 and 3.6% of the dense cache with identical byte counts, while KVzip holds all of it at every condition, which is 28 to 1078 times SnapKV's bytes. ContourKV without enforcement holds 3.5 to 84% of the dense cache, or 20 to 96 times the budget-enforcing methods' bytes and a median of 43.9 times SnapKV's, since the unenforced mode over-keeps to each layer's widest cell at 11 to 85 times its nominal budget.
SnapKV and our CompressKV reimplementation each cost 1.03 to 1.13 times a dense context prefill, while ContourKV's reconstruction score costs 8.7 to 13.6 times (7.744 seconds against 0.605 on Llama-3.1-8B), although its own method class reports 2 to 3 times for itself.
All intervals come from one estimator, a cluster bootstrap over documents with and 95% percentile intervals. When both methods were measured in the same batch we take paired per-document differences, and otherwise we resample the two samples independently. Neither the resampling nor the averaging ever crosses from the benchmark setting into the retrieval one. We treat any margin below 0.05 points as too small to interpret, though we still count it toward the totals by its sign.
D.3 Per-condition results
ContourKV's margins over KVzip at RULER s = 128 run 10.4 to 76.4 points across the fourteen model and length cells, and every interval excludes zero. ContourKV's only losses with intervals excluding zero, against any opponent, are LongBench repobench-p on Llama-3.1-8B at both budgets (-7.3 and -6.6 points). With the budget enforced, sixteen of the twenty-two losses to KVzip sit at RULER s = 32, where KVzip scores 12.6 to 17.6 from the full cache and SnapKV scores 3.6 to 5.5.
Equal-memory allocation and retrieval. At RULER s = 128 the window-scored per-layer variant falls 13.55 points below Compactor and 10.75 points below the uniform run. In the retrieval runs, the s = 64 record against SnapKV is 7/7/1 and every advantage in the 48-condition tally falls at , and the window-scored version holds 0.82 times SnapKV's bytes at s = 64 and 1.17 times at s = 128. The reconstruction score concentrates the budget so strongly that padding each layer's block to its widest head consumes up to seven eighths of the memory at grouped-query width 8, and we stopped that variant when its answer-span coverage fell 5.4 to 31.6 points below the uniform run, as the rule that we had fixed in advance required. Qwen3-14B fails retrieval under both the window-scored version and SnapKV for reasons specific to that lineage.
Our CompressKV reimplementation selects identical entries to the official implementation on all 328 test cases. Its complete record covers 80 cells at exactly matched memory on Llama-3.1-8B and Qwen2.5-7B, which are the two models that its authors provide calibration for. It is 7/47/26 against ContourKV with the budget enforced (-0.85 points in aggregate), with the RULER s = 128 block at 0/0/8 and -9.39. It is 13/60/7 against SnapKV at +0.89, 15/55/10 against the per-layer variant of §4 at +0.79 [+0.24, +1.38], which is its one favorable comparison and is concentrated on Llama-3.1-8B, and 11/36/33 against Compactor, where it trails by 4.96 at RULER s = 32 (ContourKV's own aggregate against Compactor runs -1.9 to +0.7). Its layer allocation does not vary at s = 32 (a uniform 32 entries per layer) and varies at s = 128 (54 to 169 per layer on Llama-3.1-8B and
63 to 174 on Qwen2.5-7B), so the s = 32 comparison tests its scoring alone and s = 128 adds its allocation, where the deficit is largest.
E Reconstruction Boundary
The prefill probe of §2.4 is a rank-16 scorer trained on the query and key projections of Qwen2.5-1.5B and Llama-3.2-1B to reproduce the balancing swaps ([36]), and it recovers at most 5% of the decode-time loss reduction against a 25% bar fixed in advance. It is zero-initialized, so an untrained probe selects identically to top-mass, and it was trained on 48 documents disjoint from evaluation, where the mixing weight between the probe and the top-mass score was calibrated on half of the held-out documents and checked on the other half. Its held-out swap recall is 0.33 and 0.39, and when deployed it moves held-out cross-entropy at s = 8 by +0.010 and -0.006, where balancing in the same run moves it by -0.119 and -0.118.
To test whether the map picks the right cells, we switched the same number of cells at random instead. On Qwen2.5-1.5B the map recovers 94% of the all-cell gain and the random set recovers 66%, so two thirds of the map's gain comes from set size alone; on Qwen3-1.7B the random set recovers 77% and the map recovers 15%, and no ranking of cells that we tried beat the random set (Fig. 4). Across the three Qwen3 scales the map keeps 55/15/31% of the all-cell gain. Both configurations sit far from the dense output, so the difference between their cross-entropies is second order and is set by the local curvature. At deployment scale, the reconstruction-ranked per-layer batch was withheld when its answer-span coverage collapsed at matched memory (§4), and the reconstruction-scored state of the art loses when scored at its measured bytes (§4).
Balancing restricted to matched-size cell sets
Qwen2.5-1.5B

Qwen3-1.7B

Figure 4: Change in held-out cross-entropy against top-mass at s = 8 when balancing only the labeled cells. The percentages give each set's fraction of the gain from balancing all cells.
We measured the local curvature directly, from loss gradients and Hessian-vector products at each head's output-projection input. The second-order prediction built from it matches the measured shares of the loss gain (0.86 to 0.95 against 0.88 to 0.98), and the conversion constant is the loss change per unit of flat-cell reconstruction reduction.