arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.01053cs.LG
收藏

LRAgent: 面向多LoRA LLM代理的高效KV缓存共享

LRAgent: Efficient KV Cache Sharing for Multi-LoRA LLM Agents

KAIST(韩国科学技术院)

Hyesung Jeon, Hyeongju Ha, Jae-Joon Kim

AI总结:

针对多LoRA代理系统中每个代理独立存储相同长轨迹的KV缓存导致内存和计算开销大的问题,提出LRAgent框架,通过将缓存分解为共享基座部分和适配器依赖部分,并利用共享A的多LoRA架构和Flash-LoRA-Attention内核,实现高效共享,在保持精度的同时显著降低开销。

摘要:

多LLM代理系统中的角色专业化通常通过多LoRA实现,其中代理共享预训练骨干网络,仅通过轻量级适配器区分。尽管共享基础模型权重,每个代理仍独立构建和存储相同长工具增强轨迹的KV缓存,导致大量内存和计算开销。现有的KV缓存共享方法大多忽略这种多LoRA设置。我们观察到,代理间的缓存差异主要由适配器输出主导,而共享预训练骨干网络的激活保持高度相似。基于此观察,我们提出LRAgent,一个面向多LoRA代理的KV缓存共享框架。它将缓存分解为两个组件:来自预训练权重的共享基座组件和来自LoRA权重的适配器依赖组件。LRAgent通过在代理间共享基座组件并以固有的低秩形式存储适配器组件来减少内存开销。它还通过共享A的多LoRA架构共享低秩缓存,从而减少计算开销,避免对已被其他代理处理过的上下文进行冗余计算。为了在运行时高效重建适配器贡献,我们引入Flash-LoRA-Attention,一个重新排序注意力计算以避免将低秩缓存实例化为全维度的内核。LRAgent实现了接近完全共享缓存的吞吐量和首令牌延迟,同时在代理问答基准测试中保持了接近非共享缓存基线的准确性。

英文摘要:

Role specialization in multi-LLM agent systems is often realized via multi-LoRA, where agents share a pretrained backbone and differ only by lightweight adapters. Despite sharing base model weights, each agent independently builds and stores its own KV cache for the same long, tool-augmented trajectories, incurring substantial memory and compute overhead. Existing KV cache sharing methods largely overlook this multi-LoRA setting. We observe that, cache differences across agents are dominated by adapter outputs, while activations from the shared pretrained backbone remain highly similar. Based on this observation, we propose LRAgent, a KV cache sharing framework for multi-LoRA agents. It decomposes the cache into two components, a shared base component derived from pretrained weights and an adapter-dependent component derived from LoRA weights. LRAgent reduces memory overhead by sharing the base component across agents and storing the adapter component in its inherent low-rank form. It also reduces computational overhead by sharing the low-rank cache, enabled by a shared-A multi-LoRA architecture. This avoids redundant computations for contexts that have already been processed by other agents. To efficiently reconstruct adapter contributions at runtime, we introduce Flash-LoRA-Attention, a kernel that reorders attention computation to avoid materializing the low-rank cache to full dimension. LRAgent achieves throughput and time-to-first-token latency close to fully shared caching, while preserving accuracy near the non-shared caching baseline across agentic question-answering benchmarks.

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

↑