Manuscript Offprint
arXiv:2611.02230Who Should Score the Cache? Mid-Depth Layers Are the Best Judges of KV-Cache Eviction
ABSTRACT
Key-value (KV) cache eviction methods rank tokens by attention scores, and each layer scores its own cache. To our knowledge, no eviction method asks which layer should score. We find, across twenty-one models, that the depth of the scoring layer governs eviction quality. On the eighteen models with per-layer caches, spanning 0.5B to 109B, long-context retrieval accuracy collapses at shallow layers, peaks between 0.4 and 0.75 of depth, and degrades at the last layer. The curve arises because a layer judges tokens well only once it has used the question to find the answer, which takes several layers. Modeling eviction as a top- cut, we compute answer survival probability from prefill attention and reproduce the measured curves. This approach selects the scoring layer using calibration prompts with known answers, and the selected layer is the best layer measured on most models and never significantly below it. It improves on the own-layer default on sixteen of the eighteen models, with significant gains on seven, all at 14B or below, while on larger models the default is already close to the best mid-depth layer. Scoring every cache from the selected layer while keeping one set of tokens for all heads also beats per-head SnapKV by 18 to 43 points on five models up to 14B under tight budgets. This gain carries over to financial filings at 32K context, all at the same memory budget, with no extra forward pass. The same curve explains a penalty in shared-cache models, where several layers read one cache and the layer that writes it scores by default. On Gemma-4-E2B the writer is shallow and loses 28 points to a mid-depth reader at a 10% budget. We also find that in open-book question answering (LongBench) no mid-depth layer beats the own-layer default.
1 INTRODUCTION
The KV cache is the memory cost of long-context inference, and eviction is the simplest way to shrink it: score every cached token, keep the top , drop the rest. Existing methods differ in how they score and how they spend the budget (Zhang et al., 2023; Li et al., 2024; Feng et al., 2025; Cai et al., 2024), but all take scores from the layer whose cache is pruned: layer 7 judges what layer 7 keeps. The scoring layer is a hyperparameter that, to our knowledge, no eviction method varies or reports.
We find that the chosen layer's depth governs eviction quality at every scale we test. Accuracy plotted against scorer depth follows the same curve on every model (Figure 1): shallow scorers fail, the last layer is unreliable, and the best single scorer sits at mid-depth. The mechanism is simple: a layer judges evictions well once it has used the question to find the answer, while shallow layers have not yet done so. Building on this idea, we propose a predictive model with no free parameters that reproduces the measured curves and selects the scoring layer.
The choice matters most where no own-layer default exists. On models with cross-layer KV sharing, hereafter shared-cache models (Brandon et al., 2024; Sun et al., 2024; Gemma Team, 2025; 2026), one cache serves several reader layers and the scores come by construction from the cache's writer, its shallowest reader. A shallow writer scores from the region where the curve collapses.

