arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.10539cs.LGcs.AI
收藏

IceCache: 用于长序列LLM的内存高效KV缓存管理

IceCache: Memory-efficient KV-cache Management for Long-Sequence LLMs

Simon Fraser University(西蒙菲莎大学);Harvard University(哈佛大学)

Yuzhen Mao, Qitong Wang, Martin Ester, Ke Li

AI总结:

本文提出IceCache,通过语义令牌聚类与PagedAttention结合,提升长序列LLM的内存效率与性能,实验表明其在256个令牌预算下保持99%的准确性,且在延迟和精度上优于其他方法。

摘要:

Key-Value (KV) cache在大型语言模型(LLMs)推理中起关键作用,通过存储中间注意力状态并避免自回归生成中的冗余计算。然而,其内存占用与序列长度线性增长,常导致资源受限硬件的严重内存瓶颈。先前工作探索了将KV缓存卸载到CPU并仅在GPU上保留部分缓存,但这些方法通常依赖不精确的令牌选择,在长生成任务如链式推理中性能下降。本文提出了一种新的KV缓存管理策略IceCache,整合语义令牌聚类与PagedAttention。通过将语义相关的令牌组织成由分层动态更新数据结构管理的连续内存区域,该方法实现了更高效的令牌选择和在CPU-GPU传输中的内存带宽利用。在LongBench上的实验结果表明,使用256个令牌预算时,IceCache保持了完整KV缓存模型99%的准确性。此外,与其它卸载方法相比,IceCache在使用仅25%的KV缓存令牌预算的情况下,实现了竞争甚至更优的延迟和精度,展示了其在长序列场景中的有效性。代码可在项目网站https://yuzhenmao.github.io/IceCache/上获得。

英文摘要:

Key-Value (KV) cache plays a crucial role in accelerating inference in large language models (LLMs) by storing intermediate attention states and avoiding redundant computation during autoregressive generation. However, its memory footprint scales linearly with sequence length, often leading to severe memory bottlenecks on resource-constrained hardware. Prior work has explored offloading KV cache to the CPU while retaining only a subset on the GPU, but these approaches often rely on imprecise token selection and suffer performance degradation in long-generation tasks such as chain-of-thought reasoning. In this paper, we propose a novel KV cache management strategy, IceCache, which integrates semantic token clustering with PagedAttention. By organizing semantically related tokens into contiguous memory regions managed by a hierarchical, dynamically updatable data structure, our method enables more efficient token selection and better utilization of memory bandwidth during CPU-GPU transfers. Experimental results on LongBench show that, with a 256-token budget, IceCache maintains 99% of the original accuracy achieved by the full KV cache model. Moreover, compared to other offloading-based methods, IceCache attains competitive or even superior latency and accuracy while using only 25% of the KV cache token budget, demonstrating its effectiveness in long-sequence scenarios. The code is available on our project website at https://yuzhenmao.github.io/IceCache/.

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

↑