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

具有广义二阶路由的多状态线性注意力

Multi-State Linear Attention with Generalized Second-Order Routing

Princeton University(普林斯顿大学);Google DeepMind(谷歌DeepMind)

Hee Seung Hwang, Sanghyuk Chun, Xindi Wu, Olga Russakovsky, Zhiwei Deng

AI总结:

该研究针对多状态线性注意力(MSLA)的聚合缺陷,提出MERLIN方法,通过跟踪片段键的矩实现更优聚合,在长上下文任务中较基线方法取得显著性能提升。

摘要:

自注意力在长序列建模中发挥关键作用,但其二次时间复杂度从根本上限制了大语言模型的扩展。最近,多状态线性注意力(MSLA)机制被提出,通过将上下文拆分为多个片段并在各自的记忆状态中压缩每个片段,以提升序列建模效率。MSLA仅使用查询与每个片段键的平均对齐来聚合从各记忆状态提取的信息,忽略了对齐在片段内的分布情况。为了更全面地建模片段与查询的相关性,并在聚合中纳入对齐的方差,我们提出了MERLIN(多状态线性注意力的矩路由),该方法跟踪每个片段键的一阶和二阶矩。利用键的矩,查询可恢复其与每个片段对齐的均值和方差,从而对各状态读数执行更具内容感知的聚合。在Gated DeltaNet-1.3B和Mamba-2-780M的多状态变体上开展的实验表明,MERLIN在各类长上下文任务中始终优于现有聚合方法。具体而言,在RULER针插在干草堆和长上下文问答任务中,MERLIN较基线方法表现更优(Gated DeltaNet-1.3B提升8.3%,Mamba-2-780M提升7.0%);在LongBench的各类子任务中,分别提升13.5%和12.0%;它甚至优于内存消耗为其4倍的基线方法。MERLIN为提升MSLA模型的长上下文能力提供了一种简单通用的路由机制。

英文摘要:

Self-attention plays a key role in long-sequence modeling, but its quadratic time complexity fundamentally limits the scaling of Large Language Models. Recently, Multi-State Linear Attention (MSLA) mechanisms have been proposed to make sequence modeling more efficient by splitting the context into segments and compressing each in its own memory state. MSLA aggregates the information extracted from each memory state using only the mean alignment between a query and each segment's keys, ignoring how the alignment is distributed within the segment. In order to model the relevance of a segment to a query more comprehensively and incorporate the variance of the alignment in the aggregation, we propose MERLIN (MomEnt Routing for multi-state LINear attention), a method that tracks the first and second moments of each segment's keys. Using the moments of keys, a query can recover both the mean and the variance of its alignment with each segment to perform a more content-aware aggregation of per-state readouts. Experiments on multi-state variants of Gated DeltaNet-1.3B and Mamba-2-780M show that MERLIN consistently outperforms existing aggregation methods on various long-context tasks. In particular, MERLIN outperforms baselines on RULER needle-in-a-haystack and long-context QA (+8.3% for Gated DeltaNet-1.3B and +7.0% for Mamba-2-780M) and diverse subtasks in LongBench (+13.5% and +12.0%). It even outperforms baselines that consume 4x more memory. MERLIN provides a simple and general routing mechanism for improving long-context capabilities of MSLA models.

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

↑