arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.16986cs.CLcs.AIcs.LG
收藏

Crystal-KV: 通过答案优先原则高效管理链式推理LLM的KV缓存

Crystal-KV: Efficient KV Cache Management for Chain-of-Thought LLMs via Answer-First Principle

School of Computer Science and Technology, University of Science and Technology of China(计算机科学与技术学院,中国科学技术大学);University of Science and Technology of China(中国科学技术大学);Institute of Artificial Intelligence, Hefei Comprehensive National Science Center(人工智能研究所,合肥综合性国家科学中心);Suzhou Institute for Advanced Research, University of Science and Technology of China(苏州先进研究院,中国科学技术大学)

Zihan Wang, Cheng Tang, Lei Gong, Cheng Li, Chao Wang, teng wang, Wenqi Lou, Xuehai Zhou

AI总结:

Crystal-KV通过答案优先原则高效管理链式推理LLM的KV缓存,提升缓存压缩和推理效率。

摘要:

在大型语言模型(LLM)中,链式推理(CoT)显著提高了复杂任务的准确性,但因存储在键值(KV)缓存中的长思考阶段序列而带来了过大的内存开销。与传统生成任务中所有标记都同等重要不同,CoT强调最终答案,使得传统KV压缩策略无效。本文提出Crystal-KV,一种专为CoT推理设计的高效KV缓存管理框架。我们的关键见解是答案优先原则。通过将答案偏好映射到思考阶段的注意力图,我们区分了主要维护推理流程但可能偶尔引入误导上下文的SlipKV,以及真正有助于最终答案正确性的CrystalKV。接下来,我们提出了一种基于注意力的最少最近频繁使用算法。它精确地识别SlipKV条目何时失效,并将其驱逐,保留CrystalKV而不影响推理流程。最后,我们引入了一种自适应的缓存预算分配算法。基于CrystalKV的动态比例,它估计每层/头的重要性,并在推理过程中调整KV缓存预算,放大关键组件以提高预算利用率。结果表明,Crystal-KV实现了最先进的KV缓存压缩,显著提高了吞吐量,并实现了更快的响应时间,同时在CoT推理中保持或甚至提高了答案准确性。

英文摘要:

Chain-of-Thought (CoT) reasoning in large language models (LLMs) significantly improves accuracy on complex tasks, yet incurs excessive memory overhead due to the long think-stage sequences stored in the Key-Value (KV) cache. Unlike traditional generation tasks where all tokens are uniformly important, CoT emphasizes the final answer, rendering conventional KV compression strategies ineffective. In this paper, we present Crystal-KV, an efficient KV cache management framework tailored for CoT reasoning. Our key insight is the answer-first principle. By mapping answer preferences into think-stage attention map, we distinguish between SlipKV, which mainly maintains the reasoning flow but may occasionally introduce misleading context, and CrystalKV, which truly contributes to the correctness of the final answer. Next, we propose an attention-based Least Recently Frequently Used algorithm. It precisely identifies when a SlipKV entry's utility expires and evicts it, retaining CrystalKV without disrupting reasoning flow. Finally, we introduce an adaptive cache budget allocation algorithm. Based on the dynamic proportion of CrystalKV, it estimates the importance of each layer/head and adjusts the KV cache budget during inference, amplifying critical components to improve budget utilization. Results show that Crystal-KV achieves state-of-the-art KV cache compression, significantly improves throughput, and enables faster response time, while maintaining, or even improving, answer accuracy for CoT reasoning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