Dissecting Query-Key Interaction in Vision Transformers Xu Pan 1,2 Aaron Philip 3 Odelia Schwartz

Neural Information Processing Systems 

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.