Self-attention vector output similarities reveal how machines pay attention
Not on the map. Why?
Abstract (arXiv)
The self-attention mechanism has significantly advanced the field of natural language processing, facilitating the development of advanced language-learning machines. Although its utility is widely acknowledged, the precise mechanisms of self-attention underlying its advanced learning and the quantitative characterization of this learning process remains an open research question. This study introduces a new approach for quantifying information processing within the self-attention mechanism. The analysis conducted on the BERT-12 architecture reveals that, in the final layers, the attention map focuses on sentence separator tokens, suggesting a practical approach to text segmentation based on semantic features. Based on the vector space emerging from the self-attention heads, a context similarity matrix, measuring the scalar product between two token vectors was derived, revealing distinct similarities between different token vector pairs within each head and layer. The findings demonstrated that different attention heads within an attention block focused on different linguistic characteristics, such as identifying token repetitions in a given text or recognizing a token of common appearance in the text and its surrounding context. This specialization is also reflected in the distribution of distances between token vectors with high similarity as the architecture progresses. The initial attention layers exhibit substantially long-range similarities; however, as the layers progress, a more short-range similarity develops, culminating in a preference for attention heads to create strong similarities within the same sentence. Finally, the behavior of individual heads was analyzed by examining the uniqueness of their most common tokens in their high similarity elements. Each head tends to focus on a unique token from the text and builds similarity pairs centered around it.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 24 of its 34 references that are in the map. First posted on arXiv 26 Dec 2025.
Builds on
24 of 34 references.
References · 24
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,346
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2023A Survey on Evaluation of Large Language Modelscited by 1,227
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
- 2019How Can We Know What Language Models Know?cited by 953
- 2019Attention is not Explanationcited by 916
- 2019Revealing the Dark Secrets of BERTcited by 300
12 more
- 2022Matryoshka Representation Learningcited by 268
- 2021Escaping the Big Data Paradigm with Compact Transformerscited by 261
- 2021Between words and characters: A Brief History of Open-Vocabulary Modeling and Tokenization in NLPcited by 130
- 2020Methods for Pruning Deep Neural Networkscited by 49
- 2023Mapping of attention mechanisms to a generalized Potts modelcited by 19
- 2023Towards a universal mechanism for successful deep learningcited by 8
- 2025Unified CNNs and transformers underlying learning mechanism reveals multi-head attention modus vivendicited by 6
- 2023The mechanism underlying successful deep learningcited by 4
- 2025Advanced deep architecture pruning using single filter performancecited by 3
- 2025Tiny language modelscited by 3
- 2025Learning Mechanism Underlying NLP Pre-Training and Fine-Tuningcited by 2
- 2025Translation Entropy: A Statistical Framework for Evaluating Translation Systemscited by 1
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Single-Nodal Spontaneous Symmetry Breaking in NLP Modelscited by 0
- 2026Single-Nodal Spontaneous Symmetry Breaking in NLP Models28 Jan 2026