arXiv · 2610.25933
The KV-Surgeon: Compensation-Aware Offline KV-Cache Compaction
Abstract
Offline compaction of the key--value cache (KV-cache) reduces the cost of repeatedly querying a fixed context by constructing a smaller cache once and reusing it subsequently. The central challenge of compaction is deciding which cache entries to delete and which to retain. Existing methods score each candidate for deletion on its own, with the rest of the cache being held fixed. However, softmax renormalization of the attention operation couples these decisions in a nonlinear manner: removing one entry changes the attention weights of every remaining one. In this work, we introduce KV-Surgeon, which uses calibration data to take interactions into account in a tractable way. We derive a quadratic surrogate that admits closed-form expressions for jointly making the optimal greedy removal decision as well as compensation within the remaining entries. On QuALITY, LongHealth, and Long Code Arena, and at every evaluated compaction ratio, KV-Surgeon substantially advances the cost--accuracy Pareto frontier of dense and mixture-of-experts models from 4B to 30B parameters. At $50\times$ compaction, KV-Surgeon improves question-answering accuracy by up to four points over attention matching (Zweiger et al., 2026), the state of the art, at comparable cost. Lastly, we introduce an even faster variant, which also exceeds the state of the art while requiring only two fifths of its cost.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Moritz Wagner, Christophe Roux, Max Zimmer, Sebastian Pokutta. 2026-10-19. The KV-Surgeon: Compensation-Aware Offline KV-Cache Compaction. https://arxiv.org/abs/2610.25933
Cite the original work for its findings. Save a collection to share your selection of sources.