让多个模型共享相同提示的缓存,显著降低推理延迟和内存开销。
ICaRus: Identical Cache Reuse for Efficient Multi Model Inference
- 通过冻结逻辑编码器、微调逻辑解码器实现多模型共享缓存
- 在8个模型的多智能体场景下,延迟降低11.1倍,吞吐提升3.8倍
- 支持跨模型缓存复用,避免重复计算,适合大规模多模型部署
多模型推理已成为智能体AI系统的重要范式,但在这种场景下,每个模型需为相同提示维护独立的键值(KV)缓存,导致内存消耗急剧上升。这迫使大语言模型服务系统频繁淘汰旧缓存,一旦需要重新计算,便引入显著的重算开销。此外,不同模型间无法共享前缀缓存,迫使各模型重复计算相同提示的KV缓存,造成巨大性能损耗。为此,我们提出身份缓存复用(ICaRus),一种新架构,使多个模型可在所有层共享相同的KV缓存。ICaRus基于关键观察:仅解码器结构的Transformer可被概念性分解为逻辑编码器(生成缓存)与逻辑解码器(从缓存预测输出)。通过仅微调逻辑解码器并冻结逻辑编码器,实现多模型共享同一缓存。该方法消除了缓存爆炸与意外淘汰问题,并支持跨模型新输入令牌的缓存复用,彻底消除多模型推理中的冗余重算,兼顾效率与可扩展性。结合轻量级适配器如LoRA,ICaRus在解码阶段并行化缓存生成与下一个词预测。在多种任务上,ICaRus达到与专用微调模型相当的准确率,同时允许多个专业模型完全共享缓存。在包含8个不同模型的多智能体工作流中,相比传统多模型系统,其P95延迟降低11.1倍,吞吐提升3.8倍。
原文摘要 · Abstract (English)
Multi model inference has recently emerged as a prominent paradigm, particularly in the development of agentic AI systems. However, in such scenarios, each model must maintain its own Key-Value (KV) cache for the identical prompt, leading to substantial memory consumption. This explosive growth of KV caches forces LLM serving systems to evict previously stored caches, which in turn introduces significant recomputation overhead whenever the evicted caches are required again. Moreover, prefix caching is inherently infeasible across different models, forcing each model to recompute KV cache for the identical prompt, which leads to significant overhead. To alleviate these issues, we propose Identical Cache Reuse (ICaRus), a novel architecture that allows multiple models to share identical KV caches across all layers. ICaRus is based on the key observation that a decoder-only Transformer can be conceptually decomposed into a logical encoder, which generates KV caches, and a logical decoder, which predicts output tokens from the KV caches. ICaRus fine-tunes only the logical decoder while freezing the logical encoder, enabling multiple models to share an identical KV cache. This eliminates cache memory explosion and unexpected evictions while also allowing cross-model reuse of KV caches for new input tokens, thereby removing redundant recomputation in multi model inference achieving both efficiency and scalability. Moreover, by incorporating lightweight adapters such as LoRA, ICaRus parallelizes KV cache generation and next-token prediction during decoding. ICaRus achieves comparable accuracy to task-specific fine-tuned model across a diverse set of tasks, while allowing multiple specialized models to fully share KV caches. ICaRus achieves up to 11.1x lower P95 latency and 3.8x higher throughput in multi agent workflow with 8 different models, compared to conventional multi model system.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。