Abstract
Scaling Transformers to extreme depths is challenging due to training instabilities. While methods like DeepNorm enable 1,000-layer models, they often suffer from "undertraining" where fixed constraints limit representational capacity. We introduce BranchNorm, a normalization technique that uses a dynamic scaling factor to transition from high stability at the start of training to high capacity at convergence. BranchNorm achieves state-of-the-art results on machine translation and summarization while demonstrating remarkable robustness to hyperparameters.
The Challenge of Extreme Depth
Scaling Transformers to 100+ layers typically leads to vanishing or exploding gradients. While Pre-LayerNorm (Pre-LN) offers stability, it often underperforms Post-LayerNorm (Post-LN) because its heavy reliance on residual connections limits the model's ability to learn complex features.
DeepNorm recently enabled scaling Post-LN models to 1,000 layers using a fixed scaling factor ($\alpha$) to upweight the residual branch. However, this fixed constraint creates a performance gap. As shown in Figure 1, DeepNorm-based models can be "undertrained" compared to vanilla Transformers on shallower tasks because the parameters are never fully "unleashed."
BranchNorm: Dynamic Scaling for Stability and Capacity
BranchNorm addresses the undertraining problem by shifting the scaling logic. Instead of a fixed scale on the residual branch, BranchNorm rescales the non-residual branch (the part containing the Attention or FFN layers) using a dynamic factor $\alpha_t$.
The core equation for a sub-layer becomes: $$x_{l+1} = LN(x_l + \alpha_t \mathcal{F}(x_l; \theta_l))$$
Key features include:
- Dynamic Scaling: $\alpha_t$ starts near 0 at the beginning of training and linearly increases to 1.0 over a predefined number of steps ($T$).
- Stability to Convergence: In early stages, a small $\alpha_t$ makes the layer behave like an identity transformation, stabilizing the warmup phase. As $\alpha_t$ reaches 1.0, the architecture behaves like a standard Post-LN Transformer, allowing for better convergence and higher model capacity.
- Curriculum Learning: Unlike DeepNorm's fixed constraint, BranchNorm's schedule acts as a curriculum that ensures parameters are fully utilized by the end of training.
Key Results and Insights
BranchNorm was evaluated across standard NLP benchmarks including WMT translation tasks, CNN/DailyMail summarization, and WikiText-103.
- State-of-the-Art Performance: A 1,000-layer (500L-500L) BranchNorm model achieved 44.4 BLEU on WMT14 En-Fr, outperforming all previous deep Transformer variants.
- Hyperparameter Robustness: BranchNorm is remarkably stable; it can be trained without a warmup phase and is much more tolerant of high learning rates compared to DeepNorm.
- Efficiency via Depth: To make 1,000-layer models practical, the authors show that a "Deep Encoder / Shallow Decoder" configuration (e.g., 475 encoder layers, 25 decoder layers) maintains high performance while providing a nearly 2x speedup in inference.
- Increased Sparsity: BranchNorm models exhibit higher activation sparsity than DeepNorm, suggesting the model learns more efficient, robust representations.
Conclusion
BranchNorm provides a mathematically simple yet effective way to scale Transformers to unprecedented depths. By replacing fixed constraints with a dynamic scaling schedule, it resolves the stability-performance trade-off, enabling the training of 1,000-layer models that are both stable and highly expressive.
Summary updated