Self-attention vector output similarities reveal how machines pay attention
Tal Halevi, Yarden Tzach, Ronit D. Gross, Shalom Rosner, and Ido Kanter

TL;DR
This paper introduces a method to analyze self-attention in language models, revealing how different attention heads focus on linguistic features and how their focus shifts from long-range to sentence-specific similarities across layers.
Contribution
It provides a quantitative approach to understanding self-attention mechanisms by analyzing vector similarities and head specialization in BERT, offering insights into their linguistic focus.
Findings
Attention heads focus on different linguistic features.
Similarity patterns shift from long-range to sentence-specific.
Heads tend to focus on unique tokens within the text.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsText Readability and Simplification · Topic Modeling · Ferroelectric and Negative Capacitance Devices
