KVCOMM:面向高效基于LLM的多智能体系统的在线跨上下文KV缓存通信
KVCOMM: Online Cross-context KV-cache Communication for Efficient LLM-based Multi-agent Systems
AI总结:
提出免训练框架KVCOMM,通过在线维护锚点池对齐不同前缀下的KV缓存偏移,实现多智能体系统跨上下文KV缓存重用,在多种任务中达到超70%重用率及最高7.8倍加速。
摘要:
多智能体大型语言模型(LLM)系统正日益被用于需要智能体间通信与协调的复杂语言处理任务。然而,这些系统常因智能体间重复处理重叠上下文而承受巨大开销。在典型流程中,一旦智能体收到前驱的消息,包含先前轮次的完整上下文必须从头处理,导致效率低下。尽管键值(KV)缓存是在前缀保持不变的单智能体设置中避免冗余计算的有效方案,但由于智能体特定上下文扩展引入了不同前缀,它无法在多智能体场景中直接重用。我们发现核心挑战在于智能体间KV缓存的偏移方差。为此,我们提出KVCOMM,一个免训练框架,通过在不同前缀上下文下重用KV缓存并对齐重叠上下文的缓存偏移,实现多智能体推理的高效预填充。KVCOMM通过参考一个缓存示例池(称为锚点)来估计和调整共享内容的KV缓存,这些锚点存储了在不同前缀下观察到的缓存偏差。锚点池在线维护和更新,允许动态适应不同用户请求和上下文结构。KVCOMM在包括检索增强生成、数学推理和协作编码任务在内的多种多智能体工作负载中实现了超过70%的重用率,且无质量下降。特别是在五智能体设置下,当每个全连接智能体接收1K输入token、512前缀token和512输出token时,KVCOMM相比标准预填充流程实现了高达7.8倍的加速,将TTFT从约430毫秒降至约55毫秒。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。