arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.09523cs.LGcs.AIcs.ITmath.IT
收藏

通过连续动力学理解 Transformer 架构:偏微分方程视角

Understanding Transformer Architecture through Continuous Dynamics: A Partial Differential Equation Perspective

The Chinese University of Hong Kong(香港中文大学);Fudan University(复旦大学)

Yukun Zhang, Xueqing Zhou

AI总结:

本文提出主 PDE 连续动力学框架,将 Transformer 组件映射为数学算子,并通过对比实验论证残差连接与层归一化是必要稳定机制。

摘要:

Transformer 架构已经彻底改变了人工智能,但对其内部机制仍缺乏有原则的理论理解。本文提出一个新的分析框架,将 Transformer 的离散分层结构重新概念化为一个由主偏微分方程(PDE)支配的连续时空动力学系统。在这一范式中,我们把核心架构组件映射为不同的数学算子:自注意力对应非局部相互作用,前馈网络对应局部反应,而关键在于,残差连接和层归一化对应不可或缺的稳定机制。我们并非提出新模型,而是将该 PDE 系统用作理论探针,以分析这些组件在数学上的必要性。通过将标准 Transformer 与缺少显式稳定器的 PDE 模拟器进行比较,我们的实验为核心论点提供了有力的经验证据。我们证明,没有残差连接时,系统会遭受灾难性的表征漂移;而缺少层归一化则会导致不稳定、爆炸性的训练动力学。研究结果表明,这些看似启发式的“技巧”实际上是基本的数学稳定器,用于驯服一个原本强大但本质不稳定的连续系统。本工作为 Transformer 的设计提供了第一性原理解释,并建立了通过连续动力学视角分析深度神经网络的新范式。

英文摘要:

The Transformer architecture has revolutionized artificial intelligence, yet a principled theoretical understanding of its internal mechanisms remains elusive. This paper introduces a novel analytical framework that reconceptualizes the Transformer's discrete, layered structure as a continuous spatiotemporal dynamical system governed by a master Partial Differential Equation (PDE). Within this paradigm, we map core architectural components to distinct mathematical operators: self-attention as a non-local interaction, the feed-forward network as a local reaction, and, critically, residual connections and layer normalization as indispensable stabilization mechanisms. We do not propose a new model, but rather employ the PDE system as a theoretical probe to analyze the mathematical necessity of these components. By comparing a standard Transformer with a PDE simulator that lacks explicit stabilizers, our experiments provide compelling empirical evidence for our central thesis. We demonstrate that without residual connections, the system suffers from catastrophic representational drift, while the absence of layer normalization leads to unstable, explosive training dynamics. Our findings reveal that these seemingly heuristic "tricks" are, in fact, fundamental mathematical stabilizers required to tame an otherwise powerful but inherently unstable continuous system. This work offers a first-principles explanation for the Transformer's design and establishes a new paradigm for analyzing deep neural networks through the lens of continuous dynamics.

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

↑