betaFeedback

WorksComputer Science

Optimal Transport PAC-Bayes Bounds

Abstract

PAC-Bayesian generalization bounds are among the strongest distribution-dependent guarantees in statistical learning and are typically expressed in terms of the Kullback-Leibler (KL) divergence between a prior and posterior distribution. While analytically convenient, the KL divergence requires the posterior to be absolutely continuous w.r.t. the prior, imposing support constraints that can substantially restrict the choice of posterior. Moreover, the KL divergence does not account for the underlying geometry of the probability space. In this work, we derive new PAC-Bayesian bounds replacing the KL divergence with general optimal transport (OT) distances, including the total variation and Wasserstein-pp distances.

Introduction

The ability of a learning algorithm to perform accurately on unseen data is fundamental for real-world applications, ranging from medical diagnosis to autonomous systems. Classical statistical learning theory provides tools to analyze this ability, most notably the Vapnik–Chervonenkis (VC) dimension (Vapnik, [27]) and Rademacher complexity (Bartlett and Mendelson, [6]), which bound the generalization error by quantifying the capacity of a hypothesis class. However, classical generalization bounds are often overly pessimistic and distribution-agnostic. They provide uniform guarantees over the entire hypothesis class by considering worst-case scenarios and ignoring the structure of the underlying data distribution. In particular, in the modern over-parameterized regime of deep neural networks, where models generalize well in practice, these classical bounds become vacuous, since the hypothesis classes involved are extremely large.

Correspondence to: [email protected]

These limitations have motivated the development of the Probably Approximately Correct Bayes (PAC-Bayes) framework (McAllester, [17]). Unlike classical approaches, PAC-Bayes theory does not aim to provide uniform guarantees over the whole hypothesis class. Instead, it yields data-dependent bounds by considering probability distributions over hypotheses. More precisely, classical PAC-Bayes bounds depend on a measure of discrepancy between a prior distribution and a posterior distribution over hypotheses, which is most commonly quantified using the Kullback–Leibler (KL) divergence. However, the KL divergence can be very large even when the prior and posterior are close w.r.t. other probability distances that account for the geometry of the hypothesis space, which may again lead to loose generalization bounds. Moreover, the KL divergence requires the posterior to be absolutely continuous w.r.t. the prior, implying that the posterior must be supported on a subset of the prior’s support. As a consequence, the choice of the prior becomes crucial. If the prior assigns mass predominantly to poorly performing hypotheses, the posterior cannot concentrate on high-performing hypotheses.

Recent work has proposed PAC-Bayes bounds that replace the KL divergence. One approach uses general ff-divergences, which still require the posterior to be absolutely continuous w.r.t. the prior and therefore inherits similar support restrictions. A second line of work instead uses integral probability metrics (IPMs), which relax this absolute continuity requirement but require the geometry to be introduced implicitly through the choice of a test function class. In this paper, we derive a new class of PAC-Bayesian bounds based on optimal transport (OT) distances with arbitrary ground costs, hence covering a major class of statistical distances between probability measures. Unlike ff-divergence-based bounds, our OT-based bounds do not suffer from support restrictions and unlike most IPM-based bounds, they are sensitive to the underlying geometry of the hypothesis space, routinely yielding tighter and non-vacuous generalization bounds.

Our main contributions are:

  • We derive a general PAC-Bayesian generalization bound that replaces the classical KL divergence between the prior and posterior by a general OT distance, thereby allowing the discrepancy measure to incorporate the geometry of the hypothesis space.

  • We specialize the framework to several relevant choices of transport cost, including total variation (TV) and Wasserstein-pp distances, while TV is also a special case of IPMs, the Wasserstein-pp has not been considered before.

Related Work

The PAC-Bayes framework provides a powerful and flexible approach for deriving generalization guarantees for randomized predictors. Early foundational work by McAllester [17] established basic PAC-Bayesian inequalities, which were later refined by Catoni [9] to obtain sharper and more robust bounds for supervised learning. A variety of classical PAC-Bayes bounds have since been developed, including well-known results by Seeger [23], Maurer [15], Langford and Shawe-Taylor [14], Germain et al. [12] and McAllester [16], which provide explicit and practically usable generalization guarantees. More recently, PAC-Bayes theory has been successfully applied to modern deep learning models, yielding non-vacuous bounds for neural networks, notably in the works of Dziugaite and Roy [11], Arora et al. [5] and Zhou et al. [32]. For a modern and accessible introduction to PAC-Bayes theory, we refer to the survey by Alquier [2]. A common feature of essentially all of these results is their reliance on the KL divergence to quantify the discrepancy between the prior and posterior distributions over hypotheses.

