mlsanityData to 14 Oct 2026

Dissecting Query-Key Interaction in Vision Transformers

arXiv 2405.14880 ↗First posted 4 Apr 2024cs.CV cs.AIcited by 12

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

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  3. 2014ImageNet Large Scale Visual Recognition Challengecited by 8,498
  4. 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,974
  5. 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,968
  6. 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
  7. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  8. 2021SimMIM: A Simple Framework for Masked Image Modelingcited by 1,153
  9. 2023Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecturecited by 1,039
  10. 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 784
  11. 2022Mind the Gap: Understanding the Modality Gap in Multi-modal Contrastive Representation Learningcited by 561
  12. 2021Deep ViT Features as Dense Visual Descriptorscited by 330
13 more
  1. 2021When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentationscited by 260
  2. 2021Localizing Objects with Self-Supervised Transformers and no Labelscited by 230
  3. 2022Self-Supervised Transformers for Unsupervised Object Discovery using Normalized Cutcited by 167
  4. 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 149
  5. 2022Analyzing Transformers in Embedding Spacecited by 132
  6. 2022Revealing the Dark Secrets of Masked Image Modelingcited by 117
  7. 2022What do Vision Transformers Learn? A Visual Explorationcited by 76
  8. 2021IsoScore: Measuring the Uniformity of Embedding Space Utilizationcited by 53
  9. 2023AttentionViz: A Global View of Transformer Attentioncited by 50
  10. 2023Self-attention in Vision Transformers Performs Perceptual Grouping, Not Attentioncited by 16
  11. 2020Do Saliency Models Detect Odd-One-Out Targets? New Datasets and Evaluationscited by 10
  12. 2023Affinity-based Attention in Self-supervised Transformers Predicts Dynamics of Object Grouping in Humanscited by 5
  13. 2023Is Anisotropy Inherent to Transformers?cited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 1; 2026: 10.

12 papers.