Dynamical Properties of Tokens in Self-Attention and Effects of Positional Encoding

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Pham, Duy-Tung, Nguyen, An The, Tran, Viet-Hoang, Chung, Nhan-Phu, Tong, Xin T., Nguyen, Tan M., Vo, Thieu N.
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917120901644288
author Pham, Duy-Tung
Nguyen, An The
Tran, Viet-Hoang
Chung, Nhan-Phu
Tong, Xin T.
Nguyen, Tan M.
Vo, Thieu N.
author_facet Pham, Duy-Tung
Nguyen, An The
Tran, Viet-Hoang
Chung, Nhan-Phu
Tong, Xin T.
Nguyen, Tan M.
Vo, Thieu N.
contents This paper investigates the dynamical properties of tokens in pre-trained Transformer models and explores their application to improving Transformers. To this end, we analyze the dynamical system governing the continuous-time limit of the pre-trained model and characterize the asymptotic behavior of its solutions. Specifically, we characterize when tokens move closer to or farther from one another over time, depending on the model parameters. We provide sufficient conditions, based on these parameters, to identify scenarios where tokens either converge to zero or diverge to infinity. Unlike prior works, our conditions are broader in scope and more applicable to real-world models. Furthermore, we investigate how different forms of positional encoding -- specifically absolute and rotary -- affect these dynamical regimes. Empirical evidence reveals that the convergence scenario adversely impacts model performance. Motivated by these insights, we propose simple refinements to Transformer architectures that mitigate convergence behavior in models with absolute or rotary positional encoding. These findings support theoretical foundations and design principles for improving Transformer models.
format Preprint
id arxiv_https___arxiv_org_abs_2512_03058
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Dynamical Properties of Tokens in Self-Attention and Effects of Positional Encoding
Pham, Duy-Tung
Nguyen, An The
Tran, Viet-Hoang
Chung, Nhan-Phu
Tong, Xin T.
Nguyen, Tan M.
Vo, Thieu N.
Machine Learning
This paper investigates the dynamical properties of tokens in pre-trained Transformer models and explores their application to improving Transformers. To this end, we analyze the dynamical system governing the continuous-time limit of the pre-trained model and characterize the asymptotic behavior of its solutions. Specifically, we characterize when tokens move closer to or farther from one another over time, depending on the model parameters. We provide sufficient conditions, based on these parameters, to identify scenarios where tokens either converge to zero or diverge to infinity. Unlike prior works, our conditions are broader in scope and more applicable to real-world models. Furthermore, we investigate how different forms of positional encoding -- specifically absolute and rotary -- affect these dynamical regimes. Empirical evidence reveals that the convergence scenario adversely impacts model performance. Motivated by these insights, we propose simple refinements to Transformer architectures that mitigate convergence behavior in models with absolute or rotary positional encoding. These findings support theoretical foundations and design principles for improving Transformer models.
title Dynamical Properties of Tokens in Self-Attention and Effects of Positional Encoding
topic Machine Learning
url https://arxiv.org/abs/2512.03058