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

HLA: Hadamard线性注意力

HLA: Hadamard Linear Attention

Qualcomm AI Research(高通人工智能研究)

Hanno Ackermann, Hong Cai, Mohsen Ghafoorian, Amirhossein Habibian

AI总结:

HLA通过在计算成对相似性后应用非线性,提高线性注意力对softmax的近似精度,无需张量重塑,适用于大规模视频生成任务。

摘要:

注意力机制是Transformer成功的重要原因。它依赖于计算令牌之间的成对关系。为了减少标准二次注意力的高计算成本,提出了线性注意力作为一种高效的近似方法。它使用在计算成对相似性之前独立应用于输入的核函数。这允许一种高效的计算过程,但这种方法相当于低次有理函数对softmax的近似。我们提出了Hadamard线性注意力(HLA)。与之前线性注意力的工作不同,HLA中的非线性不是分别应用于查询和键,而是在计算成对相似性之后,类似于标准softmax注意力。将证明所提出的非线性相当于更高次有理函数对softmax的近似。为所提出的方法推导出一种类似于标准线性注意力的高效计算方案。与其他方法不同,无需耗时的张量重塑即可应用所提出的算法。通过将其应用于大规模扩散Transformer模型进行视频生成,证明了该方法的有效性,该应用涉及非常大量的令牌。

英文摘要:

The attention mechanism is an important reason for the success of transformers. It relies on computing pairwise relations between tokens. To reduce the high computational cost of standard quadratic attention, linear attention has been proposed as an efficient approximation. It employs kernel functions that are applied independently to the inputs before the pairwise similarities are calculated. That allows for an efficient computational procedure which, however, amounts to a low-degree rational function approximating softmax. We propose Hadamard Linear Attention (HLA). Unlike previous works on linear attention, the nonlinearity in HLA is not applied separately to queries and keys, but, analogously to standard softmax attention, after the pairwise similarities have been computed. It will be shown that the proposed nonlinearity amounts to a higher-degree rational function to approximate softmax. An efficient computational scheme for the proposed method is derived that is similar to that of standard linear attention. In contrast to other approaches, no time-consuming tensor reshaping is necessary to apply the proposed algorithm. The effectiveness of the approach is demonstrated by applying it to a large diffusion transformer model for video generation, an application that involves very large amounts of tokens.

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

↑