让多个AI助手共享记忆,提速7倍且不丢精度。
KVCOMM: Online Cross-context KV-cache Communication for Efficient LLM-based Multi-agent Systems

- 用动态锚点池对齐不同助手的上下文记忆,实现跨任务复用。
- 在5个助手协作场景下,输入1000词时首字延迟从430毫秒降至55毫秒。
- 无需训练,适合需要多智能体协同的生成类应用。
多智能体大语言模型系统在复杂语言任务中日益普及,但因各智能体重复处理重叠上下文而产生显著开销。传统流程中,一旦接收前序消息,必须从头重新处理全部历史内容,造成效率低下。虽然键值缓存能避免单智能体场景下的重复计算,但在多智能体中因各智能体引入不同前缀而无法直接复用。我们发现核心问题在于缓存偏移差异。为此提出KVCOMM,一种无需训练的框架,通过引用存储不同前缀下缓存偏差的锚点池,动态调整共享内容的缓存偏移,实现高效预填充。锚点池在线维护与更新,可适应多样用户请求。在包含检索增强生成、数学推理和协作编码的任务中,KVCOMM实现超过70%的缓存复用率,且无质量损失。尤其在五智能体设置下,每个智能体接收1000输入词(512前缀 + 512输出),相比标准预填充流水线,最快达7.8倍加速,首字时间从约430毫秒降至约55毫秒。
原文摘要 · Abstract (English)
Multi-agent large language model (LLM) systems are increasingly adopted for complex language processing tasks that require communication and coordination among agents. However, these systems often suffer substantial overhead from repeated reprocessing of overlapping contexts across agents. In typical pipelines, once an agent receives a message from its predecessor, the full context-including prior turns-must be reprocessed from scratch, leading to inefficient processing. While key-value (KV) caching is an effective solution for avoiding redundant computation in single-agent settings where prefixes remain unchanged, it cannot be directly reused in multi-agent scenarios due to diverging prefixes introduced by agent-specific context extensions. We identify that the core challenge lies in the offset variance of KV-caches across agents. To address this, we propose KVCOMM, a training-free framework that enables efficient prefilling in multi-agent inference by reusing KV-caches and aligning cache offsets of overlapping contexts under diverse prefix contexts. KVCOMM estimates and adjusts KV-caches for shared content by referencing a pool of cached examples-termed anchors-that store observed cache deviations under varying prefixes. The anchor pool is maintained and updated online, allowing dynamic adaptation to distinct user requests and context structures. KVCOMM achieves over 70% reuse rate across diverse multi-agent workloads, including retrieval-augmented generation, math reasoning, and collaborative coding tasks, all without quality degradation. Particularly, when each fully-connected agent receives 1K input tokens with 512 prefix tokens and 512 output tokens under a five-agent setting, KVCOMM achieves up to 7.8x speedup compared to the standard prefill pipeline, reducing TTFT from ~430 ms to ~55 ms.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。