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

Duy-Tung Pham, An The Nguyen, Viet-Hoang Tran, Nhan-Phu Chung, Xin T. Tong +2 more
11/25/2025
cs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pham2025dynamical,
  title  = {Dynamical Properties of Tokens in Self-Attention and Effects of Positional Encoding},
  author = {Duy-Tung Pham and An The Nguyen and Viet-Hoang Tran and Nhan-Phu Chung and Xin T. Tong and Tan M. Nguyen and Thieu N. Vo},
  year   = {2025},
  eprint = {2512.03058},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.03058v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.03058.svg)](https://codeofpaper.com/paper/2512.03058)

Discussion