Abstract
As the context length of current large language models (LLMs) rapidly increases, the memory demand for the Key-Value (KV) cache is becoming a bottleneck for LLM deployment and batch processing. Traditional KV cache compression methods typically involve permanently evicting or irreversibly merging "less important" tokens with low attention scores. This approach results in the unrecoverable loss of token information, which we call Contextual Amnesia, significantly degrading the model's information retrieval capability. To address this issue, we propose KVReviver, a reversible KV cache compression method based on the sketch algorithm. This method allows reconstructing compressed tokens from an additional data structure, thus enabling full-scale computation within limited memory. Experiments showed that in 2k-length contexts, it requires only 10% of KV Cache budget while maintaining identical end-to-end inference accuracy. For 32k-length contexts, it achieves equivalent or comparable accuracy ~2% accuracy loss) using merely 25% of KV Cache budget.
Abstract (translated)
随着当前大型语言模型(LLMs)的上下文长度迅速增加,键值(KV)缓存的内存需求成为了LLM部署和批量处理的一个瓶颈。传统的KV缓存压缩方法通常涉及永久性地移除或不可逆地合并具有低注意力分数的“不那么重要”的标记,这种方法会导致无法恢复的令牌信息丢失,我们称之为上下文失忆症,从而显著降低了模型的信息检索能力。 为了应对这一问题,我们提出了一种基于sketch算法的可逆KV缓存压缩方法——KVReviver。该方法允许从附加的数据结构中重构压缩后的标记,因此在有限内存内实现了全规模计算。实验表明,在2k长度的上下文中,它只需要10%的KV缓存预算就能保持相同的端到端推理准确度;而在32k长度的上下文中,使用仅25%的KV缓存预算即可达到相同或可比的准确性(约2%的损失)。
URL
https://arxiv.org/abs/2512.17917