arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.13289cs.LGcs.AI
收藏

RelayCaching: 通过解码KV缓存重用加速LLM协作

RelayCaching: Accelerating LLM Collaboration via Decoding KV Cache Reuse

Beijing University of Posts(北京邮电大学);Tsinghua University, Beijing, China(清华大学);University of Electronic Science(电子科学大学);Peking University, Beijing, China(北京大学)

Yingsheng Geng, Yuchong Gao, Weihong Wu, Guyue Liu, Jiang Liu

AI总结:

本文提出RelayCaching方法,通过重用前序代理的解码阶段KV缓存,在多代理LLM系统中减少冗余预填充计算,提升效率与准确性。

摘要:

随着AI任务复杂性的增加,系统架构从单体模型转向多代理大语言模型(LLM)系统。然而,这些协作架构引入了关键瓶颈:先前代理生成内容的冗余预填充计算,显著增加KV缓存内存使用和时间到第一个标记(TTFT)。尽管已提出多种KV缓存方法以减轻预填充冗余,但它们要么无法保持代理生成输出的准确性,要么由于刚性约束导致重用率低。我们提出RelayCaching,一种无需训练的推理方法,直接在后续预填充阶段重用前序代理的解码阶段KV缓存。我们的关键见解是,相同内容的KV缓存在不同阶段高度一致,而前缀诱导的偏差稀疏且局限于有限的层和标记位置。通过选择性地重新计算这些位置的KV缓存,RelayCaching在最小的开销下保持模型准确性,实现了优于现有方法的准确性-效率权衡。在多样化的协作LLM任务上进行的实验表明,RelayCaching实现了超过80%的KV缓存重用率,将TTFT降低至标准流水线的4.7倍,且准确性降解 negligible。

英文摘要:

The increasing complexity of AI tasks has shifted the paradigm from monolithic models toward multi-agent large language model (LLM) systems. However, these collaborative architectures introduce a critical bottleneck: redundant prefill computation for shared content generated by previous agents, which significantly increases KV cache memory usage and time-to-first-token (TTFT). While various KV cache methods have been proposed to mitigate prefill redundancy, they either fail to maintain accuracy on agent-generated outputs or exhibit low reuse rates due to rigid constraints. We present RelayCaching, a training-free inference method that directly reuses decoding phase KV caches from previous agents in subsequent prefill phases. Our key insight is that KV caches for identical content are highly consistent across phases, while prefix-induced deviations are sparse and localized within a limited range of layers and token positions. By selectively recomputing KV caches at these positions, RelayCaching preserves model accuracy with minimal overhead, yielding a superior accuracy-efficiency trade-off over existing methods. Experiments on diverse collaborative LLM tasks spanning mathematical reasoning, general knowledge, and code generation demonstrate that RelayCaching achieves over 80% KV cache reuse, reduces TTFT by up to $4.7\times$ compared to the standard pipeline, all with negligible accuracy degradation.

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

↑