Motivated by the limitations of KL-based bounds, several works have explored PAC-Bayes generalization bounds based on alternative discrepancy measures. Bégin et al. [7] derived PAC-Bayes bounds in which the KL divergence is replaced by Rényi divergences, extending the classical framework while retaining a divergence-based structure. Alquier and Guedj [3] further generalized this approach by replacing the KL divergence with a general Csiszár ff-divergence. While these extensions provide additional flexibility, both Rényi divergences and ff-divergences still require absolute continuity of the posterior w.r.t. the prior and thus inherit many of the limitations of KL-based bounds. In the approach by Amit et al. [4], they introduced PAC-Bayes-style bounds based on IPMs, including TV distance and the Wasserstein-1 distance. Similarly, Viallard et al. [29] derived PAC-Bayes bounds based on the Wasserstein-1 distance and proposed PAC-Bayesian learning algorithms that optimize Wasserstein-based objectives instead of KL divergence.

OT theory has recently attracted increasing attention in machine learning due to its ability to capture geometric structure in probability spaces (Peyré and Cuturi, [21]). See also Villani [30] for a comprehensive mathematical treatment. In the context of learning theory, OT distances have been used to derive generalization bounds in different settings. Chuang et al. [10] developed margin-based generalization bounds in which margins are normalized by OT costs, while Zhang et al. [31] introduced the notion of algorithmic transport cost, defined as the expected Wasserstein-1 distance between prior and posterior distributions, to control generalization error.

Notably, across both PAC-Bayesian and non-PAC-Bayesian analyses, the Wasserstein-1 distance is the only OT distance that has so far been used to obtain provable generalization guarantees. The proofs strongly rely on the equivalent characterization of Wasserstein-1 as an IPM. In contrast, this work provides a general PAC-Bayesian framework that accommodates arbitrary OT distances, including OT distances with concave costs, the TV distance and Wasserstein-pp distances. Extending beyond the Wasserstein-1 case requires quite different arguments from the one based on its IPM characterization. In the standard KL based PAC-Bayesian analysis, the Donsker-Varadhan variational formula connects the KL divergence to exponential moments of the generalization gap. For general OT distances, we instead exploit Kantorovich duality, which requires controlling the generalization gap w.r.t. the geometry induced by the transport cost. This leads to a regularity condition that requires the chosen transport cost to define a geometry that is sufficiently compatible with the learning problem. This condition is not automatically satisfied and must be verified for the learning problem and cost function at hand. We show how such verification can be carried out using classical learning-theoretic tools, including VC dimension and Rademacher complexity.

Preliminaries and Notation

Let (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) be the underlying probability space. We consider a standard Borel space (Z,Z)(\mathcal{Z}, \mathcal{Z}) as the sample space. We call the measurable space (H,H)(\mathcal{H}, \mathcal{H}) the hypothesis class, with each h∈Hh \in\mathcal{H} a hypothesis. We denote the measurable and bounded measurable functions H→R\mathcal{H} \to\mathbb{R} by M(H)\mathcal{M}(\mathcal{H}) and Mb(H)\mathcal{M}_{b}(\mathcal{H}). A loss function is a measurable function ℓ:H×Z→[0,∞)\ell: \mathcal{H} \times\mathcal{Z} \to[0, \infty). Let ZZ be a random variable in the sample space Z\mathcal{Z} and let Sn:={Zi}i=1nS_n := \{Z_i\}_{i=1}^{n} be nn i.i.d. copies of ZZ. Given a loss function ℓ\ell, the (expected) risk RℓR_\ell is defined as

Rℓ:H→[0,∞),Rℓ(h):=EZ[ℓ(h,Z)].(1)R_\ell:\mathcal{H}\to[0,\infty),\qquad R_\ell(h):=\mathbb{E}_{Z}[\ell(h,Z)]. \tag*{(1)}

The empirical risk R^ℓ\widehat{R}_\ell of a hypothesis hh and a set of points {zi}i=1n∈Zn\{z_i\}_{i=1}^{n}\in\mathcal{Z}^{n} is given by

R^ℓ:H×Zn→[0,∞),\widehat{R}_\ell:\mathcal{H}\times\mathcal{Z}^{n}\to[0,\infty),
R^ℓ(h,{zi}i=1n):=1n∑i=1nℓ(h,zi).(2)\widehat{R}_\ell\left(h,\{z_i\}_{i=1}^{n}\right):=\frac{1}{n}\sum_{i=1}^{n}\ell(h,z_i). \tag*{(2)}

