本文提出一种与点积注意力等效但具有线性复杂度的高效注意力机制,显著降低内存和计算成本,并在 MS-COCO 检测分割及 Scene Flow 立体深度估计上取得显著性能提升。
摘要:
点积注意力在计算机视觉和自然语言处理中有着广泛的应用。然而,其内存和计算成本随输入尺寸呈二次增长,这种增长阻碍了其在高分辨率输入上的应用。为了弥补这一缺陷,本文提出了一种新颖的高效注意力机制,该机制与点积注意力等效,但内存和计算成本显著降低。其资源效率使得注意力模块能够更广泛、更灵活地集成到网络中,从而获得更好的精度。实证评估证明了其优势的有效性。高效注意力模块在 MS-COCO 2017 上为物体检测器和实例分割器带来了显著的性能提升。此外,资源效率使注意力机制得以普及到复杂模型中,而在这些模型中,高昂的成本曾禁止使用点积注意力。作为一个示例,采用高效注意力的模型在 Scene Flow 数据集上实现了立体深度估计的最新精度。代码可在 https://github.com/cmsflash/efficient-attention 获取。
英文摘要:
Dot-product attention has wide applications in computer vision and natural language processing. However, its memory and computational costs grow quadratically with the input size. Such growth prohibits its application on high-resolution inputs. To remedy this drawback, this paper proposes a novel efficient attention mechanism equivalent to dot-product attention but with substantially less memory and computational costs. Its resource efficiency allows more widespread and flexible integration of attention modules into a network, which leads to better accuracies. Empirical evaluations demonstrated the effectiveness of its advantages. Efficient attention modules brought significant performance boosts to object detectors and instance segmenters on MS-COCO 2017. Further, the resource efficiency democratizes attention to complex models, where high costs prohibit the use of dot-product attention. As an exemplar, a model with efficient attention achieved state-of-the-art accuracies for stereo depth estimation on the Scene Flow dataset. Code is available at https://github.com/cmsflash/efficient-attention.
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(上海人工智能实验室)
A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attention
Taylor Lab, Huawei(华为泰勒实验室);Key Laboratory of Interdisciplinary Research of Computation and Economics(计算与经济学交叉研究关键实验室);Shanghai University of Finance and Economics(上海财经大学)
Massachusetts Institute of Technology(麻省理工学院);Princeton University(普林斯顿大学);Together AI;Carnegie Mellon University(卡内基梅隆大学);Mohamed bin Zayed University of AI(穆罕默德·本·扎耶德人工智能大学);GenBio AI
MAIS & NLPR, Institute of Automation, Chinese Academy of Sciences(自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)
Bipartite Graph Attention-based Clustering for Large-scale scRNA-seq Data
Institute of Intelligent Information Processing, Shanxi University(山西大学智能信息处理研究院);Alliance Manchester Business School, The University of Manchester(曼彻斯特大学阿联酋商业学院)
ObjectVisA-120: Object-based Visual Attention Prediction in Interactive Street-crossing Environments
German Research Center for Artificial Intelligence (DFKI) GmbH(德国人工智能研究中心(DFKI));Max Planck Institute for Intelligent Systems(智能系统马克斯·普朗克研究所);Institute for Visualization and Interactive Systems (VIS) at Stuttgart University(斯图加特大学可视化与交互系统研究所)
IMRAM: Iterative Matching with Recurrent Attention Memory for Cross-Modal Image-Text Retrieval
Tsinghua University(清华大学);Kwai Ads Platform(快手广告平台);Microsoft Research(微软研究院);Kwai Seattle AI Lab(快手西雅图人工智能实验室);Kwai FeDA Lab(快手联邦学习实验室);Kwai AI Platform(快手人工智能平台);University of Warwick(华威大学)
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(上海科技大学信息科学与技术学院)