A Universal Context-Reuse Layer for Cross-Model KV Sharing
作者: Yi Li, Dongming Jiang, Yi Zhao, Bingzhe Li
分类: cs.LG, cs.AI
发布日期: 2026-08-31
💡 一句话要点
提出跨模型KV共享层以解决冗余计算问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 跨模型共享 KV缓存 上下文重用 大型语言模型 计算效率 多代理推理 模型迁移
📋 核心要点
- 现有的KV缓存重用机制主要针对单一模型,无法有效利用跨模型的上下文共享,导致计算冗余。
- 论文提出了一种通用的上下文重用层,能够将源模型的KV状态转换为目标模型可用的表示,支持不同模型间的KV共享。
- 实验结果表明,跨模型KV共享在多个设置中显著提高了准确性,并减少了预填充成本,展示了其有效性。
📝 摘要(中文)
现代大型语言模型(LLM)服务系统在处理重复或共享上下文时,通常每个模型都会独立执行预填充计算,导致冗余计算。现有的KV缓存重用机制主要针对单一模型,假设缓存的生产者和消费者是相同的。本文研究了跨模型KV共享,将源模型生成的KV状态转换为目标模型可消费的表示,适用于不同规模、架构、注意力配置、分词器和模型家族的模型。在实验中,跨模型KV共享显著提高了准确性,并减少了预填充成本,证明了KV状态可以作为可转移的计算表示,推动了上下文移动的概念。
🔬 方法详解
问题定义:本文旨在解决现有大型语言模型在处理共享上下文时的冗余计算问题。现有方法通常假设缓存的生产者和消费者是同一模型,无法有效利用跨模型的上下文共享,导致计算资源浪费。
核心思路:论文提出了一种通用的上下文重用层,能够将源模型生成的KV状态转换为目标模型可消费的表示。这种设计允许不同模型之间共享计算结果,从而减少冗余计算,提高效率。
技术框架:整体架构包括源模型KV状态的生成、KV状态的转换和目标模型的消费三个主要模块。首先,源模型处理输入生成KV状态;然后,通过上下文重用层将KV状态转换为目标模型可用的格式;最后,目标模型利用转换后的KV状态进行推理。
关键创新:最重要的技术创新在于提出了跨模型KV共享的概念,使得不同模型之间能够共享计算结果,而不仅限于单一模型的缓存。这一创新显著降低了冗余计算,提高了系统的整体效率。
关键设计:在设计中,考虑了不同模型的规模、架构和注意力配置等因素,确保KV状态的转换能够适应多种模型。此外,采用了优化的损失函数和网络结构,以提高KV状态的转换效果和目标模型的推理性能。
🖼️ 关键图片
📊 实验亮点
实验结果显示,在Qwen2.5-7B到Qwen2.5-1.5B的设置中,KV状态转换提高了LongBench2的准确性,从27.59%提升至34.48%,提升幅度达到6.89个百分点。同时,在跨家族设置中,KV共享将目标侧预填充成本降低了67.05%,并保持了解码困惑度接近原生模型基线。
🎯 应用场景
该研究的潜在应用领域包括多种大型语言模型的协同工作,如在多代理推理工作流中共享上下文信息。通过减少冗余计算,提升了系统的整体效率,具有重要的实际价值和广泛的应用前景,尤其是在需要高效计算资源的场景中。
📄 摘要(原文)
Modern large language model (LLM) serving systems increasingly operate over repeated or shared context, yet each model typically performs its own prefill computation even when another model has already processed the same input. Existing KV-cache reuse mechanisms substantially reduce redundant computation within a single model, but generally assume that the producer and consumer of a cache are identical. We study \emph{cross-model KV sharing}, which translates the KV state produced by a source model into a representation that can be consumed by a different target model, including models that differ in scale, architecture, attention configuration, tokenizer, and model family. We evaluate the approach in both within-family and cross-family settings. For Qwen2.5-7B $\rightarrow$ Qwen2.5-1.5B, translated KV states improve LongBench2 accuracy from 27.59\% to 34.48\%, a gain of 6.89 percentage points over the native 1.5B baseline, while reducing handoff cost relative to native target prefill. For the cross-family Qwen2.5-1.5B $\rightarrow$ Gemma-2-2B setting, KV handoff reduces target-side prefill cost by up to 67.05\% at 4K context length while maintaining decoding perplexity close to native-model baselines. In a more heterogeneous Llama3.1-70B $\rightarrow$ Qwen2.5-7B setting, cross-family handoff achieves 44.0\% accuracy compared with 45.7\% for native Qwen2.5-7B inference, while reducing measured latency from 899ms to 138ms. These results provide initial evidence that KV states can serve as transferable computational representations rather than strictly model-local caches, and motivate \emph{context mobility} as a systems abstraction for reducing redundant prefill across heterogeneous LLM and multi-agent inference workflows.