[论文解读] Post-LayerNorm Is Back: Stable, ExpressivE, and Deep
引入 Keel,一种带 Highway 风格残差路径和残差归一化的 Post-LN Transformer,使超深层 LLM 的训练更稳定、表达能力更强且深度扩展性优于 Pre-LN。
Large language model (LLM) scaling is hitting a wall. Widening models yields diminishing returns, and extending context length does not improve fundamental expressivity. In contrast, depth scaling offers theoretically superior expressivity, yet current Transformer architectures struggle to train reliably at extreme depths. We revisit the Post-LayerNorm (Post-LN) formulation, whose instability at scale caused its replacement by Pre-LN in modern LLMs. We show that the central failure mode of Post-LN arises from the ResNet-style residual pathway, which introduces gradient vanishing in deep networks. We present Keel, a Post-LN Transformer that replaces this residual path with a Highway-style connection. This modification preserves the gradient flow through the residual branch, preventing signal vanishing from the top layers to the bottom. Unlike prior methods, Keel enables stable training at extreme depths without requiring specialized initialization or complex optimization tricks. Keel trains robustly at depths exceeding 1000 layers and consistently improves perplexity and depth-scaling characteristics over Pre-LN. These findings indicate that Post-LN, when paired with a Highway-style connection, provides a simple and effective foundation for building deeply scalable LLMs, opening the possibility for future infinite-depth architectures.
研究动机与目标
- 将深度尺度作为提升 LLM 表现力的路径,超越仅靠宽度和上下文长度的局限。
- 分析在规模化下 Post-LN 的不稳定原因,识别梯度消失作为关键失败模式。
- 提出对 Post-LN 的最小结构性改动,在极端深度下使训练更稳定。
- 证明 Keel 架构在多任务上实现稳定训练、更好的深度可扩展性和性能提升。
提出的方法
- 建立梯度流动分析,表明 Post-LN 中剩余通路会导致梯度消失。
- 提出 Highway 风格的残差缩放(alpha)以及额外的残差分支归一化。
- 开发 Keel:x_{l+1}=LN(alpha*x_l + F_l(LN(x_l))),其中 alpha 设定为总深度 L。
- 边界情况:对第一层注意力和第一层 FFN 禁用 Post-LN 缩放,以稳定初始化。
- 采用可学习的仿射 LN γ 且不引入偏置,并分享实现稳定性的见解。
- 将 Keel 与 Post-LN、Pre-LN,以及稳定性提升基线(DeepNorm、HybridNorm、Mix-LN)进行对比,使用最大学习率和下游任务指标评估。
实验结果
研究问题
- RQ1在超过典型 LLM 尺度的深度下,Post-LN 的训练在不使用特殊技巧的情况下能保持稳定吗?
- RQ2用 Highway 风格的连接替代残差通路,是否能在极端深度下稳定 Post-LN 的梯度流?
- RQ3与 Pre-LN 与先前的 Post-LN 变体相比,Keel 是否保持或提升表达能力和深度尺度优势?
- RQ4Keel 在不同深度区间的实际初始化与训练收益(如更高学习率、收敛性改善等)是什么?
主要发现
- Keel 在超过 1000 层的深度下实现稳定训练,在深度尺度上优于 Pre-LN。
- Keel 在被动用高学习率时仍保持平滑收敛,而 Post-LN 及其他基线出现发散。
- Keel 在深度范围内的表达能力提升显著,尤其在 Math & Code 任务上相对于 Pre-LN 提升了 +16.5%。
- Keel 允许更高的最大可承受学习率,表明优化景观更鲁棒。
- Keel 在各任务中随着学习率的提高呈现持续、单调的增益,尤其在推理密集型基准上表现突出。
- Keel 的深度尺度实验(64–1024 层)在各深度段对比 Pre-LN 显示优越的表现。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。