陷入反向传播:语言模型头部是一个梯度瓶颈
Lost in Backpropagation: The LM Head is a Gradient Bottleneck
AI总结:
语言模型头部的梯度瓶颈导致表达和优化受限,影响训练效率,需新设计
摘要:
神经语言模型(LMs)的最后层将维度为D的输出特征投影到维度为V的logits,其中V通常是词汇量的大小,通常D远小于V。这种不匹配已知会带来表达能力受限的风险,从而产生所谓的softmax瓶颈。我们展示softmax瓶颈不仅是表达瓶颈,还是优化瓶颈。通过一个秩为D的线性层反向传播V维梯度会引发不可避免的压缩,这会改变反馈给绝大多数参数的训练信息。我们对这种现象进行了理论分析,并实证发现95-99%的梯度范数被输出层抑制,导致极不优化的更新方向。我们进行了受控的预训练实验,显示梯度瓶颈使简单模式无法学习,并大幅影响LLM的训练动态。我们认为这种固有缺陷会独立于模型架构,在大规模训练中导致训练效率低下,需要新的LM头部设计。
英文摘要:
The last layer of neural language models (LMs) projects output features of dimension $D$ to logits in dimension $V$, the size of the vocabulary, where usually $D \ll V$. This mismatch is known to raise risks of limited expressivity in neural LMs, creating a so-called softmax bottleneck. We show the softmax bottleneck is not only an expressivity bottleneck but also an optimization bottleneck. Backpropagating $V$-dimensional gradients through a rank-$D$ linear layer induces unavoidable compression, which alters the training feedback provided to the vast majority of the parameters. We present a theoretical analysis of this phenomenon and measure empirically that 95-99% of the gradient norm is suppressed by the output layer, resulting in vastly suboptimal update directions. We conduct controlled pretraining experiments showing that the gradient bottleneck makes trivial patterns unlearnable, and drastically affects the training dynamics of LLMs. We argue that this inherent flaw contributes to training inefficiencies at scale independently of the model architecture, and raises the need for new LM head designs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。