Regularizing Neural Networks via Adversarial Model Perturbation

Yaowei Zheng, Richong Zhang, Yongyi Mao

Abstract

Effective regularization techniques are highly desired in deep learning for alleviating overfitting and improving generalization. This work proposes a new regularization scheme, based on the understanding that the flat local minima of the empirical risk cause the model to generalize better. This scheme is referred to as adversarial model perturbation (AMP), where instead of directly minimizing the empirical risk, an alternative "AMP loss" is minimized via SGD. Specifically, the AMP loss is obtained from the empirical risk by applying the "worst" norm-bounded perturbation on each point in the parameter space. Comparing with most existing regularization schemes, AMP has strong theoretical justifications, in that minimizing the AMP loss can be shown theoretically to favour flat local minima of the empirical risk. Extensive experiments on various modern deep architectures establish AMP as a new state of the art among regularization schemes.

Introduction: The Quest for Flat Minima

A central mystery in deep learning is why models with millions of parameters generalize well instead of simply memorizing training data. Empirical evidence suggests that flat local minima—regions where the loss remains low despite small parameter shifts—generalize significantly better than sharp local minima.

Standard Empirical Risk Minimization (ERM) focuses solely on minimizing loss depth, often landing in sharp valleys that perform poorly on unseen data. While techniques like Dropout or Weight Decay provide some regularization, they often lack a direct theoretical link to the "flatness" principle. This paper introduces Adversarial Model Perturbation (AMP) to explicitly steer optimization toward these desirable flat regions.

Adversarial Model Perturbation (AMP)

The core idea of AMP is to minimize the "worst-case" loss within a small neighborhood of the model parameters $\theta$. The authors define the AMP loss as: $$L_{AMP}(\theta) := \max_{\|\Delta\| \le \epsilon} L_{ERM}(\theta + \Delta)$$

Illustration of how AMP loss (blue dashed) transforms the empirical risk (red solid) to favor flat minima.

Training with AMP involves a mini-batch SGD approach with an inner-outer optimization loop:

  1. Inner Loop: Identify the "worst" perturbation $\Delta$ that maximizes the loss within an $\epsilon$-radius ball.
  2. Outer Loop: Update model parameters $\theta$ to minimize this worst-case loss.

Unlike standard Adversarial Training, which perturbs input data for robustness, AMP perturbs model weights to improve generalization.

Theoretical and Empirical Insights

The "Max-Pooling" Intuition

AMP acts as a "max-pooling" operation over the loss landscape. By picking the highest peak in a parameter neighborhood, minimizing the AMP loss naturally pushes the model into wide, flat valleys where the "worst-case" is still relatively low.

Implicit Gradient Regularization

The paper demonstrates that for small perturbations, minimizing the AMP loss is approximately equivalent to minimizing the standard loss plus a penalty on the gradient norm. This provides a formal bridge between adversarial weight perturbation and existing gradient-based regularization theories.

Comparison of loss landscapes around the ERM and AMP solutions, demonstrating the increased flatness achieved by AMP.

Theoretical Justification

Under the assumption that local minima are shaped like inverted Gaussians, the authors prove that AMP loss specifically favors minima with a larger "width" (measured by the smallest eigenvalue of the Hessian matrix).

Experimental Results

AMP was evaluated across standard benchmarks including SVHN, CIFAR-10, and CIFAR-100 using architectures like PreActResNet18, VGG16, and WideResNet.

  • Superior Generalization: AMP consistently outperformed baseline methods like Dropout, Label Smoothing, and MixUp. For instance, on CIFAR-100 with PreActResNet18, AMP achieved a test error of 21.51%, a significant improvement over ERM's 24.31%.
  • Synergy with Data Augmentation: When combined with AutoAugment on CIFAR-100 (PyramidNet), AMP reduced test error from 15.43% to 13.36%.
  • Better Calibration: AMP-trained models are less likely to be overconfident when incorrect, leading to better-calibrated predictions.
  • Efficiency: Using a single inner iteration ($N=1$) makes AMP roughly 1.8x slower than standard training, a manageable trade-off for the observed gains.

Discussion and Limitations

While AMP establishes a new state-of-the-art, it introduces sensitivity to the perturbation radius $\epsilon$. Proper tuning is essential to avoid underfitting. Additionally, the theoretical proofs rely on local Gaussian approximations of the loss surface, which may simplify the true complexity of deep neural network landscapes. Future work may explore more efficient approximations of the "worst" perturbation to further reduce the computational overhead.

Code available at: https://github.com/hiyouga/AMP-Regularizer

Summary updated

BibTeX
@inproceedings{zheng2021regularizing,
  author = {Yaowei Zheng and Richong Zhang and Yongyi Mao},
  title = {{Regularizing Neural Networks via Adversarial Model Perturbation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  url = {https://openreview.net/forum?id=WYgC7EM7ZV},
}
Figure