A Note on the PAC Bayesian Theorem

Andreas MaurerarXiv 2004

Abstract: We prove general exponential moment inequalities for averages of [0,1]-valued iid random variables and use them to tighten the PAC Bayesian Theorem. The logarithmic dependence on the sample count in the enumerator of the PAC Bayesian bound is halved.

Introduction

In computational learning theory, the PAC-Bayesian framework provides a robust method for bounding the generalization error of a learning algorithm. Specifically, it offers guarantees that a model performing well on a training set will maintain performance on unseen data. A persistent challenge in these bounds has been the presence of a logarithmic term—typically $\ln(n)$—in the numerator, which suggests that the complexity of the bound grows slightly with the sample size in a manner not entirely explained by the model's complexity.

This note by Andreas Maurer provides a significant refinement to the standard PAC-Bayesian Theorem. By analyzing the calculus of exponential moments, Maurer demonstrates that this logarithmic dependence can be reduced, effectively "shaving" the complexity of generalization bounds and offering tighter guarantees for machine learning models.

Theoretical Framework: The Bernoulli Reduction

The core of Maurer’s contribution lies in the analysis of the Kullback-Leibler (KL) divergence between the empirical mean of a sample and its true underlying mean. The proof relies on three primary mathematical pillars:

  1. The Bernoulli Reduction: Maurer establishes that for any convex function of independent, identically distributed (iid) variables bounded within the interval [0, 1], the "worst-case" expectation occurs when the variables follow a Bernoulli distribution (binary 0 or 1). This allows the analysis of complex distributions to be simplified to the binary case without loss of generality.
  2. Stirling’s Approximation: To handle the factorials inherent in binomial distributions, Maurer employs a precise version of Stirling’s formula. This provides the necessary granularity to bound expectations over these distributions more tightly than previous methods.
  3. Riemann Sum and Beta Function Approximation: By approximating a series as an integral related to the Beta function, Maurer demonstrates that the sum of these exponential moments is bounded by a function of $\sqrt{n}$ rather than $n$.

Refining the PAC-Bayesian Bound

The primary result of this work is a new PAC-Bayesian bound. Let $P$ represent a prior distribution over hypotheses and $Q$ represent a posterior distribution learned from $n$ samples. With probability $1-\delta$, the relationship between the empirical loss $\hat{L}(Q)$ and the true loss $L(Q)$ is governed by:

$$KL(\hat{L}(Q), L(Q)) \leq \frac{KL(Q, P) + \ln(1/\delta) + \ln(2\sqrt{n})}{n}$$

Key Insights

  • Halving the Logarithmic Term: The most significant advancement is replacing the $\ln(2n)$ term found in previous bounds (such as those by McAllester) with $\ln(2\sqrt{n})$. Since $\ln(\sqrt{n}) = \frac{1}{2}\ln(n)$, this result effectively halves the logarithmic penalty associated with the sample size.
  • Independence from the Mean: Maurer shows that for Bernoulli variables, the expectation of the exponential KL divergence is independent of the true mean $\mu$. This symmetry simplifies the underlying mathematics and reveals a fundamental property of binary random variables in learning theory.
  • Scaling Improvements: Beyond the logarithmic term, Maurer improves the overall scaling factor from $1/(n-1)$ to $1/n$, providing a mathematically cleaner and slightly tighter result.

Implications and Limitations

While Maurer acknowledges that the improvement in the raw error value may appear incremental, the impact on the confidence parameter $\delta$ is substantial. For example, in a scenario with $n = 10,000$ samples, a guarantee that previously held with a failure probability of $1/100$ (1%) can now be asserted with a failure probability of less than $1/10,000$ (0.01%) under the same error limits. This represents a significant increase in the mathematical certainty of the bound.

However, the paper also identifies a theoretical "square root wall." Maurer provides a lower bound showing that the $\sqrt{n}$ order is optimal for techniques relying on Markov’s inequality applied to exponential moments. To eliminate the $n$ dependence entirely, researchers would need to pursue a fundamentally different proof path. While other approaches (e.g., Catoni) have attempted to reduce the term further to $\ln(\ln(n))$, they often do so at the cost of introducing constants that can loosen the bound in other practical respects. Maurer’s result remains a benchmark for its balance of tightness and mathematical elegance.

Summary updated

BibTeX
@misc{maurer2004note,
  author = {Andreas Maurer},
  title = {{A Note on the PAC Bayesian Theorem}},
  year = {2004},
  eprint = {cs/0411099},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/cs/0411099},
}
Figure