arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.03058cs.LG
收藏

自注意力机制中令牌的动力学特性及位置编码的影响

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

FPT Software AI Center(FPT软件AI中心);National University of Singapore(国立新加坡大学);Ho Chi Minh University of Economics(胡志明经济大学)

Duy-Tung Pham, An The Nguyen, Viet-Hoang Tran, Nhan-Phu Chung, Xin T. Tong, Tan M. Nguyen, Thieu N. Vo

AI总结:

本文研究了Transformer中令牌的动力学特性,揭示了位置编码对模型性能的影响,并提出了改进方法以缓解收敛问题。

摘要:

本文研究了预训练Transformer模型中令牌的动力学特性,并探讨其在改进Transformer中的应用。为此,我们分析了预训练模型连续时间极限下的动力学系统,并刻画其解的渐近行为。具体来说,我们刻画了在不同模型参数下,令牌随时间相互靠近或远离的情况。我们基于这些参数提供了充分条件,以确定令牌收敛到零或发散到无穷大的场景。与以往工作不同,我们的条件范围更广,更适用于实际模型。此外,我们研究了不同形式的位置编码——特别是绝对和旋转——如何影响这些动力学模式。实证证据表明,收敛场景会损害模型性能。受这些见解启发,我们提出了简单的Transformer架构改进方法,以减轻使用绝对或旋转位置编码的模型中的收敛行为。这些发现支持了改进Transformer模型的理论基础和设计原则。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