A PAC-Bayes Analysis of Adversarial Robustness

Paul Viallard, Guillaume Vidot, Amaury Habrard, Emilie Morvant

TL;DR

This paper introduces the first PAC-Bayesian generalization bounds for adversarial robustness by shifting the theoretical focus from pessimistic worst-case analysis to averaged risks over input perturbations. By optimizing these tight bounds directly during training, the authors provide a theoretically grounded algorithm for learning robust majority-vote classifiers—such as differentiable decision trees—that come with genuine performance guarantees at test time.

What Problem Does This Paper Address?

Adversarial examples—tiny, imperceptible tweaks to inputs that completely fool machine learning models—pose a massive safety risk in critical applications like autonomous driving, aeronautics, and medical diagnosis. While empirical defenses (like adversarial training) work well in practice, we lack general, tight theoretical guarantees on how well a model will resist attacks on unseen data.

Existing theoretical frameworks (such as those based on VC-dimension or Rademacher complexity) typically rely on worst-case analysis. This focus often leads to overly pessimistic ("vacuous") bounds or optimization problems that are computationally intractable in practice. This paper aims to bridge the gap between theory and practice by providing tight, optimizable generalization bounds for adversarial robustness.

Methods

The authors tackle this problem through the lens of PAC-Bayes theory, a framework that provides generalization guarantees for ensembles or majority vote classifiers (where individual hypotheses are weighted by a posterior distribution $Q$).

Instead of calculating the absolute worst-case risk over all possible perturbations, they propose two relaxed, distribution-dependent risk metrics:

  1. Averaged Adversarial Risk: The probability of misclassification when a perturbation is randomly drawn from an example-dependent noise distribution.
  2. Averaged-Max Adversarial Risk: The probability that at least one out of $n$ sampled perturbations fools the majority vote.

They derive novel PAC-Bayesian generalization bounds for both risks. Crucially, they turn these bounds into a practical two-step training algorithm (Average Adversarial Training with Guarantee) using ensembles of differentiable decision trees:

  • Step 1: Construct a robust, data-dependent prior distribution using a subset of the data.
  • Step 2: Directly minimize the derived generalization bounds on the remaining data to find the optimal robust posterior distribution.

Datasets

The approach was evaluated on six binary classification tasks derived from two standard computer vision benchmarks:

  • MNIST: 1vs7, 4vs9, and 5vs6 digits.
  • Fashion MNIST: Coat vs Shirt, Sandal vs Ankle Boot, and Top vs Pullover.

The test sets were evaluated under uniform noise (UNIF) as well as custom variants of standard attacks: Projected Gradient Descent ($\text{PGD}_U$) and the Fast Gradient Sign Method ($\text{IFGSM}_U$), adapted to handle the paper's perturbation distribution setting.

Key Insights and Ideas

  • Averaging over the Worst-Case: Relaxing the traditional "max-error" adversarial formulation to an "averaged" or "averaged-max" formulation makes the mathematics tractable under the PAC-Bayes framework while still providing a strong proxy for actual security.
  • Independence from Perturbation Count: Surprisingly, the generalization bound for the Averaged Adversarial Risk depends only on the number of original training samples ($m$), not the number of generated perturbations ($n$). This is because the perturbations generated for a given sample are inherently inter-dependent.
  • The Power of Saturation ($H^{\text{SIGN}}$): Enforcing a hard sign function on the individual tree outputs ($H^{\text{SIGN}}$) significantly tightens the bounds. The sign function "saturates" the outputs, making the majority vote more stable against small input variations and effectively minimizing the Total Variation (TV) distance penalty term in the bound.

Key Results

  • Non-Vacuous Bounds: Unlike many traditional generalization bounds that evaluate to values greater than 1 (rendering them useless), the proposed bounds with $H^{\text{SIGN}}$ are consistently below 1 and highly informative.
  • Strong Empirical Defense: Models trained with the proposed algorithm under $\text{PGD}_U$ and $\text{IFGSM}_U$ defenses showed up to a 13x improvement in adversarial risk compared to undefended models or naive uniform noise defenses.
  • Tight Gap to Classical Risk: The empirical gap between the authors' relaxed risk metrics and the standard, classical worst-case adversarial risk ($R^{\text{ROB}}$) remains small. This proves that optimizing for average-case robustness still yields models that are highly resilient against standard worst-case attacks.

Limitations and Future Work

  • Binary Classification Only: The current theoretical framework and experimental validation are strictly limited to binary classification tasks.
  • Future Extensions: The authors highlight extending these bounds to multiclass and multilabel settings as a primary next step.
  • Advanced PAC-Bayes Tools: They suggest incorporating other advanced PAC-Bayesian tools (like the C-bound or tandem loss) to better account for voter diversity, as well as exploring applications in multimodal/multiview learning and classifier fusion.

Summary updated

Abstract

We propose the first general PAC-Bayesian generalization bounds for adversarial robustness, that estimate, at test time, how much a model will be invariant to imperceptible perturbations in the input. Instead of deriving a worst-case analysis of the risk of a hypothesis over all the possible perturbations, we leverage the PAC-Bayesian framework to bound the averaged risk on the perturbations for majority votes (over the whole class of hypotheses). Our theoretically founded analysis has the advantage to provide general bounds (i) that are valid for any kind of attacks (i.e., the adversarial attacks), (ii) that are tight thanks to the PAC-Bayesian framework, (iii) that can be directly minimized during the learning phase to obtain a robust model on different attacks at test time.
BibTeX
@inproceedings{viallard2021pac,
  author = {Paul Viallard and Guillaume Vidot and Amaury Habrard and Emilie Morvant},
  title = {{A PAC-Bayes Analysis of Adversarial Robustness}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=sUBSPowU3L5},
}
Figure