LGAPMLMay 9, 2023

The emergence of clusters in self-attention dynamics

arXiv:2305.05465v6126 citations
Originality Incremental advance
AI Analysis

This provides theoretical justification for the context-awareness of learned representations in Transformers, though it is incremental as it builds on known empirical observations.

The authors analyzed Transformers as interacting particle systems and showed that tokens cluster toward specific limiting objects determined by initial tokens, mathematically confirming the empirical observation of token leaders in Transformers.

Viewing Transformers as interacting particle systems, we describe the geometry of learned representations when the weights are not time dependent. We show that particles, representing tokens, tend to cluster toward particular limiting objects as time tends to infinity. Cluster locations are determined by the initial tokens, confirming context-awareness of representations learned by Transformers. Using techniques from dynamical systems and partial differential equations, we show that the type of limiting object that emerges depends on the spectrum of the value matrix. Additionally, in the one-dimensional case we prove that the self-attention matrix converges to a low-rank Boolean matrix. The combination of these results mathematically confirms the empirical observation made by Vaswani et al. [VSP'17] that leaders appear in a sequence of tokens when processed by Transformers.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes