Seedlabs
Source research

KV-Compress: Paged KV-Cache Compression with Variable Compression Rates per Attention Head

Isaac Rehg · 2024 · 20 citationsRead the paper

Context lengths of Large Language Models (LLMs) have exploded in recent years, with 128k-token context becoming a standard and million-token context becoming a reality. Efficiently supporting long-context inference remains challenging as the memory that must be allocated in key-value (KV) cache for a generation scales with its context length, limiting the number of long-context requests that can be served concurrently under a given memory budget. KV cache compression can mitigate this issue by removing under-utilized KVs from each attention head's cache and reducing its memory footprint. Higher theoretical compression rates can be achieved when the number of removed KVs varies across attention heads, but application of such a strategy within existing inference frameworks adds fragmentation and cannot realize the theoretical compression rates in physical memory. We introduce KV-Compress, a novel compression method that evicts contiguous KV blocks within a PagedAttention framework, reducing the memory footprint of the KV cache proportionally to this theoretical compression rate. Our method achieves state-of-the-art performance on LongBench for both Mistral-7B-Instruct-v0.2 and Llama-3.1-8B-Instruct while lowering the total number of compressed KVs by 4x compared with prior methods. Evaluations on Llama-3.1-8B-Instruct and Llama-3.1-70B-Instruct-FP8 achieve compression rates up to 8x with negligible impact on performance, and up to 64x while retaining over 90% of full-cache performance for all but three of the suite's subsets. We benchmark an integration of our method with vLLM that increases total throughput by up to 5.18x by enabling larger decoding batches.

What the full text shows

Working prototype
  • Increased total inference throughput via vLLM integration by enabling larger decoding batches. — up to 5.18x (Llama-3.1-8B on a single L4 GPU, context length Lc = 6000, compression rate 64)
  • Compression of non-repeated KV cache in GQA models reduces the number of compressed KVs compared to prior methods. — 4x lower (Mistral and Llama-3.1 benchmarks)
  • High compression rates achieved with negligible impact on performance. — up to 8x (Llama-3.1-8B-Instruct and Llama-3.1-70B-Instruct-FP8)
  • Extreme compression rates while retaining most of full-cache performance. — up to 64x (retaining >90% performance for most subsets) (Llama-3.1-8B-Instruct and Llama-3.1-70B-Instruct-FP8)
  • State-of-the-art performance on LongBench suite. — Not specified (Mistral-7B-Instruct-v0.2 and Llama-3.1-8B-Instruct)
Setup
Evaluated on Mistral-7B-Instruct-v0.2, Llama-3.1-8B-Instruct, and Llama-3.1-70B-Instruct-FP8 using the LongBench test suite on L4 and H100 GPUs.
How
The authors modified Ada-SnapKV to implement query-group compression and adapted PagedAttention to support variable-head-rate eviction by paging cache on a per-head, per-layer basis. They integrated this into vLLM, moving block management to the GPU to handle the increased number of blocks in parallel.
Limitations
Metric collection for KVC-full on H100 requires limiting GPU memory utilization to 0.6 · Llama-3.1-70B experiments were limited to a single run due to compute constraints

Summarized by Gemma 4 from the open-access full text · 8 Nov 2026. Read it