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(ViTs)已彻底改变了计算机视觉领域,但其自注意力机制缺乏明确的空间归纳偏置,导致在空间结构化任务上表现欠佳。现有方法基于固定距离度量引入数据无关的空间衰减,无论图像内容如何均采用均匀的注意力加权,限制了其对多样化视觉场景的适应性。受近期大语言模型中内容感知门控机制(如GLA、HGRN2、FOX)显著优于静态方案的启发,我们首次成功将数据依赖的空间衰减适配至二维视觉Transformer。我们提出\textbf{空间衰减Transformer(SDT)},其配备新颖的上下文感知门控(CAG)机制,能够为图像块交互生成动态的、数据依赖的衰减。我们的方法学会基于内容相关性与空间邻近性共同调节空间注意力。通过统一的“空间-内容”融合框架——该框架将基于曼哈顿距离的空间先验与学习得到的内容表征相结合——我们解决了从一维到二维适配的根本性挑战。在ImageNet-1K分类与生成任务上的大量实验表明,相较于强基线模型,我们的方法取得了持续的性能提升。本工作确立了数据依赖的空间衰减作为增强视觉Transformer空间注意力的新范式。

0
下载
关闭预览

相关内容

【ICLR2022】Vision Transformer 模型工作机制的最新理论
专知会员服务
43+阅读 · 2022年2月19日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员