ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference

Xiang Liu, Zhen-Heng Tang, Pei-Jie Dong, Ze-Yu Li, Yue Liu +3 more
2/1/2025
91 citations

Official code: NVIDIA/kvpress (1,268 stars, Python, Apache-2.0, PyTorch, last commit 2026-04-23).

Abstract

Large Language Models (LLMs) require significant GPU memory when processing long texts, with the key value (KV) cache consuming up to 70\% of total memory during inference. Although existing compression methods reduce memory by evaluating the importance of individual tokens, they overlook critical semantic relationships between tokens, resulting in fragmented context and degraded performance.

Show full abstract

We introduce ChunkKV, which fundamentally reimagines KV cache compression by treating semantic chunks - rather than isolated tokens - as basic compression units. This approach preserves complete linguistic structures and contextual integrity, ensuring that essential meaning is retained even under aggressive compression. Our innovation includes a novel layer-wise index reuse technique that exploits the higher cross-layer similarity of preserved indices in ChunkKV, reducing computational overhead and improving throughput by 26.5\%. Comprehensive evaluations on challenging benchmarks: LongBench, Needle-In-A-HayStack, GSM8K, and JailbreakV demonstrate that ChunkKV outperforms state-of-the-art methods by up to 8.7\% in precision while maintaining the same compression ratio. These results confirm that semantic-aware compression significantly enhances both efficiency and performance for long-context LLM inference, providing a simple yet effective solution to the memory bottleneck problem. The code is available at \href{https://github.com/NVIDIA/kvpress}{link}.

View on arXivView PDF

Code Implementations(1)

NVIDIA/kvpressOfficial100%
PyTorchApache-2.0

LLM KV cache compression made easy

1,268205Python, ShellNov 6, 20247 months agoApache-2.0
inferencekv-cachekv-cache-compressionlarge-language-modelsllm+4 more

Similar Papers

Cite this paper

@article{liu2025chunkkv,
  title  = {ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference},
  author = {Xiang Liu and Zhen-Heng Tang and Pei-Jie Dong and Ze-Yu Li and Yue Liu and Bo Li and Xu-Ming Hu and Xiao-Wen Chu},
  year   = {2025},
  eprint = {2502.00299},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2502.00299},
  url    = {https://doi.org/10.48550/arXiv.2502.00299},
  journal = {Neural Information Processing Systems}
}

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/2502.00299.svg)](https://codeofpaper.com/paper/2502.00299)

Discussion