The underlying structures of self-attention: symmetry, directionality, and emergent dynamics in Transformer training

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Saponati, Matteo, Sager, Pascal, Aceituno, Pau Vilimelis, Stadelmann, Thilo, Grewe, Benjamin
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912410405699584
author Saponati, Matteo
Sager, Pascal
Aceituno, Pau Vilimelis
Stadelmann, Thilo
Grewe, Benjamin
author_facet Saponati, Matteo
Sager, Pascal
Aceituno, Pau Vilimelis
Stadelmann, Thilo
Grewe, Benjamin
contents Self-attention is essential to Transformer architectures, yet how information is embedded in the self-attention matrices and how different objective functions impact this process remains unclear. We present a mathematical framework to analyze self-attention matrices by deriving the structures governing their weight updates. Using this framework, we demonstrate that bidirectional training induces symmetry in the weight matrices, while autoregressive training results in directionality and column dominance. Our theoretical findings are validated across multiple Transformer models - including ModernBERT, GPT, LLaMA3, and Mistral - and input modalities like text, vision, and audio. Finally, we apply these insights by showing that symmetric initialization improves the performance of encoder-only models on language tasks. This mathematical analysis offers a novel theoretical perspective on how information is embedded through self-attention, thereby improving the interpretability of Transformer models.
format Preprint
id arxiv_https___arxiv_org_abs_2502_10927
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle The underlying structures of self-attention: symmetry, directionality, and emergent dynamics in Transformer training
Saponati, Matteo
Sager, Pascal
Aceituno, Pau Vilimelis
Stadelmann, Thilo
Grewe, Benjamin
Machine Learning
Self-attention is essential to Transformer architectures, yet how information is embedded in the self-attention matrices and how different objective functions impact this process remains unclear. We present a mathematical framework to analyze self-attention matrices by deriving the structures governing their weight updates. Using this framework, we demonstrate that bidirectional training induces symmetry in the weight matrices, while autoregressive training results in directionality and column dominance. Our theoretical findings are validated across multiple Transformer models - including ModernBERT, GPT, LLaMA3, and Mistral - and input modalities like text, vision, and audio. Finally, we apply these insights by showing that symmetric initialization improves the performance of encoder-only models on language tasks. This mathematical analysis offers a novel theoretical perspective on how information is embedded through self-attention, thereby improving the interpretability of Transformer models.
title The underlying structures of self-attention: symmetry, directionality, and emergent dynamics in Transformer training
topic Machine Learning
url https://arxiv.org/abs/2502.10927