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

保留还是不保留:在解耦式大语言模型服务系统中学习KV缓存的保留策略

To Keep or Not to Keep: Learning KV Cache Retention in Disaggregated LLM Serving Systems

University of California, Los Angeles(加州大学洛杉矶分校);Columbia University(哥伦比亚大学)

Dong Liu, Yanxuan Yu, Eric Jiang, Shu Wang, Ying Nian Wu

AI总结:

针对解耦式LLM服务的KV缓存保留问题,提出基于学习的KVLearn框架,通过三个组件优化成本,显著降低首token生成时间和节点间KV传输量,吞吐量接近最优值。

摘要:

解耦式大语言模型(\textsc{LLM})服务将预填充(prefill)和解码(decode)任务分配到不同节点池,在\textsc{KV}缓存的计算与使用之间引入了网络结构。这打破了传统缓存策略的关键假设:缓存未命中不再仅导致本地重新计算,还会产生向解码节点的网络传输;同样,将缓存块纳入全局缓存也需要额外传输,因此保留决策不当会同时浪费内存和带宽。本文提出\textbf{KVLearn},一种用于解耦式服务中成本感知\textsc{KV}缓存保留的基于学习的框架,包含三个核心组件:(i)轻量级前缀重用预测器(\textsc{PRP}),通过结构和时间前缀特征估计重用概率,无需修改模型权重;(ii)成本感知保留得分(\textsc{CARS}),利用重新计算、传输和存储成本将重用概率转换为保留/纳入决策;(iii)自适应阈值控制器(\textsc{ATC}),根据观测到的命中率和内存压力在线调整纳入阈值。我们将KVLearn集成到全局解耦式服务拓扑中,在文本和多模态工作负载上进行评估,包括具有异构重用模式的大型图像/视频衍生\textsc{KV}块。结果显示,与无缓存(No-Cache)相比,KVLearn将端到端首token生成时间最多降低56%;与LRU-Pool相比,最多降低38%;与Mooncake风格基线相比,最多降低33%;同时,与LRU-Pool相比,节点间\textsc{KV}传输量最多减少53%。在MM-Session上,其吞吐量与最优值(oracle)的差距保持在约5%以内。代码可在该https URL获取。

英文摘要:

Disaggregated \textsc{LLM} serving separates prefill and decode across node pools, placing a network fabric between \textsc{KV}-cache computation and consumption. This breaks a key assumption of classical cache policies: a miss no longer incurs only local recomputation, but also network transfer to the decode node. Likewise, admitting a block to the global cache requires an additional transfer, so poor retention decisions waste both memory and bandwidth. We present \textbf{KVLearn}, a learning-based framework for cost-aware \textsc{KV}-cache retention in disaggregated serving. KVLearn includes: (i) a lightweight Prefix Reuse Predictor (\textsc{PRP}) that estimates reuse probability from structural and temporal prefix features without modifying model weights; (ii) a Cost-Aware Retention Score (\textsc{CARS}) that converts reuse probability into keep/admit decisions using recomputation, transfer, and storage costs; and (iii) an Adaptive Threshold Controller (\textsc{ATC}) that adjusts admission thresholds online from observed hit rates and memory pressure. We integrate KVLearn into a globally disaggregated serving topology and evaluate it on text and multimodal workloads, including large image/video-derived \textsc{KV} blocks with heterogeneous reuse patterns. KVLearn reduces end-to-end time-to-first-token by up to 56% versus No-Cache, 38% versus LRU-Pool, and 33% versus Mooncake-style baselines, while cutting inter-node \textsc{KV} transfer volume by up to 53% versus LRU-Pool. On MM-Session, throughput remains within ${\sim}5%$ of oracle. Code is available at https://github.com/FastLM/KVLearn.

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

↑