Information-Theoretic Generalization Bounds
Generalisation costs information: the gap between test and train grows with how much the learned weights reveal about the training sample, measured by mutual information.
Why Does This Exist?
Uniform bounds charge you for the whole model class even when your trained weights are simple. A network with millions of parameters gets a vacuous guarantee although noisy training leaked almost nothing about the sample. You need a bound on the weights you actually learned, not the ones you could have learned.
That is what Xu and Raginsky proved. If the learned weights reveal little about the sample , memorisation is impossible and the test gap must be small. The leakage is mutual information in nats, and the expected gap scales as . Noisy updates, compression and early stopping all shrink and tighten the number.
This page covers the weights story. The prior to posterior story lives in PAC-Bayes bounds, and the ceiling that post-processing cannot beat lives in data processing inequality.
The one idea you need first
Mutual information counts the nats of dependence between weights and sample. Zero means the weights would look the same on a fresh sample. The loss is sub-Gaussian when its tails fall at least as fast as a Gaussian with spread , which holds for bounded losses. Background is in mutual information.
Think of It Like This
A student who saw the exam versus one who learned the subject
Two students score on practice sheets. One memorised answer keys, so their notes hold nats about those exact sheets and collapse on new questions. The other learned methods, so their notes hold nats, mostly shared structure, and repeat on finals.
Mutual information is the memorisation count. The bound charges the gap by , so the memoriser pays triple at the same . Noisy study habits blur exact answers and force the second strategy, which is what stochastic gradient Langevin dynamics does to weights.
Where the analogy stops: students choose strategies while is a property of the algorithm plus the distribution. You cannot read it off a notebook for a real net, you bound it with noise, compression or stability arguments.
How It Actually Works
Let be weights learned from samples , with population risk and train risk . If the loss is sub-Gaussian then
In plain words: is test error, is train error, is the leakage in nats, sets the loss scale, is the sample count. Halve the leakage or double the samples and the allowed gap shrinks by .
For stochastic gradient Langevin dynamics with step and noise variance over steps, grows with and shrinks with noise. More steps leak more, more noise leaks less. Compression bounds swap for description length: a model you can compress to nats generalises almost as if . That is why the information bottleneck preference for minimal sufficient codes helps: fewer kept bits, smaller gap.
Worked example
Take and . With nats:
Train at and test sits below in expectation. With nats:
Same training, allowed gap as drawn, triple the price. Halve the data to with : . Information budgets trade directly against samples, which is why compression helps most on small data.
Code
The snippet evaluates the bound you just computed by hand. It uses only the standard library.
import math
def mi_bound(mi_nats: float, n: int, sigma: float = 1.0) -> float: return math.sqrt(2.0 * sigma**2 * mi_nats / n)
print(round(mi_bound(10, 2000), 4)) # -> 0.1print(round(mi_bound(100, 2000), 4)) # -> 0.3162print(round(mi_bound(10, 500), 4)) # -> 0.2The three prints match the hand arithmetic: , about , and . Change or and you will see the square root trade at once.
Watch Out For
Estimating MI on the same data and quoting the bound
Plug-in MI estimates from training data understate leakage because the estimator shares the memorisation. You will measure where the truth is , promise and allow in reality.
Fix: bound analytically through noise, compression or stability, or estimate on held-out randomisation. Never plug a point estimate into its own bound.
Confusing representation MI with weights MI
for a representation and for weights bound different gaps through different theorems. Swap them and you apply bottleneck intuition to weight leakage with mismatched and scaling.
Fix: name both arguments of every time. Weights plus sample bounds generalisation, inputs plus codes bound compression.
The Quick Version
- Test to train gap scales as : leakage about the sample is the price.
- Ten nats at 2000 samples hold the gap below 0.10, one hundred nats allow about 0.32.
- Noisy training, compression and early stopping shrink and tighten the bound.
- Bound analytically, plug-in estimates on training data understate it.
- Weights plus sample and input plus representation answer different questions, so name both arguments.