Introduction
Training deep neural networks is a fundamental challenge in machine learning, primarily due to the vanishing and exploding gradient problems. Traditional solutions involve a combination of residual connections, normalization layers (like BatchNorm or LayerNorm), and carefully tuned learning rate warm-up schedules. While effective, these techniques introduce complexity and additional hyperparameters.
The ReZero (Residual with Zero initialization) architecture proposes a simpler alternative. By initializing residual connections to zero using a single trainable parameter, ReZero enables stable training of extremely deep networks with significantly faster convergence, often making complex normalization and warm-up stages redundant.
The ReZero Method
The core of ReZero is a simple modification to the standard residual block. Instead of a direct addition, the output of the non-linear function $F(x)$ is scaled by a trainable scalar $\alpha$, which is initialized to zero:
$$x_{i+1} = x_i + \alpha_i F(x_i)$$
At the start of training, $\alpha = 0$, meaning the network effectively functions as an identity mapping. This state, known as dynamical isometry, allows gradients to propagate perfectly through the network regardless of depth. As training progresses, the model learns the optimal values for $\alpha_i$, effectively developing its own "curriculum" for which layers to activate and when.
This approach is architecture-agnostic and can be applied to fully-connected networks, ResNets, and Transformers. In the case of Transformers, ReZero allows for the complete removal of LayerNorm and the learning rate warm-up phase, simplifying the architecture significantly.
Key Results
The primary benefit of ReZero is a dramatic increase in convergence speed across various tasks and architectures.
- Transformers: On the enwiki8 language modeling benchmark, a 12-layer ReZero Transformer reached target performance 56% faster than a vanilla Transformer. Furthermore, ReZero enabled the training of 128-layer Transformers without the need for specialized initialization or auxiliary losses.
- ResNets: On CIFAR-10, ReZero-enabled ResNets achieved 80% accuracy 39% faster than their standard counterparts.
- Extreme Depth: The robustness of the method was demonstrated by successfully training a 10,000-layer fully-connected network, a feat previously considered impossible with standard techniques.
Mathematical analysis confirms that ReZero maintains the distribution of the input-output Jacobian's singular values near 1. This stability is crucial for efficient training at great depths, as it prevents the signal from vanishing or exploding as it passes through the layers.
Discussion and Future Work
ReZero demonstrates that many of the "tricks" used in modern deep learning may be addressing symptoms rather than the root cause of poor signal propagation. While ReZero can make normalization layers superfluous for convergence, the authors note that BatchNorm still provides beneficial regularization. Future research may explore the optimal combination of ReZero with lightweight regularization techniques.
Additionally, the observed evolution of the $\alpha$ parameters suggests that deep networks naturally learn a hierarchical structure. Investigating these patterns could provide deeper insights into the learning dynamics of complex models.
Summary updated