Manuscript Offprint

arXiv:2608.13514

Bagging Robustly Learns VC Classes with Linear Sample Complexity

Omar Montasser

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We revisit the problem of learning predictors robust to adversarial examples at test-time. We prove that VC classes are adversarially robustly learnable with sample complexity linear in the VC dimension dd, providing an exponential improvement over the previous upper bound of Montasser, Hanneke, and Srebro (2019). Remarkably, this result is achieved with a simple improper algorithm that combines the classic heuristic bagging (bootstrap aggregation) of Breiman (1996) with robust empirical risk minimization (RERM). Our algorithm computes RERMs on O(d⋆)O(d^{\star}) indpendent bootstrap samples and outputs their majority-vote, where d⋆d^{\star} denotes the dual VC dimension. We complement this result with a lower bound showing that this is unavoidable: in general, any learner in this oracle model requires Ω(d⋆)\Omega(d^{\star}) calls to an RERM\mathrm{RERM} oracle, even when given arbitrarily many training examples.

1 Introduction

Learning predictors robust to adversarial examples is a major contemporary challenge in machine learning. Adversarial examples can be thought of as carefully crafted perturbations of test examples that cause predictors to misclassify. Over the past decade, there has been a significant interest in how deep learning predictors are not robust to adversarial examples (Szegedy et al., 2013; Biggio et al., 2013; Goodfellow et al., 2015), leading to an ongoing effort to devise methods for learning predictors that are adversarially robust (Madry et al., 2018; Cohen et al., 2019; Zhang et al., 2019, e.g.,).

Given an instance space X\mathcal{X} and label space Y={−1,1}\mathcal{Y}=\left\{-1,1\right\}, we formalize an adversary (or perturbation map) we would like to be robust against as U:X→2X\mathcal{U}:\mathcal{X}\to 2^{\mathcal{X}}, where U(x)⊆X\mathcal{U}(x)\subseteq\mathcal{X} is the set of perturbations of xx that can be chosen by the adversary at test-time. For example, U\mathcal{U} could be perturbations of bounded ℓ∞\ell_{\infty} norm which represents “imperceptible” image perturbations in practice (Goodfellow et al., 2015). The only (implicit) restriction is that U(x)\mathcal{U}(x) is non-empty for every xx. We observe nn i.i.d. samples S=((Xi,Yi))i=1n∼PnS=((X_{i},Y_{i}))_{i=1}^{n}\sim P^{n} from an (unknown) distribution PP over X×Y\mathcal{X}\times\mathcal{Y}, and our goal is to learn a predictor f^:X→Y\hat{f}:\mathcal{X}\to\mathcal{Y} having small population robust risk,

RU(f^;P)=\mathdsE(X,Y)∼P[sup⁡Z∈U(X)\mathds1{f^(Z)≠Y}].{\mathrm{R}}_{\mathcal{U}}(\hat{f};P)=\underset{(X,Y)\sim P}{\mathds{E}}\left[\sup_{Z\in\mathcal{U}(X)}\mathds{1}\left\{\hat{f}(Z)\neq Y\right\}\right].

A central approach to adversarially robust learning in practice is adversarial training, where model parameters are trained to fit the training examples and their corresponding adversarial perturbations (Madry et al., 2018; Zhang et al., 2019, e.g.,). Theoretically, this can be viewed as minimizing the empirical robust risk over a function class F⊆YX\mathcal{F}\subseteq\mathcal{Y}^{\mathcal{X}} (e.g., neural networks):

f^S∈RERMF(S):=arg⁡min⁡f∈F1n∑i=1nsup⁡Zi∈U(Xi)\mathds1{f(Zi)≠Yi}.\widehat{f}_{S}\in\mathrm{RERM}_{\mathcal{F}}(S):=\underset{f\in\mathcal{F}}{\arg\min}\quad\frac{1}{n}\sum_{i=1}^{n}\sup_{Z_{i}\in\mathcal{U}(X_{i})}\mathds{1}\left\{f(Z_{i})\neq Y_{i}\right\}.

This approach is justified by classical uniform convergence arguments applied to the robust risk, i.e., arguing that with sufficiently many training examples, the robust generalization gap ∣RU(f;P)−RU(f;S)∣|{\mathrm{R}}_{\mathcal{U}}(f;P)-{\mathrm{R}}_{\mathcal{U}}(f;S)| is small for all f∈Ff\in\mathcal{F} (Cullina, Bhagoji, and Mittal, 2018; Bubeck, Lee, Price, and Razenshteyn, 2019; Yin, Ramchandran, and Bartlett, 2019). However, empirical evidence shows severe overfitting: adversarial training yields models with low empirical robust risk but high population robust risk (Schmidt, Santurkar, Tsipras, Talwar, and Madry, 2018). This discrepancy suggests that adversarial training and uniform convergence alone may not guarantee provable robust learning.

This empirical observation is indeed mirrored by a fundamental theoretical limitation. Montasser, Hanneke, and Srebro (2019) showed that minimizing the empirical robust risk as in (2)–or any surrogate thereof–can provably fail, even in simple settings. Specifically, there are function classes F\mathcal{F} with VC dimension 11 that are not adversarially robustly learnable with any proper learning algorithm, namely, one constrained to output a predictor f^∈F\hat{f}\in\mathcal{F}. To bypass the limitation of proper learning, Montasser, Hanneke, and Srebro (2019) designed an improper learning algorithm to adversarially robustly learn classes F\mathcal{F} with finite VC dimension. This separation between proper and improper learning stands in sharp contrast to classical (non-robust) PAC learning (Valiant, 1984), where empirical risk minimization (ERM\mathrm{ERM}), a proper learning rule, learns VC classes with near-optimal sample complexity (Vapnik and Chervonenkis, 1971; Valiant, 1984; Blumer, Ehrenfeucht, Haussler, and Warmuth, 1989; Ehrenfeucht, Haussler, Kearns, and Valiant, 1989).

Despite this progress in adversarially robust learning, two fundamental challenges remain concerning: sample-efficiency and oracle-efficiency. First, the best known upper bound on the sample complexity is exponential in the VC dimension dd (Montasser, Hanneke, and Srebro, 2019). Second, the improper learning algorithm attaining this bound is quite complex and inefficient; it makes O(nd)O(n^{d}) oracle calls to RERM\mathrm{RERM} (2) with a prohibitive additional computational overhead of n2O(d)n^{2^{O(d)}}. These challenges motivate the central question we study in this work:

Can we design sample-efficient and oracle-efficient adversarially robust learning algorithms? Or are there fundamental limitations prohibiting that?

In addition to our goal of improving the sample complexity of adversarially robust learning, we are especially interested in oracle-efficient algorithms. Just as efficient PAC learning reduces to efficient ERM\mathrm{ERM}, this work seeks an analogous recipe for robustness: reducing efficient robust PAC learning of a class F\mathcal{F} to efficient RERM\mathrm{RERM}. In this context, we view RERM\mathrm{RERM} (2) as a natural black-box oracle, since adversarial training methods in practice (Madry et al., 2018; Zhang et al., 2019, e.g.,) can be viewed as heuristics implementing RERM\mathrm{RERM}. Theoretically, oracle-efficient robust learners would strengthen reductions for leveraging non-robust learners (Montasser, Hanneke, and Srebro, 2020b), handling unknown perturbations (Montasser, Hanneke, and Srebro, 2021), and achieving computational efficiency (Montasser, Goel, Diakonikolas, and Srebro, 2020a), thereby unifying algorithmic efficiency with provable robustness.

References (65)