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

SimA:用于视觉Transformer的简单无Softmax注意力

SimA: Simple Softmax-free Attention for Vision Transformers

University of California, Davis(加州大学戴维斯分校)

Soroush Abbasi Koohpayegani, Hamed Pirsiavash

AI总结:

提出无Softmax注意力块SimA,用$\ell_1$-范数归一化查询和键矩阵以实现线性计算,在DeiT等模型上保持相当准确率并简化结构。

摘要:

最近,视觉Transformer变得非常流行。然而,由于注意力块中的Softmax层,在许多应用中部署它们的计算成本很高。我们引入了一种简单但有效的无Softmax注意力块SimA,它使用简单的$\ell_1$-范数对查询和键矩阵进行归一化,而不是使用Softmax层。因此,SimA中的注意力块是三个矩阵的简单乘法,所以SimA可以在测试时动态改变计算的顺序,以实现基于token数量或通道数量的线性计算。我们通过实验表明,应用于三种SOTA Transformer变体(DeiT、XCiT和CvT)的SimA,与SOTA模型相比具有相当的准确率,而无需任何Softmax层。有趣的是,将SimA从多头改为单头对准确率的影响很小,这进一步简化了注意力块。代码在此处提供:https://github.com/UCDvision/sima

英文摘要:

Recently, vision transformers have become very popular. However, deploying them in many applications is computationally expensive partly due to the Softmax layer in the attention block. We introduce a simple but effective, Softmax-free attention block, SimA, which normalizes query and key matrices with simple $\ell_1$-norm instead of using Softmax layer. Then, the attention block in SimA is a simple multiplication of three matrices, so SimA can dynamically change the ordering of the computation at the test time to achieve linear computation on the number of tokens or the number of channels. We empirically show that SimA applied to three SOTA variations of transformers, DeiT, XCiT, and CvT, results in on-par accuracy compared to the SOTA models, without any need for Softmax layer. Interestingly, changing SimA from multi-head to single-head has only a small effect on the accuracy, which simplifies the attention block further. The code is available here: https://github.com/UCDvision/sima

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

↑