[论文解读] Rethinking Skip Connection with Layer Normalization in Transformers and ResNets
本文提出了一种新型残差块设计——带层归一化的递归跳跃连接(2rSkip+LN),通过递归地对增强的跳跃连接应用层归一化,稳定了训练过程并提升了深度网络的优化性能。该方法在ResNet和Transformer架构中均实现了持续的性能提升——在CIFAR-100上最高实现1.02的绝对误差降低,在机器翻译任务中提升超过1个BLEU分数,展现出相较于标准跳跃连接更优的泛化能力和鲁棒性。
Skip connection, is a widely-used technique to improve the performance and the convergence of deep neural networks, which is believed to relieve the difficulty in optimization due to non-linearity by propagating a linear component through the neural network layers. However, from another point of view, it can also be seen as a modulating mechanism between the input and the output, with the input scaled by a pre-defined value one. In this work, we investigate how the scale factors in the effectiveness of the skip connection and reveal that a trivial adjustment of the scale will lead to spurious gradient exploding or vanishing in line with the deepness of the models, which could be addressed by normalization, in particular, layer normalization, which induces consistent improvements over the plain skip connection. Inspired by the findings, we further propose to adaptively adjust the scale of the input by recursively applying skip connection with layer normalization, which promotes the performance substantially and generalizes well across diverse tasks including both machine translation and image classification datasets.
研究动机与目标
- 研究跳跃连接中的缩放因子对深度网络梯度稳定性与优化的影响。
- 探究层归一化是否能够缓解跳跃连接中非恒等缩放导致的梯度爆炸/消失问题。
- 设计一种结合自适应缩放与层归一化的新型跳跃连接机制,以提升训练稳定性和模型性能。
- 在图像分类与机器翻译等多样化任务上评估所提出架构的泛化能力与可扩展性。
- 确定在残差块中结合层归一化时,固定或可学习的缩放因子哪种能获得最优性能。
提出的方法
- 提出扩展跳跃连接与层归一化,其中跳跃输入通过λ > 1进行缩放,并通过层归一化进行归一化,以稳定梯度。
- 引入递归跳跃连接与层归一化(2rSkip+LN),通过递归地对缩放后的跳跃连接应用层归一化,实现更深层块中的稳定梯度流动。
- 该架构的表达式为 y = LN(λ·x + F(x, W)),其中跳跃项通过层归一化递归处理,以维持梯度稳定性。
- 采用层归一化而非批量归一化,以更好地处理可变长度序列,并在CNN与Transformer中提升泛化性能。
- 通过在CIFAR-100与WMT翻译数据集上对ResNet与Transformer架构进行消融实验与对比验证该方法的有效性。
- 在递归变体中使用固定的λ = 2,消融实验表明,当与归一化结合时,更高的缩放因子可进一步提升性能。
实验结果
研究问题
- RQ1使用λ ≠ 1对跳跃连接进行缩放是否会导致深度网络中的梯度不稳定?层归一化能否缓解此问题?
- RQ2层归一化与缩放跳跃连接的结合如何影响残差网络中的优化与收敛性能?
- RQ3对缩放跳跃连接递归应用层归一化是否能提升训练稳定性和模型性能?
- RQ4所提出的2rSkip+LN架构是否在不同架构(ResNets、Transformers)与任务(图像分类、机器翻译)间具有泛化能力?
- RQ5在结合层归一化时,跳跃连接的最优缩放因子λ是什么?其是否随模型深度或数据集复杂度而变化?
主要发现
- 所提出的2rSkip+LN方法在使用ResNet-110时,于CIFAR-100上实现了1.02的绝对误差率降低,表明在更深模型中具有显著性能增益。
- 在机器翻译任务中,该方法使Transformer-Base在EN-VI上提升1.2 BLEU,EN-DE上提升0.7,EN-FR上提升0.8,优于参数更多但未使用该机制的更大模型。
- 该方法在CIFAR-100的所有模型深度上均持续提升性能,且在更深网络中增益更显著,表明其对深层表征的优化能力更强。
- 性能提升在图像分类(ResNet)与序列建模(Transformer)中均一致,证实该方法在不同架构与任务间具有良好的泛化能力。
- 当跳跃连接被缩放时,层归一化在稳定梯度方面优于批量归一化,尤其在更深模型中表现更优。
- 消融实验表明,仅缩放跳跃连接会导致优化问题,而仅使用层归一化则不足以解决问题;唯有两者的递归结合才能确保稳定且高效的训练。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。