Why Do Artificially Generated Data Help Adversarial Robustness

Yue Xing, Qifan Song, Guang ChengNeurIPS 2022 · OpenReview

Adversarial training (AT)—training models on "perturbed" examples to resist attacks—is notoriously data-hungry. While recent empirical breakthroughs have shown that adding millions of unlabeled or GAN-generated images can push robustness to new heights, the underlying reasons why this works so well have remained fuzzy.

Specifically, two questions have persisted in the field:

  1. The Asymmetry: Why does unlabeled data help adversarial robustness so much more than it helps "clean" (standard) accuracy?
  2. The Quality Gap: How does the quality of the data generator (e.g., a perfect distribution vs. a biased GAN) impact the final robustness?

This paper provides a theoretical foundation to answer these questions. By decomposing adversarial risk into distinct components, the authors show that adversarial training is uniquely less sensitive to labeling errors than standard training, and they propose a dynamic weighting algorithm to maximize the utility of even low-quality synthetic data.

Deconstructing the Error: Label Cost vs. Generator Cost

To understand the mechanics of synthetic data in AT, the authors tackle the problem through a statistical lens, providing an exact error decomposition of the "excess adversarial risk." They break the error down into two primary components:

  • Label Cost: The error introduced by using a "clean" classifier to assign pseudo-labels to unlabeled or generated data.
  • Generator Cost: The error introduced because the synthetic data distribution doesn't perfectly match the real-world distribution.
Decomposition of excess adversarial risk into label cost and generator cost.

The Asymmetry of Adversarial Training: A key novelty of this work is proving that in the adversarial loss function, the model parameters and the true data parameters play asymmetric roles. This is a departure from standard linear regression, where they are symmetric. Because of this asymmetry, the "label cost" becomes much less influential as the attack strength ($\epsilon$) increases.

Key Insights: Error Tolerance and the "U-Shaped" Benefit

The theoretical decomposition leads to several practical insights about how models behave when trained with synthetic data:

  • Adversarial Training is "Error-Tolerant": The most surprising finding is that adversarial training is naturally more robust to noisy pseudo-labels than standard training. As the attack strength $\epsilon$ grows, the benefit of having more data points (which help map the data density near decision boundaries) outweighs the harm of the labeling noise.
  • The U-Shaped Benefit for Poor Generators: You don't need a perfect GAN to improve robustness. However, for "poor" generators, there is a U-shaped curve regarding the amount of synthetic data used. A little bit of low-quality data helps smooth out predictions, but too much can eventually hurt performance due to the accumulating "generator cost" (bias).
Excess risk ratio showing the U-shaped benefit for poor generators.

Putting Theory into Practice: Dynamic Weighting

To make these insights actionable, the authors introduce a dynamic weighting algorithm. Instead of using a static 1:1 ratio between real and synthetic data, the algorithm uses a surrogate of the generator loss (balancing the bias-variance trade-off) to "downweight" synthetic data if the generator is poor. This optimizes the adversarial risk on the fly.

Empirical Validation: The authors validated their theories and algorithm using standard benchmarks like CIFAR-10, CIFAR-100, and SVHN. They compared "ideal" generators (real unlabeled data) against "poor" generators (e.g., multivariate Gaussians or models trained on limited data).

Their dynamic weighting algorithm achieved results comparable to the "best fixed weight" found via exhaustive grid search, but at a fraction of the computational cost. For instance, on a binary CIFAR-10 task (airplane vs. car) with 4,000 unlabeled samples, their method reached ~84% robust accuracy compared to ~81.7% for unweighted training.

Limitations and Future Directions

While this paper takes a significant step forward in explaining the mechanics of adversarial training, it has a few limitations:

  • Simplified Models: Much of the rigorous theoretical proof relies on linear and logistic regression setups with sub-Gaussian distributions. While the insights carry over to Deep Neural Networks (DNNs) empirically, a full theoretical treatment of non-convex DNNs remains a challenge.
  • Attack Diversity: The study focuses primarily on $L_2$ and $L_\infty$ attacks. Future work could investigate if these insights hold for more complex, non-norm-based adversarial perturbations.
  • Generator Evolution: The current algorithm tunes the weight of the data, but it doesn't "fix" the generator itself. Integrating the weighting scheme directly with the training of the generative model could be a promising next step.

Summary updated

Abstract

In the adversarial training framework of \cite{carmon2019unlabeled,gowal2021improving}, people use generated/real unlabeled data with pseudolabels to improve adversarial robustness. We provide statistical insights to explain why the artificially generated data improve adversarial training. In particular, we study how the attack strength and the quality of the unlabeled data affect adversarial robustness in this framework. Our results show that with a high-quality unlabeled data generator, adversarial training can benefit greatly from this framework under large attack strength, while a poor generator can still help to some extent. To make adaptions concerning the quality of generated data, we propose an algorithm that performs online adjustment to the weight between the labeled real data and the generated data, aiming to optimize the adversarial risk. Numerical studies are conducted to verify our theories and show the effectiveness of the proposed algorithm.
BibTeX
@inproceedings{xing2022why,
  author = {Yue Xing and Qifan Song and Guang Cheng},
  title = {{Why Do Artificially Generated Data Help Adversarial Robustness}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=W-Z8n9HrWn0},
}
Figure