[论文解读] Why Deep Transformers are Difficult to Converge? From Computation Order to Lipschitz Restricted Parameter Initialization
本文指出,深度Transformer中残差连接与层归一化计算顺序的差异显著影响优化效果,并提出一种Lipschitz约束参数初始化方法,即使在原始计算顺序下,也能使深度Transformer(最多24层)成功收敛,从而克服了以往研究中需修改网络结构或仅关注深度编码器的关键局限性。
The Transformer translation model employs residual connection and layer normalization to ease the optimization difficulties caused by its multi-layer encoder/decoder structure. While several previous works show that even with residual connection and layer normalization, deep Transformers still have difficulty in training, and particularly a Transformer model with more than 12 encoder/decoder layers fails to converge. In this paper, we first empirically demonstrate that a simple modification made in the official implementation which changes the computation order of residual connection and layer normalization can effectively ease the optimization of deep Transformers. In addition, we deeply compare the subtle difference in computation order, and propose a parameter initialization method which simply puts Lipschitz restriction on the initialization of Transformers but can effectively ensure their convergence. We empirically show that with proper parameter initialization, deep Transformers with the original computation order can converge, which is quite in contrast to all previous works, and obtain significant improvements with up to 24 layers. Our proposed approach additionally enables to benefit from deep decoders compared to previous works which focus on deep encoders.
研究动机与目标
- 探究为何深度Transformer(超过12层)尽管有残差连接和层归一化仍无法收敛。
- 分析计算顺序(特别是残差连接与层归一化的顺序)对优化稳定性的影响。
- 开发一种施加Lipschitz约束的参数初始化方法,以稳定深度Transformer的训练过程。
- 通过确保收敛并仅做最小程度的架构修改,实现深度解码器的训练,而此前研究对此关注甚少。
提出的方法
- 通过实验表明,将层归一化计算顺序调整为在残差连接之前,可显著提升深度Transformer的训练稳定性。
- 提出一种新颖的参数初始化方案,通过在模型权重上施加Lipschitz约束来控制梯度流动,改善优化过程。
- 通过约束前馈子层和自注意力子层中权重矩阵的谱范数,构建Lipschitz约束初始化方法。
- 在机器翻译基准上评估所提方法,对比标准初始化在深度编码器和深度解码器上的收敛性与性能表现。
- 通过消融实验隔离计算顺序与初始化的影响,表明正确的初始化可在原始顺序下恢复收敛性。
- 分析梯度动态与损失轨迹,验证Lipschitz约束能稳定深层网络的训练过程。
实验结果
研究问题
- RQ1残差连接与层归一化的计算顺序如何影响深度Transformer的优化?
- RQ2是否可通过Lipschitz约束参数初始化方法,在不改变计算顺序的前提下稳定深度Transformer的训练?
- RQ3所提初始化方法是否能实现深度解码器的收敛,而此前研究对深度解码器的关注远少于深度编码器?
- RQ4在所提方法下,模型深度可提升至多大程度(例如24层),同时保持收敛性与性能?
主要发现
- 将层归一化计算顺序调整为在残差连接之前,可显著提升深度Transformer的训练稳定性。
- 采用所提出的Lipschitz约束初始化方法后,即使使用原始计算顺序,深度Transformer(最多24层)也能成功收敛。
- 该方法实现了有效深度解码器的训练,而此前研究大多未能实现,展现出超越深度编码器的更广泛应用潜力。
- 所提初始化方法在机器翻译基准上取得显著性能提升,优于标准初始化及先前的深度Transformer方法。
- 实证分析表明,Lipschitz约束能稳定梯度流动并降低训练损失方差,尤其在更深的架构中效果更明显。
- 该方法在标准初始化失败的场景下仍能实现收敛,即使模型层数超过12层,成功解决了深度Transformer架构中长期存在的训练难题。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。