The attention module is the key component in Transformers. While the global attention mechanism offers high expressiveness, its excessive computational cost restricts its applicability in various scenarios. In this paper, we propose a novel attention paradigm, Agent Attention, to strike a favorable balance between computational efficiency and representation power. Specifically, the Agent Attention, denoted as a quadruple $(Q, A, K, V)$, introduces an additional set of agent tokens $A$ into the conventional attention module. The agent tokens first act as the agent for the query tokens $Q$ to aggregate information from $K$ and $V$, and then broadcast the information back to $Q$. Given the number of agent tokens can be designed to be much smaller than the number of query tokens, the agent attention is significantly more efficient than the widely adopted Softmax attention, while preserving global context modelling capability. Interestingly, we show that the proposed agent attention is equivalent to a generalized form of linear attention. Therefore, agent attention seamlessly integrates the powerful Softmax attention and the highly efficient linear attention. Extensive experiments demonstrate the effectiveness of agent attention with various vision Transformers and across diverse vision tasks, including image classification, object detection, semantic segmentation and image generation. Notably, agent attention has shown remarkable performance in high-resolution scenarios, owning to its linear attention nature. For instance, when applied to Stable Diffusion, our agent attention accelerates generation and substantially enhances image generation quality without any additional training. Code is available at https://github.com/LeapLabTHU/Agent-Attention.
MAIS & NLPR, Institute of Automation, Chinese Academy of Sciences(自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)
SoLA-Vision: Fine-grained Layer-wise Linear Softmax Hybrid Attention
State Key Laboratory of Multimodal Artificial Intelligence Systems (MAIS), CASIA(多模态人工智能系统国家重点实验室(MAIS),中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Beijing Key Laboratory of Super Intelligent Security of Multi-Modal Information(北京多模信息超智能安防重点实验室);School of Information Science and Technology, ShanghaiTech University(上海科技大学信息科学与技术学院)
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函数预测分段重要性得分来解决的。然而,softmax函数在保留复杂视觉或顺序信息的高阶表示方面存在问题,这被称为Softmax瓶颈问题。在本文中,我们提出了一种新的视频摘要框架--带Meta学习的双混合注意力(Dual Mixture Attention,DMASum)模型来解决softmax瓶颈问题,其中混合注意力层(Mixture of Attention,MoA)通过使用两次自查询注意力来有效地增加模型容量,除了初始的查询-关键字注意力之外,还可以捕获二阶变化,并引入了一种新的单帧Meta学习规则,以实现对训练源有限的小数据集的更好的泛化。此外,DMASum显著地利用了视觉注意力和顺序注意力,以累积的方式连接局部关键帧和全局注意力。我们在两个公共数据集SumMe和TVSum上采用了新的评估协议。定性和定量的实验表明显着的改进,在国家的最先进的方法。
University of Amsterdam(阿姆斯特丹大学);Priberam Labs(Priberam实验室);Institute of Systems and Robotics(系统与机器人研究所);LUMLIS (Lisbon ELLIS Unit)(LUMLIS(里斯本ELLIS单元));Unbabel(Unbabel公司)
LaplacianFormer:Rethinking Linear Attention with Laplacian Kernel
School of Artificial Intelligence, University of Chinese Academy of Sciences(人工智能学院,中国科学院大学);China Electronics Data Corporation(中国电子数据公司);Institute of Computing Technology, Chinese Academy of Sciences(计算技术研究所,中国科学院);The Key Laboratory of Computing Power Network and Information Security, Ministry of Education, Shandong Computer Science Center, Qilu University of Technology(计算能力网络与信息安全重点实验室,教育部,山东计算机科学中心,齐鲁大学);Shandong Provincial Key Laboratory of Computing Power Internet and Service Computing, Shandong Fundamental Research Center for Computer Science(山东省计算能力互联网与服务计算重点实验室,山东省计算机科学基础研究中心);Spatialtemporal AI(时空人工智能)