Smoothness Analysis of Loss Functions of Adversarial Training

Sekitoshi Kanai, Masanori Yamada, Hiroshi Takahashi, Yuki Yamanaka, Yasutoshi Ida

Adversarial training (AT) is the gold standard for defending deep neural networks against adversarial attacks. Despite its effectiveness, AT is notoriously difficult to optimize, often resulting in "robust overfitting" and significantly lower accuracy compared to standard training. This paper investigates the underlying cause of these difficulties, identifying the non-smoothness of the adversarial loss landscape as a primary culprit. By analyzing how attack constraints influence the Lipschitz continuity of the gradient, the authors propose EntropySGD as a mathematically grounded solution to smooth the training objective.

The Smoothness Problem in Adversarial Training

The difficulty of adversarial training stems from the fact that the adversarial loss function is often non-smooth, meaning its gradient is not Lipschitz continuous. Unlike standard training, where the loss is a direct function of fixed data points, the adversarial loss depends on an "optimal" attack that itself changes as the model's parameters $\theta$ evolve.

Visualization of a non-smooth loss landscape in adversarial training.

Previous research often overlooked this parameter-dependent nature of the attack. This study utilizes the implicit function theorem and bordered Hessian matrices to rigorously analyze the smoothness of the adversarial objective in general deep neural networks.

Theoretical Insights: $L_2$ vs. $L_\infty$ Constraints

A key finding of this work is the inherent difference between $L_2$ (Euclidean) and $L_\infty$ (maximum perturbation) constraints. While both are common in the literature, $L_\infty$ constraints introduce significantly more "jaggedness" into the loss landscape.

Geometric comparison of $L_2$ and $L_\infty$ constraints on the optimal adversarial attack.

As shown in the figure above, $L_\infty$ attacks tend to push perturbations toward the corners of a hypercube. A minor update to the model parameters can cause the optimal attack to jump abruptly from one corner to another. This discontinuity in the optimal attack $x^*(\theta)$ manifests as a massive spike in the gradient of the loss function, making optimization volatile. Furthermore, the authors identify a "Robustness Paradox": as a model becomes more robust to input perturbations (flattening the input-loss landscape), the Lipschitz constant of the gradient with respect to the parameters actually increases, making the training process harder.

Smoothing via EntropySGD

To mitigate these optimization hurdles, the authors propose the use of EntropySGD. Standard SGD minimizes the loss at a single point in the parameter space. In contrast, EntropySGD optimizes a local "Gibbs distribution," effectively averaging the loss over a small neighborhood.

The paper provides a mathematical proof that this local averaging smoothens the objective function, even when the original adversarial loss is non-smooth. By prioritizing "wide valleys" over sharp, non-smooth minima, EntropySGD bypasses the jagged edges created by adversarial constraints.

Experimental Results

The researchers evaluated EntropySGD (EnSGD) on CIFAR-10, CIFAR-100, and SVHN using ResNet-18 and WideResNet-34-10 architectures. Key findings include:

  • Higher Robust Accuracy: On CIFAR-10, EnSGD improved robust accuracy against the AutoAttack benchmark from 48.0% to 49.2%. When combined with Adversarial Weight Perturbation (AWP), it reached 50.5%.
  • Faster Convergence: Despite the internal iterations required by EntropySGD, it reached peak robust accuracy faster than standard AT.
  • Reduced Overfitting: The method narrowed the gap between training and test robust accuracy, addressing the common issue of robust overfitting.

Conclusion

This work highlights that the choice of attack constraint is not just a matter of preference but a fundamental factor in the optimizability of robust models. By identifying the non-smoothness induced by $L_\infty$ constraints and providing a smoothing solution via EntropySGD, this research offers a principled path toward more stable and effective adversarial training. Future work may explore how these findings apply to non-vision domains and the gap between theoretical optimal attacks and practical PGD approximations.

Summary updated

BibTeX
@misc{kanai2021smoothness,
  author = {Sekitoshi Kanai and Masanori Yamada and Hiroshi Takahashi and Yuki Yamanaka and Yasutoshi Ida},
  title = {{Smoothness Analysis of Loss Functions of Adversarial Training}},
  year = {2021},
  eprint = {2103.01400},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.01400},
}
Figure