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

B2T连接:在深度Transformer中兼顾服务稳定性与性能

B2T Connection: Serving Stability and Performance in Deep Transformers

LINE Corporation(LINE公司);Tohoku University(东北大学);Tokyo Institute of Technology(东京工业大学)

Sho Takase, Shun Kiyono, Sosuke Kobayashi, Jun Suzuki

AI总结:

本文针对深度Transformer中Post-LN训练不稳定但性能更优的问题,提出B2T连接方法,通过简单修改Post-LN同时实现高稳定性和有效训练,在文本生成任务上优于Pre-LN。

摘要:

从层归一化(LN)位置的角度来看,Transformer的架构可以分为两种类型:Post-LN和Pre-LN。近期的Transformer倾向于采用Pre-LN,因为在深度Transformer(例如具有十层或更多层的模型)中使用Post-LN时,训练往往不稳定,导致模型无法使用。然而,在相对较浅的Transformer(例如具有六层或更少层的模型)中,Post-LN始终比Pre-LN取得更好的性能。本研究首先从经验和理论上调查了这些不一致观察结果的原因,并得出以下发现:1,Post-LN中的LN是导致训练不稳定的梯度消失问题的主要来源,而Pre-LN可以防止该问题;2,Post-LN在反向传播过程中倾向于在较高层保持更大的梯度范数,这可能有助于有效训练。利用这些新发现,我们提出了一种方法,通过对Post-LN进行简单修改,即可同时提供高稳定性和有效训练。我们在广泛的文本生成任务上进行了实验。实验结果表明,我们的方法优于Pre-LN,并且无论层设置是浅层还是深层,都能实现稳定训练。我们的代码公开在 https://github.com/takase/b2t_connection。

英文摘要:

From the perspective of the layer normalization (LN) positions, the architectures of Transformers can be categorized into two types: Post-LN and Pre-LN. Recent Transformers tend to be Pre-LN because, in Post-LN with deep Transformers (e.g., those with ten or more layers), the training is often unstable, resulting in useless models. However, Post-LN has consistently achieved better performance than Pre-LN in relatively shallow Transformers (e.g., those with six or fewer layers). This study first investigates the reason for these discrepant observations empirically and theoretically and made the following discoveries: 1, the LN in Post-LN is the main source of the vanishing gradient problem that leads to unstable training, whereas Pre-LN prevents it, and 2, Post-LN tends to preserve larger gradient norms in higher layers during the back-propagation, which may lead to effective training. Exploiting the new findings, we propose a method that can provide both high stability and effective training by a simple modification of Post-LN. We conduct experiments on a wide range of text generation tasks. The experimental results demonstrate that our method outperforms Pre-LN, and enables stable training regardless of the shallow or deep layer settings. Our code is publicly available at https://github.com/takase/b2t_connection.

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

↑