Abstract
Deep Transformer models (12+ layers) are notoriously difficult to train and often fail to converge using the original "Post-LN" architecture. This research introduces a Lipschitz Constrained Parameter Initialization that ensures stable training for models up to 24 layers deep. By maintaining the signal variance throughout the network, this method enables the use of both deep encoders and deep decoders, delivering significant BLEU improvements over standard shallow baselines and more stable "Pre-LN" alternatives.
The Post-LN vs. Pre-LN Dilemma
In the original Transformer architecture (Vaswani et al., 2017), Layer Normalization (LN) is applied after the residual connection, a configuration known as Post-LN. While effective for shallow 6-layer models, researchers found that deeper versions frequently fail to converge. To mitigate this, the community largely shifted to Pre-LN, where LN is applied inside the residual branch. While Pre-LN is significantly more stable, it often results in slightly lower translation quality compared to a successfully trained Post-LN model.
The authors identify the root cause of this instability: in Post-LN models, the standard deviation of the combined signals grows as the model gets deeper. Because LayerNorm divides by this increasing standard deviation, it effectively "shrinks" the contribution of the residual connection. As depth increases, the identity path—the critical "highway" for gradients—effectively vanishes, making optimization nearly impossible.
Lipschitz Constrained Parameter Initialization
The authors propose a theoretical and practical solution: Lipschitz Constrained Parameter Initialization. The core idea is to ensure that each sub-layer acts as a $k$-Lipschitz function where $k \le 1$. By limiting how much a layer can amplify its input, the authors can guarantee that the standard deviation ($\sigma$) of the layer input remains $\le 1.0$, preventing the residual connection from being diminished.
Instead of standard Glorot initialization, the authors employ a specific strategy for embedding matrices and linear transformation weights:
- Embeddings: Initialized within $[-\epsilon, +\epsilon]$ where $\epsilon = \sqrt{\frac{2}{esize + vsize}}$.
- Linear Weights: Initialized within $[-l, +l]$ where $l = \sqrt{\frac{1}{isize}}$.
This simple change in initialization allows the original Post-LN architecture to converge reliably without requiring complex architectural modifications like "Transparent Attention" or "Depth-Scaled Initialization."
Experimental Setup
The method was evaluated on two standard Neural Machine Translation (NMT) benchmarks:
- WMT 14 English-to-German (En-De): A high-resource benchmark.
- WMT 15 Czech-to-English (Cs-En): A benchmark used to test cross-language robustness. Both datasets utilized Byte-Pair Encoding (BPE) with 32k merge operations.
Key Results and Insights
The experimental results demonstrate that Post-LN (v1) is superior to Pre-LN (v2) when training is stabilized via Lipschitz initialization. As shown in the table below, the 24-layer Post-LN model (v1-L) consistently achieves the highest BLEU scores across both language pairs.
Key findings include:
- Convergence at Depth: Using the new initialization, 24-layer Post-LN Transformers converged perfectly, achieving 29.46 BLEU on En-De (+1.50 over baseline) and 29.70 BLEU on Cs-En (+0.92 over baseline).
- Deep Decoders Matter: While most research focuses on deep encoders, this study shows that increasing decoder depth to 24 layers provides substantial gains, particularly in the Czech-to-English task.
- Robustness: Unlike other stabilization methods that may degrade performance on shallow models, this initialization actually improved the 6-layer Transformer's performance slightly, making it a robust "drop-in" replacement for standard initialization.
Conclusion
This paper reveals that the instability of deep Post-LN Transformers is an initialization problem rather than an inherent architectural flaw. By applying Lipschitz constraints at initialization, researchers can unlock the superior performance of Post-LN architectures at significant depths. This approach is computationally efficient, requiring no changes to the training loop or model architecture, and provides a new path for scaling Transformer models in NMT and potentially beyond.
Summary updated