Figure 1: The depth of the scoring layer governs eviction quality. Accuracy when a single layer at depth scores every cache's eviction. All panels: question-window scoring (Section 3), the eight-task RULER pool, (25 per task). Bands: each layer's task-clustered 95% CI. Filled markers: the paired difference from the default excludes zero (task-clustered 95% CI, narrower than the bands). Diamonds: the survival model's pick (Section 5). Curves include off-grid layers near the peak. Top row: the four models whose best mid-depth scorer beats the default, at 15%; top right, a shared-cache model, where the default is the writer (□). Bottom row: the three models whose gain is not significant, each at its binding budget; the curve keeps its shape.
-
A better SnapKV. We change two things in SnapKV, and each helps on its own in most settings: scoring from a mid-depth layer, and keeping one set of tokens for all heads. Together they beat per-head SnapKV (as implemented in the kvpress library) by +18 to +43pp at budgets of 5 to 15% on five of the seven per-layer models we test (0.5B through 14B) and tie it on the two Llama models (Section 4.1). On financial filings at 32K they beat it on both families, by 14 and 16pp. From 32B up we detect no gain over the default, which is already close to the best mid-depth layer (Section 5.2).
-
A mechanism and a predictive model. Without the question, every layer is nearly equally blind to the answer; with it, attention on the answer builds over depth and peaks at mid-depth. We compute the probability that the answer survives the scorer's top- cut, and it reproduces the measured curves and the reader ranking on the shared-cache model. It also selects the scoring layer: the pick is the best layer measured on fourteen of the eighteen per-layer models and never significantly below it on the other four (Section 5).
-
The shared-cache penalty. On Gemma-4-E2B the shallow writer scores the shared cache by default and needs roughly twice a mid-depth reader's budget. A sibling design whose writer sits at mid-depth shows no significant penalty, so the writer's depth is the likely cause. The penalty replicates across budgets, tasks, context lengths, checkpoints, and on Gemma-3n (Section 6).
2 RELATED WORK
Attention-scored eviction. These methods score with accumulated attention, recent-window attention, adjusted softmax, or analytic estimates, and differ in how they spend the budget (Zhang et al., 2023; Liu et al., 2023; Adnan et al., 2024; Li et al., 2024; Oren et al., 2024; Feng et al., 2025; Devoto et al., 2025; Wang et al., 2025a). Within this family the scoring layer never differs: each method scores a cache with the layer it belongs to. SqueezeAttention, PyramidKV, CAKE, LAVa, RippleKV, and MOSAIC vary each layer's budget while keeping own-layer scores (Wang et al., 2025c; Cai et al., 2024; Qin et al., 2025; Shen et al., 2025; Xu et al., 2026; Kodavanti & Arveti, 2026); we compare against PyramidKV in Section 4.1.
Mid-layer token selection. The closest prior work is GemFilter (Shi et al., 2026), which selects tokens with an early-middle layer's attention and then re-runs the model on the shortened prompt. Its layer ablation was the first to show a middle-layer peak, in that recompression setting; ASL (Taniguchi et al., 2026) picks the selection layer per input there. Multimodal models prune visual tokens the same way, with a middle layer's attention, and MAP (Sun et al., 2026) picks that layer per input. FastKV (Jo et al., 2026) forwards only the tokens a mid-depth layer selects to the layers after it, and LazyLLM (Fu et al., 2024) prunes tokens layer by layer during prefill; both speed up prefill and leave each layer scoring its own cache. Eviction is a different setting: no second forward pass, one memory budget for every method, and a default (each layer scoring its own cache) with no counterpart in recompression. The finding that this default loses is new. Section 4.1 reports a head-to-head at the same decode-time memory. HySparse and LongCat Sparse Attention hard-code the choice at training time: each sparse layer takes a preceding layer's selections (Gao et al., 2026; Zan et al., 2026), which is the writer's role in Section 6. At decode time, TidalDecode (Yang et al., 2025) and InfiniGen (Lee et al., 2024) also move selection across layers; neither asks which depth selects best.
Cross-layer KV sharing and compression. CLA, YOCO, LCKV, and the Gemma-3n and Gemma-4 line made one cache serve many layers (Brandon et al., 2024; Sun et al., 2024; Wu & Tu, 2024; Gemma Team, 2025; 2026). That is the regime this paper studies. xKV and CommonKV exploit cross-layer redundancy for compression after the fact (Chang et al., 2025; Wang et al., 2025b). None of them decides what an architecturally shared cache should evict.
Per-head differences. RazorAttention, DuoAttention, FastGen, and HeadKV show that, within a layer, different heads need different tokens retained (Tang et al., 2025; Xiao et al., 2025; Ge et al., 2024; Fu et al., 2025). DuoAttention calibrates its heads on synthetic prompts with known answer spans, the style our layer selection reuses at layer level (Section 5). A shared cache with multi-query attention removes that freedom: its readers share one physical cache, which can hold only one set of kept tokens. Per-head selections also carry a memory cost of their own: stored as masks they keep the full cache, and heads sharing one buffer keep the union of their picks (Shi & Gu, 2026; Inbasekaran S, 2026). Table 1 shows that a single set scored from the right layer beats per-head selection even where per-head budgets remain possible.
3 SETUP
Scoring. The importance of context token under scorer layer is the mean softmax attention that a window of queries places on token . The depth curves and the shared-cache results take that window from the question block and average over heads (the question-window convention). The baseline comparison of Section 4.1 instead follows the kpress implementations, under their own window. The same scorer at the same budget shifts by several points between the two windows, so we never compare numbers across the two windows.
Eviction. A budget keeps of a prompt's context tokens in every layer's KV cache and masks the rest. Some tokens are always kept, and they count against . Under the question window these are the sink (first 4) and the recency window (last 32) (Xiao et al., 2024); under kpress's window, the scoring window itself. All methods compete at the same . Each model is reported at its binding budget, the smallest candidate budget at which the own-layer default loses at least 5pp to the uncompressed model while no task collapses (default recall under 5%): eviction costs accuracy but leaves signal to compare scorers. At these budgets the default has lost 7 to 41pp (Section A.1). The three weakest primary models (15%) and the Gemma-4 shared cache (15% in Figure 1, 10% in Table 3) are shown at uniform budgets; their binding budgets are 15 to 25%, and the gains hold there (Section A.1). We compress after prefill, so the savings apply to the cache that persists through decode. We mask evicted context positions at decode ( additive mask, per-layer and per-head where the baseline requires). Masking preserves RoPE positions and is mathematically equivalent to deleting the rows (Section B).
Models, tasks, metrics. We study twenty-one models: eighteen with per-layer caches and three with shared caches (Gemma-4-E2B, Gemma-4-E4B, Gemma-3n-E2B). The primary set is six instruction-tuned per-layer models (Qwen2.5- , SmolLM2-1.7B, Llama-3.2-3B, Llama-3.1-8B) and Gemma-4-E2B (base checkpoint; the instruct one replicates, Section A.7), where the writer plays the “own layer”; twelve more per-layer models extend the range of scale and release date under the same setup (Table 2). The benchmarks are RULER (Hsieh et al., 2024) at 4K, 8K, 16K, and 32K, LongBench v1 (Bai et al., 2024), and DocFinQA (Reddy et al., 2024), numeric questions over 10-K filings (Section A.9). Every primary RULER result pools the same eight RULER-4096 tasks (five needle-retrieval variants, variable tracking, two QA) and, for each model, counts only the informative ones, those the uncompressed model gets at least 30% right (all eight, on every per-layer model). Adding the other five RULER tasks shrinks every gain and does not change any conclusion (Section A.3). Decoding is greedy. RULER is scored as recall: the fraction of a prompt’s gold answers that appear in the output. The LongBench and DocFinQA metrics are in Sections A.6 and A.9.
Statistics. Results use 25 prompts per task, for the eight-task pool. Prompts are nested in tasks, so all primary confidence intervals are two-stage cluster bootstraps (resample tasks, then prompts). Bold numbers and filled markers mean the paired difference’s 95% interval excludes zero (clustered-significant, for short). Percentile bootstraps can undercover at tasks, so the six primary comparisons are also checked with an exact sign-flip test (Section A.10). No multiple-comparison correction is applied. Section A records how each budget was set and how each pick performed.
4 THE DEPTH OF THE SCORING LAYER
Figure 1 is the paper’s central result. We let one layer at a time score every cache and plot accuracy against that layer’s depth. On each per-layer model we test seven grid layers, at depths 0.08, 0.25, 0.40, 0.55, 0.70, 0.85, and 1.0, plus extra layers near the peak, including the survival model’s pick when it is not a grid layer. The curve has the same shape on every model: a cliff on the shallow side, a peak at 0.4–0.75 of depth, and a decline toward the last layer. The default loses to the best mid-depth layer on all seven models, significantly on the four in the top row. The diamonds mark the survival model’s pick (Section 5), chosen from prefill attention and known answer locations on calibration prompts. The picked layer beats the default by +11.8pp (SmolLM2), +26.6pp (1.5B), and +31.4pp (0.5B) on the top row’s three per-layer models, and on the shared-cache panel the best reader recovers +36.7pp over the writer, all clustered-significant. The three models whose gain is not significant (3B, 7B, 8B) are considered in Section 5.2.
4.1 AGAINST THE EXISTING METHODS
The depth curves use our question-window scoring. Table 1 re-tests the gains inside SnapKV as kypress runs it: the last 64 prefilled tokens are the query window (Section B), scores are smoothed over 5 tokens, and each head keeps its own token set. All methods share one memory budget. The last three methods change SnapKV’s two defaults, one at a time and then together: one kept set for all heads, scoring from the survival model’s pick, and both.
On its own, the mid layer helps in every column and the single set in every column but the 14B (Table A5). The combination scores above either alone in every column. It beats per-head SnapKV by +18 to +43pp, clustered-significant in every column (exact tests in Section A.10), and recovers 83 to 99% of the uncompressed accuracy where SnapKV keeps 37 to 63%. Beyond these columns
Table 1: Changing SnapKV's scoring layer and dropping its per-head selection each help, and together help most. Accuracy (%) on the eight-task pool of Section 3, per column; 1.5B, 7B, and 14B are Qwen2.5. Every row but H2O scores with the kvpress window, so numbers are not comparable to Figure 1. Single set: one kept set for all heads. Mid-layer: scored from the survival model's pick at the column's budget (L20, L20, L15, L18, L30; Section 5); in its per-head row, KV head of the mid layer selects for KV head of every layer. Columns are separate runs, each with its own ceiling. Bold accuracy: best method in the column. row: task-clustered 95% CI; bold = significant.
| Scoring method | 1.5B @15% | 1.5B @10% | SmolLM2 @15% | 7B @10% | 14B @5% |
|---|---|---|---|---|---|
| No eviction (ceiling) | 91.1 | 90.8 | 76.4 | 93.0 | 91.7 |
| H2O (observed attention) | 18.4 | 16.6 | 8.8 | 21.6 | 21.7 |
| SnapKV (per-head, own layer) | 53.0 | 39.2 | 28.4 | 57.4 | 57.6 |
| AdaKV (SnapKV scores) | 57.8 | 42.8 | 30.9 | 53.9 | 53.6 |
| PyramidKV (pyramid budgets) | 33.1 | 22.6 | 20.2 | 28.0 | 34.8 |
| Own layer, single set | 63.1 | 49.5 | 48.5 | 77.1 | 56.0 |
| Mid-layer, per-head | 84.7 | 75.1 | 47.0 | 87.2 | 71.6 |
| Mid-layer, single set (ours) | 87.6 | 82.0 | 63.4 | 91.9 | 75.9 |
| (ours – SnapKV) | +34.6 | +42.8 | +34.9 | +34.6 | +18.3 |
| 95% CI | [+15.6, +54.0] | [+20.0, +65.8] | [+14.6, +55.7] | [+12.6, +57.5] | [+4.0, +32.8] |
the combination wins on Qwen2.5-0.5B and ties on the two Llama models, whose depth gains are not significant either (Table A4). On the 1.5B the lead holds from 5% to 50%: it peaks at 10%, then shrinks as SnapKV recovers, and stays significant throughout (Section A.4).
AdaKV, which redistributes budget across heads using SnapKV's scores, stays within 4.8pp of SnapKV in these columns and differs significantly in one (Table A5). PyramidKV shrinks per-layer budgets with depth, following its authors' schedule. At the same total memory it scores below SnapKV in every column of Table 1 (-8.2 to -29.4pp): PyramidKV's schedule costs more here than ignoring depth.
Recompression head-to-head. GemFilter (Shi et al., 2026), the nearest competing method, selects tokens with one layer's attention and re-runs the model on them alone; its layer is fixed at a set fraction of depth (L11 here). With the same decode-time cache size (Qwen2.5-1.5B, 15%), it reaches 36.5% against our 89.3% (L20 under the question window, as in Figure 1; ceiling 90.8%; clustered-significant). The layer explains the gap: GemFilter moved to L20 reaches 91.4%, within noise of the uncompressed model and of our eviction, which needs no second prefill. GemFilter targets far longer prompts; the comparison holds in our setting only.
5 THE MODEL: EVICTION AS TOP- SELECTION
Eviction is a ranking problem: when one layer scores every cache, the kept set is the top of its scores, so is a good scorer when it ranks the tokens the answer needs above -th place. For each prompt we reconstruct the set of tokens layer would keep, including the always-kept sink and recency tokens. A gold answer survives if some occurrence of it lies entirely inside , matching the metric's all-or-nothing credit. The prediction is survival averaged over a prompt's gold answers, then over prompts,
where is the prompt's gold set and the token-index sets of gold 's occurrences. Everything on the right side comes from the prefill attention of the uncompressed model and the locations of the gold spans. It needs no generation and has no adjustable constants; we call it the survival model. It is computed on 25 calibration prompts per task, drawn from dataset rows the evaluation never uses.
Figure 2 overlays on the depth curves. The survival model's pick is the layer with the highest . When the top two layers differ by less than one standard error of their paired per-prompt difference,

Figure 2: The survival model predicts the depth curve. Blue: observed accuracy at the measured layers, on and off the seven-layer grid, with task-clustered 95% CIs. Orange dashed: predicted survival (Equation (1)) from the uncompressed model's prefill attention, computed at every layer. Diamonds: the survival model's pick, at its observed accuracy. Last panel: the same construction on the Gemma-4 shared cache, one point per reader.
cannot separate them, and the pick is the shallower of the two: counts only the answer span, and a deeper scorer can drop other context the model needs. The pick (diamonds in Figure 2) is the best layer measured on fourteen of the eighteen per-layer models and never significantly below it on the other four (Table A2). On the six per-layer models in Figure 2, tracks the measured curves with a Spearman correlation of 0.90–1.00 and a mean absolute error of 2.7–7.4pp. We also compute from each reader's attention over the Gemma-4 shared cache; it reproduces all five readers' accuracies within 5.1pp (; Figure 2, last panel), so the per-layer curves and the shared-cache penalty are one phenomenon.
5.1 THE MECHANISM
Our explanation for the middle peak is that the network needs several layers to find the answer with the question. Early layers have not finished that work, so their attention cannot yet pick out what the question needs. The last layer has moved on to producing output. The layers in between use the question to retrieve, so their attention ranks tokens well. The cliffs at both ends come from the all-or-nothing rule: an answer survives only if every one of its tokens is kept, so moderate ranking errors add up to lost answers.
The direct test is to take the question away. Every depth-curve score in this paper comes from attention paid by the question's tokens (Section 3). For the test we compute the same attention from the context's own final tokens instead, as if no question had been asked, and compare how much attention mass each layer places on the answer's tokens. With the question, Gemma-4's reader layers place as much mass on the answer as the writer does. Without it, the readers and the writer are nearly equally blind to the answer, and the gap between them shrinks by a factor of 6.5.
Figure 3 shows the same collapse on the per-layer models. On the two weakest models, Qwen2.5-0.5B and SmolLM2, the drop is small: there the needle draws much of its attention simply by standing out from the surrounding text, with or without the question. With the question, the mass on the answer peaks at mid-depth, within one grid step of the accuracy peak, on every model we test.
Heads versus depth. Retrieval heads concentrate at mid-depth (Wu et al., 2025), so the depth curve could simply reflect where they sit. As a control, we score every cache with the pooled attention of the sixteen heads with the most attention mass on the answer, chosen on two calibration

