arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.15294cs.CLcs.AI
收藏

Round Attention:一种加速LLM推理的新型轮级注意力机制

Round Attention: A Novel Round-Level Attention Mechanism to Accelerate LLM Inference

Moore Threads AI(摩尔线程人工智能)

Yaohua Tang, Zhicheng Hu, Kun Cheng, Fan Mo, Qiheng Lv, Hua Wang, Zhi Chen

AI总结:

本文提出新型轮级注意力机制Round Attention,利用分水岭层动态选择top-k相关轮次的KV缓存,在保持回答准确性的同时将LLM推理内存使用量降低54%至82%。

摘要:

大型语言模型(LLMs)中上下文窗口大小的增加,提升了其处理复杂长文本任务的能力。然而,随着对话轮次的增加,需要在GPU内存中存储大量KV缓存,这严重影响了模型服务系统的效率甚至可用性。本文在轮次粒度上分析了真实用户的对话数据,发现LLM推理存在一个分水岭层,在此之后轮级注意力的分布表现出显著的相似性。基于此,我们提出了Round Attention——一种新型轮级注意力机制,能选择性地处理top-k相关轮次的KV缓存,其中k通过分水岭层中的注意力矩阵动态确定。理论分析表明,该方法将内存使用量降低了54%至82%,同时实验结果证实,加载稀疏的关键轮次KV缓存能在不降低性能的情况下保持回答准确性。

英文摘要:

The increasing context window size in large language models (LLMs) has improved their ability to handle complex, long-text tasks. However, as the conversation rounds continue, it is required to store a large amount of KV cache in GPU memory, which significantly affects the efficiency and even availability of the model serving systems. This paper analyzes dialogue data from real users on the granularity of round and discovers that the LLM inference manifests a watershed layer, after which the distribution of round-level attention shows notable similarity. Based on this, we propose Round Attention - a novel round-level attention mechanism that selectively processes the KV cache of top-k relevant rounds, where k is dynamically determined through the attention matrix in the watershed layer. Theoretical analysis demonstrates that our method reduces memory usage by 54\% to 82\%, while experimental results confirm that loading sparse critical-round KV cache maintains answer accuracy without performance degradation.

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

↑