A PAC-Bayes bound says that, with probability at least 1−δ over m examples, every posterior Q satisfies L(Q)≤L^(Q)+KL(Q∥P)+ln⁡(2m/δ)2m. Take P=N(0,I100) and Q=N(w,I100) with ∥w∥2=100. Compute the KL, and the bound for m=10000, δ=0.05 and L^(Q)=0.08. Why does the bound beat a naive one for a large network?

Learning theory, PAC-Bayes
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can evaluate a PAC-Bayes bound, including the KL between Gaussians, and explain what it measures.

Key idea

The prior P is fixed before seeing data and Q is any data-dependent posterior over hypotheses. The bound depends on how far Q moves from P, measured by KL(Q∥P), not on the size of the hypothesis class.

Steps

  1. For Gaussians with equal covariance σ2I, the KL is ∥w−0∥22σ2. Here σ=1 and ∥w∥2=100, so KL(Q∥P)=100/2=50.
  2. Compute the log term: ln⁡(210000/0.05)=ln⁡(200/0.05)=ln⁡4000=8.294.
  3. Add: 50+8.294=58.294. Divide by 2m=20000 to get 0.002915.
  4. Take the square root: 0.002915=0.0540.
  5. Bound: L(Q)≤0.08+0.054=0.134. About 40% of the bound is the complexity term.
  6. Here L(Q) is the expected risk of a random classifier drawn from Q. It is not the risk of one fixed weight vector.
  7. Why it is useful: a large network has a huge VC dimension, but if Q stays close to the prior (small KL), the bound is still small. Good priors and flat posteriors give non-vacuous bounds, which is why PAC-Bayes is used for deep nets.

Common mistakes

How long your answer should be

Half a page; 5 minutes.

Last checked on 4 December 2026.

Read this

Previous in Learning theory: Three nested hypothesis classes have VC dimensions d=3, 10, 40 and the best training errors on m=1000 examples are 0.12, 0.06, 0.04. Using the penalised bound L^+dln⁡(m/d)+ln⁡(1/δ)m with δ=0.05, which class does structural risk minimisation pick? Why is picking the lowest training error wrong?
Next in Learning theory: What is the empirical Rademacher complexity of a function class, and why does it measure capacity? What is it for (a) a class containing one function and (b) the class of all ±1 labellings of m distinct points, and what generalisation bound does it give?