Some theoretical improvements on the tightness of PAC-Bayes risk certificates for neural networks

Diego García-Pérez, Emilio Parrado-Hernández, John Shawe-TaylorarXiv 2025 · DOI

Abstract

PAC-Bayesian theory offers a robust framework for deriving generalization bounds, yet its application to deep neural networks often yields "vacuous" results—certificates that exceed trivial error rates. This work introduces tighter analytical relaxations, specifically the Tighter Refined Pinsker (TRP) and Refined Tolstikhin-Seldin (RTS) bounds, alongside a novel optimization strategy using implicit differentiation. These improvements lead to the first non-vacuous risk certificates for neural networks on CIFAR-10 without data-dependent priors.

Introduction

In high-stakes machine learning applications, such as autonomous driving or medical diagnostics, empirical performance on a test set is often insufficient. Stakeholders require mathematical guarantees—risk certificates—that a model's error on unseen data will not exceed a specific threshold. The PAC-Bayes framework provides a path to these guarantees, but traditional bounds frequently become vacuous when applied to high-dimensional neural networks, often predicting error rates above 100%.

This paper addresses the challenge of making these bounds tighter and finding efficient ways to optimize models specifically to minimize these theoretical certificates.

Theoretical Advancements

New Analytical Relaxations

The authors introduce two new relaxations of Maurer’s bound: the Tighter Refined Pinsker (TRP) and the Refined Tolstikhin-Seldin (RTS) bounds. These provide tighter closed-form approximations of the true risk across various ranges of empirical error and complexity. Notably, the RTS bound is shown to be universally tighter than the widely used PAC-Bayes-quadratic (PBQ) bound, particularly when empirical risk is low.

Phase diagram illustrating the regions where different PAC-Bayes bounds provide the tightest upper bound as a function of empirical risk and complexity K.

Optimization via Implicit Differentiation

Standard practice involves optimizing simplified versions of bounds because the exact Maurer’s bound involves an inverse KL divergence function with no closed-form solution. By applying the Implicit Function Theorem, the authors calculate the gradient of the exact bound directly. This allows the risk certificate itself to serve as the objective function during training, consistently yielding better certificates than closed-form approximations.

Gradient Alignment and KL-Modulation

Optimizing for 0-1 loss is difficult due to its non-differentiability. The authors propose a "KL-modulating" method that uses surrogate losses (like cross-entropy) but adjusts the weight of the complexity penalty (the KL term). This ensures that the gradients of the surrogate objective align with the target 0-1 loss, reframing the common heuristic of "KL attenuation" as a principled gradient alignment step.

Experimental Results

The proposed methods were evaluated on MNIST and CIFAR-10. On MNIST, the RTS bound achieved a risk certificate of 0.335 for 0-1 loss, a significant improvement over the PBQ baseline of 0.425.

Scatter plots comparing risk certificates for cross-entropy (top) and 0-1 loss (bottom) across different methods. The RTS bound consistently provides tighter certificates than the PBQ baseline.

More significantly, the authors report the first non-vacuous generalization bounds for neural networks on CIFAR-10 without using data-dependent priors. For a 4-layer CNN, they achieved a certified risk bound of 0.738. While this remains higher than the observed test error, it represents a landmark result in PAC-Bayesian literature, where previous attempts on this dataset typically resulted in bounds exceeding 1.0.

Conclusion

By focusing on gradient alignment and leveraging implicit differentiation, this work significantly narrows the gap between theoretical risk certificates and empirical performance. While a disparity still exists—particularly as model scale increases—these findings provide a foundation for designing architectures and optimization strategies that are inherently more amenable to PAC-Bayesian certification.

Summary updated

BibTeX
@misc{garciaperez2025some,
  author = {Diego García-Pérez and Emilio Parrado-Hernández and John Shawe-Taylor},
  title = {{Some theoretical improvements on the tightness of PAC-Bayes risk certificates for neural networks}},
  year = {2025},
  eprint = {2510.07935},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.07935},
}
Figure