arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.07247cond-mat.dis-nncs.LG
收藏

自注意力神经网络的动力学平均场理论

Dynamical Mean-Field Theory of Self-Attention Neural Networks

BCAM – Basque Center for Applied Mathematics(巴斯克应用数学中心);University of Zaragoza(萨拉戈萨大学);IKERBASQUE, Basque Foundation for Science(巴斯克科学基金会(IKERBASQUE))

Ángel Poc-López, Miguel Aguilera

AI总结:

本文利用非对称 Hopfield 网络的路径积分平均场方法分析 1-bit 自注意力网络动力学,揭示 softmax 耦合下的非平衡相变与混沌分岔。

摘要:

基于 Transformer 的模型已在多个不同领域展现出卓越性能,成为解决序列机器学习问题的最先进方案。尽管我们对 Transformer 架构中的基本组件已有总体理解,但对于它们如何运行以及其预期动力学仍知之甚少。近来,人们越来越关注探索注意力机制与 Hopfield 网络之间的关系,这有望阐明 Transformer 网络的统计物理。然而,迄今为止,类 Transformer 模型的动力学区间尚未得到深入研究。本文中,我们通过使用研究非平衡区间中非对称 Hopfield 网络的方法来填补这一空白——即对生成泛函采用路径积分方法,从而得到由并发平均场变量支配的动力学。在假设 1-bit token 和权重的条件下,我们推导了与 softmax 输出耦合的大型自注意力神经网络行为的解析近似,这些近似在大尺寸极限下变为精确。结果揭示了非平凡动力学现象,包括与混沌分岔相关的非平衡相变,即使在仅有少量编码特征和极短上下文窗口的非常简单配置中也是如此。最后,我们讨论了该解析方法在增进对 Transformer 模型内部工作机制理解方面的潜力,其可能降低计算训练成本并增强模型可解释性。

英文摘要:

Transformer-based models have demonstrated exceptional performance across diverse domains, becoming the state-of-the-art solution for addressing sequential machine learning problems. Even though we have a general understanding of the fundamental components in the transformer architecture, little is known about how they operate or what are their expected dynamics. Recently, there has been an increasing interest in exploring the relationship between attention mechanisms and Hopfield networks, promising to shed light on the statistical physics of transformer networks. However, to date, the dynamical regimes of transformer-like models have not been studied in depth. In this paper, we address this gap by using methods for the study of asymmetric Hopfield networks in nonequilibrium regimes --namely path integral methods over generating functionals, yielding dynamics governed by concurrent mean-field variables. Assuming 1-bit tokens and weights, we derive analytical approximations for the behavior of large self-attention neural networks coupled to a softmax output, which become exact in the large limit size. Our findings reveal nontrivial dynamical phenomena, including nonequilibrium phase transitions associated with chaotic bifurcations, even for very simple configurations with a few encoded features and a very short context window. Finally, we discuss the potential of our analytic approach to improve our understanding of the inner workings of transformer models, potentially reducing computational training costs and enhancing model interpretability.

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

↑