Dissecting Query-Key Interaction in Vision Transformers
Not on the map. Why?
Abstract (arXiv)
Self-attention in vision transformers is often thought to perform perceptual grouping where tokens attend to other tokens with similar embeddings, which could correspond to semantically similar features of an object. However, attending to dissimilar tokens can be beneficial by providing contextual information. We propose to analyze the query-key interaction by the singular value decomposition of the interaction matrix (i.e. Wq^topWk). We find that in many ViTs, especially those with classification training objectives, early layers attend more to similar tokens, while late layers show increased attention to dissimilar tokens, providing evidence corresponding to perceptual grouping and contextualization, respectively. Many of these interactions between features represented by singular vectors are interpretable and semantic, such as attention between relevant objects, between parts of an object, or between the foreground and background. This offers a novel perspective on interpreting the attention mechanism, which contributes to understanding how transformer models utilize context and salient features when processing images.
Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Builds on 25 of its 46 references that are in the map. First posted on arXiv 4 Apr 2024.
Builds on
25 of 46 references.
References · 25
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,498
- 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,974
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,968
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2021SimMIM: A Simple Framework for Masked Image Modelingcited by 1,153
- 2023Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecturecited by 1,039
- 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 784
- 2022Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learningcited by 561
- 2021Deep ViT Features as Dense Visual Descriptorscited by 330
13 more
- 2021When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentationscited by 260
- 2021Localizing Objects with Self-Supervised Transformers and no Labelscited by 230
- 2022Self-Supervised Transformers for Unsupervised Object Discovery using Normalized Cutcited by 167
- 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 149
- 2022Analyzing Transformers in Embedding Spacecited by 132
- 2022Revealing the Dark Secrets of Masked Image Modelingcited by 117
- 2022What do Vision Transformers Learn? A Visual Explorationcited by 76
- 2021IsoScore: Measuring the Uniformity of Embedding Space Utilizationcited by 53
- 2023AttentionViz: A Global View of Transformer Attentioncited by 50
- 2023Self-attention in Vision Transformers Performs Perceptual Grouping, Not Attentioncited by 16
- 2020Do Saliency Models Detect Odd-One-Out Targets? New Datasets and Evaluationscited by 10
- 2023Affinity-based Attention in Self-supervised Transformers Predicts Dynamics of Object Grouping in Humanscited by 5
- 2023Is Anisotropy Inherent to Transformers?cited by 5
Built on by
Citing papers per year: 2024: 1; 2025: 1; 2026: 10.
12 papers.
- 2024Towards Interpreting Visual Information Processing in Vision-Language Modelscited by 122
- 2026Bi-Orthogonal Factor Decomposition for Vision Transformerscited by 5
- 2026Decomposing Query-Key Feature Interactions Using Contrastive Covariancescited by 3
- 2026Causal Attribution via Activation Patchingcited by 2
- 2026Mechanism-Driven Monitors for Preemptive Detection of LLM Training Instabilitycited by 2
- 2026Singular Vectors of Attention Heads Align with Featurescited by 1
- 2026Diffusion-CAM: Faithful Visual Explanations for dMLLMscited by 1
- 2026Intrinsic Interaction Geometry Controls the Low-Rank Complexity of Softmax Attentioncited by 1
- 2025A Unified Geometric Space for Topological Alignment Between Transformer-Based Models and Human Brain Networkscited by 0
- 2026Enhancing Continual Learning of Vision-Language Models via Dynamic Prefix Weightingcited by 0
- 2026Prescriptive SVD-Inspired Attention via Spectral Energy Retentioncited by 0
- 2026Query Expansion and Key Specialization in Transformer Attention Geometrycited by 0
- 2026Query Expansion and Key Specialization in Transformer Attention Geometry28 Sep 2026
- 2026Prescriptive SVD-Inspired Attention via Spectral Energy Retention21 Sep 2026
- 2026Intrinsic Interaction Geometry Controls the Low-Rank Complexity of Softmax Attention28 Aug 2026
- 2026Mechanism-Driven Monitors for Preemptive Detection of LLM Training Instability26 Jun 2026
- 2026Enhancing Continual Learning of Vision-Language Models via Dynamic Prefix Weighting20 Apr 2026
- 2026Diffusion-CAM: Faithful Visual Explanations for dMLLMs13 Apr 2026
- 2026Causal Attribution via Activation Patching13 Mar 2026
- 2026Singular Vectors of Attention Heads Align with Features13 Feb 2026
- 2026Decomposing Query-Key Feature Interactions Using Contrastive Covariances4 Feb 2026
- 2026Bi-Orthogonal Factor Decomposition for Vision Transformers8 Jan 2026
- 2025A Unified Geometric Space for Topological Alignment Between Transformer-Based Models and Human Brain Networks28 Oct 2025
- 2024Towards Interpreting Visual Information Processing in Vision-Language Models9 Oct 2024