arXiv:2508.09525cs.CV2025-08AAAI被引 2

让视觉Transformer学会根据内容动态调整注意力范围。

Learning Spatial Decay for Vision Transformers

论文配图:Learning Spatial Decay for Vision Transformers
图 1 · 摘自论文原文
  • 引入上下文感知门控机制,让注意力随图像内容动态变化。
  • 在ImageNet-1K上分类与生成任务均超越强基线模型。
  • 适合关注视觉注意力机制改进的研究者和工程师。

视觉变压器(ViTs)革新了计算机视觉,但其自注意力机制缺乏显式的空间归纳偏置,导致在结构化空间任务中表现不佳。现有方法采用基于固定距离度量的数据无关空间衰减,对所有图像统一加权,难以适应多样视觉场景。受大语言模型中内容感知门控机制(如GLA、HGRN2、FOX)的启发,我们首次成功将数据依赖的空间衰减应用于二维视觉变压器。提出新型上下文感知门控(CAG)机制,生成动态、数据相关的衰减以调节块间交互。通过统一的空间-内容融合框架解决从一维到二维的适配难题,结合曼哈顿距离的空间先验与学习到的内容表示。在ImageNet-1K分类与生成任务上的大量实验表明,本方法持续优于强基线。研究确立了数据依赖空间衰减作为提升视觉变压器空间注意力的新范式。

原文摘要 · Abstract (English)

Vision Transformers (ViTs) have revolutionized computer vision, yet their self-attention mechanism lacks explicit spatial inductive biases, leading to suboptimal performance on spatially-structured tasks. Existing approaches introduce data-independent spatial decay based on fixed distance metrics, applying uniform attention weighting regardless of image content and limiting adaptability to diverse visual scenarios. Inspired by recent advances in large language models where content-aware gating mechanisms (e.g., GLA, HGRN2, FOX) significantly outperform static alternatives, we present the first successful adaptation of data-dependent spatial decay to 2D vision transformers. We introduce \textbf{Spatial Decay Transformer (SDT)}, featuring a novel Context-Aware Gating (CAG) mechanism that generates dynamic, data-dependent decay for patch interactions. Our approach learns to modulate spatial attention based on both content relevance and spatial proximity. We address the fundamental challenge of 1D-to-2D adaptation through a unified spatial-content fusion framework that integrates manhattan distance-based spatial priors with learned content representations. Extensive experiments on ImageNet-1K classification and generation tasks demonstrate consistent improvements over strong baselines. Our work establishes data-dependent spatial decay as a new paradigm for enhancing spatial attention in vision transformers.

视觉Transformer注意力机制空间衰减深度学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。