Improving Generalization and Convergence by Enhancing Implicit Regularization

Mingze Wang, Jinbo Wang, Haotian He, Zilin Wang, Guanhua Huang, Feiyu Xiong, Zhiyu li, Weinan E, Lei Wu

TL;DR

Researchers have introduced Implicit Regularization Enhancement (IRE), a lightweight framework that speeds up the discovery of "flat minima" in deep learning. By decoupling the training dynamics of flat and sharp directions in the loss landscape, IRE consistently improves model generalization and—most impressively—achieves a 2× speedup in pre-training Llama-style language models compared to AdamW.

What Problem Does This Paper Address?

When training deep neural networks, finding a solution with low training loss isn't the only goal; the geometry of that solution matters immensely. Even if two sets of model weights result in the same training loss, the one located in a "flat" region of the loss landscape (where small changes in weights don't cause the loss to spike) typically generalizes much better to unseen data than a "sharp" minimum.

Standard optimizers like Stochastic Gradient Descent (SGD) possess an "implicit regularization" property—they naturally drift toward these flatter regions over time. However, this drifting process is notoriously slow. While you could theoretically speed it up by increasing the learning rate, doing so often makes the training unstable because the "sharp" directions (where the loss changes rapidly) will cause the model to diverge.

Comparison of optimization trajectories: Standard GD is slow (a) or unstable with a high learning rate (b), while IRE rapidly converges to the flattest minimum (c).

The core challenge is: How do we accelerate the search for flat minima without breaking the stability of the training process?

Methods

The authors propose the IRE (Implicit Regularization Enhancement) framework. The central idea is decoupling: treating flat directions and sharp directions differently during the optimizer's update step.

  1. Identify the Directions: To avoid the massive computational cost of calculating a full Hessian matrix (which describes the landscape's exact curvature), IRE uses a "lightweight" diagonal Hessian estimator based on mini-batch gradients.
  2. The Masking Strategy: IRE identifies the top-$\gamma$ "flattest" coordinates (where the estimated curvature is lowest).
  3. The Boost: During the weight update, IRE adds an extra "enhancement" term specifically to these flat directions. The update rule looks like this: $$\theta_{t+1} = \theta_t - \eta(g_t + \kappa P_t g_t)$$ Where $g_t$ is the gradient, $\kappa$ is the enhancement strength, and $P_t$ is a projection mask that isolates the flat directions.

  4. Efficiency: By updating the Hessian estimate only every $K$ steps (e.g., every 10 steps), the authors keep the computational overhead extremely low—only about 1.1× the cost of a standard optimizer step.

Datasets

The authors validated IRE across a broad range of tasks and architectures:

  • Computer Vision: CIFAR-10, CIFAR-100, and ImageNet using ResNet-18/50/56, WideResNet-28-10, and Vision Transformers (ViT-T/S).
  • Language Modeling (Llama pre-training): Wikitext-2, Wikitext-103, Minipile, and Openwebtext, training models ranging from 60M to 229M parameters.

Key Insights and Ideas

  • Effective Learning Rate: The "aha moment" of the paper is realizing that flat directions can handle much higher learning rates than sharp ones. IRE effectively gives the model a "turbo boost" in directions where it’s safe to move fast, while enforcing a strict "speed limit" in the volatile sharp directions.
  • Orthogonality to SAM: Sharpness-Aware Minimization (SAM) is a popular explicit regularization technique. The authors show that IRE isn't just an alternative to SAM; it can be seamlessly combined with it. IRE accelerates the underlying dynamics that SAM uses to find flat regions, making the combination even more potent.
  • Convergence vs. Generalization: While IRE was primarily designed to improve generalization (finding flatter spots), it surprisingly acted as a powerful convergence accelerator for Large Language Models (LLMs), reaching target validation losses in roughly half the time.

Key Results

  • LLM Speedup: In pre-training Llama models, IRE achieved a 2.1× speedup over a well-tuned AdamW. For example, a model trained with IRE for 50k steps achieved the same validation loss as AdamW at 100k steps.
  • Vision Accuracy: IRE consistently boosted Top-1 accuracy. On ImageNet with a ResNet-50, adding IRE to SGD improved accuracy by 0.23%, and adding it to SAM improved it by 0.45%.
  • ViT Improvements: The gains were even more pronounced on Vision Transformers, with accuracy jumps of over 3% on CIFAR-100 when using IRE with AdamW or SAM.
  • Flatter Solutions: Quantitative measurements of the Hessian trace confirmed that IRE indeed leads the model to significantly flatter minima than base optimizers.
Heatmap demonstrating that increasing the enhancement strength (κ) in IRE consistently reduces the sharpness of the discovered minima across different masking thresholds (γ).

Limitations and Future Work

While the results are highly promising, the authors note a few areas for further exploration:

  • Scale: The LLM experiments were conducted on models up to 229M parameters. Testing IRE on "7B+" scale models is a necessary next step for widespread industry adoption.
  • The "Why" of Convergence: The 2× speedup in LLM convergence is a massive practical win, but the theoretical link between sharpness reduction and loss convergence speed (potentially involving the "Edge of Stability" phenomenon) requires deeper study.
  • Downstream Performance: Future work should evaluate whether the flatter solutions found during pre-training translate to better performance on specific downstream fine-tuning tasks.

Paper Citation: Wang, M., et al. (2024). Improving Generalization and Convergence by Enhancing Implicit Regularization. 38th Conference on Neural Information Processing Systems (NeurIPS 2024).

Summary updated

BibTeX
@inproceedings{wang2024improving,
  author = {Mingze Wang and Jinbo Wang and Haotian He and Zilin Wang and Guanhua Huang and Feiyu Xiong and Zhiyu li and Weinan E and Lei Wu},
  title = {{Improving Generalization and Convergence by Enhancing Implicit Regularization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=cjM2bhLOiC},
}
Figure