TL;DR
While Pre-Layer Normalization (Pre-LN) has become the de facto standard for training deep Transformers stably, it often underperforms compared to its unstable counterpart, Post-LN, in shallower networks. This paper introduces the Bottom-to-Top (B2T) connection, a simple yet highly effective architectural modification that combines the training stability of Pre-LN with the superior representational capacity of Post-LN, enabling state-of-the-art performance across deep and shallow Transformers alike.
What Problem Does This Paper Address?
In Transformer architectures, the placement of Layer Normalization (LN) matters immensely.
- Post-LN (the original Transformer design) places LN after the residual addition. While highly effective in shallow networks (e.g., 6 layers), attempting to train deep Post-LN models (10+ layers) typically fails due to severe vanishing gradients.
- Pre-LN places LN before the sub-layer components (like Attention or Feed-Forward Networks). This creates a clean identity path for gradients, making the training of exceptionally deep networks stable.
However, Pre-LN comes with a hidden cost: its deep layers tend to become "lazy." Because the input can easily bypass the transformations via the residual connection, the representations in higher layers remain highly similar to those in shallow layers, reducing the model's overall capacity. The authors set out to resolve this dilemma: How can we maintain the training stability of Pre-LN while preserving the high-performance dynamics of Post-LN?
Methods
The authors propose the Bottom-to-Top (B2T) connection, an architectural adjustment built on top of the Post-LN framework.
As illustrated in the diagram above, the B2T connection introduces an additional residual path (highlighted in red) that links the input of a layer block ($x_{inp}$) directly to the output of the Feed-Forward Network (FFN), just before the final layer normalization of that block. Mathematically, the block is formalized as:
$$\text{Output} = x_{inp} + x_{ffn} + \text{FFN}(x_{ffn})$$
By routing $x_{inp}$ past the internal layer normalizations, the mathematical derivative of this block isolates an identity matrix ($I$). Just like in Pre-LN, this unblocked path allows gradients to flow freely backward through the network without being drastically diminished by intermediate layer normalizations, ensuring stable training even as the network scales up.
Datasets
The authors evaluated their method across four distinct language and speech modalities:
- Machine Translation: WMT English-to-German dataset (4.5M sentence pairs), evaluated on newstest2010-2016.
- Abstractive Summarization: Annotated English Gigaword (3.8M headline-sentence pairs) supplemented with 13M pairs from REALNEWS and NewsCrawl.
- Language Modeling: WikiText-103 (103M tokens).
- Automatic Speech Recognition (ASR): LibriSpeech (1,000 hours of English speech).
Key Insights and Ideas
- Layer Norm is the Gradient Killer: Through meticulous empirical tracking of gradient flows, the authors confirmed that the vanishing gradient problem in Post-LN is explicitly caused by the layer normalization steps within the block, which scale down the gradient norms exponentially during backpropagation.
- The "Lazy Layer" Phenomenon in Pre-LN: By analyzing cosine similarities between layers, the authors showed that Pre-LN layers change very little from input to output in deeper configurations. Post-LN layers, by contrast, exhibit much lower similarity across layers, meaning higher layers are actively performing useful, distinct transformations.
- Preserving Post-LN Benefits: By placing the B2T connection before the final layer normalization of each block, the model avoids a direct identity connection to the absolute final output. This subtle choice preserves the distinct layer transformations that give Post-LN its performance edge.
Key Results
The B2T connection consistently delivered the best of both worlds across all tasks:
- Overcoming Post-LN Failure: In deep configurations (18-layer encoder-decoder setups), vanilla Post-LN completely failed to train. B2T connection trained flawlessly.
- Machine Translation: In an 18L-18L deep Transformer setup on the WMT dataset, B2T achieved an average BLEU score of 27.30, outperforming Pre-LN (26.57) and beating other deep-stacking alternatives like DLCL (26.90) and Admin (26.86). It even successfully stabilized an extreme 100L-100L configuration.
- Abstractive Summarization: On headline generation (18L-18L), B2T achieved a ROUGE-1 score of 39.61, outperforming Pre-LN (38.97).
- Language Modeling & ASR: B2T achieved lower perplexity on WikiText-103 (19.20 vs 19.24 for Pre-LN at 16 layers) and lower Word Error Rates (WER) on LibriSpeech (7.68 vs 8.22 for Pre-LN on the 'other' test set).
Crucially, B2T achieves these gains without introducing any additional parameters or incurring the initialization computational overhead found in competitive methods like Admin.
Limitations and Future Work
While B2T significantly mitigates the vanishing gradient problem, the authors note that it does not perfectly eliminate it; gradient norms still decay slightly in exceptionally deep networks (e.g., 100+ layers), which could pose risks in extreme scaling scenarios. Additionally, the paper relies primarily on empirical findings to justify why Post-LN style transformations outperform Pre-LN, leaving room for deeper theoretical proofs. Finally, the authors flag the substantial energy consumption required to train these deep models, highlighting a vital future direction: finding ways to improve energy efficiency while maintaining the performance benefits of deep stacking.
Summary updated