arXiv:2607.18584cs.LGmath.DS2026-07被引 1

揭示深度线性Transformer在推理时的多样动态行为机制

On the Diverse Dynamical Behaviors Arising in Deep Linear Transformers

论文配图:On the Diverse Dynamical Behaviors Arising in Deep Linear Transformers
图 1 · 摘自论文原文
  • 将注意力层建模为粒子相互作用系统,揭示其低维动力学本质
  • 发现参数可引发聚类、振荡与分岔等丰富长期行为
  • 理论适用于二维,数值实验表明高维仍具相似特性

我们从相互作用粒子系统的视角研究深度线性编码器仅变压器在推理阶段的行为。在此框架下,标记被建模为通过连续线性自注意力层动态交互的粒子。我们证明,在嵌入维度为二时,对任意键、查询和值矩阵,该动力学可重述为具有纯二次谐波耦合的广义库拉莫托型模型。这一形式适用于Watanabe-Strogatz理论,揭示了无论参数矩阵如何,动力学本质上是低维的。对于与Ott-Antonsen(OA)流形相关的某一类标记初始化,我们发现参数矩阵会诱导出线性变压器中多样的长期行为,包括聚类、振荡和分岔。振荡与分岔通过揭示动力学中隐藏的哈密顿结构得以刻画。通过建立结构稳定性结果,我们进一步表明,初始位置靠近OA流形的动力学展现出与精确位于流形上的动力学相同的长期行为。受二维理论的启发,我们在更高维度的类似参数设置下进行了数值实验。数值结果表明,理论所刻画的长期行为在高维情形中依然存在。

原文摘要 · Abstract (English)

We study the inference-time behavior of deep linear encoder-only transformers through the lens of interacting particle systems. In this perspective, tokens are modeled as particles that interact dynamically through successive linear self-attention layers. We show that in embedding dimension two, for any key, query, and value matrices, the dynamics can be reformulated as a generalized Kuramoto-type model with pure second-harmonic coupling. This formulation is amenable to Watanabe--Strogatz theory which reveals the dynamics are intrinsically low-dimensional regardless of the parameter matrices. For a class of token initializations associated with the Ott--Antonsen (OA) manifold, we show that the parameter matrices induce a diverse variety of long-time behaviors in linear transformers, including clustering, oscillations, and bifurcations. The oscillations and bifurcations are characterized by uncovering a hidden Hamiltonian structure in the dynamics. By establishing a structural stability result, we further show that dynamics initialized near the OA manifold exhibit the same long-time behavior as those initialized exactly on the manifold. Motivated by our theory in dimension two, we conduct numerical experiments for analogous parameter regimes in higher-dimensional transformers. Our numerical experiments suggest that the long-time behaviors characterized in our theoretical results persist in higher dimensions.

Transformer动力系统线性模型动态行为

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