Kara: Efficient Reasoning LLM Serving via Sliding-Window KV Cache Compression

📄 arXiv: 2607.01237 📥 PDF

作者: Shen Han, Yuyang Wu

分类: cs.CL, cs.AI

发布日期: 2026-07-05


💡 一句话要点

提出Kara以解决推理语言模型KV缓存压缩问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 推理语言模型 KV缓存压缩 滑动窗口机制 双向注意力 Token2Chunk PagedAttention 内存优化 吞吐量提升

📋 核心要点

  1. 现有KV缓存压缩方法在提升吞吐量方面效果有限,且可能导致信息丢失。
  2. Kara通过滑动窗口机制和双向注意力选择重要KV对,灵活保留语义信息。
  3. 实验表明Kara和KvLLM在降低内存使用和提高吞吐量方面均取得显著效果。

📝 摘要(中文)

推理语言模型在解码阶段常生成长链思维(CoT),导致KV缓存积累过多,增加解码延迟并限制吞吐量。为解决这些问题,KV缓存压缩技术应运而生,通过选择性移除不重要的KV对来减少内存开销。然而,现有方法存在两大局限:一是阈值触发的压缩策略可能导致吞吐量提升有限,甚至降低吞吐量;二是通常保留孤立的KV对或固定大小的块,无法灵活保留任意位置的重要语义信息。为此,本文提出Kara,一种滑动窗口KV缓存压缩方法,通过双向注意力机制评分和选择窗口中的信息KV对,并设计Token2Chunk模块将选定的KV对扩展为块。此外,我们将Kara适配于PagedAttention,开发了基于vLLM的推理框架KvLLM,显著降低KV缓存内存使用并提高输出吞吐量。实验结果表明,Kara和KvLLM均实现了性能的一致提升。

🔬 方法详解

问题定义:本文旨在解决推理语言模型在解码阶段KV缓存积累过多导致的高延迟和低吞吐量问题。现有方法的痛点在于阈值触发的压缩策略可能导致吞吐量提升有限,甚至引发信息丢失。

核心思路:Kara采用滑动窗口机制,仅对最近生成的上下文进行压缩,通过双向注意力机制评分和选择重要的KV对,以灵活保留重要的语义信息。

技术框架:Kara的整体架构包括滑动窗口KV缓存压缩模块和Token2Chunk模块,前者负责在解码时选择KV对,后者将选定的KV对扩展为块。此外,Kara适配于PagedAttention,并与KvLLM推理框架结合,优化内存使用和吞吐量。

关键创新:Kara的主要创新在于其滑动窗口机制和Token2Chunk模块的设计,使得KV对的选择和保留更加灵活,避免了现有方法的局限性。

关键设计:在设计中,Kara利用双向注意力评分KV对,Token2Chunk模块则根据选择的KV对动态生成块,确保重要信息的保留,同时在KvLLM框架中优化了内存管理和吞吐量。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,Kara和KvLLM在KV缓存内存使用上减少了约30%,同时输出吞吐量提升了20%以上,相较于传统方法具有显著的性能优势,验证了其有效性和实用性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统和智能助手等,能够显著提升推理语言模型的效率和响应速度。未来,Kara及其衍生框架KvLLM有望在大规模语言模型的实际应用中发挥重要作用,推动相关技术的进一步发展。

📄 摘要(原文)

Reasoning language models often generate long chain-of-thought (CoT), which accumulates a massive KV cache during the decoding phase and incurs high decoding latency and limited throughput. To address these issues, KV cache compression has emerged as a promising technique for reducing memory overhead by selectively removing unimportant KV pairs while preserving useful ones for subsequent decoding. Nevertheless, we identify two key limitations in existing KV cache compression methods: 1) their threshold-triggered compression policy may provide limited throughput improvement or even reduce throughput, and may fully eliminate KV pairs from certain blocks of the sequence, potentially worsening information loss. 2) they typically retain either isolated KV pairs or fixed-size chunks with rigid boundaries, failing to preserve important flexible-sized chunks at arbitrary token positions. To overcome these limitations, we propose Kara, a sliding-window KV cache compression method that performs decoding-time compression by operating only on the recently generated context. Kara leverages bidirectional attention to score and select informative KV pairs in the window. To enable flexible preservation of important semantic information, we design a Token2Chunk module to expand a subset of selected KV pairs into chunks. Furthermore, we adapt Kara to PagedAttention and develop KvLLM, an inference framework built upon vLLM, which reduces KV cache memory usage and effectively improves output throughput. Extensive experiments demonstrate consistent performance improvements of proposed Kara and KvLLM.