The Origin of Self-Attention: Pairwise Affinity Matrices in Feature Selection and the Emergence of Self-Attention
Not on the map. Why?
Abstract (arXiv)
The self-attention mechanism, now central to deep learning architectures such as Transformers, is a modern instance of a more general computational principle: learning and using pairwise affinity matrices to control how information flows through a model. This paper traces the conceptual origins of self-attention across multiple domains, including computer vision, natural language processing, and graph learning, through their shared reliance on an affinity matrix, denoted as A. We highlight Infinite Feature Selection (Inf-FS) as a foundational approach that generalizes the idea of affinity-based weighting. Unlike the fixed dot-product structure used in Transformers, Inf-FS defines A either through domain knowledge or by learning, and computes feature relevance through multi-hop propagation over the affinity graph. From this perspective, self-attention can be seen as a special case of Inf-FS: it uses a single-hop affinity computation where A is dynamically built from token similarities. We argue that the underlying structure, reasoning over pairwise relationships, is preserved across both approaches, and the key differences lie in how the affinity matrix is defined and applied. By situating self-attention within the broader paradigm of affinity-based computation, we unify several strands of machine learning research and highlight a common mathematical foundation that underpins diverse models and tasks.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 24 of its 50 references that are in the map. First posted on arXiv 19 Jul 2025.
Builds on
24 of 50 references.
References · 24
- 2017Attention Is All You Needcited by 60,361
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2017Graph Attention Networkscited by 8,923
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2017Non-local Neural Networkscited by 2,293
- 2020Rethinking Attention with Performerscited by 1,601
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2018Dual Attention Network for Scene Segmentationcited by 1,003
- 2018CCNet: Criss-Cross Attention for Semantic Segmentationcited by 718
- 2020Hopfield Networks is All You Needcited by 475
- 2018Efficient Attention: Attention with Linear Complexitiescited by 368
- 2017A Deep Reinforced Model for Abstractive Summarizationcited by 365
12 more
- 2017A simple neural network module for relational reasoningcited by 346
- 2017A Structured Self-attentive Sentence Embeddingcited by 318
- 2016A Decomposable Attention Model for Natural Language Inferencecited by 215
- 2016Long Short-Term Memory-Networks for Machine Readingcited by 161
- 2019Concrete Autoencoders for Differentiable Feature Selection and Reconstructioncited by 90
- 2019AFS: An Attention-based mechanism for Supervised Feature Selectioncited by 21
- 2014Attentional Neural Network: Feature Selection Using Cognitive Feedbackcited by 8
- 2017Infinite Latent Feature Selection: A Probabilistic Latent Graph-Based Ranking Approachcited by 6
- 2017Ranking to Learn and Learning to Rank: On the Role of Ranking in Pattern Recognition Applicationscited by 4
- 2016Feature Selection Library (MATLAB Toolbox)cited by 3
- 2024Hard-Attention Gates with Gradient Routing for Endoscopic Image Computingcited by 3
- 2024Exploring Advanced Large Language Models with LLMsuitecited by 3
Built on by
Citing papers per year: 2026: 1.
1 paper.