打破线性注意力的低秩困境
Breaking the Low-Rank Dilemma of Linear Attention
AI总结:
本文针对线性注意力因特征图低秩导致性能下降的问题,提出秩增强线性注意力RALA及视觉Transformer模型RAVLT,在保持线性复杂度的同时以26M参数在ImageNet-1k上达到84.4% Top-1准确率。
摘要:
Transformer模型中的Softmax注意力机制因其二次复杂度而计算开销极大,尤其在视觉应用中带来了显著挑战。相比之下,线性注意力通过将复杂度降低到线性水平,提供了更为高效的解决方案。然而,与Softmax注意力相比,线性注意力通常会出现明显的性能下降。我们的实验表明,这种性能下降源于线性注意力特征图的低秩特性,这阻碍了其充分建模复杂空间信息的能力。在本文中,为了打破线性注意力的低秩困境,我们从两个角度进行秩分析:KV缓冲区和输出特征。据此,我们提出了Rank-Augmented Linear Attention(RALA,秩增强线性注意力),它在保持线性复杂度和高效率的同时,性能可与Softmax注意力相媲美。基于RALA,我们构建了Rank-Augmented Vision Linear Transformer(RAVLT,秩增强视觉线性Transformer)。大量实验表明,RAVLT在各种视觉任务上均取得了优异的性能。具体而言,在训练过程中不使用任何额外标签、数据或监督的情况下,RAVLT仅用26M参数和4.6G FLOPs就在ImageNet-1k上实现了84.4%的Top-1准确率。这一结果显著超越了此前的线性注意力机制,充分展示了RALA的潜力。代码将发布在https://github.com/qhfan/RALA。
英文摘要:
The Softmax attention mechanism in Transformer models is notoriously computationally expensive, particularly due to its quadratic complexity, posing significant challenges in vision applications. In contrast, linear attention provides a far more efficient solution by reducing the complexity to linear levels. However, compared to Softmax attention, linear attention often experiences significant performance degradation. Our experiments indicate that this performance drop is due to the low-rank nature of linear attention's feature map, which hinders its ability to adequately model complex spatial information. In this paper, to break the low-rank dilemma of linear attention, we conduct rank analysis from two perspectives: the KV buffer and the output features. Consequently, we introduce Rank-Augmented Linear Attention (RALA), which rivals the performance of Softmax attention while maintaining linear complexity and high efficiency. Based on RALA, we construct the Rank-Augmented Vision Linear Transformer (RAVLT). Extensive experiments demonstrate that RAVLT achieves excellent performance across various vision tasks. Specifically, without using any additional labels, data, or supervision during training, RAVLT achieves an 84.4% Top-1 accuracy on ImageNet-1k with only 26M parameters and 4.6G FLOPs. This result significantly surpasses previous linear attention mechanisms, fully illustrating the potential of RALA. Code will be available at https://github.com/qhfan/RALA.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。