NTH

Error Certificates for KV-Cache Eviction via Randomized Design

AuthorsPeng Xie

July 26, 2026 2 min read
Watch on YouTube
The one-line take

Randomly sampling what an AI forgets lets its serving system tell whether a bad answer came from cache compression or from the model itself.

Key results

96.9%
12.5% certificate coverage

Coverage of realized attention-output error in Qwen2.5-1.5B offline replay at the 12.5% eviction budget.

0.943
Attention-error correlation

Spearman correlation between the certificate and true attention-output error at the 12.5% budget.

0.836
Synthetic task AUC

Mean certificate–failure AUC across 16 of 16 model–task cells using four models and four RULER-style tasks.

0.555
LongBench failure-prediction AUC

Pooled certificate AUC for predicting its own task failures at 6k-token contexts.

0.749
6k attribution AUC

AUC for distinguishing eviction-induced failures from inherent failures among LongBench failures.

What the paper found

Peng Xie of the Technical University of Munich argues that deterministic KV-cache eviction, including top-k strategies such as H2O and SnapKV, cannot reliably estimate the attention error caused by deleting tokens: unseen evicted values can change arbitrarily while every retained statistic remains identical. The proposed remedy is certainty-plus-Poisson tail sampling with known inclusion probabilities, a Hájek correction implemented as the logit offset log(1/πi), and a retained-set Sen–Yates–Grundy variance estimator converted into an empirical-Bernstein error certificate; it requires no training or new matrices and supports an e-process extension for trajectory-wide monitoring. In offline replays of Qwen2.5-1.5B, certificate coverage reached 96.9% at the 12.5% budget, while certificate-to-attention-error Spearman correlation reached 0.943. Across four models—Qwen2.5-1.5B and 7B, Llama-3.1-8B, and Mistral-7B-v0.3—on four RULER-style tasks, certificate–failure AUC was positive in 16 of 16 cells, with mean 0.836. The real-world LongBench study is more restrained: failure prediction AUC was only 0.555 at 6k contexts and 0.572 at 16k, losing to mean output log-probability. The certificate’s practical advantage is attribution rather than prediction: among failures, it separated cache-induced from inherent errors with AUC 0.749 at 6k and 0.727 at 16k, outperforming confidence signals and improving recomputation scheduling. Randomization therefore makes compression damage identifiable, but it does not reveal whether the model will fail overall.

Original abstract

Deterministic KV-cache eviction keeps the top-$k$ tokens under an importance score and deletes the rest. We prove that this design cannot know what it destroyed: evicted values can be altered so that everything the serving system retains is unchanged while the true attention-output error grows arbitrarily, so no serving-time estimator of that error is consistent. Randomized eviction restores identifiability. With a Poisson-sampled tail at known inclusion probabilities, one logit offset performs the Hájek correction inside the softmax, and a survey-sampling variance estimator over the retained set becomes a per-step error certificate with 0.97 empirical coverage at no accuracy cost. On real workloads we pre-registered seven claims and lost three: question-aware eviction at 25--50\% budgets is nearly free; output log-probability predicts failure better than the certificate; certificate-gated budget escalation adds nothing. What survives is attribution: the certificate separates cache-induced from inherent failures (AUC 0.73--0.75, against 0.47--0.54 for output confidence) and schedules recomputation better than random or confidence gating. Randomization buys attribution, not prediction.

Read the original paper

More in Efficient AI

Browse all 55 papers →
01Efficiency

Decoding Looped Transformers Better for (Almost) Free

Weihao Liu, Huangjie Zheng, Tianrong Chen, Rohit Dilip, Richard He Bai, Yizhu Jiao, Yuyang Wang, Ruixiang Zhang

LoopCD turns the partially computed states of looped Transformers into free guidance, improving accuracy while often cutting inference compute nearly in half.

Read analysis
02Efficiency

Scaling Laws for Looped Mixture of Experts

Yanbei Chen, Anirudh Goyal, Raghuraman Krishnamoorthi

This work develops scaling laws that explain how looping and sparse experts can be combined to build more capable models with less training and inference compute.

Read analysis