We call the difference of the risk and the empirical risk the generalization gap, which we denote by

Δ:H×Zn→R,\Delta:\mathcal{H}\times\mathcal{Z}^{n}\to\mathbb{R},
Δn(h):=Δ(h,{zi}i=1n):=Rℓ(h)−R^ℓ(h,{zi}i=1n).\Delta_n(h):=\Delta\left(h,\{z_i\}_{i=1}^{n}\right):=R_\ell(h)-\widehat{R}_\ell\left(h,\{z_i\}_{i=1}^{n}\right).

For a measure μ\mu on a measurable space (S,S)(S,\mathcal{S}) and an integrable function f:S→Rf:S\to\mathbb{R}, we use the shorthand

μ[f]:=∫Sf dμ.(3)\mu[f]:=\int_{S}f\,\mathrm{d}\mu. \tag*{(3)}

When μ\mu is the probability measure induced by a random variable ZZ, denoted by PZ\mathbb{P}_{Z}, we instead write EZ[f]\mathbb{E}_{Z}[f]. We next define OT discrepancies between probability measures μ\mu and ν\nu on Polish spaces SS and TT, respectively. Let the cost function c∈L1(μ⊗ν)c\in L^{1}(\mu\otimes\nu) be bounded from below. The OT distance is given by

OT⁡c(μ,ν):=inf⁡π∈Π(μ,ν)π[c],\operatorname{OT}_{c}(\mu,\nu):=\inf_{\pi\in\Pi(\mu,\nu)}\pi[c],

where Π(μ,ν)\Pi(\mu,\nu) is the set of couplings of μ\mu and ν\nu, i.e., the set of joint probability measures with marginals μ\mu and ν\nu. The Kantorovich duality provides an equivalent dual formulation and will be central to our main result.

Theorem 1.1. (Villani [30]) Let the cost function c∈L1(μ⊗ν)c\in L^{1}(\mu\otimes\nu) be bounded from below. Then we have

OT⁡c(μ,ν)=sup⁡ψ1∈Mb(S),ψ2∈Mb(T):ψ1⊕ψ2≤cμ[ψ1]+ν[ψ2],\operatorname{OT}_{c}(\mu,\nu)=\sup_{\substack{\psi_{1}\in M_{b}(S),\psi_{2}\in M_{b}(T):\\ \psi_{1}\oplus\psi_{2}\le c}}\mu[\psi_{1}]+\nu[\psi_{2}],

where ψ1⊕ψ2(x,y):=ψ1(x)+ψ2(y)\psi_{1}\oplus\psi_{2}(x,y):=\psi_{1}(x)+\psi_{2}(y).

The PAC-Bayesian bound due to McAllester [18] will serve as a baseline example to demonstrate how to construct PAC-Bayesian bounds that use OT distances instead of the KL divergence. Since the KL divergence is a central component of the classical bound, we first recall its definition. Let μ\mu and ν\nu be probability measures on a measurable space (S,S)(S,\mathcal{S}). The KL divergence of μ\mu w.r.t. ν\nu is defined as