Figure 3: Taking the question away flattens the depth signal. Attention mass on the answer's tokens, scored by the question block (blue) or the context's last 32 tokens (orange); means over the 199 prompts with located answer spans, no eviction. Left: Qwen2.5-7B by scorer depth. Right: mass at each model's peak layer, with and without the question; the number above each pair is their ratio.
Table 2: Scale, release date, and context length: the win shrinks, the downside stays. Best and worst single scorer among the layers tested, against the per-layer default (own), each model at its binding budget; n=200, task-clustered 95% CIs, bold = significant. The survival model's picks are in Table A2. The 70B and 72B run in 4-bit NF4. Last two rows: 32K contexts.
| Model | Cache | Budget | Best scorer (depth) | Best – own | Worst – own |
|---|---|---|---|---|---|
| Qwen2.5-14B | per-layer | 5% | L30 (0.64) | +17.7 [+5.6,+30.9] | -50.7 [-71.9,-31.5] |
| Qwen2.5-32B | per-layer | 5% | L41 (0.65) | +3.9 [-4.2,+11.4] | -44.6 [-60.2,-29.4] |
| Qwen3-0.6B | per-layer | 15% | L16 (0.59) | +20.4 [+5.1,+37.4] | -45.4 [-65.4,-26.9] |
| Qwen3-1.7B | per-layer | 10% | L17 (0.63) | +8.3 [-4.6,+21.6] | -55.4 [-72.8,-38.5] |
| Qwen3-14B | per-layer | 5% | L28 (0.72) | -2.1 [-6.9,+2.4] | -42.0 [-63.6,-22.4] |
| Qwen3.5-9B | hybrid 8/32 | 5% | L15 (0.48) | +9.8 [-6.2,+26.2] | -29.8 [-43.1,-18.7] |
| Qwen2.5-72B | per-layer | 5% | L59 (0.75) | +3.1 [-1.6,+8.2] | -52.8 [-73.9,-32.7] |
| Mistral-7B-v0.3 | per-layer | 5% | L15 (0.48) | +9.6 [+3.0,+17.9] | -36.5 [-59.0,-16.6] |
| Mistral-Small-24B | per-layer | 5% | L20 (0.51) | +7.2 [-1.5,+18.6] | -49.0 [-73.9,-26.2] |
| Llama-3.2-1B | per-layer | 10% | L8 (0.53) | +24.4 [+5.7,+45.6] | -46.0 [-65.1,-26.9] |
| Llama-3.1-70B | per-layer | 5% | L37 (0.47) | +2.4 [-8.5,+16.4] | -42.9 [-59.7,-26.1] |
| Llama-4-Scout | MoE, NoPE 1/4 | 3% | L32 (0.68) | +7.0 [-2.7,+18.1] | -50.0 [-74.3,-26.0] |
| Llama-3.1-8B (32K) | per-layer | 0.5% | L14 (0.45) | +7.2 [-6.8,+23.2] | -47.8 [-71.5,-25.7] |
| Qwen2.5-7B (32K) | per-layer | 1% | L19 (0.70) | +16.3 [-9.8,+42.8] | -37.6 [-61.3,-14.9] |
prompts per task. The head scorer beats the default on all three models tested. It ties the best layer on Qwen2.5-1.5B and Llama-3.1-8B and beats a mid layer on Mistral-Small-24B, where good and poor layers interleave (Section A.8). The good heads live at mid-depth on every model. A single layer collects them without a head search, and choosing heads within that region would refine the pick.
5.2 WHERE THE ADVANTAGE HOLDS AND WHERE IT ENDS
The three models of Figure 1's bottom row show no significant pooled gain. On the 7B and the 8B the default already ties the mid-depth plateau. On the 3B, gains on the multi-needle tasks offset losses on variable tracking and QA.
Scale. The mid-depth gain persists to 14B and is undetectable from 32B (Table 2). Significant gains of +12 to +31pp below 2B continue at 14B (+17.7pp at the pick, L30). From 32B up the survival model's picks (32B, 70B, 72B, 109B) tie the default too (Table A2), so the grid did not miss a better layer. The cost of a wrong scorer does not shrink: the worst layer loses 25 to 56pp at every scale. This matters when the architecture fixes the scorer (Section 6) or a deployment adopts one scorer without checking it.
Newer families, hybrid attention, and MoE. The curve and the shrinking margin replicate on the 2025–2026 releases (Table 2). On Qwen3 all three sizes peak at a middle depth, and the margin
Table 3: On Gemma-4-E2B the default scores from the shallow end of the curve. Layer-14 cache evicted to a 10% budget; n=200. The writer needs a 15–25% budget to match reader L19 at 10% (Table A1). : task-clustered 95% CIs; bold = significant.
| Scorer of the shared cache | Accuracy (%) | vs. writer |
|---|---|---|
| No eviction (ceiling) | 90.3 | – |
| Writer, L14 (default) | 23.1 | – |
| Reader L19 | 51.2 | +28.2 [+13.7, +48.0] |
| Reader L24 | 48.3 | +25.2 [+9.5, +43.6] |
| Reader L29 | 42.5 | +19.4 [+4.9, +38.7] |
| Reader L34 (terminal) | 37.0 | +13.9 [+0.8, +33.9] |
| Rank consensus (5 readers) | 45.3 | +22.2 [+7.6, +39.9] |
falls with capability: significant at 0.6B, not significant at 1.7B, gone at 14B. The curve also holds on Qwen3.5-9B, where gated linear attention leaves only 8 of 32 layers with a KV cache, and on the mixture-of-experts Llama-4-Scout (109B), whose layers without positional encoding score like their neighbors (Section A.2).
Task family. The curve carries to real documents when exact values must survive the cut. On DocFinQA (Reddy et al., 2024), the layer selected on RULER at 32K (the RULER pick) beats the default significantly on both Llama-3.1-8B and Qwen2.5-7B, by 8 and 12pp, and each pick lies at its family's usual depth (Section A.9). Against per-head SnapKV the combination of Table 1 wins there too, by +13.8 and +15.9pp (Table A4). Open-book question answering keeps the curve's ends but loses its gain: on LongBench the shallow and last layers still lose, by 5 to 6 F1, and no mid layer beats the default (Section A.6). The survival model, which was built for exact-match answers, does not predict that outcome. The RULER pool splits the same way at 4K and at 32K: the margin over SnapKV comes from the needle tasks and variable tracking; the two QA tasks add little on the small models and lose up to 12pp on the larger ones (Table A5).
Context length. At 32K the curve keeps its shape and its family depth: Llama-3.1-8B and Qwen2.5-7B peak at their picks, L14 and L19. The shallow third and the last layer sit 20 to 48pp below the default, and the best layer ties it (Table 2). Table 1's comparison repeats its 4K outcome: the combination beats SnapKV by +32.5pp on Qwen2.5-7B and ties it on Llama-3.1-8B (Table A4). Eviction binds only at 0.5% and 1%, which keep 160 to 330 tokens, about what the 4K budgets keep (Table A1): pressure depends on the number of kept tokens rather than their fraction of the context.
6 SHARED CACHES: WHEN THE ARCHITECTURE PICKS THE SCORER
Gemma-4-E2B computes one KV cache at layer 14 and reads it from layers 14, 19, 24, 29, and 34. The five layers share one physical cache, so it can hold only one set of kept tokens, and the architecture decides who scores it: by default the writer, the layer that computes the cache, ranks the tokens with its own attention. On E2B the writer is layer 14 of 35 (depth 0.41), the shallowest of the five readers, and it sits on the shallow side of the curve (Figure 1); the deeper readers place as much question-driven mass on the answer as it does (Section 5.1). We evict the shared cache only and leave the private caches intact (Section A.7).
Table 3 shows what the default costs. At a 10% budget the writer scores 23% where reader L19 scores 51%, and every reader beats the writer with clustered significance. Rank consensus over the readers, which keeps the tokens with the best mean rank and removes the need to pick a layer, recovers most of L19's gain. The penalty replicates across budgets, context lengths, prompt draws, and checkpoints (Section A.7). It is smaller on Gemma-3n, whose writer sits at 0.66 and whose best reader sits deeper still, at 0.83 (+12.5pp).
The penalty follows the writer's depth. Gemma-4-E4B, a sibling design, places its writer at depth 0.56. On E4B the penalty largely disappears: the +22.2pp consensus-over-writer gain of Table 3 shrinks to +6.3pp [-3.2, +17.1] at the same 10% budget, and the task-paired difference between the two designs is +15.9pp [+4.5, +28.2]. Beyond retrieval the evidence weakens. On
LongBench (seven datasets) consensus beats the writer on E2B-it by +8.4 F1 [+1.6, +17.1], but the two designs do not differ significantly there. On DocFinQA, E4B-it's mid-depth writer beats every deeper reader by 14 to 22pp (Section A.9): when the writer already sits at mid-depth, the architecture has picked well.
7 PRACTICAL GUIDANCE, COST, AND LIMITATIONS
On per-layer models, let the survival model choose the scoring layer (Section 5) and let that layer score every cache with a single set of kept tokens. Do not average across all layers: rank consensus over all layers loses 21–37pp to the selected layer on two models (Section A.5). On shared-cache models with a shallow writer, score with a mid-depth reader or with rank consensus over the cache's readers. Scoring reads one layer's attention at prefill and adds under 1% to its time (Section B). Physical eviction at a 1% budget shrinks Llama-3.1-8B's 32K decode-resident cache from 4.0GB to 45MB and speeds decode 1.4× (Section B).
The evidence has limits. The pick needs calibration prompts with known answers. The shared-cache results come only from Gemma models, the scale trend on newer releases only from Qwen3, and the 70B and 72B runs from 4-bit NF4 checkpoints. Three problems remain open. First, the best scorer differs by task family (Section 5.2), so a selector that detects the task family at prefill could beat any single layer. Second, the writer-depth explanation rests on one sibling pair (Section 6). Training the same model with a deeper writer would test it directly. Third, every scorer here sees the question, and SnapKV's edge disappears without it (Luo et al., 2026), so prefix caches need a question-free signal (Kim et al., 2025).
ACKNOWLEDGMENTS
Computations were run on the Colby College High-Performance Computing cluster.
REPRODUCIBILITY STATEMENT
RULER prompts at 4K–16K come from the simonjegou/ruler Hugging Face release and at 32K from lighteval's official-generator releases, one per tokenizer (e.g. lighteval/RULER-32768-Lamma3-Instruct). Models run in fp16, except Llama-4-Scout and Qwen3.5-9B in bf16 and the 70B and 72B in 4-bit NF4. Prompt draws are deterministic. Greedy decoding is bit-exact only within one GPU and kernel configuration: rerunning the primary sweeps on a different GPU flipped a few near-tied prompts per configuration and moved pooled accuracies by at most a point. Every number is computed by a script and stored in a JSON file; figures, tables, and the statistics quoted as macros read these files, and the prose numbers come from those tables and files. One statistics implementation is shared by every figure and table. Baseline semantics were ported from the kvpress reference implementations (https://github.com/NVIDIA/kvpress, version 0.5.4; PyramidKV's schedule from its authors' code), and Section B verifies that masked eviction matches physical deletion. On the same prompts, our SnapKV scoring and kvpress agree on over 99.8% of kept tokens (Llama-3.1-8B).
REFERENCES
Muhammad Adnan, Akhil Arunkumar, Gaurav Jain, Prashant J. Nair, Ilya Soloveychik, and Purushotham Kamath. Keyformer: KV cache reduction through key tokens selection for efficient generative inference. In Conference on Machine Learning and Systems (MLSys), 2024. arXiv:2403.09054.
Yushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu, Jiankai Tang, Zhidian Huang, Zhengxiao Du, Xiao Liu, Aohan Zeng, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li. LongBench: A bilingual, multitask benchmark for long context understanding. In Annual Meeting of the Association for Computational Linguistics (ACL), 2024. arXiv:2308.14508.
William Brandon, Mayank Mishra, Aniruddha Nrusimha, Rameswar Panda, and Jonathan Ragan-Kelley. Reducing Transformer key-value cache size with cross-layer attention. In Advances in Neural Information Processing Systems (NeurIPS), 2024. arXiv:2405.12981.
Zefan Cai, Yichi Zhang, Bofei Gao, Yuliang Liu, Yucheng Li, Tianyu Liu, Keming Lu, Wayne Xiong, Yue Dong, Junjie Hu, and Wen Xiao. PyramidKV: Dynamic KV cache compression based on pyramidal information funneling. arXiv preprint arXiv:2406.02069, 2024.
Chi-Chih Chang, Wei-Cheng Lin, Chien-Yu Lin, Hung-Yueh Chiang, Yash Akhauri, Xilai Dai, Huiqiang Jiang, Yucheng Li, Luis Ceze, Kai-Chiang Wu, and Mohamed S. Abdelfattah. xKV: Cross-layer KV-cache compression via aligned singular vector extraction. arXiv preprint arXiv:2503.18893, 2025.
Alessio Devoto, Maximilian Jeblick, and Simon Jégou. Expected attention: KV cache compression by estimating attention from future queries distribution. arXiv preprint arXiv:2510.00636, 2025. Implemented in the NVIDIA kvpress library, https://github.com/NVIDIA/kvpress.
Yuan Feng, Junlin Lv, Yukun Cao, Xike Xie, and S. Kevin 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.
Qichen Fu, Minsik Cho, Thomas Merth, Sachin Mehta, Mohammad Rastegari, and Mahyar Najibi. LazyLLM: Dynamic token pruning for efficient long context LLM inference. arXiv preprint arXiv:2407.14057, 2024.
Yu Fu, Zefan Cai, Abedelkadir Asi, Wayne Xiong, Yue Dong, and Wen Xiao. Not all heads matter: A head-level KV cache compression method with integrated retrieval and reasoning. In International Conference on Learning Representations (ICLR), 2025. arXiv:2410.19258.
Yizhao Gao, Jianyu Wei, Qihao Zhang, Yu Cheng, Shimao Chen, Zhengju Tang, Zihan Jiang, Yifan Song, Hailin Zhang, Liang Zhao, Bo Yang, Gang Wang, Shijie Cao, and Fuli Luo. HySparse: A hybrid sparse attention architecture with oracle token selection and KV cache sharing. arXiv preprint arXiv:2602.03560, 2026.
Suyu Ge, Yunan Zhang, Liyuan Liu, Minjia Zhang, Jiawei Han, and Jianfeng Gao. Model tells you what to discard: Adaptive KV cache compression for LLMs. In International Conference on Learning Representations (ICLR), 2024. arXiv:2310.01801.
Gemma Team. Gemma 3n: Efficient on-device architectures. Google developer documentation, https://ai.google.dev/gemma/docs/gemma-3n, 2025. No standalone technical report; architecture documented in the official developer guide.
Gemma Team. Gemma 4 technical report. arXiv preprint arXiv:2607.02770, 2026.
Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia, Yang Zhang, and Boris Ginsburg. RULER: What's the real context size of your long-context language models? arXiv preprint arXiv:2404.06654, 2024.
Inbasekaran S. Page-EntroKV: Hardware-aligned, entropy-weighted KV-cache eviction under grouped-query attention. arXiv preprint arXiv:2610.03135, 2026.
Dongwon Jo, Jiwon Song, Yulhwa Kim, and Jae-Joon Kim. FastKV: Decoupling of context reduction and KV cache compression for prefill-decoding acceleration. In Findings of the Association for Computational Linguistics: ACL 2026, 2026. arXiv:2502.01068.
Jang-Hyun Kim, Jinuk Kim, Sangwoo Kwon, Jae W. Lee, Sangdoo Yun, and Hyun Oh Song. KVzip: Query-agnostic KV cache compression with context reconstruction. In Advances in Neural Information Processing Systems (NeurIPS), 2025. arXiv:2505.23416.
Sravanth Kodavanti and Manjunath Arveti. MOSAIC: Multi-objective search for allocating inference cache across LLM decoder layers. arXiv preprint arXiv:2610.25431, 2026.
Wonbeom Lee, Jungi Lee, Junghwan Seo, and Jaewoong Sim. InfiniGen: Efficient generative inference of large language models with dynamic KV cache management. In USENIX Symposium on Operating Systems Design and Implementation (OSDI), 2024. arXiv:2406.19707.
Yuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh, Acyr Locatelli, Hanchen Ye, Tianle Cai, Patrick Lewis, and Deming Chen. SnapKV: LLM knows what you are looking for before generation. In Advances in Neural Information Processing Systems (NeurIPS), 2024. arXiv:2404.14469.
Zichang Liu, Aditya Desai, Fangshuo Liao, Weitao Wang, Victor Xie, Zhaozhuo Xu, Anastasios Kyrillidis, and Anshumali Shrivastava. Scissorhands: Exploiting the persistence of importance hypothesis for LLM KV cache compression at test time. In Advances in Neural Information Processing Systems (NeurIPS), 2023. arXiv:2305.17118.
Daming Luo, Christy Liang, and Junyu Xuan. How query visibility changes KV-cache compression rankings: A matched-budget audit. arXiv preprint arXiv:2607.11942, 2026.
Matanel Oren, Michael Hassid, Nir Yarden, Yossi Adi, and Roy Schwartz. Transformers are multi-state RNNs. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2024. arXiv:2401.06104.
Ziran Qin, Yuchen Cao, Mingbao Lin, Wen Hu, Shixuan Fan, Ke Cheng, Weiyao Lin, and Jianguo Li. CAKE: Cascading and adaptive KV cache eviction with layer preferences. In International Conference on Learning Representations (ICLR), 2025. arXiv:2503.12491.
Varshini Reddy, Rik Koncel-Kedziorski, Viet Dac Lai, Michael Krumdick, Charles Lovering, and Chris Tanner. DocFinQA: A long-context financial reasoning dataset. In Annual Meeting of the Association for Computational Linguistics (ACL), 2024. arXiv:2401.06915.
Yiqun Shen, Song Yuan, Zhengze Zhang, Xiaoliang Wang, Daxin Jiang, and Nguyen Cam-Tu. LAva: Layer-wise KV cache eviction with dynamic budget allocation. In Findings of the Association for Computational Linguistics: EMNLP 2025, 2025. arXiv:2509.09754.
Jack Shi and Jerry Gu. Trust the mass: Forced weights in KV-cache eviction. arXiv preprint arXiv:2608.25230, 2026.
Zhenmei Shi, Yifei Ming, Xuan-Phi Nguyen, Yingyu Liang, and Shafiq Joty. Discovering the gems in early layers: Accelerating long-context LLMs with 1000x input token reduction. In Findings of the Association for Computational Linguistics: ACL 2026, 2026. arXiv:2409.17422.
Yutao Sun, Li Dong, Yi Zhu, Shaohan Huang, Wenhui Wang, Shuming Ma, Quanlu Zhang, Jianyong Wang, and Furu Wei. You only cache once: Decoder-decoder architectures for language models. In Advances in Neural Information Processing Systems (NeurIPS), 2024. arXiv:2405.05254.
Yuyao Sun, Tao Deng, Shuang Li, Deqing Wang, Hao Geng, and Minjun Yu. Learning to predict middle-layer attention in MLLMs for visual token pruning. arXiv preprint arXiv:2608.06411, 2026.
Hanlin Tang, Yang Lin, Jing Lin, Qingsen Han, Danning Ke, Shikuan Hong, Yiwu Yao, and Gongyi Wang. RazorAttention: Efficient KV cache compression through retrieval heads. In International Conference on Learning Representations (ICLR), 2025. arXiv:2407.15891.
Rei Taniguchi, Yuyang Dong, Makoto Onizuka, and Chuan Xiao. Adaptive layer selection for layer-wise token pruning in LLM inference. In Findings of the Association for Computational Linguistics: ACL 2026, 2026. arXiv:2601.07667.
Guangtao Wang, Shubhangi Upasani, Chen Wu, Darshan Gandhi, Jonathan Li, Changran Hu, Bo Li, and Urmish Thakker. LLMs know what to drop: Self-attention guided KV cache eviction for efficient long-context inference. arXiv preprint arXiv:2503.08879, 2025a.
Yixuan Wang, Haoyu Qiao, Lujun Li, Qingfu Zhu, and Wanxiang Che. CommonKV: Compressing KV cache with cross-layer parameter sharing. arXiv preprint arXiv:2508.16134, 2025b.
Zihao Wang, Bin Cui, and Shaoduo Gan. SqueezeAttention: 2D management of KV-cache in LLM inference via layer-wise optimal budget. In International Conference on Learning Representations (ICLR), 2025c. arXiv:2404.04793.
Haoyi Wu and Kewei Tu. Layer-condensed KV cache for efficient inference of large language models. In Annual Meeting of the Association for Computational Linguistics (ACL), 2024. arXiv:2405.10637.
Wenhao Wu, Yizhong Wang, Guangxuan Xiao, Hao Peng, and Yao Fu. Retrieval head mechanistically explains long-context factuality. In International Conference on Learning Representations (ICLR), 2025. arXiv:2404.15574.
Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. In International Conference on Learning Representations (ICLR), 2024. arXiv:2309.17453.
Guangxuan Xiao, Jiaming Tang, Jingwei Zuo, Junxian Guo, Shang Yang, Haotian Tang, Yao Fu, and Song Han. DuoAttention: Efficient long-context LLM inference with retrieval and streaming heads. In International Conference on Learning Representations (ICLR), 2025. arXiv:2410.10819.
Dongjie Xu, Kai Qian, Julius, Weijie Shi, Yuxuan Sun, Minghua Tang, Fenglei Jin, Hanchi Dong, and Jiajie Xu. RippleKV: Cross-layer KV cache allocation via perturbation propagation. arXiv preprint arXiv:2608.08684, 2026.
Lijie Yang, Zhihao Zhang, Zhuofu Chen, Zikun Li, and Zhihao Jia. TidalDecode: Fast and accurate LLM decoding with position persistent sparse attention. In International Conference on Learning Representations (ICLR), 2025. arXiv:2410.05076.
Wen Zan, Jiaqi Zhang, Jianchao Tan, Hong Liu, Cunguang Wang, Xiang Li, Duyue Ma, Guanyu Wu, Yifan Lu, Fengcun Li, Yerui Sun, Peng Pei, Yuchen Xie, and Xunliang Cai. LongCat sparse attention: Taming the lightning via streaming-aware hierarchical cross-layer indexing. arXiv preprint arXiv:2608.01662, 2026.
Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, Ruisi Cai, Zhao Song, Yuandong Tian, Christopher Ré, Clark Barrett, Zhangyang Wang, and Beidi 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 SUPPORTING COMPARISONS
This appendix records the two choices made for each model, its budget (Section A.1) and its scoring layer (Section A.2), and then the comparisons the main text cites (Section A.3 to Section A.10).
A.1 BINDING BUDGETS
Table A1 shows the scan behind every rule-chosen budget in the paper. The scan uses the first ten evaluation prompts per task and depends only on how much the default loses. Budgets loosen as models weaken. Four primary models appear in the main text at a uniform budget in place of their binding budgets (Section 3); for Qwen2.5-1.5B the two coincide at 15%. At the binding budgets the gains hold. The pick beats the default by +33.7pp on Qwen2.5-0.5B (25%) and +15.9pp on SmolLM2 (20%), and the combination of Table 1 beats per-head SnapKV by +40.8 and +32.6pp there, all clustered-significant; the Gemma-4-E2B gap at 25% is in Table A7.
A.2 THE SURVIVAL MODEL'S PICKS
Table A2 tests the survival model's pick on every per-layer model and on two of them at 32K. Against the default the pick wins significantly on seven models and ties the rest, the largest models included; the margin is large where the peak is sharp and a tie where the top is flat. The pick is the best layer measured on fourteen of the eighteen models and within noise of the best on the other four; it beats the best other layer significantly on two. Bootstrapping the calibration prompts leaves the pick unchanged in 66 to 100% of resamples on the seven models with a significant gain. Llama-4-Scout drops positional encoding in every fourth layer; the four such layers that we ran score like their neighbors (54.7 to 66.6% against 60.5 to 70.8%), so the layer type does not disturb the depth curve.
Table A1: How each model's budget was set. Accuracy lost by the own-layer default at each candidate budget (uncompressed minus default, pp, informative tasks, ten prompts per task). Bold: the chosen budget, the smallest that loses at least 5pp with no task collapsed (¹: default recall under 5% on a task the uncompressed model gets above 30%). Dashes: budget not scanned. The candidates are {5, 10, 15}%, extended when nothing bound: up to 25% for the weakest models, down to 2% for Llama-4-Scout and to 0.25% at 32K. Blocks: the primary models (on Gemma-4-E2B the default is the writer), the twelve models of Table 2, the 32K runs.
| Model | Default damage at each candidate budget (% of context kept) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.25 | 0.5 | 1 | 2 | 3 | 5 | 10 | 15 | 20 | 25 | Binding | |
| Qwen2.5-0.5B | - | - | - | - | - | 63.2f | 48.0f | 44.0f | 42.6f | 38.8 | 25% |
| Qwen2.5-1.5B | - | - | - | - | - | 54.9f | 34.1f | 28.4 | 24.4 | - | 15% |
| SmolLM2-1.7B | - | - | - | - | - | 46.8f | 38.2f | 33.2f | 27.4 | - | 20% |
| Qwen2.5-7B | - | - | - | - | - | 36.6f | 13.8 | - | - | - | 10% |
| Llama-3.2-3B | - | - | - | - | - | 19.0 | 5.2 | - | - | - | 5% |
| Llama-3.1-8B | - | - | - | - | - | 15.9 | 3.4 | - | - | - | 5% |
| Gemma-4-E2B (writer) | - | - | - | - | - | 84.7f | 67.4f | 52.4f | - | 35.2 | 25% |
| Qwen2.5-14B | - | - | - | - | - | 28.0 | 7.2 | 1.2 | - | - | 5% |
| Qwen2.5-32B | - | - | - | - | - | 27.1 | 2.3 | 0.4 | - | - | 5% |
| Qwen3-0.6B | - | - | - | - | - | 56.2f | 39.8f | 27.8 | - | - | 15% |
| Qwen3-1.7B | - | - | - | - | - | 45.8f | 22.4 | 10.3 | - | - | 10% |
| Qwen3-14B | - | - | - | - | - | 39.6 | 11.2 | 6.6 | - | - | 5% |
| Qwen3.5-9B | - | - | - | - | - | 41.2 | 12.0 | 3.9 | - | - | 5% |
| Qwen2.5-72B | - | - | - | - | - | 22.0 | 3.6 | 2.7 | - | - | 5% |
| Mistral-7B-v0.3 | - | - | - | - | - | 31.9 | 6.6 | 0.9 | - | - | 5% |
| Mistral-Small-24B | - | - | - | - | - | 26.0 | 5.5 | 1.5 | - | - | 5% |
| Llama-3.2-1B | - | - | - | - | - | 43.3f | 24.4 | 16.0 | - | - | 10% |
| Llama-3.1-70B | - | - | - | - | - | 6.8 | -1.0 | -2.5 | - | - | 5% |
| Llama-4-Scout | - | - | - | 49.7f | 29.6 | 4.3 | 1.9 | 0.4 | - | - | 3% |
| Llama-3.1-8B (32K) | 45.2f | 22.6 | 3.3 | 2.4 | - | 3.1 | 0.6 | - | - | - | 0.5% |
| Qwen2.5-7B (32K) | 83.3f | 62.0f | 34.2 | 16.8 | - | 2.8 | -1.1 | - | - | - | 1% |
A.3 THE TASK POOL
Table A3 checks the five RULER tasks left out of the eight-task pool (Section 3). Three score low under both methods and so carry little signal: niah_single_3, whose needle is a UUID of about thirty tokens that the all-or-nothing metric never credits once one is lost, cwe, and niah_multikey_3. On the other two, fwe and niah_multikey_2, ours matches or beats SnapKV. Over all thirteen tasks every gain shrinks by 3–6pp and stays significant.
A.4 THE METHOD COMPARISON BEYOND TABLE 1
Table A4 extends the Table 1 comparison to Qwen2.5-1.5B at five more budgets, to the three remaining primary models, and to 32K. The combination's lead over per-head SnapKV holds at every 1.5B budget, shrinking above 10% as SnapKV recovers, and on the 0.5B; the two Llama models, whose depth gains are not significant, tie. At 32K it beats SnapKV on both models on DocFinQA and on Qwen2.5-7B on RULER, and ties on Llama-3.1-8B, as at 4K. Table A5 splits the margin into its two changes (top) and by task (bottom).
A.5 CONSENSUS OVER LAYERS
Averaging across layers loses to the pick, which backs the advice of Section 7. The pick beats rank consensus over all layers by +36.9pp on Qwen2.5-1.5B and +20.8pp on SmolLM2-1.7B, and consensus over the middle third by +29.9 and +20.0pp, all clustered-significant (eight-task pool at 15%, n=200; the pick, L20 and L15, measured in a separate run on the same prompts). Averaging dilutes the one sharply good layer with its neighbors.
Table A2: The survival model's picks. Pick: the layer the survival model selects (Section 5) on 25 calibration prompts per task, disjoint from the evaluation prompts. Best other: the highest-scoring other layer measured on the model. Bottom block: the same rule at 32K context on two models. n=200; task-clustered 95% CIs; bold: CI excludes zero.
| Model | Budget | Pick | Best other | Pick – own | Pick – best other |
|---|---|---|---|---|---|
| Qwen2.5-0.5B | 15% | L14 | L15 | +31.4 [+9.9,+53.8] | +10.5 [-0.5,+22.9] |
| Qwen2.5-1.5B | 15% | L20 | L19 | +26.6 [+8.4,+46.5] | +7.4 [+1.8,+14.1] |
| SmolLM2-1.7B | 15% | L15 | L16 | +11.8 [+3.3,+21.5] | +0.1 [-6.0,+6.4] |
| Llama-3.2-3B | 5% | L14 | L16 | +7.2 [-5.8,+22.4] | -1.7 [-13.8,+8.0] |
| Qwen2.5-7B | 10% | L18 | L19 | +5.5 [-12.5,+26.9] | +1.5 [-3.2,+6.1] |
| Llama-3.1-8B | 5% | L15 | L13 | +6.0 [-2.9,+16.1] | -1.4 [-5.6,+2.2] |
| Qwen2.5-14B | 5% | L30 | L29 | +17.7 [+5.6,+30.9] | +5.7 [-2.1,+15.7] |
| Qwen2.5-32B | 5% | L41 | L50 | +3.9 [-4.2,+11.4] | +1.3 [-7.1,+10.2] |
| Qwen2.5-72B | 5% | L59 | L55 | +3.1 [-1.6,+8.2] | +3.1 [-2.4,+8.8] |
| Qwen3-0.6B | 15% | L16 | L15 | +20.4 [+5.1,+37.4] | +5.0 [-0.8,+11.5] |
| Qwen3-1.7B | 10% | L17 | L15 | +8.3 [-4.6,+21.6] | +4.3 [-3.7,+12.7] |
| Qwen3-14B | 5% | L28 | L21 | -2.1 [-6.9,+2.4] | +0.7 [-10.8,+12.2] |
| Qwen3.5-9B | 5% | L15 | L19 | +9.8 [-6.2,+26.2] | +8.3 [-3.9,+19.9] |
| Mistral-7B-v0.3 | 5% | L15 | L18 | +9.6 [+3.0,+17.9] | +9.0 [+2.9,+16.8] |
| Mistral-Small-24B | 5% | L28 | L20 | -0.8 [-4.0,+1.8] | -8.0 [-18.9,+0.6] |
| Llama-3.2-1B | 10% | L8 | L10 | +24.4 [+5.7,+45.6] | +3.0 [-1.2,+7.8] |
| Llama-4-Scout | 3% | L32 | L26 | +7.0 [-2.7,+18.1] | +3.8 [-0.1,+8.4] |
| Llama-3.1-70B | 5% | L35 | L37 | +1.5 [-9.7,+15.8] | -0.9 [-3.8,+1.4] |
| Qwen2.5-7B (32K) | 1% | L19 | L22 | +16.3 [-9.8,+42.8] | +5.5 [-14.1,+26.7] |
| Llama-3.1-8B (32K) | 0.5% | L14 | L20 | +7.2 [-6.8,+23.2] | +1.5 [-4.4,+7.6] |
Table A3: The five excluded RULER tasks. Accuracy (%) of the uncompressed model (none) and of the mid-layer single set and per-head SnapKV (ours/SnapKV), ten prompts per task. Bottom rows: ours minus SnapKV, pooled over prompts, on the five excluded tasks (ten prompts each), the eight-task pool of Table 1 (25 each), and all thirteen tasks; informative tasks only, as throughout. Task-clustered 95% CIs; bold: CI excludes zero.
| Excluded task | Qwen2.5-1.5B @10% | Qwen2.5-1.5B @15% | SmolLM2-1.7B @15% | |||
|---|---|---|---|---|---|---|
| none | ours/SnapKV | none | ours/SnapKV | |||
| cwe | 58 | 5/6 | 58 | 12/7 | 4 | 4/10 |
| fwe | 80 | 73/50 | 80 | 67/57 | 70 | 47/40 |
| niah_multikey_2 | 100 | 60/20 | 100 | 90/20 | 90 | 10/10 |
| niah_multikey_3 | 90 | 10/0 | 90 | 20/10 | 60 | 10/0 |
| niah_single_3 | 100 | 0/0 | 100 | 0/0 | 100 | 0/0 |
| ours – SnapKV: five excluded tasks | +14.5 | [+0.8,+32.0] | +19.0 | [+2.0,+46.4] | +4.2 | [-5.8,+15.0] |
| ours – SnapKV: eight-task pool | +42.8 | [+20.0,+65.8] | +34.6 | [+15.6,+54.0] | +34.9 | [+14.6,+55.7] |
| ours – SnapKV: all thirteen tasks | +37.1 | [+17.7,+56.1] | +31.5 | [+15.0,+47.7] | +29.8 | [+11.6,+47.4] |
A.6 LONGBENCH
Table A6 gives the LongBench result of Section 5.2 on two models, pooled over datasets. No scorer beats the default: the mid layers tie it and the shallow and last layers lose 5 to 6 F1 on both models. The same Llama-3.1-8B layers gain 4 to 12pp on the filings (Section A.9). LongBench's two code-completion datasets, LCC and RepoBench-P, were left out because eviction barely touches them: on Qwen2.5-1.5B the default loses at most 0.5 points of edit similarity, LongBench's metric for code, at any budget from 2% to 10%, so no budget binds.
Table A4: The method comparison beyond Table 1. Rows and conventions as in Table 1; the scoring layer is the survival model's pick at the column's budget. Top: Qwen2.5-1.5B at two more budgets, and the three remaining primary models at the budgets of Figure 1. Middle: Qwen2.5-1.5B at looser budgets (picks L16, L16, L20). Bottom: at 32K, on the DocFinQA prompts and budgets of Table A9 and on the RULER pool at the budgets of Table 2; H2O was not run at 32K, where its full 32K×32K attention did not fit. DocFinQA intervals are over prompts (one task), and its numbers use the kypress window, so they differ from Table A9's.
| Scoring method | 1.5B @5% | 1.5B @20% | 0.5B @15% | 3B @5% | 8B @5% |
|---|---|---|---|---|---|
| No eviction (ceiling) | 90.8 | 90.8 | 84.6 | 91.3 | 93.9 |
| H2O (observed attention) | 13.7 | 19.9 | 15.5 | 17.4 | 21.1 |
| SnapKV (per-head, own layer) | 17.9 | 60.5 | 35.1 | 74.7 | 78.6 |
| AdaKV (SnapKV scores) | 20.1 | 66.8 | 31.4 | 74.0 | 75.1 |
| PyramidKV (pyramid budgets) | 10.4 | 44.8 | 22.7 | 62.2 | 72.3 |
| Own layer, single set | 23.1 | 73.4 | 31.9 | 74.6 | 78.2 |
| Mid-layer, per-head | 48.5 | 86.4 | 74.0 | 72.0 | 81.4 |
| Mid-layer, single set (ours) | 55.7 | 88.3 | 72.1 | 76.8 | 81.0 |
| Δ (ours – SnapKV) | +37.8 | +27.7 | +37.0 | +2.1 | +2.4 |
| 95% CI | [+16.1, +61.0] | [+9.5, +46.2] | [+15.3, +58.9] | [-9.0, +13.6] | [-4.8, +9.3] |
| Scoring method | 1.5B @30% | 1.5B @40% | 1.5B @50% |
|---|---|---|---|
| No eviction (ceiling) | 90.8 | 90.8 | 90.8 |
| H2O (observed attention) | 26.6 | 33.2 | 40.7 |
| SnapKV (per-head, own layer) | 70.0 | 78.1 | 82.4 |
| AdaKV (SnapKV scores) | 76.1 | 81.8 | 84.9 |
| PyramidKV (pyramid budgets) | 63.7 | 69.6 | 79.2 |
| Own layer, single set | 81.3 | 84.9 | 85.0 |
| Mid-layer, per-head | 88.3 | 89.8 | 89.9 |
| Mid-layer, single set (ours) | 89.5 | 90.5 | 90.0 |
| Δ (ours – SnapKV) | +19.4 | +12.5 | +7.6 |
| 95% CI | [+6.3, +34.4] | [+4.0, +22.6] | [+0.8, +16.1] |
| Scoring method | DocFinQA, 31.5K | RULER, 32K | ||
|---|---|---|---|---|
| 8B @1% | 7B @5% | 8B @0.5% | 7B @1% | |
| No eviction (ceiling) | 45.9 | 46.2 | 91.7 | 88.3 |
| SnapKV (per-head, own layer) | 15.0 | 21.6 | 68.3 | 40.1 |
| AdaKV (SnapKV scores) | 14.6 | 19.9 | 64.6 | 37.1 |
| PyramidKV (pyramid budgets) | 15.1 | 14.7 | 62.0 | 21.4 |
| Own layer, single set | 17.6 | 24.6 | 68.8 | 51.2 |
| Mid-layer, per-head | 24.0 | 22.9 | 74.2 | 62.0 |
| Mid-layer, single set (ours) | 28.8 | 37.5 | 72.9 | 72.6 |
| Δ (ours – SnapKV) | +13.8 | +15.9 | +4.6 | +32.5 |
| 95% CI | [+9.2, +18.6] | [+11.0, +21.0] | [-3.7, +12.3] | [+8.1, +58.5] |
A.7 SHARED-CACHE REPLICATIONS AND THE PRIVATE CACHES
Table A7 repeats the comparison of Section 6 at other budgets and context lengths, on a disjoint prompt draw, on all thirteen RULER tasks for both checkpoints, and on Gemma-3n. Every gap is significant. On LongBench (the seven F1-scored datasets of Table A6, 12 prompts each, 10% budget) consensus beats the writer by +8.4 F1 on E2B-it and by a non-significant +4.4 on E4B-it.
Gemma-4-E2B has two other caches that grow with the prompt, written by layers 4 and 9 and read only by those layers; the main experiments leave them intact. In a separate run, evicting them to 10% costs 21pp when each layer ranks its own tokens and 9pp under reader L19's ranking, a difference of
Table A5: Both changes contribute, and the margin comes from the needle and variable-tracking tasks. Top: each change on its own, and AdaKV, against per-head SnapKV in the columns of Table 1; task-clustered 95% CIs; bold: CI excludes zero. The 14B rows come from two runs on the same prompts, each paired with the SnapKV of its own run. Bottom: accuracy of the combination minus per-head SnapKV on each task (pp, 25 prompts per task and column); each column averages to its row in Table 1 or Table A4.
| vs. SnapKV | 1.5B @15% | 1.5B @10% | SmolLM2 @15% | 7B @10% | 14B @5% |
|---|---|---|---|---|---|
| single set (own layer) | +10.1 | +10.3 | +20.1 | +19.7 | -1.4 |
| 95% CI | [+2.7, +18.9] | [+1.4, +23.0] | [+1.1, +42.3] | [+8.9, +31.9] | [-9.3, +7.0] |
| mid layer (per-head) | +31.7 | +35.9 | +18.6 | +29.8 | +14.0 |
| 95% CI | [+14.6, +49.5] | [+17.6, +55.9] | [+0.9, +40.1] | [+10.0, +51.1] | [+0.4, +26.7] |
| AdaKV | +4.8 | +3.6 | +2.5 | -3.5 | -3.9 |
| 95% CI | [+0.5, +10.1] | [-2.0, +10.5] | [-7.1, +13.6] | [-12.0, +3.7] | [-13.1, +3.3] |
| Task | 4K (Table 1) | 32K (Table A4) | ||||||
|---|---|---|---|---|---|---|---|---|
| 1.5B @15% | 1.5B @10% | SmolLM2 @15% | 7B @10% | 14B @5% | 8B @0.5% | 7B @1% | ||
| niah_single_1 | +24 | +52 | +80 | +12 | +16 | +0 | +12 | |
| niah_single_2 | +52 | +84 | +68 | +52 | +44 | +0 | +88 | |
| niah_multikey_1 | +72 | +80 | +40 | +72 | +44 | +0 | +56 | |
| niah_multiquery | +65 | +79 | +37 | +49 | +27 | +12 | +83 | |
| niah_multivalue | +51 | +23 | +6 | +84 | +3 | +20 | +20 | |
| vt | +2 | +10 | +47 | +13 | +27 | +17 | +17 | |
| qa_1 | +3 | +3 | +1 | -1 | -7 | -12 | -12 | |
| qa_2 | +8 | +12 | +0 | -4 | -8 | +0 | -4 | |
Table A6: On LongBench no mid layer beats the default, and the shallow and last layers still lose. Nine question-aware datasets (HotpotQA, 2WikiMQA, MuSiQue, Qasper, MultiFieldQA-en, TriviaQA, NarrativeQA, QMSum, PassageRetrieval-en), official templates and metrics (normalized F1; ROUGE-L for QMSum, the retrieval score for PassageRetrieval-en), 25 prompts each, pooled over the datasets whose no-eviction score is at least 15. Qwen2.5-1.5B at 5%, its binding budget on this benchmark (L19, the grid mid layer, and L20, the pick); Llama-3.1-8B at 2% (L13, L14, L17, the plateau of its RULER curve). Task-clustered 95% CIs against the default; bold: CI excludes zero.
| Scorer | F1 | vs. default | 95% CI |
|---|---|---|---|
| Qwen2.5-1.5B, 5% (binding); 8 of 9 datasets informative | |||
| none (no eviction) | 36.6 | - | - |
| own (per-layer default) | 30.2 | - | - |
| L2 | 24.4 | -5.8 | [-12.0,-0.3] |
| L19 | 30.0 | -0.2 | [-3.7,+3.1] |
| L20 | 29.4 | -0.9 | [-4.7,+2.5] |
| L27 | 25.1 | -5.2 | [-10.6,-0.7] |
| Llama-3.1-8B, 2%; 9 of 9 datasets informative | |||
| none (no eviction) | 43.5 | - | - |
| own (per-layer default) | 38.7 | - | - |
| L2 | 32.6 | -6.1 | [-11.2,-1.8] |
| L13 | 36.9 | -1.8 | [-5.8,+1.3] |
| L14 | 37.8 | -0.9 | [-5.2,+3.4] |
| L17 | 37.7 | -1.0 | [-4.6,+2.4] |
| L31 | 33.4 | -5.3 | [-10.5,-0.9] |
+12.3pp (95% CI [+0.2, +25.6]; sign-flip p=0.16). Even as a cache’s only reader, a shallow layer scores it poorly.
Table A7: The shared-cache penalty replicates across budgets, context lengths, prompt draws, and checkpoints, and on Gemma-3n. Top: reader L19 minus the writer on the shared cache across budgets and context lengths, in separate runs (Figure 1's panel gives +36.7 at 15%); last row, Gemma-3n's reader L24 minus its writer L19 (13 tasks, n=325). Bottom: the 10% comparison on a prompt draw disjoint from every other Gemma table (five tasks, ten prompts each), and on all thirteen RULER-4096 tasks (five prompts each, informative tasks pooled) for the base and instruct checkpoints; cons.: rank consensus over the five readers. Task-clustered 95% CIs; bold: CI excludes zero.
| Replication | reader – writer |
|---|---|
| reader L19 – writer @ budget 5% | +16.8 [+1.5, +38.0] |
| reader L19 – writer @ budget 15% | +36.3 [+16.0, +58.1] |
| reader L19 – writer @ budget 25% | +30.2 [+12.0, +48.7] |
| reader L19 – writer @ 8K context | +36.5 [+13.9, +61.4] |
| reader L19 – writer @ 16K context | +33.8 [+15.5, +52.0] |
| Gemma-3n: reader L24 – writer L19 | +12.5 [+3.2, +23.2] |
| Replication | none | writer | L19 | cons. | L19 – writer | cons. – writer |
|---|---|---|---|---|---|---|
| disjoint prompt draw (5 tasks) | 99.0 | 24.8 | – | 57.1 | – | +32.3 [+10.0, +56.4] |
| 13 tasks, base | 90.6 | 22.9 | 41.0 | 40.9 | +18.1 [+4.6, +35.1] | +18.0 [+4.6, +33.8] |
| 13 tasks, instruct | 84.9 | 39.3 | 63.9 | 51.1 | +24.6 [+10.0, +41.2] | +11.8 [+3.5, +21.9] |
A.8 HEADS AS SCORERS
Table A8 backs the heads-versus-depth test of Section 5.1. The sixteen (layer, head) pairs with the most attention mass on the answer, chosen on two calibration prompts per task, are pooled into one ranking that scores every cache. The three models are the cases where head selection had the best chance to beat depth: a sharp peak (Qwen2.5-1.5B), a flat plateau with no significant depth gain (Llama-3.1-8B), and interleaved good and poor layers (Mistral-Small-24B). On Gemma-4 the writer's gap in attention mass (Section 5.1) is not an artifact of averaging over its heads: each reader's best single head carries 1.5 to 3.4× as much mass on the answer as the writer's best head.
Table A8: The top-16 retrieval heads beat the default on every model and tie or beat the mid layer they are compared with. Eight-task pool, n=200, each model at its binding budget; layer: the mid layer the heads are compared with (on Qwen2.5-1.5B, L19, the grid mid layer, and L20, the pick). Task-clustered 95% CIs; bold: CI excludes zero.
| Model | Budget | Heads – own | Layer | Heads – layer |
|---|---|---|---|---|
| Qwen2.5-1.5B | 15% | +26.0 [+6.4, +47.8] | L19 (grid)L20 (pick) | +6.8 [+0.2, +15.0]-0.6 [-3.7, +2.0] |
| Llama-3.1-8B | 5% | +9.0 [+1.1, +17.8] | L13 | +1.4 [-1.6, +5.0] |
| Mistral-Small-24B | 5% | +18.7 [+2.0, +38.5] | L17 | +11.5 [+3.5, +20.1] |
A.9 FINANCIAL-FILING EXTRACTION
DocFinQA (Reddy et al., 2024) asks numeric questions about full 10-K filings. Each question comes with the arithmetic steps that produce its answer; the gold set is the figures those steps take from the filing, as they appear there. The model sees a 31.5K-token slice that contains them at a random offset and is asked to state the figures it uses; we score recall of those figures. The uncompressed model scores under 50% on this task, so the binding budget's 5% collapse threshold is too low to be useful. The budget here is the smallest scanned one at which the default keeps at least 30% of its uncompressed recall. With one task there is nothing to cluster, so the intervals are prompt-level bootstraps.
Table A9 gives the depth curves. The layer picked on RULER transfers: it beats the default significantly on both per-layer models, and the curve peaks in the same region as on RULER while the other family's depth loses, so the good depth belongs to the model family rather than the task.
Picking the layer on the task itself gains little: the on-task pick, the layer where attention mass on the answer peaks, ties the RULER pick on Qwen2.5-7B and sits one layer beside it on Llama-3.1-8B (L13 against L14; chosen on 25 prompts and tested on the other 175, where it beats the default by +12.3pp). On Gemma-4-E4B-it the mid-depth writer is already the best scorer and every deeper reader loses, consistent with Section 6, where the penalty follows the writer's depth; a shared cache has no scorer shallower than its writer, so only the deep half of the curve is covered. E2B-it has no entry: no budget up to 2% damages its writer on this task.
Table A9: The RULER pick transfers to financial-filing extraction, and a mid-depth writer is already the best scorer of its shared cache. DocFinQA test questions on 31.5K-token filing slices; the metric is recall of the answer's figures; n=200 per block. Top and middle: Llama-3.1-8B at a 1% budget and Qwen2.5-7B at 5%. (pick): the layer the survival model chose on RULER at 32K, deployed unchanged; (on-task pick): the layer where attention mass on the answer peaks on these prompts; †: a second run on the same prompts, compared with its own default. Bottom: Gemma-4-E4B-it's shared layer-23 cache at a 1% budget, scored by the writer, by one of its readers, or by their consensus; differences from the writer. Prompt-level 95% bootstrap CIs; bold: CI excludes zero.
| Scorer | Depth | Recall (%) | Δ vs. default |
|---|---|---|---|
| Llama-3.1-8B, per-layer caches (1%, n=200) | |||
| none (no eviction) | - | 45.9 | - |
| own (per-layer default) | - | 25.2 | - |
| L2 | 0.06 | 1.4 | -23.8 [-28.8,-18.9] |
| L8 | 0.26 | 3.2 | -22.0 [-26.9,-17.5] |
| L12 | 0.39 | 1.9 | -23.3 [-28.4,-18.5] |
| L13 (on-task pick) | 0.42 | 37.0 | +11.8 [+7.0,+16.6] |
| L14 (pick) | 0.45 | 33.4 | +8.2 [+4.0,+12.4] |
| L17 | 0.55 | 29.5 | +4.2 [+0.1,+8.7] |
| L22 | 0.71 | 15.0 | -10.2 [-14.9,-5.6] |
| L26 | 0.84 | 8.9 | -16.3 [-21.5,-11.3] |
| L31 | 1.00 | 2.2 | -23.0 [-28.1,-18.0] |
| Qwen2.5-7B, per-layer caches (5%, n=200) | |||
| none (no eviction) | - | 46.5 | - |
| own (per-layer default) | - | 24.4 | - |
| L2 | 0.07 | 2.7 | -21.8 [-27.0,-16.7] |
| L7 | 0.26 | 2.4 | -22.0 [-27.3,-17.0] |
| L11 | 0.41 | 6.7 | -17.8 [-23.0,-12.7] |
| L15 | 0.56 | 12.3 | -12.1 [-16.9,-7.5] |
| L16† (on-task pick) | 0.59 | 40.9 | +16.2 [+11.3,+21.2] |
| L17 | 0.63 | 34.3 | +9.9 [+5.3,+14.5] |
| L18† | 0.67 | 34.5 | +9.8 [+4.7,+15.0] |
| L19 (pick) | 0.70 | 36.6 | +12.2 [+8.0,+16.8] |
| L21 | 0.78 | 32.5 | +8.1 [+4.4,+12.1] |
| L23 | 0.85 | 25.3 | +0.9 [-2.6,+4.4] |
| L27 | 1.00 | 6.2 | -18.2 [-23.1,-13.5] |
| Gemma-4-E4B-it, shared layer-23 cache (1%, n=200) | |||
| none (no eviction) | - | 48.9 | - |
| writer L23 (default) | 0.56 | 21.8 | - |
| L29 | 0.71 | 8.0 | -13.7 [-18.0,-9.6] |
| L35 | 0.85 | 3.2 | -18.6 [-23.8,-13.8] |
| L41 | 1.00 | 0.2 | -21.5 [-26.6,-16.7] |
| consensus (4 readers) | - | 6.3 | -15.4 [-20.3,-10.8] |
A.10 STATISTICAL CHECKS
Clustered intervals use 50k bootstrap draws. The six primary comparisons are the four combination-over-SnapKV gains of Table 1 (one per model in column order, the 1.5B at 15%), the Qwen2.5-0.5B pick (L14) over its default, and the Gemma-4-E2B best reader over the writer. Each is tested with an exact sign-flip test over all task-sign patterns of its task means, studentized: , 0.016, 0.031, 0.055, 0.031, and 0.008 in that order (the smallest the test can give is ). Because the six share the same eight tasks, a joint sign-flip on the sum of the six statistics gives , again the smallest possible. In Table 3 the terminal reader's margin over the writer gives . On the same test, the seven significant picks of Table A2 give to 0.062, six of them below 0.05.
B EVICTION, SCORING WINDOW, AND COST
The main-text experiments mask evicted rows rather than deleting them, which lets the kept set vary per layer and per head. Masking is exact: softmax with entries equals softmax over the kept subset. We checked it by rerunning the single set scored from L19 on Qwen2.5-1.5B (15% budget, the eight-task pool, ) with the evicted rows physically removed: accuracy is identical on all 200 prompts, and 171 generations are token-identical. The other 29 differ from some token on, as fp16 arithmetic over different tensor shapes allows when two candidates are nearly tied, and none changes the answer.
Scoring convention. Every scorer uses attention from a prefill of the prompt without its final token. The cache is then compressed, and that final token is decoded under the mask like every generated token. The kvpress window of Section 4.1 is therefore the 64 prompt tokens preceding the final one. GemFilter's statistic is defined on the final token itself, so Section 4.1 takes its scores from a full-prompt prefill.
Runtime and memory. The Section 7 cost numbers come from Llama-3.1-8B in fp16 on one H200, five prompts per context length, the first as warm-up and medians over the other four. Scoring as deployed captures one layer's queries and keys during the ordinary prefill, which matches a plain prefill within timing noise at both lengths. The saving arrives at decode: at 32K and a 1% budget the decode-resident cache falls from 3.96GB to 45MB and decoding runs faster (81 to 113 tokens/s); at 4K and 5%, from 0.45GB to 27MB for . Peak prefill memory is unchanged, because eviction happens after prefill. On Qwen2.5-1.5B at 4K, scoring from one layer costs 0.16ms and the top- selection 0.06ms, together under 1% of a prefill that takes 31 to 54ms across prompts; scoring all 28 layers, as the own-layer default does, costs 4.3ms.