Abstract
Among the various pre-trained neural language models that are popular today, dropout is already an indispensable regularization technique. To solve the inconsistency between training and inference caused by the randomness of dropout, some studies use consistency training to regularize dropout at the output layer. In this paper, we propose a novel Layer-wise Regularized Dropout (LR-Drop), which is specially designed for Transformer-based Language models. Specifically, LR-Drop layer-wise regularizes each Transformer layer using the consistency training strategy. Each training sample passes through the two siamese sub-models sampled by dropout, and then LR-Drop forces the hidden states, multi-head attention matrices, and output distribution of the two siamese sub-models to be consistent. The proposed LR-Drop can be regarded as a “self-distillation” framework, in which each sub-model generated by dropout is the other’s “teacher” model and “student” model. Through extensive experiments on 15 datasets, we show that LR-Drop achieves superior performances, including state-of-the-art results.
Introduction
Dropout is a staple of modern deep learning, used to prevent overfitting by randomly "turning off" neurons during training. This effectively creates an ensemble of sub-models. However, there is a fundamental mismatch: during training, the model is stochastic and sparse, but during inference, the full, deterministic model is used. This inconsistency can lead to sub-optimal performance.
Previous research, such as R-Drop, attempted to fix this by forcing the final output distributions of two different dropout runs to be consistent using KL divergence. While effective, regularizing only the output layer is often insufficient. If the internal representations of the model—its hidden states and attention weights—vary significantly between dropout runs, the model remains fragile. Layer-wise Regularized Dropout (LR-Drop) addresses this by enforcing consistency throughout the entire body of the Transformer.
Methodology
The core of LR-Drop is a "siamese" training strategy. For every training sample, the model performs two forward passes, each with a different random dropout mask. This creates two distinct sub-models. The training objective then minimizes a four-part loss function:
- Standard Cross-Entropy ($\mathcal{L}_{CE}$): The usual task-specific loss.
- Hidden State Regularization ($\mathcal{L}_{HSR}$): Minimizes the Mean Squared Error (MSE) between the hidden states of the two sub-models at every layer.
- Multi-head Attention Regularization ($\mathcal{L}_{MHAR}$): Minimizes the MSE between the attention weight matrices. This ensures the model "looks" at the same parts of the input regardless of which neurons are dropped.
- Output Regularization ($\mathcal{L}_{OR}$): Minimizes the bidirectional KL divergence between the final output distributions.
This approach functions as a "self-distillation" framework where, because parameters are shared, each sub-model effectively acts as both a teacher and a student for the other.
Key Results
The authors conducted an extensive evaluation across 15 datasets covering Natural Language Understanding (GLUE), Neural Machine Translation (IWSLT), and Abstractive Summarization (CNN/Daily Mail).
As shown in the table below, LR-Drop consistently improves performance across various base models on the GLUE benchmark. For instance, it improved the average score of BERT-base from 82.85 to 84.55 and RoBERTa-large from 88.93 to 90.41, outperforming the standard R-Drop method (denoted as +RD).
Beyond NLU, LR-Drop achieved an average improvement of 2.91 BLEU points over standard Transformer baselines in translation tasks. When applied to BART for summarization, it achieved state-of-the-art results on the CNN/Daily Mail dataset, surpassing specialized models like ProphetNet and PEGASUS.
Discussion and Insights
- Internal Consistency: Regularizing internal layers (attention and hidden states) provides a consistent boost over just regularizing the output, suggesting that stable internal representations are key to closing the training-inference gap.
- Flatter Loss Landscapes: Visualizations of the loss landscape indicate that LR-Drop leads models toward "flatter" minima, which is strongly correlated with better generalization on unseen data.
- Efficiency in Data-Scarce Scenarios: LR-Drop showed particularly strong gains on smaller datasets, forcing the model to be more robust internally and learn more effectively from limited examples.
- Zero Architectural Overhead: A major practical advantage is that LR-Drop requires no changes to the model architecture and adds zero parameters, making it a purely training-time enhancement.
Limitations
While effective, LR-Drop requires at least two forward passes per training step, effectively doubling the training time. Additionally, the method introduces new weight coefficients for the different loss components, which may require tuning for new architectures. Future work could investigate more efficient ways to apply these consistency constraints to ultra-large scale models.
Summary updated