Primal-Attention:通过原始表示中的非对称核 SVD 实现自注意力
Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation
AI总结:
本文针对非对称自注意力难以用对称核方法准确分析的问题,提出基于非对称 KSVD 原始表示的 Primal-Attention,并证明其可通过正则化损失实现低秩优化,取得更优效率与性能。
摘要:
最近,一系列新的研究工作通过将 Transformer 中的自注意力视为核机器来理解并改进它。然而,现有工作将用于对称核的方法应用于非对称自注意力,导致分析理解与数值实现之间存在不可忽视的差距。本文提出一种通过非对称核奇异值分解(Kernel Singular Value Decomposition,KSVD)来表示和优化自注意力的新视角,其动机还来自深层中通常观察到的自注意力低秩性质。通过非对称 KSVD:i)构建了自注意力的原始-对偶表示,其中优化目标被转化为最大化注意力输出中的投影方差;ii)通过 KSVD 的原始表示提出了一种新颖的注意力机制,即 Primal-Attention,避免在对偶中显式计算核矩阵;iii)借助 KKT 条件,我们证明 Primal-Attention 中 KSVD 优化的平稳解会产生零值目标。这样一来,KSVD 优化可通过简单地最小化一个正则化损失来实现,从而在无需额外分解的情况下促进低秩性质。数值实验表明,我们的 Primal-Attention 具有最先进的性能,并且效率有所提升。此外,我们证明所部署的 KSVD 优化以比标准自注意力更陡峭的奇异值衰减来正则化 Primal-Attention,进一步验证了我们方法的巨大潜力。据我们所知,这是首个为自注意力中的非对称核提供原始-对偶表示并将其成功应用于建模和优化的工作。
英文摘要:
Recently, a new line of works has emerged to understand and improve self-attention in Transformers by treating it as a kernel machine. However, existing works apply the methods for symmetric kernels to the asymmetric self-attention, resulting in a nontrivial gap between the analytical understanding and numerical implementation. In this paper, we provide a new perspective to represent and optimize self-attention through asymmetric Kernel Singular Value Decomposition (KSVD), which is also motivated by the low-rank property of self-attention normally observed in deep layers. Through asymmetric KSVD, $i$) a primal-dual representation of self-attention is formulated, where the optimization objective is cast to maximize the projection variances in the attention outputs; $ii$) a novel attention mechanism, i.e., Primal-Attention, is proposed via the primal representation of KSVD, avoiding explicit computation of the kernel matrix in the dual; $iii$) with KKT conditions, we prove that the stationary solution to the KSVD optimization in Primal-Attention yields a zero-value objective. In this manner, KSVD optimization can be implemented by simply minimizing a regularization loss, so that low-rank property is promoted without extra decomposition. Numerical experiments show state-of-the-art performance of our Primal-Attention with improved efficiency. Moreover, we demonstrate that the deployed KSVD optimization regularizes Primal-Attention with a sharper singular value decay than that of the canonical self-attention, further verifying the great potential of our method. To the best of our knowledge, this is the first work that provides a primal-dual representation for the asymmetric kernel in self-attention and successfully applies it to modeling and optimization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。