Implicit Regularization of Stochastic Gradient Descent in Natural Language Processing: Observations and Implications

Deren Lei, Zichen Sun, Yijun Xiao, William Yang WangarXiv 2018

TL;DR

This paper investigates the often-overlooked "implicit regularization" of Stochastic Gradient Descent (SGD) in modern deep learning, particularly for Natural Language Processing (NLP) tasks. The authors demonstrate that pure SGD, even without explicit regularization techniques like dropout, consistently leads to better generalization in over-parameterized models, suggesting it's a fundamental driver of good performance.

What Problem Does This Paper Address?

Deep neural networks, especially those used in NLP, are notoriously "over-parameterized" – they have far more parameters than training examples. This typically leads to overfitting, where models memorize the training data but fail to generalize to new, unseen data. While explicit regularization methods like L1/L2 regularization and dropout are commonly used to combat overfitting, their impact is often limited. Theoretical studies have hinted that the optimization algorithm itself, specifically SGD, might be implicitly regularizing the model, pushing it towards solutions that generalize better. However, this phenomenon has been largely unexamined in the context of state-of-the-art deep learning models and real-world NLP datasets. This paper aims to bridge this gap by empirically investigating the role and implications of SGD's implicit regularization in these complex systems.

Methods

The core of the paper's methodology involves systematically evaluating the performance of deep learning models under various conditions, primarily by varying the batch size used during training. The authors compare "pure SGD" (batch size 1) against mini-batch gradient descent (larger batch sizes). They hypothesize that as the batch size increases, the optimization method moves from pure SGD towards standard Gradient Descent (GD), and if implicit regularization is at play, generalization performance should degrade.

To isolate and understand the implicit regularization effect, experiments were conducted:

  • Without explicit regularization: Initially, models were trained without dropout or L2 regularization to observe the baseline behavior.
  • With dropout: The impact of dropout, a common explicit regularizer, was then analyzed to see if it could compensate for or interact with implicit regularization.
  • Varying training data conditions: Experiments were performed with limited training data and with corrupted labels to assess the robustness of implicit regularization.
  • Weight initialization analysis: The influence of different weight initialization ranges on implicit regularization was explored.
  • Interpretation: A simple 3-layer neural network was used to visualize decision boundaries, providing a more intuitive understanding of how different batch sizes affect model behavior.

Datasets

The paper utilizes several standard NLP datasets for its experiments:

  • Sentence Classification:
    • MR (Movie Reviews)
    • SST2 (Stanford Sentiment Treebank)
    • Subj (Subjectivity test)
  • Language Modeling:
    • Penn Treebank corpus
  • Sequence Tagging:
    • CONLL 2003 NER task

Key Insights and Ideas

  • Pure SGD is a powerful implicit regularizer: The most striking finding is that pure SGD (batch size 1) consistently leads to better generalization performance across various NLP tasks compared to larger batch sizes. This suggests that the optimization process itself is a key factor in achieving good generalization, not just the model architecture or explicit regularization.
  • Implicit regularization is robust to data limitations: The paper shows that SGD's implicit regularization effect remains strong even when training data is scarce or labels are corrupted. This is surprising, as one might expect such conditions to severely hinder generalization.
  • Dropout doesn't replace implicit regularization: While dropout can improve generalization, it doesn't fully substitute for the implicit regularization provided by pure SGD. The implicit effect is weakened but still present even with dropout.
  • Initialization matters, but not always linearly: While smaller initialization ranges tend to correlate with stronger implicit regularization, the relationship isn't strictly monotonic. This suggests a nuanced interplay between initialization and optimization.

Key Results

  • Generalization Performance: Across sentence classification, language modeling, and sequence tagging tasks, pure SGD (batch size 1) consistently achieved better test performance (e.g., higher accuracy, lower perplexity, higher F1 scores) than models trained with larger batch sizes. This improvement was observed even when explicit regularization like dropout was applied.
  • Limited Data: When the training dataset size was reduced to 10% of the original, the generalization performance of models trained with pure SGD showed only a slow, steady decrease, indicating the resilience of implicit regularization.
  • Corrupted Labels: Even with label corruption levels up to 0.2, the implicit regularization effect of SGD remained strong, maintaining a performance gap compared to larger batch sizes. The gap narrowed at higher corruption levels, but pure SGD still showed a more predictable degradation.
  • Weight Initialization: Table 2 shows that for language modeling, smaller initialization ranges (e.g., [10^-3.5, 10^-3]) generally led to better implicit regularization, especially with smaller batch sizes.

Limitations and Future Work

  • Computational Cost: The paper acknowledges that pure SGD converges much slower than mini-batch methods, making it computationally expensive for large-scale training. This is a significant practical limitation.
  • Theoretical Understanding: While the paper provides strong empirical evidence, it notes that a complete theoretical understanding of SGD's implicit regularization in deep neural networks with complex activations and cross-entropy loss is still lacking.
  • Other Regularizers: The authors suggest further research into the impact of other explicit regularizers like early stopping and L2 regularization.
  • Practical Applications: The study aims to help researchers better measure and understand the generalization of their models, implying future work could focus on leveraging these insights for more effective model design and training strategies.

Summary updated

BibTeX
@misc{lei2018implicit,
  author = {Deren Lei and Zichen Sun and Yijun Xiao and William Yang Wang},
  title = {{Implicit Regularization of Stochastic Gradient Descent in Natural Language Processing: Observations and Implications}},
  year = {2018},
  eprint = {1811.00659},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.00659},
}
Figure