Paper commentary
EntroKV: Entropy-Guided Dynamic Budget Allocation for KV-Cache Compression
Entropy-guided budgets let KV-cache compression spend memory where attention needs it
- Problem Long-context models keep a KV cache that grows with the context, and most compression methods give every layer and head the same budget. Some heads saturate at small budgets while others keep gaining, so uniform splits waste memory.
- Method EntroKV sets each head's budget from its normalized attention entropy. Low-entropy heads release budget and high-entropy heads get more, and the budget is then handed to an eviction or merging operator such as SnapKV or CaM.
- Results On RULER at 128K with Llama-3.1-8B-Instruct, Entro-SnapKV scored 74.00 against 72.68 for SnapKV and 75.45 for Full Cache, keeping 98.1% of Full Cache performance.
Why a uniform KV budget falls short
Long-context inference keeps a KV cache whose size grows linearly with the context, and compression methods shrink it through eviction, merging or quantization. Most of these methods give every layer and head the same share of the budget, which assumes that all components need the same amount of cache. The authors argue that this ignores the structural differences between heads and the varying difficulty of each input.
The authors measure how much attention mass the Top-K positions keep, which they call Attention Recall, across budgets. For needle-in-a-haystack retrieval, most sampled layer-head pairs saturate at very small budgets. For Common Words Extraction, recall saturates later, at higher budgets, and different pairs grow at different rates. A uniform split therefore spends cache on components that saturate early and starves those that keep gaining.
Dynamic allocation methods such as PyramidKV, AdaKV and CAKE already exist. The authors say these rely on handcrafted rules, auxiliary branches or task-specific signals. What they want is one signal that stays stable across tasks, can be compared across components and can be computed online.
Attention entropy as the proxy signal
Attention Recall is only known after compression, so it cannot set the budget in advance. The authors therefore look for a signal computed before compression that predicts how sensitive each head is.
Shannon entropy of a head's attention distribution is low when attention is concentrated and high when it is diffuse. A peaky distribution loses little when only Top-K positions are kept, while a flat one discards a large tail. The raw entropy grows with sequence length, so the paper divides it by log n, which keeps the value in [0,1].
The authors check the signal against Taylor importance, a head score built from the gradient of the task loss with respect to the head output. Their Figure 2(c) shows a positive correlation between normalized attention entropy and this importance, which they take to mean high-entropy heads carry more critical dependencies.
The method rests on a diminishing returns assumption: giving a head more budget does not raise its loss, and each extra unit helps less.
How the budget rule runs at inference
EntroKV reads the attention weights that the backend has already computed inside its observation window, so it adds no extra matrix multiplication. The method is training-free, and the only quantity estimated beforehand is the global baseline. The authors use a window of at least 16 queries, w≥16, to estimate sensitivity reliably.
The global baseline is the average normalized entropy over a calibration set, taken across all layers and heads.
Each layer-head pair receives a budget equal to β times a mix of the global baseline and its own normalized entropy. The mixing weight α sets the balance, moving the rule from the static baseline at α=0 toward pure instance entropy at α=1. Heads with entropy above the baseline get extra budget, and low-entropy heads release budget for others.
For eviction operators such as SnapKV, each head's budget becomes a count of Top-K positions, and the operator keeps its own observation window and pooling. For merging operators such as CaM and D2O, the budget is read as a target retention ratio, so high-entropy heads merge less and low-entropy heads merge more.
Accuracy on long-context benchmarks
Table 1 compares fixed and entropy-guided versions of SnapKV, CaM and D2O on LongBench, RULER-4K and RULER-16K across three models. Each comparison uses a retention ratio of at most 0.3, and the reported values are means with standard deviations.
On LongBench with Llama-3.1-8B-Instruct, Entro-SnapKV scored 48.15±0.15, compared to 47.01±0.18 for SnapKV.
The widest gap in the table is for CaM on Llama-3.1-8B-Instruct at RULER-16K. There Entro-CAM scored 91.57±0.11, compared to 67.18±0.15 for CaM.
The authors report that the gains are larger for merging operators than for eviction, and that they hold at 4K and 16K and on Qwen3-8B.
Within the SnapKV comparison on Llama-3.1-8B-Instruct, Entro-SnapKV scored 89.33±0.27 on RULER-4K, compared to 88.02±0.13 for CAKE. The authors say PyramidKV and AdaKV add only small gains over static SnapKV, and that LAVA and Task-KV underperform on RULER-16K.
Short prompts with in-context demonstrations
The authors test MATH-500 and SQuAD with 0 to 5 in-context demonstrations, on Llama and Qwen backbones and with SnapKV, CaM and D2O. In those settings the entropy-guided variant improves the matching fixed-budget baseline at the same compression ratio.
Full Cache accuracy on MATH does not rise with more demonstrations, and in several subplots it falls. The authors read this as sensitivity to redundant or distracting prompt content.
Entropy-guided allocation stays steadier across shot counts and can exceed Full Cache under larger few-shot settings. The authors attribute this to selective retention possibly suppressing noisy attention patterns.
Memory, latency and overhead
The authors measure peak memory, prefill latency, decode latency and batch decode latency on NVIDIA A800 (80GB) GPUs.
Full Cache memory grows linearly and runs into out-of-memory errors at long contexts, while EntroKV keeps a lower, bounded footprint. Prefill and decode latency follow SnapKV closely, which the authors take as evidence of negligible added computation.
With 2K context per batch, Full Cache runs out of memory at batch size 64, while EntroKV decodes up to batch size 128 with stable latency.
The authors put the added cost of the windowed computation at O(L·H·m) per window of size m, which they describe as negligible next to attention.
Scaling to 128K tokens
On RULER with Llama-3.1-8B-Instruct, every method degrades as context grows from 4K to 128K. At 128K, Entro-SnapKV scored 74.00, compared to 75.45 for Full Cache, which the authors put at 98.1% of Full Cache performance. SnapKV scored 72.68 at 128K, which is 96.3% of Full Cache.
The authors say the allocation needs no recalibration as inputs get longer, but this check covers one model and one benchmark.
Sensitivity to α and β
The authors vary α from 0 to 1 for Llama-3.1-8B-Instruct and Qwen2.5-7B-Instruct. Accuracy rises from α=0, peaks near α=0.5, and falls as α approaches 1. At α=0 the rule ignores input-specific entropy, and at α=1 it depends on noisy per-pattern estimates. Both models peak at similar α values, which the authors take as evidence that the setting transfers across architectures.
Accuracy rises with the total ratio β over the reported range of 0.1 to 0.5. At a budget ratio of 0.2, Llama-3.1-8B-Instruct reaches about 98% of Full Cache accuracy, and at 0.3 it nearly matches the uncompressed baseline. At ratios of 0.4 to 0.5, Llama exceeds Full Cache, while Qwen2.5-7B-Instruct converges toward Full Cache as the budget grows.
Oracle bound and the allocation pattern
The oracle selects the top B entries across all layers and heads using global importance scores known only in hindsight. The authors call it a diagnostic upper reference that is not an achievable online method. The authors report that EntroKV improves substantially over uniform allocation and closely approaches this bound across budgets.
At similar attention recall, a 10% budget gives lower downstream loss than a 50% budget, which the authors read as redundant mass in looser allocations.
Figure 6 shows the allocation varies by layer-head pair, by layer and by task. The layer-averaged budget follows a non-monotonic pattern, which the authors say departs from fixed depth heuristics. Retrieval-intensive tasks receive higher average budgets than tasks with more input redundancy.
The authors explain the Full Cache crossover as implicit denoising, where minimal budgets for low-entropy heads keep noisy attention patterns out of the output. They support this with the recall-versus-loss result rather than a direct test of denoising.
Limitations
The oracle uses hindsight, so it serves as a reference and not as a method that can be run online. The global baseline is computed once on a small calibration workload, and the authors say recomputing it may help when the domain shifts, especially at large α.
The abstract ties about 98% of full-cache performance to a 30% budget ratio, while the ablation text ties about 98% to a 0.2 ratio for Llama-3.1-8B-Instruct. The paper does not reconcile these two statements.
The normalizer appears as log n in the normalized entropy formula and as log m in Algorithm 1, and the text does not say how they relate when the window is shorter than the sequence. The appendix that covers window-length ablations is referenced but is not part of this excerpt.
The main accuracy tables cover three models and five benchmark settings, with means over five runs. The Full Cache reference on MATH itself moves non-monotonically with the number of shots, so short-context gains must be read setting by setting.
Paper info
- Authors
- Wenhao Gao, Haoran Cao, Yueyan Li, Yonggao Xiao, Caixia Yuan, Xiaojie Wang
- Venue
- International Conference on Machine Learning · Published
- First published
- 2026-9-29
- Added
- 2026-11-26
- Original paper terms
- Check in the original ↗
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Wenhao Gao, Haoran Cao, Yueyan Li, Yonggao Xiao, Caixia Yuan, Xiaojie Wang (2026). EntroKV: Entropy-Guided Dynamic Budget Allocation for KV-Cache Compression. International Conference on Machine Learning. https://proceedings.mlr.press/v306/gao26a.html
BibTeX
@article{gao2026entrokv,
title = {{EntroKV: Entropy-Guided Dynamic Budget Allocation for KV-Cache Compression}},
author = {Wenhao Gao and Haoran Cao and Yueyan Li and Yonggao Xiao and Caixia Yuan and Xiaojie Wang},
year = {2026},
journal = {International Conference on Machine Learning},
url = {https://proceedings.mlr.press/v306/gao26a.html}
}