Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs

Suyu Ge, Yunan Zhang, Liyuan Liu, Minjia Zhang, Jiawei Han +1 more
2/12/2026

No official code found. Best implementation: machilusZ/FastGen (44 stars, MIT, last commit 2024-08-14).

Abstract

In this study, we introduce adaptive KV cache compression, a plug-and-play method that reduces the memory footprint of generative inference for Large Language Models (LLMs). Different from the conventional KV cache that retains key and value vectors for all context tokens, we conduct targeted profiling to discern the intrinsic structure of attention modules. Based on the recognized structure, we then construct the KV cache in an adaptive manner: evicting long-range contexts on attention heads emphasizing local contexts, discarding non-special tokens on attention heads centered on special tokens, and only employing the standard KV cache for attention heads that broadly attend to all tokens. Moreover, with the lightweight attention profiling used to guide the construction of the adaptive KV cache, FastGen can be deployed without resource-intensive fine-tuning or re-training. In our experiments across various asks, FastGen demonstrates substantial reduction on GPU memory consumption with negligible generation quality loss. We will release our code and the compatible CUDA kernel for reproducibility.

View on arXivView PDF

Code Implementations(1)

machilusZ/FastGenCommunity69%
MIT

This repo contains the source code for: Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs

441Mar 16, 20242 years agoMIT

Similar Papers

Cite this paper

@article{ge2026model,
  title  = {Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs},
  author = {Suyu Ge and Yunan Zhang and Liyuan Liu and Minjia Zhang and Jiawei Han and Jianfeng Gao},
  year   = {2026},
  eprint = {2310.01801},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2310.01801},
  journal = {ICLR 2023 2023}
}

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

Discussion