arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.24050cs.LGstat.ML
收藏

Transformer训练动态的机制研究

A Mechanistic Study of Transformers Training Dynamics

Ambroise Odonnat, Wassim Bouaziz, Vivien Cabannes

AI总结:

本文通过可控实验研究Transformer训练动态,发现梯度下降可实现聚类头解决稀疏模块加法任务,并揭示训练过程中两阶段学习及归一化层高曲率导致的损失尖峰现象。

摘要:

大规模Transformer预训练是基础模型成功的关键,但模型规模限制了我们对优化机制的理解。本文在可控可解释的环境下研究Transformer训练动态。在稀疏模块加法任务中,我们证明梯度下降可实现专门的注意力电路——聚类头来解决问题。实验显示此类路径自然在训练中出现。通过可视化沙盒监控token演化,我们发现两阶段学习及因归一化层高曲率导致的损失尖峰现象。我们的发现为更实际的设置,如大语言模型预训练中的模式提供了若干见解。

英文摘要:

Large-scale pretraining of transformers has been central to the success of foundation models. However, the scale of those models limits our understanding of the mechanisms at play during optimization. In this work, we study the training dynamics of transformers in a controlled and interpretable setting. On the sparse modular addition task, we demonstrate that specialized attention circuits, called clustering heads, can be implemented during gradient descent to solve the problem. Our experiments show that such pathways naturally emerge during training. By monitoring the evolution of tokens via a visual sandbox, we uncover a two-stage learning and the occurrences of loss spikes due to the high curvature of normalization layers. Our findings provide several insights into patterns observed in more practical settings, such as the pretraining of large language models.

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

↑