Beyond Mean Attention: Diversity-Aware, Layer-Wise Scoring for KV Cache Eviction
Organizations: Georgia Institute of Technology Atlanta, GA 30332, USA · Zhangjiang Lab Shanghai, China
Abstract
KV cache eviction methods such as SnapKV and PyramidKV rank tokens solely by mean attention over a small observation window. We study a unified score, , adding attention dispersion across window queries and redundancy relative to selected tokens. For , the score penalizes similarity to selected tokens as in maximal marginal relevance (MMR), without extra forward passes. To test whether this relevance-diversity balance should vary with depth, we compare fixed global coefficients with three-segment and quadratic profiles. Only these depth profiles are searched on a development split under a reparameterization. On all 16 English LongBench datasets with Mistral-7B at a budget of 64 entries per layer, a single global diversification constant improves 13 of 16 datasets (macro +1.1); the gain holds at budget 32 and narrows at 128. Per-dataset search finds no detectable layer structure on most datasets; on passage retrieval it finds a large one: a mid-layer sign flip that rewards similarity and is worth +9.6 over the baseline at budget 64 and, without re-tuning, +13.2 over the global constant at budget 128. Ablations attribute the gain to the redundancy term; replaying every accepted search state on the held-out test set separates genuine structure from tuning noise.
Figures & tables
| Dataset | PyramidKV | Ours | ||
|---|---|---|---|---|
| Global | Seg. | Curve | ||
| qasper | 23.73 | 25.12 | 25.12 | 25.12 |
| hotpotqa | 33.67 | 36.94 | 36.94 | 36.17 |
| 2wikimqa | 23.52 | 23.33 | 23.76 | 23.12 |
| passage-retrieval | 60.60 | 66.81 | 70.17 | 65.87 |
| musique | 13.13 | 11.88 | 12.07 | 12.00 |
| Method | |||
|---|---|---|---|
| PyramidKV | 30.48 | 33.31 | 35.79 |
| Global | 31.21 | 34.44 | 35.99 |
| Seg. | 31.49 | 35.15 | 36.39 |
| Scoring rule | Macro | Wins |
| Mean (baseline) | 33.31 | — |
| Mean & dispersion | 33.50 | 8/16 |
| Mean & Corr | 34.57 | 13/16 |
| dispersion & Corr (fixed ) | 33.16 | 9/16 |
| All three terms (ours, 3 segments) | 35.15 | 14/16 |
| All three terms, 2 segments | 34.75 | 14/16 |
KV-Cache Eviction
Key-value (KV) cache eviction reduces language-model memory use by removing or compressing cached tokens while preserving useful context.
See all 99 papers