Manuscript Offprint

arXiv:2611.02230

Who Should Score the Cache? Mid-Depth Layers Are the Best Judges of KV-Cache Eviction

Ekaterina Seregina

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-kk 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 kk, 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

Figure 1: The depth of the scoring layer governs eviction quality. Accuracy when a single layer at depth ℓ/(L−1)\ell/(L-1) scores every cache's eviction. All panels: question-window scoring (Section 3), the eight-task RULER pool, n=200n=200 (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.

References (59)