DKL(μ∥ν):={∫ln⁡(dμdν) dμ,if μ≪ν,∞,otherwise,D_{\mathrm{KL}}(\mu\Vert\nu):= \begin{cases} \int\ln\left(\frac{\mathrm{d}\mu}{\mathrm{d}\nu}\right)\,\mathrm{d}\mu, & \text{if }\mu\ll\nu,\\ \infty, & \text{otherwise}, \end{cases}

where dμdν\frac{\mathrm{d}\mu}{\mathrm{d}\nu} denotes the Radon–Nikodym derivative of μ\mu w.r.t. ν\nu. In particular, the KL divergence is finite only if μ\mu is absolutely continuous w.r.t. ν\nu.

Theorem 1.2. (McAllester [18]) Let ℓ:H×Z→[0,1]\ell:\mathcal{H}\times\mathcal{Z}\to[0,1] be a measurable loss function, let PP be a prior distribution over H\mathcal{H}, n≥2n\ge2 and let δ∈(0,1)\delta\in(0,1). Then, with probability at least 1−δ1-\delta over the draw of SnS_n,

Q[Rℓ]≤Q[R^ℓ(⋅,Sn)]+DKL(Q∥P)+ln⁡nδ2(n−1)Q[R_\ell]\le Q[\widehat{R}_\ell(\cdot,S_n)]+\sqrt{\frac{D_{\mathrm{KL}}(Q\Vert P)+\ln\frac{n}{\delta}}{2(n-1)}}

holds simultaneously for any distribution QQ over H\mathcal{H}.

Main Result: Optimal Transport based PAC-Bayesian Bound

In this section, we present a general template for PAC-Bayesian generalization bounds in which the KL divergence is replaced by OT distances. Before stating the general bound, we first introduce and discuss a crucial regularity assumption that characterizes the relation between the learning task and the cost function. This condition needs to be verified for the specific learning task and transport cost under consideration.

Assumption 2.1 (regularity condition). Let the cost function c:H×Z→[0,∞)c:\mathcal{H}\times\mathcal{Z}\to[0,\infty) be a measurable function, and n∈Nn\in\mathbb{N}. Assume that there exists Cn>0C_n>0 such that

Δn2⊕−Δn2≤Cn⋅c(4)\Delta_n^{2}\oplus-\Delta_n^{2}\le C_n\cdot c \tag*{(4)}

for PSn\mathbb{P}_{S_n} almost all sn={zi}i=1n∈Zns_n=\{z_i\}_{i=1}^{n}\in\mathcal{Z}^{n}.

Assumption 2.1 links the learning problem and the OT cost. It ensures that the geometry induced by the cost function cc is meaningful for the underlying learning task. Depending on the sample size nn, the difference of the generalization gap for hypotheses hh and ff is controlled by their ground cost c(h,f)c(h,f). This condition is not automatic and must be verified on a case-by-case basis for each specific choice of transport cost. Similar assumptions were made for example by Amit et al. [4] and Raginsky and Recht [22]. While Amit et al. [4] use such regularity assumptions to derive PAC-Bayesian bounds based on integral probability metrics, Raginsky and Recht [22] use related sensitivity assumptions to derive deterministic generalization bounds from the geometry of the learning problem. In particular, they interpret generalization as a sensitivity problem, separating the geometric properties of the learning problem from the probabilistic assumptions on the data. For bounded losses as in McAllester-type bounds, the assumption can be weakened. If ℓ:H×Z→[0,1]\ell:\mathcal{H}\times\mathcal{Z}\to[0,1], then ∣Δn(f)∣≤1|\Delta_n(f)|\le1. Hence, it suffices to establish ∣Δn(f)−Δn(g)∣≤Cnc(f,g)|\Delta_n(f)-\Delta_n(g)|\le C_n c(f,g), since it implies the regularity condition (4). Based on the regularity condition, we derive our following main theorem.

References

  1. [1]Alpaydin, E. and Alimoglu, F. (1996). Pen-based recognition of handwritten digits. UCI Machine Learning Repository.
  2. [2]Alquier, P. (2024). User-friendly introduction to PAC-bayes bounds. Foundations and Trends® in Machine Learning, 17(2):174–303.
  3. [3]Alquier, P. and Guedj, B. (2017). Simpler PAC-bayesian bounds for hostile data. Machine Learning, 107(5):887–902.DOI
  4. [4]Amit, R., Epstein, B., Moran, S., and Meir, R. (2022). Integral probability metrics pac-bayes bounds. Advances in Neural Information Processing Systems, 35:3123–3136.arxiv.org/abs/2207.00614
  5. [5]Arora, S., Ge, R., Neyshabur, B., and Zhang, Y. (2018). Stronger generalization bounds for deep nets via a compression approach. In Proceedings of the 35th International Conference on Machine Learning (ICML 2018), volume 80 of Proceedings of Machine Learning Research, pages 390–418. PMLR.arxiv.org/abs/1802.05296
  6. [6]Bartlett, P. L. and Mendelson, S. (2002). Rademacher and Gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3:463–482.
  7. [7]Bégin, L., Germain, P., Laviolette, F., and Roy, J.-F. (2016). PAC-bayesian bounds based on the rényi divergence. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics (AISTATS), volume 51 of JMLR Workshop and Conference Proceedings, pages 435–444.
  8. [8]Boucheron, S., Bousquet, O., and Lugosi, G. (2005). Theory of classification: A survey of some recent advances. ESAIM: Probability and Statistics, 9:323–375.DOI
  9. [9]Catoni, O. (2007). PAC-bayesian supervised classification: The thermodynamics of statistical learning. In IMS Lecture Notes Monograph Series, volume 56, pages 1–163. Institute of Mathematical Statistics.DOI
  10. [10]Chuang, C.-Y., Mroueh, Y., Greenewald, K., Torralba, A., and Jegelka, S. (2021). Measuring generalization with optimal transport. Technical Report arXiv:2106.03314, arXiv.arxiv.org/abs/2106.03314
  11. [11]Dziugaite, G. K. and Roy, D. M. (2017). Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. In Proceedings of the 33rd Conference on Uncertainty in Artificial Intelligence (UAI 2017), pages 231–240. AUAI Press.arxiv.org/abs/1703.11008
  12. [12]Germain, P., Lacasse, A., Laviolette, F., and Marchand, M. (2009). Pac-bayesian learning of linear classifiers. In Proceedings of the 26th Annual International Conference on Machine Learning (ICML 2009), ICML ’09, pages 353–360, New York, NY, USA. Association for Computing Machinery.DOI
  13. [13]Kallenberg, O. (2002). Foundations of Modern Probability. Probability and Its Applications. Springer-Verlag, New York, 2nd edition.
  14. [14]Langford, J. and Shawe-Taylor, J. (2002). Pac-bayes & margins. In Proceedings of the 16th International Conference on Neural Information Processing Systems (NIPS 2002), NIPS’02, pages 439–446, Cambridge, MA, USA. MIT Press.
  15. [15]Maurer, A. (2004). A note on the PAC-bayesian theorem. CoRR, cs.LG/0411099.DOI
  16. [16]McAllester, D. (2003a). Simplified PAC-bayesian margin bounds. In Schölkopf, B. and Warmuth, M. K., editors, Learning Theory and Kernel Machines, pages 203–215, Berlin, Heidelberg. Springer Berlin Heidelberg.DOI
  17. [17]McAllester, D. A. (1999). Some PAC-bayesian theorems. Machine Learning, 37(3):355–363.
  18. [18]McAllester, D. A. (2003b). PAC-bayesian stochastic model selection. Machine Learning, 51(1):5–21.DOI
  19. [19]McDiarmid, C. (1989). On the method of bounded differences. In Surveys in Combinatorics, 1989, pages 148–188. Cambridge University Press.DOI
  20. [20]Mohri, M., Rostamizadeh, A., and Talwalkar, A. (2018). Foundations of Machine Learning. MIT Press, 2nd edition.DOI
  21. [21]Peyré, G. and Cuturi, M. (2018). Computational optimal transport. Foundations and Trends® in Machine Learning, 11(5-6):355–607.
  22. [22]Raginsky, M. and Recht, B. (2026). Separating geometry from probability in the analysis of generalization. arXiv2604.19560.
  23. [23]Seeger, M. (2003). Pac-bayesian generalisation error bounds for gaussian process classification. Journal of Machine Learning Research, 3:233–269.
  24. [24]Shalev-Shwartz, S. and Ben-David, S. (2014). Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, Cambridge.
  25. [25]van der Vaart, A. W. (1998). Asymptotic Statistics. Cambridge University Press, Cambridge.
  26. [26]van der Vaart, A. W. and Wellner, J. A. (1996). Weak Convergence and Empirical Processes: With Applications to Statistics. Springer Series in Statistics. Springer, New York.
  27. [27]Vapnik, V. N. (1995). The Nature of Statistical Learning Theory. Statistics for Engineering and Information Science. Springer-Verlag, New York.
  28. [28]Vershynin, R. (2018). High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, Cambridge.
  29. [29]Viallard, P., Haddouche, M., Simsekli, U., and Guedj, B. (2023). Learning via wasserstein-based high probability generalisation bounds. In Oh, A., Naumann, T., Globerson, A., Saenko, K., Hardt, M., and Levine, S., editors, Advances in Neural Information Processing Systems 36 (NeurIPS 2023), volume 36, pages 56108–56137. Curran Associates, Inc.arxiv.org/abs/2306.04375
  30. [30]Villani, C. (2021). Topics in Optimal Transportation, volume 58 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI.
  31. [31]Zhang, J., Liu, T., and Tao, D. (2018). An optimal transport view on generalization. Technical Report arXiv:1811.03270, arXiv.arxiv.org/abs/1811.03270
  32. [32]Zhou, W., Veitch, V., Austern, M., Adams, R. P., and Orbanz, P. (2019). Non-vacuous generalization bounds at the imagenet scale: A PAC-bayesian compression approach. In Proceedings of the 7th International Conference on Learning Representations (ICLR 2019). OpenReview.net.

Paper details

vlnc:W_y9wzy9xc
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents