IceCache:面向长序列 LLM 的内存高效 KV 缓存管理
阅读原文· arxiv.org研究团队提出 IceCache,一种面向长序列 LLM 的内存高效 KV 缓存管理策略。该方法融合语义 token 聚类与 PagedAttention,通过分层动态数据结构将语义相关 token 组织为连续内存区域,提升 CPU-GPU 传输效率。LongBench 测试显示,在 256 token 预算下 IceCache 保持 99% 原始准确率,且仅用 25% 的 KV 缓存预算即可达到与其他卸载方法相当或更优的延迟和准确率。
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/.