ATTUNER: Recomputation-Free KV Cache Reuse via Query-Side Adaptation
作者: Xinghao Chen, Junnan Dong, Cai Ke, Chak Tou Leong, Haocheng Sun, Keyu Chen, Siyu An, Ruizhi Qiao, Xing Sun, Wenjie Li, Xiaoyu Shen
分类: cs.CL
发布日期: 2026-09-29
💡 一句话要点
提出ATTUNER以解决KV缓存重计算问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 位置无关缓存 查询侧适应 低秩适配器 性能优化 计算效率 知识重用
📋 核心要点
- 现有方法在处理可重用内容时,频繁的重编码导致计算资源浪费,影响性能。
- ATTUNER通过查询侧适应,利用低秩适配器学习读取冻结的工件缓存,避免了KV重计算。
- 在多个基准测试中,ATTUNER在领域内外均显著超越了现有方法,匹配全上下文预填充质量。
📝 摘要(中文)
大型语言模型(LLM)代理在处理请求时需要重复加载可重用内容,如技能、文档和记忆条目。每次请求都重新编码这些内容会浪费计算资源。位置无关缓存(PIC)通过独立编码每个工件并在任意位置重用其键值(KV)状态来缓解这一问题,但相较于全上下文预填充会导致质量损失。本文发现,位置不匹配对性能的影响较小,独立缓存的工件仍能保持准确的表示。基于此,提出了ATTUNER,一种查询侧适应方法,通过在查询投影中插入低秩适配器来学习读取冻结的工件缓存。ATTUNER在推理时无需重新计算缓存或全上下文参考,在多个基准测试中显著超越了现有PIC基线,且提供了高达3.73倍的速度提升。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在处理可重用内容时的计算浪费问题,现有的PIC方法虽然能减少计算,但会导致性能下降。
核心思路:ATTUNER通过查询侧适应,插入低秩适配器来学习如何有效利用冻结的工件缓存,从而避免KV重计算。
技术框架:ATTUNER的整体架构包括查询投影的低秩适配器和一个学生模型,通过蒸馏全上下文预填充的分布来进行训练。
关键创新:ATTUNER的主要创新在于其能够在不重新计算KV的情况下,通过调整查询的适配器来恢复性能,解决了传统方法的局限性。
关键设计:ATTUNER仅训练不到0.05%的模型参数,设计上避免了全上下文参考和KV重计算,显著提高了推理效率。
🖼️ 关键图片
📊 实验亮点
ATTUNER在Qwen3-4B和Qwen3-8B模型上进行了测试,在七个基准测试中表现出色,显著超越了现有的PIC基线,且在领域内外均表现优异,匹配全上下文预填充的质量,同时实现了高达3.73倍的速度提升。
🎯 应用场景
ATTUNER的研究成果具有广泛的应用潜力,尤其是在需要快速响应的对话系统、智能助手和实时信息检索等领域。其高效的缓存利用方式可以显著提升系统的响应速度和用户体验,未来可能推动更多基于LLM的应用落地。
📄 摘要(原文)
Large language model (LLM) agents repeatedly load reusable content, such as skills, documents, and memory entries, into the current context. Re-encoding this content for every request wastes computation. Position-independent caching (PIC) alleviates this by encoding each artifact independently and reusing its key-value (KV) states at arbitrary positions, but it incurs a quality loss relative to full-context prefill. Existing methods repair this loss by restoring global position IDs or recomputing selected tokens. In this work, we isolate the source of the loss, finding that the positional mismatch has minor effect, and independently cached artifacts retain faithful representations: reading a provided artifact stays largely accurate, and performance degrades only when the model must select among multiple artifacts. Moreover, replacing PIC's attention scores with full-prefill scores recovers performance with the cached KV unchanged, localizing the failure to the attention rather than KV recomputation. Motivated by this, we propose \textsc{Attuner}, a query-side adaptation method that learns to read a frozen artifact cache. \textsc{Attuner} inserts low-rank adapters into the query projections and is trained by distilling full-prefill distribution into the student. It trains fewer than 0.05\% of the model parameters and, at inference, requires neither cache recomputation nor a full-context reference. On Qwen3-4B and Qwen3-8B across seven benchmarks covering skills, documents, memory, and code, \textsc{Attuner} substantially outperforms prior PIC baselines in both in-domain and out-of-domain settings, matches full-context prefill quality while providing up to $3.73\times$ speedup.