arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2406.03072cs.LGcs.ITmath.ITstat.ML
收藏

从局部到全局:Transformer的学习动力学及初始化的影响

Local to Global: Learning Dynamics and Effect of Initialization for Transformers

EPFL(洛桑联邦理工学院);UT Austin(德克萨斯大学奥斯汀分校)

Ashok Vardhan Makkuva, Marco Bondaschi, Chanakya Ekbote, Adway Girish, Alliot Nagle, Hyeji Kim, Michael Gastpar

AI总结:

本文研究单层Transformer学习一阶马尔可夫链的动力学,证明参数收敛至全局或局部最小值取决于初始化与数据属性,并据此提出有效的参数初始化指南。

摘要:

近年来,基于Transformer的模型彻底改变了深度学习,特别是在序列建模方面。为了更好地理解这一现象,人们越来越关注使用马尔可夫输入过程来研究Transformer。然而,我们目前在这方面的理解仍然有限,关于Transformer如何学习马尔可夫链的许多基本问题仍未得到解答。在本文中,我们通过关注一阶马尔可夫链和单层Transformer来解决这一问题,并在此背景下全面刻画了学习动力学。具体而言,我们证明了基于下一词预测损失训练的Transformer参数可以收敛到全局或局部最小值,这取决于初始化和马尔可夫数据属性,并且我们刻画了发生这种情况的精确条件。据我们所知,这是首个强调初始化作用的此类结果。我们进一步证明,我们的理论发现得到了实证证据的支持。基于这些见解,我们提供了Transformer参数初始化的指南,并证明了其有效性。最后,我们概述了该领域中的几个开放性问题。代码可在以下网址获取:https://github.com/Bond1995/Markov。

英文摘要:

In recent years, transformer-based models have revolutionized deep learning, particularly in sequence modeling. To better understand this phenomenon, there is a growing interest in using Markov input processes to study transformers. However, our current understanding in this regard remains limited with many fundamental questions about how transformers learn Markov chains still unanswered. In this paper, we address this by focusing on first-order Markov chains and single-layer transformers, providing a comprehensive characterization of the learning dynamics in this context. Specifically, we prove that transformer parameters trained on next-token prediction loss can either converge to global or local minima, contingent on the initialization and the Markovian data properties, and we characterize the precise conditions under which this occurs. To the best of our knowledge, this is the first result of its kind highlighting the role of initialization. We further demonstrate that our theoretical findings are corroborated by empirical evidence. Based on these insights, we provide guidelines for the initialization of transformer parameters and demonstrate their effectiveness. Finally, we outline several open problems in this arena. Code is available at: https://github.com/Bond1995/Markov.

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

↑