TL;DR
This paper introduces ReZero, a simple yet powerful architectural modification for deep neural networks that significantly improves signal propagation and enables training of much deeper models. By initializing a scaling parameter in residual connections to zero, ReZero ensures initial dynamical isometry, leading to faster convergence and better performance across various architectures like ResNets and Transformers.
What Problem Does This Paper Address?
Deep neural networks, despite their impressive performance, often struggle with training due to vanishing or exploding gradients. This issue arises from inefficient signal propagation through the many layers, making it difficult to train very deep models. Existing solutions like complex gating mechanisms, careful initialization, and normalization layers (e.g., BatchNorm, LayerNorm) have helped, but they often add complexity or computational overhead. The paper aims to find a simpler, more generalizable solution that addresses the core problem of signal propagation and dynamical isometry, which is crucial for efficient deep learning.
Methods
The core contribution is the ReZero technique. It's a minimal change to residual connections: instead of a direct skip connection, the input signal is added to a scaled version of the layer's output. The key is that this scaling parameter ($\alpha_i$) is initialized to zero for each layer.
The modified residual connection becomes: $x_{i+1} = x_i + \alpha_i F(x_i)$
At initialization ($\alpha_i = 0$), the network effectively becomes an identity mapping, ensuring dynamical isometry (where input perturbations propagate without significant amplification or attenuation). As training progresses, $\alpha_i$ is learned, allowing the network to gradually incorporate the non-trivial transformation $F(x_i)$. This approach is architecture-agnostic and requires minimal code changes.
Datasets
The paper evaluates ReZero on the following datasets:
- CIFAR-10: Used for training and evaluating convolutional ResNet variants.
- enwiki8: Used for language modeling experiments with Transformers.
- WikiText-2: Used for language modeling experiments with Transformers.
Key Insights and Ideas
- Dynamical Isometry is Key: The paper reinforces the theoretical insight that dynamical isometry (input perturbations propagating with consistent magnitude) is critical for deep network trainability.
- Simplicity Wins: A surprisingly simple architectural change (zero-initialized scaling in residual connections) can achieve the benefits of more complex methods.
- Identity Initialization is Powerful: Initializing the network to be an identity function at the start of training is a robust strategy for enabling deep learning.
- ReZero is Architecture Agnostic: The technique works seamlessly with various architectures, including fully connected networks, ResNets, and Transformers, without requiring architecture-specific tuning.
- Normalization May Become Superfluous: While ReZero doesn't strictly require normalization for convergence, its regularizing effect can be complementary.
Key Results
- Faster Convergence:
- ReZero ResNets achieved a 32% speedup on CIFAR-10 to reach 85% accuracy.
- ReZero Transformers converged 56% faster than vanilla Transformers on the enwiki8 benchmark.
- Deeper Networks:
- Successfully trained fully-connected ReZero networks with up to 10,000 layers.
- Trained 120-layer Transformers without learning rate warm-up, LayerNorm, or auxiliary losses.
- Achieved similar performance with 128-layer ReZero Transformers as with shallower vanilla Transformers, while vanilla Transformers struggled to converge at such depths.
- Performance:
- ReZero achieved competitive or superior validation errors on CIFAR-10 compared to other methods like Gated ResNets, zero-gamma, and FixUp.
- On enwiki8, ReZero Transformers achieved comparable or better BPB scores than other normalization strategies.
Limitations and Future Work
- Limitations:
- The paper notes that while ReZero makes normalization superfluous for convergence, the regularizing effect of BatchNorm can be complementary. This suggests that for optimal performance, a combination might still be beneficial.
- For Transformers, ReZero replaces LayerNorm. While this improves convergence, the paper doesn't definitively state that ReZero always outperforms LayerNorm in terms of final accuracy across all tasks.
- Future Work:
- The authors discovered interesting patterns in the learned residual weights ($\alpha_i$) over training, suggesting potential for curriculum learning and progressive stacking of layers. They plan to explore these patterns further.
- Investigating the role of these residual weight patterns in understanding training dynamics and model performance is a key future direction.
- Exploring ReZero's application to other architectures and tasks, especially in areas where deep models are currently challenging to train.
Summary updated