arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.18322cs.LGmath.AP
收藏

深度Transformer动力学的统一视角

A Unified Perspective on the Dynamics of Deep Transformers

CNRS and Ecole Normale Supérieure PSL(CNRS和巴黎高等师范大学);Apple(苹果公司);Mathematical Institute, University of Oxford(牛津大学数学学院)

Valérie Castin, Pierre Ablin, José Antonio Carrillo, Gabriel Peyré

AI总结:

提出Transformer PDE作为注意力层迭代的均场极限,证明其适定性并分析高斯初始数据下的各向异性演化与聚类现象。

摘要:

Transformer在大多数机器学习任务中是最先进的,它将数据表示为称为token的向量序列。然后通过注意力函数利用这种表示,该函数学习token之间的依赖关系,是Transformer成功的关键。然而,跨层迭代应用注意力会导致复杂的动力学,这些动力学尚未被完全理解。为了分析这些动力学,我们将每个输入序列识别为一个概率测度,并将其演化建模为称为Transformer PDE的Vlasov方程,其速度场在概率测度中是非线性的。我们的第一组贡献聚焦于紧支撑初始数据。我们证明Transformer PDE是适定的,并且是相互作用粒子系统的均场极限,从而将先前的分析推广并扩展到自注意力的几种变体:多头注意力、L2注意力、Sinkhorn注意力、Sigmoid注意力和掩码注意力——利用条件Wasserstein框架。在第二组贡献中,我们首次研究非紧支撑初始条件,聚焦于高斯初始数据。再次针对不同类型的注意力,我们证明Transformer PDE保持高斯测度空间,这使我们能够从理论上和数值上分析高斯情况以识别典型行为。这种高斯分析捕捉了通过深度Transformer的数据各向异性演化。特别地,我们强调了与先前在非归一化离散情况下的结果平行的聚类现象。

英文摘要:

Transformers, which are state-of-the-art in most machine learning tasks, represent the data as sequences of vectors called tokens. This representation is then exploited by the attention function, which learns dependencies between tokens and is key to the success of Transformers. However, the iterative application of attention across layers induces complex dynamics that remain to be fully understood. To analyze these dynamics, we identify each input sequence with a probability measure and model its evolution as a Vlasov equation called Transformer PDE, whose velocity field is non-linear in the probability measure. Our first set of contributions focuses on compactly supported initial data. We show the Transformer PDE is well-posed and is the mean-field limit of an interacting particle system, thus generalizing and extending previous analysis to several variants of self-attention: multi-head attention, L2 attention, Sinkhorn attention, Sigmoid attention, and masked attention--leveraging a conditional Wasserstein framework. In a second set of contributions, we are the first to study non-compactly supported initial conditions, by focusing on Gaussian initial data. Again for different types of attention, we show that the Transformer PDE preserves the space of Gaussian measures, which allows us to analyze the Gaussian case theoretically and numerically to identify typical behaviors. This Gaussian analysis captures the evolution of data anisotropy through a deep Transformer. In particular, we highlight a clustering phenomenon that parallels previous results in the non-normalized discrete case.

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

↑