Bagging Provides Assumption-free Stability

Jake A. Soloff, Rina Foygel Barber, Rebecca Willett

TL;DR

Bagging is widely used to reduce variance, but can it provably stabilize any learning algorithm without making restrictive assumptions? This paper proves that bagging provides an assumption-free, finite-sample guarantee on average-case algorithmic stability for arbitrary base models and data distributions. The authors show that the resulting stability bound is tight up to a constant factor and extends to unbounded outputs via adaptive clipping.

What Problem Does This Paper Address?

Algorithmic stability measures how sensitive a machine learning model's predictions are to small perturbations in its training data (such as dropping one data point). Stability is a cornerstone of statistical learning theory: it governs generalization bounds, guarantees the validity of jackknife/leave-one-out conformal prediction intervals, and ensures reproducible scientific findings.

Unfortunately, standard machine learning methods (such as unregularized deep neural networks or deep decision trees) are notoriously unstable. Prior attempts to prove that bagging (bootstrap aggregating) induces stability had critical gaps:

  1. They assumed the base algorithm was already stable.
  2. They required severe subsampling (taking bag sizes $m = o(\sqrt{n})$), sacrificing predictive accuracy.
  3. Universal statistical tests to verify whether an algorithm is stable are mathematically impossible without massive sample sizes.

The central question addressed here is: Can bagging convert an arbitrary, potentially highly unstable algorithm into a stable one, without making any assumptions on the base algorithm, covariate dimension, or data distribution?

Methods

The paper analyzes both idealized derandomized bagging ($\tilde{\mathcal{A}}_\infty$, taking an infinite number of bags) and generic bagging ($\tilde{\mathcal{A}}_B$, taking $B$ empirical bags), covering four standard resampling schemes: classical bootstrap bagging, subbagging without replacement, Poissonized bagging, and Bernoulli subbagging.

Key technical ingredients include:

  • Average-Case $(\varepsilon, \delta)$-Stability: Rather than demanding worst-case stability over every single point, the authors analyze the average leave-one-out perturbation across training points: $$\frac{1}{n} \sum_{i=1}^n \mathbb{P}_\xi\left(|\hat{f}(x) - \hat{f}^{\setminus i}(x)| > \varepsilon\right) \le \delta$$
  • Variance and Covariance Analysis: Using Cauchy–Schwarz and Popoviciu’s inequality on bounded predictions, the leave-one-out perturbation is bounded by the probability $p$ that an observation is included in a bag and its cross-bag covariance parameter $q$.
  • Finite $B$ via Hoeffding’s Inequality: The gap between finite-bag bagging and the derandomized limit is bounded using concentration inequalities, adding an explicit Monte Carlo error term of order $O\left(\sqrt{\frac{1}{B}\log\frac{1}{\delta'}}\right)$.
  • Extensions to Unbounded Responses: The authors introduce adaptively clipped bagging, where individual bag outputs are clipped to a data-dependent interval $I(D)$ (e.g., based on response quantiles or empirical range).

Datasets

The paper evaluates the theoretical bounds exclusively on synthetic simulation settings (no real-world benchmark datasets were used):

  • Setting 1 (High-Dimensional Logistic Regression): $n = 500, d = 200$, covariates drawn i.i.d. from $\mathcal{N}(0, I_d)$, and Bernoulli labels with an extremely small $\ell_2$ penalty.
  • Setting 2 (Logistic Regression): Same setup as Setting 1, scaled to $n = 1000, d = 200$.
  • Setting 3 (Neural Network): $n = 500, d = 200$, fitting a single-hidden-layer MLP classifier (40 units) with SGD.
  • Setting 4 (Regression Trees): $n = 500, d = 40$, nonlinear regression with periodic and latent confounder terms, fitted with an unpruned DecisionTreeRegressor (maximum depth 50).

Key Insights and Ideas

  • Universal Stabilization: Bagging guarantees average-case stability for any bounded base algorithm. The stabilizer treats the algorithm as a pure black box.
  • Why Bagging Works: The stabilizing mechanism relies on the exclusion probability $(1 - p)$. Leaving a high-leverage data point out of a constant fraction of bags systematically suppresses its influence on the aggregated prediction.
  • Average-Case vs. Worst-Case Dichotomy:
  • For worst-case stability, the paper proves a hardness result: derandomized bagging cannot guarantee worst-case stability for any $\varepsilon < p$. Hence, achieving $O(n^{-1/2})$ worst-case stability requires massive subsampling ($p = O(n^{-1/2})$).
  • For average-case stability, subbagging half the data ($p = 0.5$) guarantees perturbation $\varepsilon = O(n^{-1/2})$, retaining model capacity while ensuring stability.
  • Matching Lower Bound: By constructing an adversarial base algorithm that counts training points exceeding a threshold, the authors prove that their guarantee $\delta \varepsilon^2 \gtrsim \frac{1}{n}\frac{p}{1-p}$ is optimal up to constant factors.

Key Results

  • Theoretical Guarantee (Theorem 8): For any base algorithm with outputs in $[0, 1]$, derandomized bagging satisfies $(\varepsilon, \delta)$-stability whenever: $$\delta \varepsilon^2 \ge \frac{1}{4(n-1)} \cdot \frac{p}{1 - p}$$ For subbagging with $m = n/2$ ($p = 0.5$), this simplifies to $\delta \varepsilon^2 \ge \frac{1}{4(n-1)}$.

  • Expectation Bound (Corollary 15): The average leave-one-out perturbation in expectation satisfies: $$\frac{1}{n}\sum_{i=1}^n \mathbb{E}_\xi\left[|\hat{f}(x) - \hat{f}^{\setminus i}(x)|\right] \le \sqrt{\frac{1}{4n}\left(\frac{p}{1-p} + \frac{q}{(1-p)^2}\right)} + \sqrt{\frac{2\pi}{B}}$$

  • Empirical Validation: Across all simulation setups (logistic regression, MLPs, deep trees), subbagging ($m = n/2, B = 10{,}000$) suppressed leave-one-out perturbations well within the theoretical curve, whereas the unbagged base algorithms showed substantial instability.

Limitations and Future Work

  • Computational Cost for Generic Bagging: To match the theoretical stability rate of derandomized bagging, generic bagging requires the number of bags $B$ to scale on the order of $n$ (or $1/\varepsilon^2$), which can be computationally prohibitive for large datasets.
  • Boundedness Dependency: For unbounded targets, guarantees require either finite prediction variance across bags or adaptive clipping strategies, which require careful calibration of outlier truncation parameters.
  • In-Sample vs. Out-of-Sample: While average-case stability controls perturbations at new test points, it does not guarantee "in-sample" stability (e.g., bounding perturbations when evaluating at a training point $X_i$).
  • Future Directions: The authors highlight formalizing general lower bounds for black-box stabilizers and determining whether alternative ensembling schemes can achieve optimal trade-offs with fewer bags.

Summary updated

BibTeX
@article{soloff2024bagging,
  author = {Jake A. Soloff and Rina Foygel Barber and Rebecca Willett},
  title = {{Bagging Provides Assumption-free Stability}},
  journal = {J. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=wCPdsuicJC},
}
Figure