Dynamic Model of Attention in Transformers
V. B. Gisin
Financial University
Key points
From the paper's conclusion- The article examines the dynamic of attention using a continuous model.
Abstract
The attention mechanism is a key component of modern artificial neural networks designed to process data of various nature. The article examines the dynamic of attention using a continuous model. In this model, attention is described as the movement of interacting tokens. It is shown that, under suitable assumptions, attention is Lipschitz continuous. In particular, Lipschitz continuity may be ensured by token normalization. The dynamics of transformers is modelled by a system of differential equations. Lipschitz continuity guarantees that there exists a solution to this system. T he purpose of the study is to investigate the behavior of tokens that make up promt under an unlimited increasing in the number of transformer layers. For one-dimensional tokens, a qualitative description of the trajectories of tokens and the dynamics of the attention matrix is given. It is shown that if a token goes beyond a fairly narrow corridor at some point (the width is on the order of the logarithm of the promt size), this token tends to infinity (positive or negative, depending on which border the exit occurred). The research methodology is based on continuous parameterization of the attention matrix. The common representation of transformer dynamics by difference equations has been replaced by a representation using systems of ordinary differential equations. A huge number of publications are devoted to the description and study of transformers, but most of them do not contain accurate mathematical descriptions of architecture. T his article attempts to give a mathematically meaningful and at the same time fairly simple description of attention. The description dynamics of 1-d tokens is certainly much simpler than the dynamics of multidimensional tokens. Nevertheless, this description gives an idea of the behavior of transformers in a more general situation creates a framework for future investigation.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Asymptotic Analysis of Discrete-Time Self-Attention Dynamics in TransformersarXiv · 2026
- A Geometric Theory for Nonequilibrium Transformer DynamicsarXiv · 2026
- SympFormer: Inertial Attention Blocks from Damped Hamiltonian Dynamics on Spaces of Probability MeasuresarXiv · 2026
- Stability of Measure-to-Measure Transformers on Sub-Gaussian DataarXiv · 2026
- Continuum AttentionarXiv · 2026
- Asymptotic Behavior of TransformersarXiv · 2026