[Paper Review] Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs
FastGen introduces adaptive KV cache compression for LLMs by leveraging lightweight attention profiling to dynamically apply tailored compression policies—such as evicting long-range contexts, retaining only special tokens, or discarding low-frequency tokens—resulting in up to 36% memory reduction with negligible generation quality loss, all without fine-tuning or retraining.
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.
Motivation & Objective
- To reduce the memory footprint of KV cache in autoregressive LLM inference without requiring model fine-tuning or retraining.
- To identify and exploit structural patterns in attention modules that allow for targeted, context-aware KV cache compression.
- To develop a plug-and-play method that adapts compression strategies per attention head based on its functional role.
- To achieve significant memory savings while preserving generation quality through intelligent, structure-aware pruning.
- To enable efficient on-device deployment of large language models by minimizing GPU memory pressure.
Proposed method
- The method employs a lightweight attention profiling step to analyze attention maps and classify each head into one of five structural categories.
- Based on the profiling, FastGen applies one of five compression policies: local-context eviction, special-token retention, frequency-based pruning, column-wise sparsity, or standard caching.
- The system constructs an adaptive KV cache by selecting only relevant tokens per head, guided by a policy set that includes frequency, special tokens, punctuation, and local attention patterns.
- The profiling overhead is minimal—only 0.78% of KV cache memory—making it feasible for real-time inference.
- The approach uses a greedy policy ordering strategy to sequentially apply compression policies, prioritizing high-impact ones like special tokens and frequent tokens first.
- The method is fully compatible with existing LLM inference pipelines and requires no model retraining or architectural changes.

Experimental results
Research questions
- RQ1Can attention modules in LLMs be classified into distinct structural patterns that inform efficient, targeted KV cache compression?
- RQ2How can KV cache be adaptively compressed per attention head without degrading generation quality?
- RQ3What is the optimal order and combination of compression policies to maximize memory savings while preserving model performance?
- RQ4Can a plug-and-play, non-fine-tuned method achieve substantial memory reduction in KV cache with negligible quality loss?
- RQ5How sensitive is the compression performance to hyperparameter choices such as frequency and local attention thresholds?
Key findings
- FastGen achieves up to 36.04% reduction in KV cache memory usage on Llama 1-65B while maintaining a win rate of 49.75% on AlpacaEval, nearly matching the full cache baseline.
- The removal of the special-token policy (${\bm{C}}_{\text{special}}$) causes the largest drop in performance—2.11% win rate decrease—highlighting its critical role.
- The frequency-based policy (${\bm{C}}_{\text{frequent}}$) contributes most to compression, reducing cache by 36.04% when combined with other policies.
- The order of policy application significantly affects performance: the default greedy order (special → punct → frequent → local) achieves the highest win rate and compression ratio.
- The method is robust to hyperparameter changes, maintaining over 45% win rate across all tested configurations, with compression ratios varying significantly based on settings.
- The profiling overhead is negligible—only 0.78% of the full KV cache size—making it practical for real-time deployment.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.