Page-EntroKV: Hardware-Aligned, Entropy-Weighted KV-Cache Eviction under Grouped-Query Attention
Organizations: Department of Computer Science and Engineering SRM Institute of Science and Technology, India
Abstract
Serving long-context autoregressive language models is constrained by the key-value (KV) cache. Most dynamic eviction methods score token importance per query head and choose tokens independently. This fits poorly with grouped-query attention (GQA), where several query heads share one physical KV buffer: divergent per-head selections force the serving engine to retain the union of their choices - inflating the cache by up to the group ratio r - while arithmetic mean pooling dilutes the specialized retrieval heads that carry factual recall. We introduce Page-EntroKV, a formal framework for KV-cache eviction operating at the granularity GQA serving actually allocates. Heads within each physical group are pooled by weights derived from sink-isolated collision (Renyi-2) entropy - one inner product per head, computed once at prefill with no calibration - so sink heads cannot masquerade as retrieval heads. Pooled scores are projected onto PagedAttention page frames, and eviction executes at the hardware tuple (layer, group, page). We formalize the union overhead ratio (UOR) and intra-group disagreement, prove an exact identity linking them for two-head groups alongside two-sided bounds at every group ratio, prove strict budget preservation and a finite-context needle-retention bound that arithmetic mean pooling provably violates, and give exact per-layer page accounting. On a pilot architecture (Qwen2.5-1.5B-Instruct, r=6), head-independent replay over 2,240 group measurements yields union overhead up to 4.75x at a 2% budget, while Page-EntroKV holds UOR exactly 1.000; sink isolation removes a 13x sink masquerade; needle recall is 100% versus 0% for mean pooling at a 20% budget; retained cardinality is exact for every page size; and QA and code tasks remain solvable at 20% retention.
Figures & tables
| Method | Importance | GQA-union | Eviction | Strict budget | Calibration |
|---|---|---|---|---|---|
| granularity | aware? | granularity | guarantee? | -free? | |
| H2O [ 10 ] | token | (union ) | ✓ | ||
| StreamingLLM [ 13 ] | position | ✓ (uniform) | token | ✓ (static) | ✓ |
| Scissorhands [ 12 ] | token | ✓ | |||
| SnapKV [ 11 ] | token | ✓ | |||
| FastGen [ 14 ] | per-head policy | token | (profiling) |
| Bonferroni | Sandwich | |
|---|---|---|
| ( Corollary 1 ) | ( Theorem 1 ) | |
| threshold ( ) | ||
| threshold ( ) | ||
| At (disjoint) | (exact, tight) | (exact, tight) |
| At (consensus) | clamp to | (naturally tight) |
| Shannon ( ) | Collision ( ) | Min-entropy ( ) | |
|---|---|---|---|
| Definition | |||
| On-chip primitive | ln-calls | 1 dot product ln | -way max ln |
| FP16 stability | cancellation as | stable ; argument in | plateau ties |
| Spike sensitivity | logarithmic scaling | quadratic amplification of spikes | ignores shape below peak |
| (a) By scoring method | |||||||
| Scorer | -frac | ||||||
| H2O (accum.) | 0.02 | 2.849 | 5.100 | 1.000 | 62 | 290 | 0.879 |
| H2O (accum.) | 0.05 | 2.442 | 4.471 | 1.000 | 22 | 112 | 0.820 |
| H2O (accum.) | 0.10 | 2.292 | 3.971 | 1.000 | 6 | 65 | 0.769 |
| Last-row | 0.02 | 2.982 | 4.600 | 1.000 | 21 | 329 | 0.960 |
| Last-row | 0.05 | 2.703 | 3.961 | 1.000 | 6 | 196 | 0.933 |
| (a) sweep | (b) sweep ( ) | |||
| std | : ; | |||
| 0.1 | 0.9632 | 0.3922 | 0.5 | 0.620; |
| 0.2 | 0.9105 | 0.3700 | 1.0 | 0.762; |
| 0.5 | 0.7502 | 0.2994 | 2.0 | 0.750; |
| 1.0 | 0.5501 | 0.2076 | 999 | 0.641; |
| 2.0 | 0.3656 | 0.1179 | violations of : 0 | |
| (a) Pooled-selection criterion | ||||
|---|---|---|---|---|
| Context | 959 | 1469 | 1989 | 2499 |
| Arithmetic mean | 0.0% | 0.0% | 0.0% | 0.0% |
| Page-EntroKV | 100.0% | 100.0% | 100.0% | 100.0% |
| (b) Strict all-layer criterion (recall by needle depth) | ||||
| Method | 0% | 25% | 50% | 75% / 100% |
| Uncompressed | 1.00 | 1.00 | 1.00 | 1.00 / 1.00 |
| LongBench subset | Page-EntroKV score (%) |
|---|---|
| qasper | 38.60 |
| multifieldqa_en | 44.20 |
| lcc | 56.10 |
| repobench-p | 44.81 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Definition |
|---|---|
| Number of transformer layers, . | |
| Logical query heads; physical KV heads. | |
| GQA group ratio (query heads per physical KV buffer). | |
| Hidden dimension; head dimension ( ). | |
| Current sequence length ( ). | |
| PagedAttention block size (tokens per page, e.g. ). |
| Guarantee | Mathematical form | Value / bound | Systems impact | Validated by |
|---|---|---|---|---|
| Arithmetic intensity | ( Eq. 1 ) | FLOP/Byte | Decode phase memory-bound | Architectural constant |
| H100 ridge point | Eq. 2 | FLOP/Byte | Decode at of peak | Architectural constant |
| Cache footprint | Eq. 3 | Bytes | Linear HBM capacity | Architectural constant |
| identity | , monotone and convex in ( Remark 1 ) | Exact | Disagreement implies inflation | Table 4 certificates |
| Bonferroni certificate | at | Elementary certificate | Table 4 ( ) | |
| Sandwich bound | Tight at extremes | Two-sided inflation bound | Table 4 ( ); Fig. 4 |
| Non-sink | Ratio | |||||
|---|---|---|---|---|---|---|
| 4k | 4,092 | 0.949998 | 0.118750 | |||
| 8k | 8,188 | 0.949999 | 0.118750 | |||
| 16k | 16,380 | 0.949999 | 0.118750 | |||
| 32k | 32,764 | 0.950000 | 0.118750 | |||
| 64k | 65,532 | 0.950000 | 0.118750 | |||
| 128k | 131,068 | 0.950000 | 0.118750 |
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