跳到正文
arXiv (AI + Vision + Imaging)· Hanno Ackermann, Hong Cai, Mohsen Ghafoorian, Amirhossein Habibian·· 7 小时前AI 评分28

HLA:Hadamard线性注意力

HLA: Hadamard Linear Attention

AI 导读

研究提出Hadamard线性注意力(HLA),与以往线性注意力不同,其非线性不分别作用于query和key,而是在计算成对相似度之后施加,相当于用更高次有理函数逼近softmax。该方法给出与标准线性注意力类似的高效计算方案,且无需耗时的张量重排。团队将其应用于视频生成的大型扩散Transformer模型验证有效性。

正文 · 原文

arXiv:2602.12128v2 Announce Type: replace Abstract: 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.

来源:arXiv (AI + Vision + Imaging) · arxiv.org