Compactor: Calibrated Query-Agnostic KV Cache Compression with Approximate Leverage Scores

Vivek Chari, Benjamin Van Durme
7/10/2025
21 citations
cs.CLcs.AI

No official code found. Best implementation: vnchari/compactor-vllm (3 stars, Python, last commit 2025-12-03).

Abstract

Modern Large Language Models (LLMs) are increasingly trained to support very large context windows. We present Compactor, a training-free, query-agnostic KV compression strategy that uses approximate leverage scores to determine token importance.

Show full abstract

We show that Compactor can achieve the same performance as competing methods while retaining 20% fewer tokens in both synthetic and real-world context tasks, while being more task-robust. We further introduce a procedure for context-calibrated compression: inferring the maximum compression a given context supports before significant performance loss. Using context-calibrated compression, we show that Compactor achieves full KV performance on Longbench while reducing the KV memory burden by 68%, on average. To demonstrate the efficacy and generalizability of our approach, we apply Compactor to 27 synthetic and real-world tasks from RULER and Longbench, with models from both the Qwen 2.5 and Llama 3.1 families. Finally, we release compactor-vllm, an inference engine and suite of optimized Triton kernels designed to efficiently support the sparse, non-contiguous memory access patterns inherent to compressed KV caches. This work demonstrates that Compactor offers a practical, high-performance solution for alleviating the memory bottleneck in modern LLM deployment.

View on arXivView PDF

Code Implementations(1)

(nearly) Zero-overhead KV-cache compression in a minimal vLLM-style engine. Official repo of https://arxiv.org/abs/2507.08143

31PythonNov 19, 202512 months ago

Similar Papers

Cite this paper

@article{chari2025compactor,
  title  = {Compactor: Calibrated Query-Agnostic KV Cache Compression with Approximate Leverage Scores},
  author = {Vivek Chari and Benjamin Van Durme},
  year   = {2025},
  eprint = {2507.08143},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.08143v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.08143.svg)](https://codeofpaper.com/paper/2507.08143)

Discussion