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

自注意力与无限:迈向线性变换器的无限自注意力

Self-Attention And Beyond the Infinite: Towards Linear Transformers with Infinite Self-Attention

Equixly API Security, Italy(Equixly API安全公司,意大利);Toyota Motor Europe, Belgium(丰田汽车欧洲公司,比利时);MindVisionLabs, UK(MindVisionLabs,英国);Institute of Cognitive Neuroscience, University College London, UK(伦敦大学学院认知神经科学研究所,英国);GlimpseML, UK(GlimpseML,英国)

Giorgio Roffo, Hazem Abdelkawy, Nilli Lavie, Luke Palmer

AI总结:

本文提出无限自注意力(InfSA)和线性-InfSA,通过谱重构将自注意力层视为内容自适应标记图的扩散步骤,实现线性时间复杂度的高效自注意力机制,在图像识别任务中取得显著性能提升。

摘要:

softmax注意力的二次成本限制了Transformer在高分辨率视觉中的可扩展性。我们引入无限自注意力(InfSA),一种谱重构方法,将每个注意力层视为内容自适应标记图上的扩散步骤,通过折扣的Neumann级数累积多跳交互。这将自注意力与经典图中心性(Katz、PageRank、特征向量中心性)联系起来,用于可解释的标记加权。我们还展示了Neumann核等于吸收马尔可夫链的基本矩阵,因此一个标记的中心性是其在吸收前的随机游走访问次数的期望。我们随后提出了线性-InfSA,一种线性时间变体,通过近似隐式注意力操作符的主特征向量而不形成完整的注意力矩阵。它保持一个固定大小的辅助状态,比例于每个头的维度dh(与序列长度N无关),与Vision Transformers兼容,并在4096x4096上稳定训练,在9216x9216上推理(约332k标记)。在4层ViT(53.5M参数,224x224上59 GFLOPs)中,Linear-InfSA在ImageNet-1K上达到84.7%的top-1准确率,比同等深度的softmax ViT提升3.2个百分点。在ImageNet-V2上,InfViT变体优于所有比较基线(最高79.8% vs 76.8%),表明在分布偏移下的鲁棒性。在A100 40GB GPU上,Linear-InfViT运行速度为231张/秒,能耗为0.87 J/张(比同等深度ViT快13倍),是唯一完成9216x9216推理而不出内存的模型。线性近似与二次操作符的主导特征向量高度匹配(余弦0.985)。

英文摘要:

The quadratic cost of softmax attention limits Transformer scalability in high-resolution vision. We introduce Infinite Self-Attention (InfSA), a spectral reformulation that treats each attention layer as a diffusion step on a content-adaptive token graph, accumulating multi-hop interactions through a discounted Neumann series over attention matrices. This links self-attention to classical graph centrality (Katz, PageRank, eigenvector centrality) for interpretable token weighting. We also show the Neumann kernel equals the fundamental matrix of an absorbing Markov chain, so a token's centrality is its expected number of random-walk visits before absorption. We then propose Linear-InfSA, a linear-time variant that approximates the principal eigenvector of the implicit attention operator without forming the full attention matrix. It keeps an auxiliary state of fixed size proportional to per-head dimension dh (independent of sequence length N), is drop-in compatible with Vision Transformers, and supports stable training at 4096 by 4096 and inference at 9216 by 9216 (about 332k tokens). In a 4-layer ViT (53.5M parameters, 59 GFLOPs at 224 by 224), Linear-InfSA reaches 84.7% top-1 on ImageNet-1K, a +3.2 point architectural gain over an equal-depth softmax ViT trained with the same recipe. On ImageNet-V2, InfViT variants outperform all compared baselines (up to 79.8% vs 76.8%), indicating robustness under distribution shift. On an A100 40GB GPU, Linear-InfViT runs at 231 images/s and 0.87 J/image (13x better throughput and energy than equal-depth ViT) and is the only tested model to complete 9216 by 9216 inference without out-of-memory. The linear approximation closely matches the dominant eigenvector of the quadratic operator (cosine 0.985).

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

↑