arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.02748cs.CVcs.AIcs.LG
收藏

具有全局上下文的线性注意力:一种用于视觉与物理的多极注意力机制

Linear Attention with Global Context: A Multipole Attention Mechanism for Vision and Physics

Miles Team, LAMSADE, Université Paris Dauphine-PSL(巴黎南大学LAMSADE研究所)

Alex Colagrande, Paul Caillon, Eva Feillet, Alexandre Allauzen

AI总结:

本文提出多极注意力神经算子 MANO,将注意力建模为网格点间的多尺度相互作用,在保持全局感受野的同时实现线性复杂度,并在图像分类和 Darcy 流任务上以大幅降低的资源开销媲美 ViT 和 Swin Transformer。

摘要:

Transformer 已成为从图像分类到物理模拟等广泛任务的事实标准。尽管其性能令人印象深刻,但标准 Transformer 在内存和时间上相对于输入长度的二次复杂度使其难以处理高分辨率输入。因此,人们提出了多种变体,其中最成功的依赖于分块化、下采样或粗化技术,但往往以丢失最精细尺度的细节为代价。在本工作中,我们采取了一种不同的方法。受 n 体数值模拟中最先进技术的启发,我们将注意力视为网格点之间的相互作用问题。我们引入了多极注意力神经算子(MANO),它以基于距离的多尺度方式计算注意力。MANO 在每个注意力头中保持全局感受野,并相对于网格点数量实现线性的时间和内存复杂度。在图像分类和 Darcy 流上的实验结果表明,MANO 可与 ViT 和 Swin Transformer 等最先进模型相媲美,同时将运行时间和峰值内存使用量降低了数个数量级。我们开源代码以促进可复现性,地址为 https://github.com/AlexColagrande/MANO。

英文摘要:

Transformers have become the de facto standard for a wide range of tasks, from image classification to physics simulations. Despite their impressive performance, the quadratic complexity of standard Transformers in both memory and time with respect to the input length makes them impractical for processing high-resolution inputs. Therefore, several variants have been proposed, the most successful relying on patchification, downsampling, or coarsening techniques, often at the cost of losing the finest-scale details. In this work, we take a different approach. Inspired by state-of-the-art techniques in $n$-body numerical simulations, we cast attention as an interaction problem between grid points. We introduce the Multipole Attention Neural Operator (MANO), which computes attention in a distance-based multiscale fashion. MANO maintains, in each attention head, a global receptive field and achieves linear time and memory complexity with respect to the number of grid points. Empirical results on image classification and Darcy flows demonstrate that MANO rivals state-of-the-art models such as ViT and Swin Transformer, while reducing runtime and peak memory usage by orders of magnitude. We open source our code for reproducibility at https://github.com/AlexColagrande/MANO.

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

↑