Fast KVzip: Efficient and Accurate LLM Inference with Gated KV Eviction
Jang-Hyun Kim, Dongyoon Han, Sangdoo Yun
TL;DR
Fast KVzip tackles the growing memory bottleneck of KV caches in long-context LLM inference by introducing a gating-based eviction mechanism. It leverages a lightweight, low-rank sink-attention gate that predicts KV importance from input hidden states, with gate training performed offline using reconstruction-derived targets while keeping the LLM frozen. The approach achieves near-lossless performance at substantial KV budget reductions (30-40%) across diverse models and tasks, and reduces prefill latency and peak memory relative to prior methods like KVzip. Its results demonstrate broad applicability to retrieval, code understanding, and reasoning tasks, and its design remains compatible with quantization and sliding-window attention, enabling practical deployment. Overall, Fast KVzip provides a general, task-agnostic, and hardware-friendly solution for efficient LLM inference in long-context scenarios.
Abstract
Efficient key-value (KV) cache management is crucial for the practical deployment of large language models (LLMs), yet existing compression techniques often incur a trade-off between performance degradation and computational overhead. We propose a novel gating-based KV cache eviction method for frozen-weight LLMs that achieves high compression ratios with negligible computational cost. Our approach introduces lightweight sink-attention gating modules to identify and retain critical KV pairs, and integrates seamlessly into both the prefill and decoding stages. The proposed gate training algorithm relies on forward passes of an LLM, avoiding expensive backpropagation, while achieving strong task generalization through a task-agnostic reconstruction objective. Extensive experiments across the Qwen2.5-1M, Qwen3, and Gemma3 families show that our method maintains near-lossless performance while evicting up to 70% of the KV cache. The results are consistent across a wide range of tasks, including long-context understanding, code comprehension, and mathematical reasoning, demonstrating the generality of our approach.
