arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.18870cs.LGmath.APmath.FA
收藏

多头变压器架构作为时间依赖的Wasserstein梯度流

Multi-Headed Transformer Architectures as Time-dependent Wasserstein Gradient Flows

Department of Applied Mathematics and Theoretical Physics, University of Cambridge(应用数学与理论物理系,剑桥大学);Department of Mathematics, University of Twente(数学系,埃因霍温理工大学)

Alex Massucco, Leonardo Del Grande, Marcello Carioni, Christoph Brune, Carola-Bibiane Schönlieb

AI总结:

本文提出将多头变压器架构中的数据流建模为时间依赖的Wasserstein梯度流,以捕捉注意力机制的设计,并证明了在合适积分性假设下,梯度流的ω-极限集元素是交互能量的稳态点,同时分析了梯度流的稳定性,并通过数值实验验证了预测的能量耗散身份和动力学的渐近行为。

摘要:

近年来,变压器架构已彻底改变了语言处理领域,开辟了前所未有的可能性。然而,从理论角度来看,文献中提出的数学模型往往缺乏与实际架构的直接联系,并依赖于强简化的假设。在本文中,我们通过将多头变压器架构中的数据流建模为时间依赖的梯度流,以捕捉注意力机制的设计,从而缩小这一差距。显式的时间依赖性使我们能够为每个头和每个层分配不同的权重,而无需对初始化方法施加限制。此外,我们证明,在合适积分性假设下,每个梯度流的ω-极限集元素都是交互能量在极限权重分布下的稳态点。最后,我们分析了梯度流的稳定性,考虑了初始数据和权重的扰动。一方面,我们研究了所提出模型对噪声输入的鲁棒性,建立了梯度流对初始数据的连续依赖性和流的唯一性。另一方面,我们证明了扰动的交互能量对未扰动能量的Γ收敛性,导致相应的梯度流收敛。我们通过数值实验补充了这些理论结果,验证了预测的能量耗散身份,并澄清了动力学在自主型(Ornstein-Uhlenbeck)和真正非自主型(振荡权重)两种情况下的渐近行为。

英文摘要:

In recent years, transformer architectures have revolutionized the field of language processing, opening the door to previously unforeseen possibilities. However, from a theoretical point of view, the mathematical models proposed in the literature often lack direct contact with the actual architectures and depend on strong simplifying assumptions. In this paper, we reduce this gap by modelling the data flow in multi-headed transformer architectures as time-dependent gradient flows for a suitable interaction energy capturing the design of the attention mechanism. The explicit dependence on time allows us to consider different weights for each head and for each layer, without imposing constraints on the initialization method. Moreover, we prove that, under a suitable integrability assumption on the evolution of the weights, each element of the $ω$-limit set of the gradient flows is a stationary point of the interaction energy at a limiting weight distribution. Finally, we analyse the stability of the gradient flows considering perturbations of both the initial data and the weights. Specifically, on the one hand, we study the robustness of the proposed models with respect to noisy inputs, establishing a continuous dependence of the gradient flows on the initial data and uniqueness of the flows. On the other hand, we prove the $Γ$-convergence of the perturbed interaction energy to the unperturbed one, leading to the convergence of the corresponding gradient flows. We complement these theoretical results with numerical experiments that confirm the predicted energy-dissipation identity and clarify the asymptotic behavior of the dynamics in both the autonomous-like (Ornstein--Uhlenbeck) and the genuinely non-autonomous (oscillating-weights) regimes.

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

↑