arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.08128cs.LG
收藏

短-长卷积助力硬件高效线性注意力聚焦长序列

Short-Long Convolutions Help Hardware-Efficient Linear Attention to Focus on Long Sequences

Westlake University(西湖大学);Research Center for Industries of the Future(未来产业研究中心);AI Lab(人工智能实验室)

Zicheng Liu, Siyuan Li, Li Wang, Zedong Wang, Yunfan Liu, Stan Z. Li

AI总结:

针对因果线性注意力难以硬件高效实现及 SSM 不稳定的问题,本文提出 CHELA,用短-长卷积替代 SSM 并以分治方式实现线性注意力,在保持线性复杂度的同时提升长序列建模性能。

摘要:

为缓解自注意力机制在长序列上的计算复杂度,线性注意力利用计算技巧实现线性复杂度,而状态空间模型(SSM)则推广了一种有利实践:使用非数据依赖的记忆模式来处理序列,即重视近处、忽略远处。近期研究表明,将二者结合为一体具有优势。然而,在因果设置下,线性注意力的效率仍停留在理论层面;SSM 则需要各种精心设计的约束,才能在特定数据上有效运行。因此,为揭示这种混合设计的真正潜力,需要解决以下两个问题:(1)线性注意力的硬件高效实现;(2)SSM 的稳定化。为此,我们借鉴分块与层级思想,提出 CHELA(short-long Convolutions with Hardware-Efficient Linear Attention,即短-长卷积与硬件高效线性注意力),它用短-长卷积替代 SSM,并以分治方式实现线性注意力。该方法在保持真正线性复杂度的同时,兼具来自稳定 SSM 和线性注意力的全局抽象与数据依赖选择能力。我们在 Long Range Arena 基准和语言建模任务上的综合实验证明了所提方法的有效性。

英文摘要:

To mitigate the computational complexity in the self-attention mechanism on long sequences, linear attention utilizes computation tricks to achieve linear complexity, while state space models (SSMs) popularize a favorable practice of using non-data-dependent memory pattern, i.e., emphasize the near and neglect the distant, to processing sequences. Recent studies have shown the priorities by combining them as one. However, the efficiency of linear attention remains only at the theoretical level in a causal setting, and SSMs require various designed constraints to operate effectively on specific data. Therefore, in order to unveil the true power of the hybrid design, the following two issues need to be addressed: (1) hardware-efficient implementation for linear attention and (2) stabilization of SSMs. To achieve this, we leverage the thought of tiling and hierarchy to propose CHELA (short-long Convolutions with Hardware-Efficient Linear Attention), which replaces SSMs with short-long convolutions and implements linear attention in a divide-and-conquer manner. This approach enjoys global abstraction and data-dependent selection from stable SSM and linear attention while maintaining real linear complexity. Our comprehensive experiments on the Long Range Arena benchmark and language modeling tasks demonstrate the effectiveness of the proposed method.

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

↑