Generalization Bounds and PAC-Bayes
Generalization bounds and PAC-Bayes theory form the mathematical backbone of statistical learning theory, providing rigorous upper bounds on the gap between a model's empirical risk on training data and its true risk on the population distribution. These results matter profoundly in modern AI because they connect finite-sample observations to distributional guarantees, underpinning the theoretical justification for everything from regularization to Bayesian deep learning. The remarkable and counterintuitive fact is that PAC-Bayes bounds can be exponentially tighter than classical uniform convergence bounds for the same hypothesis class, yet remain vacuous for modern overparameterized neural networks — revealing a fundamental gap between current theory and practice.
The fundamental tension in learning theory is that we optimize on a finite sample but care about performance on an infinite population — generalization bounds quantify exactly how much this gap can hurt us. PAC-Bayes theory resolves this by bounding the expected risk of a posterior distribution over hypotheses rather than a single hypothesis, trading the union bound's worst-case pessimism for a KL-divergence penalty that measures how much the posterior was "surprised" by the data. The critical "aha moment" is that the bound holds simultaneously for all posteriors in terms of a fixed prior, meaning you can choose the posterior after seeing the data (a form of data-dependent regularization) and still get a valid bound — a mathematical loophole that classical VC theory does not permit. This makes PAC-Bayes the most flexible framework for deriving non-vacuous generalization bounds for learned predictors, and the theoretical bridge between Bayesian inference and frequentist risk guarantees.
The most dangerous misconception is that a non-vacuous PAC-Bayes bound (say, a bound of 0.3 on 0/1 loss) explains why a neural network generalizes. What PAC-Bayes bounds actually do is certify a specific stochastic predictor (the posterior) rather than the deterministic network found by SGD, and the posterior is often engineered post-hoc (e.g., via weight perturbation noise) to be provably compressible — not the thing you deploy. The correct mental model is: PAC-Bayes bounds prove that a good predictor close to the trained network exists with bounded complexity, but they do not explain why SGD finds it; the implicit bias of SGD and sharpness-flatness geometry (see Loss Landscape Geometry) are doing independent theoretical work that the bound takes for granted.
How It Works
Classical PAC Learning and Uniform Convergence
The PAC (Probably Approximately Correct) framework, due to Valiant (1984), asks: how many samples suffice to ensure that, with probability at least , every empirical risk minimizer achieves true risk within of optimal? For a hypothesis class with VC dimension , the fundamental uniform convergence bound states:
Explanation: With probability over training sets of size , no hypothesis in can have its true risk differ from empirical risk by more than the right-hand side, which grows as . Here is the VC dimension (the largest shattered set), is the number of training examples, and is the failure probability. The bound is distribution-free and hypothesis-class-level, making it both powerful and pessimistic. For a ResNet-50 with tens of millions of parameters, easily exceeds , rendering this bound vacuous ().
Rademacher Complexity
A sharper complexity measure is Rademacher complexity, which adapts to the data distribution and the specific function class geometry:
Explanation: The Rademacher complexity measures how well the function class can correlate with random noise labels , averaged over training sets — a class that fits noise well has high complexity and poor generalization. Here are Rademacher variables, is the training set, and searches over all functions in the class. The key generalization theorem reads .
The PAC-Bayes Theorem
PAC-Bayes (McAllester 1999, Seeger 2002) shifts from bounding a single hypothesis to bounding the Gibbs predictor — the expected loss under a posterior over :
Explanation: The true risk of the stochastic predictor (averaging predictions over hypotheses drawn from ) is bounded by its empirical risk plus a complexity term that grows as the square root of how many nats has diverged from the prior . Here is a prior distribution over chosen before seeing the data, is a data-dependent posterior, is the KL divergence, and is the sample size. The remarkable property: because is fixed before the data, the bound holds simultaneously for all via a single application of the change-of-measure inequality — no union bound needed over the infinite space of posteriors.
The PAC-Bayes–Bernstein Variant
The square-root form of Eq. [3] can be loose when the empirical risk is small. Tighter "KL-form" or Bernstein-style PAC-Bayes bounds address this:
Explanation: The binary KL divergence between empirical and true risk (a tighter measure of their gap than their absolute difference) is bounded by the normalized complexity term, giving meaningful bounds even when empirical risk is near zero. Here is the binary KL divergence. This form, due to Seeger (2002) and Maurer (2004), is the sharpest standard PAC-Bayes inequality and the one used in landmark numerical experiments by Dziugaite & Roy (2017) to achieve non-vacuous bounds on MNIST classifiers.
Data-Dependent Priors and Catoni's Bound
A further refinement allows data-dependent priors if the data is split — use the first half to construct , then apply PAC-Bayes on the second half. Catoni (2007) derived a parametric family of bounds trading off the learning rate against the complexity:
Explanation: Catoni's bound introduces a free parameter that can be optimized after seeing the data, interpolating between the variance-dominated and bias-dominated regimes of the generalization gap. Here is a free inverse-temperature parameter. The optimal balances empirical risk against the KL penalty, and the Gibbs posterior is the exact minimizer of the PAC-Bayes objective.
McAllester received his PhD from MIT and spent his career at AT&T Bell Labs and the Toyota Technological Institute at Chicago, working at the intersection of logic, learning theory, and statistical inference. His 1999 COLT paper "Some PAC-Bayesian theorems" introduced the foundational PAC-Bayes framework, proving that a prior-to-posterior KL divergence could replace VC-dimension-style counting arguments to obtain distribution-sensitive generalization bounds. Remarkably, McAllester was originally motivated by connections to minimum description length and algorithmic information theory rather than Bayesian inference per se, making PAC-Bayes a meeting point of three distinct theoretical traditions.
Dziugaite completed her PhD at the University of Cambridge under Zoubin Ghahramani and is now a Research Scientist at Google DeepMind, working on the theory and practice of generalization in deep learning. Her landmark 2017 paper with Daniel Roy, "Computing Nonvacuous Generalization Bounds for Deep (Stochastic) Neural Networks with Many More Parameters than Training Data," was the first to demonstrate that PAC-Bayes bounds could be numerically non-vacuous for networks trained on MNIST — a watershed moment disproving the folklore that learning theory was irrelevant to modern deep learning. The key insight was to optimize the PAC-Bayes bound directly via SGD, treating the posterior variance as a learnable parameter, rather than deriving the bound analytically from a post-hoc analysis.
Intuition
Imagine you are a scientist trying to predict whether any given river in the world will flood next year, based on historical data from 1,000 rivers. A classical (VC-theory) approach says: "I have a huge hypothesis class — every possible flooding model — so I need to worry that any of them might have fooled me." This is like checking every house in a city for a gas leak simultaneously: expensive, pessimistic, and mostly irrelevant to the one house you care about. PAC-Bayes instead says: "Before seeing any data, I'll write down my best guess about what kinds of river models are plausible (the prior ). After seeing the data, I'll update to a smeared-out posterior distribution over models, not just the single best one. My guarantee is: if my posterior hasn't drifted too far from my prior (measured in KL divergence), then the flooding behavior I see on my 1,000 rivers will be close to what I'd see on all rivers worldwide." The KL divergence acts like a complexity tax: the more the data forced you to update from your prior beliefs, the more complexity you consumed, and the looser your generalization guarantee. A model that barely changes from the prior (because the data is consistent with many hypotheses) generalizes well; a model that memorizes idiosyncratic training quirks has a huge KL divergence and a lousy bound. In deep learning, this translates to: networks with flat loss-landscape regions (where many weight configurations give similar loss) correspond to posteriors that can be well-approximated by tight Gaussians around the optimum — small KL divergence — explaining empirically why flat minima generalize better (Hochreiter & Schmidhuber 1997, Keskar et al. 2017). The PAC-Bayes framework thus gives theoretical teeth to the intuition that "flatness = generalizability."