arXiv:2512.03058cs.LG2025-12NeurIPS被引 2

分析注意力中令牌的动态行为,提出改进Transformer架构的新方法。

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

  • 通过连续时间模型分析令牌间的动态演化规律
  • 发现绝对与旋转位置编码会引发令牌收敛或发散现象
  • 提出简单改进方案,缓解性能下降问题,适合模型优化研究者

本文研究预训练Transformer模型中令牌的动力学特性,并探索其对提升Transformer模型的潜力。我们分析了预训练模型在连续时间极限下的动力系统,刻画了解的渐近行为。具体而言,根据模型参数,刻画了令牌随时间趋于靠近或远离的条件,并提供了充分条件,用于判断令牌是否收敛至零或发散至无穷。相比以往工作,本条件更具普适性,更适用于真实模型。此外,我们考察了不同位置编码形式(绝对编码与旋转编码)对这些动力学行为的影响。实证结果表明,收敛情形会严重损害模型性能。基于此,我们提出了针对使用绝对或旋转位置编码模型的简单架构改进方法,有效缓解收敛问题。这些发现为改进Transformer提供了理论基础和设计原则。

原文摘要 · Abstract (English)

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.

Transformer注意力机制动态系统位置编码

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。