Vision transformers (ViTs) have pushed the state-of-the-art for visual perception tasks. The self-attention mechanism underpinning the strength of ViTs has a quadratic complexity in both computation and memory usage. This motivates the development of approximating the self-attention at linear complexity. However, an in-depth analysis in this work reveals that existing methods are either theoretically flawed or empirically ineffective for visual recognition. We identify that their limitations are rooted in the inheritance of softmax-based self-attention during approximations, that is, normalizing the scaled dot-product between token feature vectors using the softmax function. As preserving the softmax operation challenges any subsequent linearization efforts. By this insight, a family of Softmax-Free Transformers (SOFT) are proposed. Specifically, a Gaussian kernel function is adopted to replace the dot-product similarity, enabling a full self-attention matrix to be approximated under low-rank matrix decomposition. For computational robustness, we estimate the Moore-Penrose inverse using an iterative Newton-Raphson method in the forward process only, while calculating its theoretical gradients only once in the backward process. To further expand applicability (e.g., dense prediction tasks), an efficient symmetric normalization technique is introduced. Extensive experiments on ImageNet, COCO, and ADE20K show that our SOFT significantly improves the computational efficiency of existing ViT variants. With linear complexity, much longer token sequences are permitted by SOFT, resulting in superior trade-off between accuracy and complexity. Code and models are available at https://github.com/fudan-zvg/SOFT.
Copy the Same, Distill the Difference: Initializing Linear Vision Transformers
Institute of Advanced Intelligence and Computing (IAIC), A*STAR(先进智能与计算研究所(IAIC),新加坡科技研究局);Nanyang Technological University(南洋理工大学);ST Engineering Geo-Insights(新科工程地理信息公司);Sichuan University(四川大学);Shanghai Jiao Tong University(上海交通大学);University of Science and Technology of China(中国科学技术大学)
Softmax-Free Attention in Spiking Transformers as Zero-Temperature Two-Level Systems: Applications to XAI
University of Calgary(卡尔加里大学);Hotchkiss Brain Institute, University of Calgary(卡尔加里大学霍奇基斯脑研究所);Ulster University(阿尔斯特大学);Intelligent Systems Research Center, Ulster University(阿尔斯特大学智能系统研究中心)
Hierarchical Shift Mixing -- Beyond Dense Attention in Transformers
Dept. of Electrical Engineering, Linköping University, Linköping, Sweden(电子工程系,林霍普大学);RISE Research Institutes of Sweden, Linköping, Sweden(瑞典RISE研究机构)
Center for Foundation Models and Generative AI, Northwestern University(基础模型与生成式人工智能中心,西北大学);Department of Computer Science, Northwestern University(计算机科学系,西北大学);Department of Physics, National Taiwan University(物理系,国立台湾大学);Department of Statistics and Data Science, Northwestern University(统计与数据科学系,西北大学)
MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map
The Hong Kong Polytechnic University(香港理工大学);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);UC Santa Cruz(加州大学圣克鲁兹分校);Shanghai AI Lab(上海人工智能实验室)
In-Context Algorithm Emulation in Fixed-Weight Transformers
Center for Foundation Models and Generative AI, Northwestern University(西北大学基础模型与生成式人工智能中心);Department of Computer Science, Northwestern University(西北大学计算机科学系);Ensemble AI;Engineering Science, University of Toronto(多伦多大学工程科学系);Department of Statistics and Data Science, Northwestern University(西北大学统计与数据科学系)
在本文中,我们首次将Attention Is All You Need中最先进的Transformer中的自注意力应用于与偏微分方程相关的数据驱动算子学习问题。努力放在一起解释的原理,并提高注意力机制的功效。利用Hilbert空间中的算子逼近理论,首次证明了在标度点积注意力中的softmax归一化是充分的,但不是必要的。在没有softmax的情况下,可以证明线性化的Transformer变体的近似能力与逐层的Petrov-Galerkin投影相当,并且估计与序列长度无关。提出了一种新的层归一化方案,该方案模仿Petrov-Galerkin投影,以允许缩放通过注意层传播,这有助于模型在具有未归一化数据的算子学习任务中实现显着的准确性。最后,我们提出了三个操作学习实验,包括粘性Burgers方程,界面达西流,和反界面系数识别问题。新提出的简单的基于注意力的算子学习器Galerkin Transformer,在训练成本和评估精度方面都比其softmax归一化的同类算法有了显着的改进。
ELLIS Institute Tübingen(图宾根埃利斯研究所);LIONS, EPFL(日内瓦理工学院LIONS实验室);University of Freiburg(弗赖堡大学);Max-Planck-Institute for Intelligent Systems(智能系统马克斯·普朗克研究所);Prior Labs(Prior实验室)
Center for Foundation Models and Generative AI & Department of Computer Science, Northwestern University, USA(基础模型与生成人工智能中心及计算机科学系,西北大学,美国);School of Mathematical Sciences, Fudan University(复旦大学数学科学学院);University of California, Berkeley, USA(加州大学伯克利分校,美国);Center for Foundation Models and Generative AI & Department of Computer Science & Department of Statistics and Data Science, Northwestern University, USA(基础模型与生成人工智能中心及计算机科学系与统计与数据科学系,西北大学,美国)