Robustness between the worst and average case

Leslie Rice, Anna Bair, Huan Zhang, J. Zico KolterNeurIPS 2021

Introduction

In machine learning, evaluating a model's "robustness" typically focuses on one of two extremes:

  1. Average-case robustness: How well a model handles random, natural noise (e.g., Gaussian blur) drawn from a specific distribution.
  2. Worst-case (Adversarial) robustness: How well a model withstands the single most damaging perturbation possible within a defined set.

While these extremes are well-studied, this binary view is limiting. Real-world threats often fall somewhere in between—they are more structured than random noise but less targeted than a full-blown adversarial attack. Measuring this "middle ground," however, is mathematically challenging. It requires calculating high-dimensional integrals over the space of all possible perturbations. Naive sampling methods, like simple Monte Carlo, fail in this context because they rarely sample the rare, high-loss regions that define a model's vulnerability as it approaches the worst-case scenario.

This paper bridges the gap between average-case and worst-case robustness by introducing a continuous spectrum of "intermediate-$q$" robustness metrics. To navigate the high-dimensional integrals required to measure this middle ground, the authors provide a novel, efficient estimation method using path sampling and Markov Chain Monte Carlo (MCMC).

A Continuous Spectrum of Robustness

The core innovation of this work is treating robustness as a functional $q$-norm of the loss over the perturbation space. In this framework:

  • $q = 1$ corresponds to average-case robustness.
  • $q \to \infty$ corresponds to adversarial (worst-case) robustness.
  • Intermediate $q$ values represent a sliding scale between the two.

To estimate these norms efficiently, the authors adapt path sampling (or thermodynamic integration), a technique borrowed from statistical physics. They interpret the $q$-norm integral as a "partition function" of a probability distribution. By employing an "annealing" process—gradually shifting from a simple distribution (random noise) to a more "peaked" one (focused on high loss)—they can estimate the norm using the geometric mean of samples.

For differentiable perturbations, such as pixel-wise changes, the authors utilize Hamiltonian Monte Carlo (HMC) to sample effectively. For non-differentiable perturbations, like rotations or crops, they rely on Metropolis-Hastings.

Key Insights and Results

The authors evaluated their approach on standard computer vision benchmarks (MNIST and CIFAR-10), testing models trained with standard methods, data augmentation (random noise), and adversarial training (PGD).

The Failure of Naive Sampling

A primary finding is that simple random sampling significantly underestimates a model's vulnerability for intermediate $q$ values because it misses pockets of high loss. By reframing the robustness metric as a partition function, the authors unlocked decades of research in statistical mechanics to solve this previously intractable evaluation problem.

As shown in the results below, the path-sampling estimator (PS+HMC) consistently provides much more accurate—and significantly higher—loss estimates for intermediate $q$ values compared to naive Monte Carlo (MC).

Comparison of Monte Carlo vs. Path Sampling (PS+HMC) estimates across different q values.

For example, on a standard MNIST model evaluated at $q=10^3$, naive MC estimated a loss of only 0.268. In contrast, the more accurate PS+HMC method revealed the true vulnerability was actually 4.456, demonstrating that PS+HMC successfully finds the more "adversarial" regions that MC misses.

Training for Intermediate Robustness

Robustness is a spectrum: a model robust to random noise isn't necessarily robust to "slightly-worse-than-average" noise. The paper highlights a clear trade-off where models optimized for one end of the spectrum often perform poorly in the middle.

Crucially, the authors demonstrate that these path-sampling estimators can be used directly as a training objective. This allows for the creation of models specifically tuned for intermediate levels of robustness.

Evaluation of models trained using different intermediate-q objectives.

Models trained with the PS+HMC objective achieved better "middle-ground" performance (lower intermediate-$q$ loss) than those trained with simple random noise or full adversarial training.

Limitations and Future Work

While promising, the approach has several limitations that present opportunities for future research:

  • Computational Cost: Running MCMC (especially HMC) inside a training loop is significantly more computationally expensive than standard training or basic adversarial training.
  • Hyperparameter Sensitivity: HMC requires careful tuning of step sizes and variances to function correctly, which can be difficult to automate across different architectures and datasets.
  • Scaling to Large Datasets: Although the method is effective on MNIST and CIFAR-10, the computational complexity makes scaling this training approach to larger datasets like ImageNet a significant challenge.

Summary updated

BibTeX
@inproceedings{rice2021robustness,
  author = {Leslie Rice and Anna Bair and Huan Zhang and J. Zico Kolter},
  title = {{Robustness between the worst and average case}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=uIP0giNarj},
}
Figure