arXiv:2511.17560cs.CLcs.AI2025-11被引 4

通过关注注意力机制,精准融合关键词缓存,显著降低大模型推理延迟。

$A^3$: Attention-Aware Accurate KV Cache Fusion for Fast Large Language Model Serving

  • 基于问题相关性预计算并选择性融合键值缓存
  • 在多个模型和基准上实现最优任务性能,首字生成时间减半
  • 适合需要低延迟推理的长文本处理场景

大型语言模型(LLMs)在处理长上下文方面展现出强大能力,可应对多轮对话、法律文档或检索增强生成(RAG)系统中的长文本输入。然而,尽管能处理长序列,解码延迟和内存开销依然显著,制约实际部署。近期基于重计算的键值(KV)缓存复用方法虽有潜力缓解成本,但仍存在明显性能下降。我们深入研究此类方法,发现重计算的词元常与问题最相关的上下文段落不匹配,导致关键上下文表示更新不准确。为此,提出注意力感知的精确KV缓存融合算法(A³),根据文本块与问题的相关性预计算并选择性融合其KV缓存,实现高精度整合且计算开销极小。在多个基准和模型上的实验表明,A³相比四种基线方法达到最佳任务性能,同时将首次输出时间(TTFT)降低2倍。

原文摘要 · Abstract (English)

Large language models (LLMs) have demonstrated strong capabilities in processing long contexts, enabling them to tackle tasks involving long textual inputs such as multi-turn conversations, legal documents, or retrieved documents in Retrieval-Augmented Generation (RAG) systems. However, despite their ability to handle long sequences, the resulting decoding latency and memory overhead remain substantial, posing challenges for real-world deployment. Recent advances in KV Cache reuse have shown potential to mitigate these costs, but still suffer from notable performance degradation. To address this issue, we conduct an in-depth investigation of recomputation-based reuse methods and observe that the recomputed tokens often fail to align with the context segments most relevant to the question. This misalignment hinders proper updates to the critical contextual representations. Therefore, we propose the $\textbf{A}$ttention-$\textbf{A}$ware $\textbf{A}$ccurate KV Cache Fusion algorithm ($A^3$), which precomputes and selectively fuses the KV Cache of text chunks based on their relevance to the question, achieving accurate integration with minimal computational overhead. Extensive experiments on various benchmarks and LLMs demonstrate that $A^3$ achieves the best task performance compared to four baselines while reducing the time-to-first-token (TTFT) by 2$\times$.

大模型推理缓存优化KV缓存低延迟

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。