arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.05076cs.LGcs.AIcs.CL
收藏

TidalDecode:基于位置持久稀疏注意力的快速准确大语言模型解码

TidalDecode: Fast and Accurate LLM Decoding with Position Persistent Sparse Attention

Carnegie Mellon University(卡内基梅隆大学)

Lijie Yang, Zhihao Zhang, Zhuofu Chen, Zikun Li, Zhihao Jia

AI总结:

针对大语言模型解码阶段KV缓存内存瓶颈及现有稀疏注意力的两大局限,提出TidalDecode算法,利用层间token空间连贯性,通过少量全注意力层选token、其余层用预选token做稀疏注意力,在保证生成质量的同时最高降低2.1倍解码延迟。

摘要:

大语言模型(LLM)已在各类自然语言处理(NLP)任务中取得了显著进展,其中长上下文模型因能处理超长输入而日益受到关注。然而,Transformer架构所需的键值(KV)缓存规模不断扩大,加剧了内存限制,在解码阶段尤为突出,形成了严重的性能瓶颈。现有针对该瓶颈设计的稀疏注意力机制存在两大局限:一是往往无法可靠识别注意力最相关的token,二是忽略了连续Transformer层之间token选择的空间连贯性,这会导致性能下降且token选择的开销极大。本文提出TidalDecode——一种通过位置持久稀疏注意力实现快速准确LLM解码的简洁高效算法与系统。TidalDecode利用现有稀疏注意力方法所选token的空间连贯性,引入少量执行全注意力的token选择层以识别注意力得分最高的token,其余所有层则基于预选出的token执行稀疏注意力。该设计使TidalDecode能在不牺牲生成结果质量的前提下,大幅降低稀疏注意力的token选择开销。在多种LLM和任务上的评估表明,TidalDecode的生成性能与全注意力方法十分接近,同时将LLM解码延迟降低了最高2.1倍。

英文摘要:

Large language models (LLMs) have driven significant advancements across diverse NLP tasks, with long-context models gaining prominence for handling extended inputs. However, the expanding key-value (KV) cache size required by Transformer architectures intensifies the memory constraints, particularly during the decoding phase, creating a significant bottleneck. Existing sparse attention mechanisms designed to address this bottleneck have two limitations: (1) they often fail to reliably identify the most relevant tokens for attention, and (2) they overlook the spatial coherence of token selection across consecutive Transformer layers, which can lead to performance degradation and substantial overhead in token selection. This paper introduces TidalDecode, a simple yet effective algorithm and system for fast and accurate LLM decoding through position persistent sparse attention. TidalDecode leverages the spatial coherence of tokens selected by existing sparse attention methods and introduces a few token selection layers that perform full attention to identify the tokens with the highest attention scores, while all other layers perform sparse attention with the pre-selected tokens. This design enables TidalDecode to substantially reduce the overhead of token selection for sparse attention without sacrificing the quality of the generated results. Evaluation on a diverse set of LLMs and tasks shows that TidalDecode closely matches the generative performance of full attention methods while reducing the LLM decoding latency by up to 2.1x.

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

↑