Skip to main content
QUICK REVIEW

[论文解读] Understanding and Improving Layer Normalization

Jingjing Xu, Xu Sun|arXiv (Cornell University)|Nov 16, 2019
Natural Language Processing Techniques被引用 175
一句话总结

本论文表明 mean 与 variance 的导数,而非前向归一化,驱动 LayerNorm 的有效性;它引入 AdaNorm,用自适应变换替代偏置/增益,在大多数任务上提升性能。

ABSTRACT

Layer normalization (LayerNorm) is a technique to normalize the distributions of intermediate layers. It enables smoother gradients, faster training, and better generalization accuracy. However, it is still unclear where the effectiveness stems from. In this paper, our main contribution is to take a step further in understanding LayerNorm. Many of previous studies believe that the success of LayerNorm comes from forward normalization. Unlike them, we find that the derivatives of the mean and variance are more important than forward normalization by re-centering and re-scaling backward gradients. Furthermore, we find that the parameters of LayerNorm, including the bias and gain, increase the risk of over-fitting and do not work in most cases. Experiments show that a simple version of LayerNorm (LayerNorm-simple) without the bias and gain outperforms LayerNorm on four datasets. It obtains the state-of-the-art performance on En-Vi machine translation. To address the over-fitting problem, we propose a new normalization method, Adaptive Normalization (AdaNorm), by replacing the bias and gain with a new transformation function. Experiments show that AdaNorm demonstrates better results than LayerNorm on seven out of eight datasets.

研究动机与目标

  • 研究是什么使 LayerNorm 在超越前向输入归一化的情况下仍然有效。
  • 评估 LayerNorm 中偏置和增益的作用及其对过拟合的影响。
  • 分析反向梯度如何受到均值和方差导数的影响。
  • 提出 AdaNorm,用自适应变换替代偏置/增益并评估其性能。

提出的方法

  • 在多任务中复现 LayerNorm 的变体,并与无归一化基线进行比较。
  • 引入 DetachNorm 以分离均值和方差的导数,并测量对前向/反向效应的影响。
  • 理论分析 LayerNorm 中通过均值/方差导数进行梯度重新居中与重新缩放(定理 1)。
  • 提出 AdaNorm,在归一化特征上应用变换 phi(y),确保可微分且平均输出有界(定理 2)。
  • 在八个数据集上对 LayerNorm、LayerNorm-simple、DetachNorm 和 AdaNorm 进行经验比较,数据集覆盖机器翻译、语言模型、分类、解析、OCR 以及 NLP 任务。

实验结果

研究问题

  • RQ1是什么因素驱动 LayerNorm 的有效性:前向归一化还是来自均值/方差的梯度效应?
  • RQ2偏置和增益是否有正向贡献,还是在多任务中引发过拟合?
  • RQ3梯度归一化(通过均值/方差导数)是否能解释 LayerNorm 的训练行为和性能?
  • RQ4通过用输入相关的缩放替代固定的仿射参数,适应性归一化(AdaNorm)是否优于 LayerNorm?

主要发现

模型英-德(BLEU)德英(BLEU)英-越(BLEU)Enwiki8(比特/字符)RT(准确率)SST5(准确率)MNIST(准确率)PTB(UAC)
无归一化发散34.028.41.0476.8538.5599.1488.31
LayerNorm28.335.531.21.0777.2139.2399.1389.12
LayerNorm-simple28.435.531.61.0776.6640.5499.0989.19
AdaNorm28.535.631.41.0777.5040.5499.3589.23
  • 前向归一化对 LayerNorm 成功的解释力有限;均值和方差的导数更为重要。
  • 分离均值/方差的导数(DetachNorm)会降低性能,表明梯度归一化有助于优化,尤其在更深的模型中。
  • LayerNorm-simple(无偏置/增益)在若干数据集上可与 LayerNorm 相媲美甚至超越,并且在英-越 MT 上可达到最先进水平。
  • 偏置和增益往往增加过拟合,在多任务中常常效果不佳。
  • AdaNorm,用自适应的 phi(y) 替代偏置/增益,在八个数据集中的七个上优于 LayerNorm,显示出更好的泛化能力。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。