Rethinking Skip Connection with Layer Normalization

Fenglin Liu, Xuancheng Ren, Zhiyuan Zhang, Xu Sun, Yuexian Zou

In modern deep learning, the skip connection is a foundational component that enables the training of extremely deep architectures. While standard models like ResNet and the Transformer treat the "shortcut" as a simple identity mapping, research presented at COLING 2020 suggests that this approach may be suboptimal. The authors argue that by adaptively scaling the input signal and stabilizing it with Layer Normalization (LN), we can significantly improve model performance and efficiency.

The Problem: Identity vs. Adaptive Scaling

Conventionally, skip connections are formulated as $y = x + F(x)$, where $x$ is the input and $F(x)$ is the learned transformation. This identity mapping assumes that the input and the transformation should contribute equally to the output. While effective, this fixed ratio limits the network's ability to prioritize information flow.

Comparison of standard skip connection architectures, including ResNet, Highway Networks, and Transformers.

Earlier attempts to address this, such as Highway Networks, used gating mechanisms to balance the signals. However, simply increasing the weight of the input (e.g., $y = \lambda x + F(x)$ where $\lambda > 1$) typically leads to "gradient malformation." This results in exploding or vanishing gradients, making deep models nearly impossible to converge. The challenge lies in increasing the influence of the input signal without compromising training stability.

Proposed Methodology

The authors investigate three primary variations to evolve the standard skip connection:

  1. Expanded Skip Connection (xSkip): This variant scales the input by a constant factor $\lambda > 1$. While it increases input influence, it suffers from the aforementioned gradient instability.
  2. Expanded Skip Connection with LN (xSkip+LN): To counter instability, the authors apply Layer Normalization after scaling: $y = LN(\lambda x + F(x))$. LN is particularly effective here because it operates in "feature space," allowing it to normalize input features even when the residual branch is noisy during early training stages.
  3. Recursive Skip Connection with LN (rSkip+LN): This is the core contribution. Instead of a single large jump, the input signal is added in stages. For a scale of $\lambda=2$, the process is defined as $y_1 = LN(x + F(x))$ followed by $y_2 = LN(x + y_1)$.
The Expanded Skip Connection with Layer Normalization (xSkip+LN) architecture, showing the integration of the scaling factor λ and LN.

This recursive structure allows the gain parameters within the Layer Normalization to act as a learnable, adaptive ratio. By unrolling the mathematics, the authors demonstrate that the model effectively learns the optimal balance between the shortcut and the transformation for every layer individually.

Experimental Results and Insights

The researchers validated rSkip+LN across image classification and machine translation tasks, demonstrating consistent improvements over baselines:

  • Image Classification: On CIFAR-100 using a ResNet-110 backbone, the proposed method reduced the error rate by 1.02% absolute over the standard identity skip connection.
  • Machine Translation: In WMT 2014 English-German tasks, rSkip+LN improved the Transformer-Base BLEU score by 0.7 and the Transformer-Big by 0.5.
  • Efficiency Gains: Most notably, on English-Vietnamese translation, a Transformer-Base equipped with rSkip+LN achieved 32.2 BLEU, outperforming the much larger Transformer-Big baseline (31.4 BLEU) while utilizing only one-third of the parameters.

Conclusion

The study confirms that the "identity mapping" default for skip connections is not always the most effective choice. By introducing recursive scaling and Layer Normalization, models can adaptively manage information flow. While the current implementation uses a fixed integer hyperparameter for the number of recursions ($\lambda$), future work aims to develop adaptive mechanisms that allow the model to dynamically determine the optimal scaling factor based on gradient distributions during training.

Summary updated

BibTeX
@inproceedings{liu2020rethinking,
  author = {Fenglin Liu and Xuancheng Ren and Zhiyuan Zhang and Xu Sun and Yuexian Zou},
  title = {{Rethinking Skip Connection with Layer Normalization}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.coling-main.320},
}
Figure