揭示视觉Transformer中注意力机制如何传递位置与语义信息
Bi-Orthogonal Factor Decomposition for Vision Transformers
- 提出双正交分解框架,分离令牌的位置与内容因子
- 发现注意力主要依赖内容交互,且DINOv2计算模式更丰富
- 揭示注意力头的分工特性,适合研究模型内部机制者
自注意力是视觉Transformer的核心组件,但对其在标记间传递何种信息仍缺乏系统理解。注意力图仅显示权重集中位置,无法判断查询与键是否交换位置、内容或两者兼有。本文提出双正交因子分解(BFD),分两阶段分析:首先通过ANOVA分解将标记激活分离为正交的位置与内容因子;其次对查询-键交互矩阵QK^T进行SVD,揭示其双正交模式,反映因子间的通信方式。经验证位置与内容因子可有效分离后,应用于主流视觉模型,发现三类现象:(i) 注意力主要通过内容交互实现,内容-内容交互占主导,其次为内容-位置耦合;DINOv2相较监督模型分配更多能量至内容-位置耦合,并在更广谱的模式上分布计算。(ii) 注意力头呈现专业化分工:分为内容-内容、内容-位置和位置-位置操作器,且单个头内奇异模式亦具类似分化。(iii) DINOv2在中间层同时保留位置结构并增强语义内容,从而实现整体形状处理优势。总体而言,BFD揭示了注意力中信息传递的中介因子(位置或语义),为理解视觉Transformer机制提供实用洞见。
原文摘要 · Abstract (English)
Self-attention is the central computational primitive of Vision Transformers, yet we lack a principled understanding of what information attention mechanisms exchange between tokens. Attention maps describe where weight mass concentrates; they do not reveal whether queries and keys trade position, content, or both. We introduce Bi-orthogonal Factor Decomposition (BFD), a two-stage analytical framework: first, an ANOVA-based decomposition statistically disentangles token activations into orthogonal positional and content factors; second, SVD of the query-key interaction matrix QK^T exposes bi-orthogonal modes that reveal how these factors mediate communication. After validating proper isolation of position and content, we apply BFD to state-of-the-art vision models and uncover three phenomena.(i) Attention operates primarily through content. Content-content interactions dominate attention energy, followed by content-position coupling. DINOv2 allocates more energy to content-position than supervised models and distributes computation across a richer mode spectrum. (ii) Attention mechanisms exhibit specialization: heads differentiate into content-content, content-position, and position-position operators, while singular modes within heads show analogous specialization. (iii) DINOv2's superior holistic shape processing emerges from intermediate layers that simultaneously preserve positional structure while contextually enriching semantic content. Overall, BFD exposes how tokens interact through attention and which informational factors - positional or semantic - mediate their communication, yielding practical insights into vision transformer mechanisms.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。