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

无界输入下Transformer的训练动力学:注意力学习可滞后于输出层学习

Training Dynamics of Transformers on Unbounded Inputs: Attention Learning Can Lag Output Layer Learning

Technical University of Munich(慕尼黑工业大学)

Yaomengxi Han, Debarghya Ghoshdastidar

AI总结:

该研究针对无界输入下Transformer的训练动力学,发现注意力学习可滞后于输出层学习,提出三阶段梯度下降训练法,验证其在多类任务中有效。

摘要:

Transformer的成功归因于多个因素,包括其对变长输入表达形式语言的能力,以及注意力机制聚焦相关输入特征的能力。然而,人们对浅层Transformer的训练动力学,尤其是如何解耦注意力与输出(前馈)层的学习,理解有限。前馈网络中单步梯度特征学习理论的自然延伸表明,可通过单步梯度步骤先学习注意力权重,再训练输出层。但我们发现,这一方法在训练用于从无界长度输入识别无星语言的浅层Transformer时失效。我们证明,该Transformer可通过三阶段梯度下降训练以识别该语言:首先更新输出层,接着更新注意力,第三阶段微调输出层。相比之下,仅训练注意力或输出层、或单步注意力层更新后微调输出层,均无法学习该语言。我们通过实验表明,“注意力学习滞后于输出层学习”这一规律,在其他语言识别、回归及上下文学习任务中同样有效。

英文摘要:

The success of transformers is attributed to several factors, including their capacity to express formal languages over variable-length inputs, and ability of the attention mechanism to focus on relevant input features. However, there is limited understanding of the training dynamics of shallow transformers, specifically how to decouple the learning of the attention and the output (feedforward) layer. A natural extension of the theory of one-step gradient feature learning in feedforward networks suggests that one could first learn the attention weights with a single gradient step, and then train the output layer. We show that this fails for a shallow transformer trained to recognize a star-free language from unbounded-length input. We prove that the transformer can be trained to recognize the language with a three-phase gradient descent: the output layer is updated first, followed by an attention update, and the output layer is fine-tuned in the third phase. In contrast, the language cannot be learned by training only the attention or output layer, or by a single attention-layer update followed by finetuning the output layer. We empirically show that ``attention learning lagging output layer learning" is beneficial in other language recognition, regression, and in-context learning tasks as well.

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

↑