Simple Algorithm
Deep Learning · Emergence · 30 min

Generalization Bounds for Deep Networks

Norm-based, PAC-Bayes and compression bounds, and when they stop being vacuous.

A bound that counts parameters is vacuous for every network worth training, and so is any bound blind to the labels, since the same network fits random ones. The bounds that say something about deep networks measure other things: how much the layers can stretch their inputs relative to the margin, how far the weights can move without changing the predictions, how few bits describe the trained network. This lesson proves a spectrally normalized margin bound, computes compression bounds that are non-vacuous for ImageNet classifiers and language models, and dissects a construction in which no uniform-convergence bound can succeed.

What you’ll learn

  • Explain why parameter-counting bounds are vacuous for deep networks, and what any valid bound must output for a network trained on random labels.
  • Prove the perturbation lemma for ReLU networks and derive from it, through a PAC-Bayes margin argument, a bound governed by ∏ℓ∥Wℓ∥22∑ℓ∥Wℓ∥F2/∥Wℓ∥22\prod_\ell\norm{W_\ell}_2^2\sum_\ell\norm{W_\ell}_F^2/\norm{W_\ell}_2^2 (Neyshabur, Bhojanapalli & Srebro, 2018).
  • Compute an Occam bound for a network described in kk bits, and prove that a network fitting random labels cannot be compressed.
  • Compare the non-vacuous bounds from MNIST to ImageNet and language models by what each one actually certifies.
  • Reconstruct the Nagarajan–Kolter construction, in which every two-sided uniform-convergence bound is nearly vacuous although the test error is small.

What a bound must beat

A generalization bound says that with probability at least 1−δ1-\delta over the nn training examples, the test error is at most the training error plus a complexity term. The Machine Learning course proves the classical routes: uniform convergence over a class through the VC dimension or Rademacher complexity, and PAC-Bayes bounds, which charge the KL divergence of a learned distribution over weights from a prior fixed in advance (VC Dimension & the Fundamental Theorem, Rademacher Complexity, Stability, Compression & PAC-Bayes). This lesson is about what changes when the class is a deep network.

Two hurdles come first. Counting fails. For piecewise-linear networks with WW weights and LL layers the VC dimension is at most of order WLlog⁡WWL\log W, and this is nearly tight (Bartlett, Harvey, Liaw & Mehrabian, 2019). For a 50-layer network with 10710^7 weights and 5×1045\times10^4 training images, WLln⁡W/n≈1.6×105WL\ln W/n\approx1.6\times10^5; even without constants or the log⁡n\log n, the square root is about 400, four hundred times the largest possible error.

Blindness fails. A network trained on random labels has training error 0 and test error 0.9 (10 classes). A valid bound must say at least 0.9 for that network, and if it depends only on what the two runs share (the architecture, the training inputs, nn), it says at least 0.9 for the true-label run too. A useful bound must depend on something that differs between the runs: the trained weights, through their norms, margins or compressibility, or the behavior of the algorithm.

Norms instead of counts. Bartlett (1998) found the way out: for sigmoid networks whose units each have weights of small total absolute value, the error of classifying with a margin is controlled by the size of the weights rather than their number. For deep networks, norm bounds take a product form, because a change in layer ℓ\ell is stretched by every later layer. Neyshabur, Tomioka and Srebro (2015) proved such bounds for several norms, some with a factor exponential in depth; the Machine Learning course's Rademacher Complexity tabulates the main ones.

Any norm bound for ReLU networks must respect two symmetries. Since ReLU⁡(cz)=cReLU⁡(z)\operatorname{ReLU}(cz)=c\operatorname{ReLU}(z) for c>0c>0, multiplying layer ℓ\ell by cc and layer ℓ+1\ell+1 by 1/c1/c leaves the function unchanged, so a sensible capacity is invariant to such rebalancing: products of layer norms are, sums of squared norms are not. And multiplying every layer by cc multiplies every output, and every margin, by cLc^L, so margins must be measured relative to the network's scale.

Check your understanding

A network trained on uniformly random CIFAR-10 labels has zero training error. A proposed bound, computed from the trained weights, certifies a test error of at most 0.15 for it. What follows?

  1. The network has learned something about the images after all
  2. The bound cannot be valid as stated: the true test error is about 0.9, so some assumption or step of the bound must fail
  3. Nothing: bounds hold only with probability 1−δ1-\delta, and this is the unlucky case
  4. The bound is fine, because random labels are not drawn i.i.d.
Show the answer

B. The bound cannot be valid as stated: the true test error is about 0.9, so some assumption or step of the bound must fail

With labels independent of the images, no classifier beats chance: the expected test error is 0.9. A bound of 0.15 would fail for almost every random-label training set, far more often than the allowed probability δ\delta. Random labels are a cheap sanity test that every valid bound passes, which is why useful bounds must depend on the trained weights or on the algorithm.

Spectral margin bounds, by perturbation

Take a bias-free ReLU network fw(x)=WL ϕ(WL−1 ϕ(⋯ϕ(W1x)))f_{\mathbf w}(\mathbf x)=W_L\,\phi(W_{L-1}\,\phi(\cdots\phi(W_1\mathbf x))), writing WℓW_\ell for the weight matrix W(ℓ)W^{(\ell)}, with width at most hh, kk outputs and inputs ∥x∥2≤B\norm{\mathbf x}_2\le B. Its margin on (x,y)(\mathbf x,y) is f(x)[y]−max⁡j≠yf(x)[j]f(\mathbf x)[y]-\max_{j\ne y}f(\mathbf x)[j]; L^γ(f)\hat L_\gamma(f) is the fraction of training points with margin at most γ\gamma, and L0(f)L_0(f) is the test error. The route of Neyshabur, Bhojanapalli and Srebro (2018) has two steps: a PAC-Bayes lemma that turns robustness to weight noise into a bound for the unperturbed network, and a lemma that measures that robustness with spectral norms.

DerivationPerturbation lemma (Neyshabur, Bhojanapalli & Srebro, 2018)
  1. ∥fw+u(x)−fw(x)∥2≤e B(∏ℓ=1L∥Wℓ∥2)∑ℓ=1L∥Uℓ∥2∥Wℓ∥2\norm{f_{\mathbf w+\mathbf u}(\mathbf x)-f_{\mathbf w}(\mathbf x)}_2\le e\,B\Big(\prod_{\ell=1}^L\norm{W_\ell}_2\Big)\sum_{\ell=1}^L\frac{\norm{U_\ell}_2}{\norm{W_\ell}_2}

    Claim. If every perturbation satisfies ∥Uℓ∥2≤∥Wℓ∥2/L\norm{U_\ell}_2\le\norm{W_\ell}_2/L, then for every input with ∥x∥2≤B\norm{\mathbf x}_2\le B

  2. Δℓ+1=∥(Wℓ+1+Uℓ+1)(h~ℓ−hℓ)+Uℓ+1hℓ∥≤(∥Wℓ+1∥2+∥Uℓ+1∥2)Δℓ+∥Uℓ+1∥2 ∥hℓ∥\Delta_{\ell+1}=\norm{(W_{\ell+1}+U_{\ell+1})(\tilde{\mathbf h}_\ell-\mathbf h_\ell)+U_{\ell+1}\mathbf h_\ell}\le\big(\norm{W_{\ell+1}}_2+\norm{U_{\ell+1}}_2\big)\Delta_\ell+\norm{U_{\ell+1}}_2\,\norm{\mathbf h_\ell}

    Let zℓ\mathbf z_\ell be the pre-activations, hℓ=ϕ(zℓ)\mathbf h_\ell=\phi(\mathbf z_\ell) with h0=x\mathbf h_0=\mathbf x, tildes mark the perturbed network, and Δℓ=∥z~ℓ−zℓ∥2\Delta_\ell=\norm{\tilde{\mathbf z}_\ell-\mathbf z_\ell}_2 with Δ0=0\Delta_0=0. Add and subtract (Wℓ+1+Uℓ+1)hℓ(W_{\ell+1}+U_{\ell+1})\mathbf h_\ell. The ReLU is 1-Lipschitz with ϕ(0)=0\phi(0)=0, so ∥h~ℓ−hℓ∥≤Δℓ\norm{\tilde{\mathbf h}_\ell-\mathbf h_\ell}\le\Delta_\ell and ∥hℓ∥≤∥zℓ∥\norm{\mathbf h_\ell}\le\norm{\mathbf z_\ell}:

  3. Δℓ≤(1+1L)ℓB(∏j=1ℓ∥Wj∥2)∑j=1ℓ∥Uj∥2∥Wj∥2\Delta_\ell\le\Big(1+\frac1L\Big)^{\ell}B\Big(\prod_{j=1}^{\ell}\norm{W_j}_2\Big)\sum_{j=1}^{\ell}\frac{\norm{U_j}_2}{\norm{W_j}_2}

    Unperturbed activations grow by at most each layer's spectral norm, ∥hℓ∥≤B∏j≤ℓ∥Wj∥2\norm{\mathbf h_\ell}\le B\prod_{j\le\ell}\norm{W_j}_2, and the assumption gives ∥Wℓ+1∥2+∥Uℓ+1∥2≤(1+1L)∥Wℓ+1∥2\norm{W_{\ell+1}}_2+\norm{U_{\ell+1}}_2\le(1+\tfrac1L)\norm{W_{\ell+1}}_2. Induction on ℓ\ell then gives

  4. At ℓ=L\ell=L, (1+1/L)L≤e(1+1/L)^L\le e, which proves the claim. The product of spectral norms bounds how much the network can stretch anything, and each layer's relative perturbation ∥Uℓ∥2/∥Wℓ∥2\norm{U_\ell}_2/\norm{W_\ell}_2 enters once.

From lemma to bound. By ReLU homogeneity, rebalance the layers so that all have the same spectral norm β\beta; nothing in the bound changes. Take the prior P=N(0,σ2I)P=\mathcal N(\mathbf 0,\sigma^2I) and perturbations u∼N(0,σ2I)\mathbf u\sim\mathcal N(\mathbf 0,\sigma^2I). A matrix concentration inequality and a union bound over layers show that with probability at least 12\tfrac12 every ∥Uℓ∥2≤σ2hln⁡(4Lh)\norm{U_\ell}_2\le\sigma\sqrt{2h\ln(4Lh)}, so choosing σ\sigma of order γ/(BLβL−1hln⁡(Lh))\gamma/\big(BL\beta^{L-1}\sqrt{h\ln(Lh)}\big) keeps the lemma's bound below γ/4\gamma/4. The KL term is ∥w∥2/(2σ2)=∑ℓ∥Wℓ∥F2/(2σ2)\norm{\mathbf w}^2/(2\sigma^2)=\sum_\ell\norm{W_\ell}_F^2/(2\sigma^2), and because σ\sigma depends on β\beta, a union bound over a grid of values of β\beta completes the proof.

What the bound gets right. It is invariant to rebalancing the layers; it measures the margin relative to ∏ℓ∥Wℓ∥2\prod_\ell\norm{W_\ell}_2, an upper bound on the network's Lipschitz constant; and the ratio ∥Wℓ∥F2/∥Wℓ∥22\norm{W_\ell}_F^2/\norm{W_\ell}_2^2 (the stable rank) is at most the rank, so the bound rewards weight matrices dominated by a few directions. Bartlett et al. found the normalized margins of networks trained on random labels much smaller than with true labels, as a valid bound requires.

What it gets wrong. The numbers are astronomical. Arora, Ge, Neyshabur and Zhang (2018) evaluated such quantities for a VGG-19 trained on CIFAR-10: the smallest, of the Bartlett–Foster–Telgarsky type, was about 101510^{15} (with constants and logarithms dropped), to be compared with 5×1045\times10^4 training examples, and far above the parameter count. Products of norms assume that every layer stretches the worst-case direction, which trained networks rarely do. The spectral product also correlates poorly, even negatively, with generalization across hyperparameters (Jiang et al., 2020), and Nagarajan and Kolter (2019) found such bounds growing with the training-set size.

Check your understanding

In the perturbation lemma, why does the product of all the layers' spectral norms multiply each layer's relative perturbation?

  1. Because spectral norms of random matrices multiply
  2. Because the lemma assumes all layers have the same spectral norm
  3. Because the KL divergence of Gaussians multiplies across layers
  4. Because a change in one layer acts on an input already stretched by the earlier layers, and is then stretched by every later one
Show the answer

D. Because a change in one layer acts on an input already stretched by the earlier layers, and is then stretched by every later one

An error Uℓhℓ−1U_\ell\mathbf h_{\ell-1} introduced at layer ℓ\ell has size at most ∥Uℓ∥2∥hℓ−1∥≤∥Uℓ∥2B∏j<ℓ∥Wj∥2\norm{U_\ell}_2\norm{\mathbf h_{\ell-1}}\le\norm{U_\ell}_2B\prod_{j<\ell}\norm{W_j}_2, and each later layer multiplies it by at most (1+1L)∥Wj∥2(1+\tfrac1L)\norm{W_j}_2. Together that is the full product times ∥Uℓ∥2/∥Wℓ∥2\norm{U_\ell}_2/\norm{W_\ell}_2.

Compress, then count

Arora, Ge, Neyshabur and Zhang (2018) turned the perturbation idea around. A network that tolerates noise in its weights can be compressed, for instance by replacing each layer with a low-rank or randomly projected version, and a compressed network is a small, countable object. The argument never needs the capacity of the original network's class.

For a VGG-19 trained on CIFAR-10, noise stability let the later layers be compressed to around 1% of their parameters, though some earlier layers not at all. The bound beat naive parameter counting and the earlier norm-based bounds, the latter by orders of magnitude. It was still far from non-vacuous: even with constants and logarithms dropped, the effective parameter count ran into the millions, against 50,000 training examples. The simplest form of the idea counts bits directly.

Predict before you look

A trained network can be described in 10,000 bits and has 2% training error on n=50,000n=50{,}000 examples. With δ=0.05\delta=0.05, what test error does the Occam bound certify?

Show the answer

0.283

The KL term is 10,000ln⁡2≈6,93110{,}000\ln2\approx6{,}931 nats and ln⁡(250,000/0.05)≈9.10\ln(2\sqrt{50{,}000}/0.05)\approx9.10, so the complexity term is 6,940.6/100,000≈0.263\sqrt{6{,}940.6/100{,}000}\approx0.263 and the bound is 0.02+0.263≈0.2830.02+0.263\approx0.283. The tighter kl form of the PAC-Bayes bound gives 0.187 for the same numbers. Describing one million 32-bit weights instead, 3.2×1073.2\times10^7 bits, makes the complexity term about 14.9: vacuous.

DerivationA network that fits random labels cannot be compressed (after Lotfi et al., 2022)
  1. Pr⁡[the labels have a description of at most N−c bits]<2−c+1\Pr\big[\text{the labels have a description of at most }N-c\text{ bits}\big]<2^{-c+1}

    Fix the inputs and draw nn labels uniformly from kk classes: kn=2Nk^n=2^N equally likely labelings, with N=nlog⁡2kN=n\log_2k. Fewer than 2N−c+12^{N-c+1} binary strings have at most N−cN-c bits, and each describes at most one labeling, so

  2. shortest description of the labels ≤ ∣h∣+NLL⁡2(h)+O(1)\text{shortest description of the labels}\ \le\ |h|+\operatorname{NLL}_2(h)+O(1)

    A network hh that outputs class probabilities, followed by the labels arithmetic-coded with those probabilities, is a description of the labels. With NLL⁡2(h)=∑ilog⁡2(1/h(xi)yi)\operatorname{NLL}_2(h)=\sum_i\log_2\big(1/h(\mathbf x_i)_{y_i}\big), the negative log-likelihood in bits,

  3. ∣h∣ ≥ nlog⁡2k−NLL⁡2(h)−log⁡2(1/δ)−O(1)|h|\ \ge\ n\log_2k-\operatorname{NLL}_2(h)-\log_2(1/\delta)-O(1)

    Taking c=1+log⁡2(1/δ)c=1+\log_2(1/\delta) in the first step: with probability at least 1−δ1-\delta no description is shorter than N−log⁡2(1/δ)−1N-\log_2(1/\delta)-1 bits. Combining the two,

  4. A network that fits random labels confidently has a small NLL⁡2\operatorname{NLL}_2, so it needs nearly nlog⁡2kn\log_2k bits, about 166,000 for 50,000 labels from 10 classes, and its Occam bound is vacuous, as it must be. Real labels escape the argument only because they are predictable from the images, so a short network can describe them: compressibility is a property of the data as much as of the network.

WorkSettingBoundWhat is certified
Dziugaite & Roy (2017)Fully connected networks on MNIST relabeled into two classesError 0.16 to 0.22 (measured: about 0.03); 1.35 with random labelsA Gaussian-perturbed network around the SGD solution, with the PAC-Bayes bound optimized directly
Zhou et al. (2019)LeNet-5 on MNIST; a pruned, quantized MobileNet on ImageNetMNIST: error 46%. ImageNet: top-1 error 96.5%, top-5 error 89% (chance: 99.9% and 99.5%)The compressed network with Gaussian noise on its weights
Lotfi et al. (2022)Training in a random low-dimensional subspace, then quantization and arithmetic codingMNIST 11.6%; CIFAR-10 58.2%, or 35.1% when starting from an ImageNet-trained networkThe compressed network, with a prior fixed before seeing the data
Lotfi et al. (2024)GPT-2-architecture language models on OpenWebText, compressed with SubLoRA12.12 bits per token (uniform guessing: 15.62); top-1 next-token error 96.41% (chance: 99.99%)The compressed model with predictions smoothed toward uniform, and documents as the i.i.d. samples
Every true-label bound is well above the measured error but below chance, which is what non-vacuous means. With data-dependent priors fitted on part of the training set, Lotfi et al. (2022) reached 16.6% on CIFAR-10, but then most of the learning happens while building the prior, outside what the bound explains. Lotfi et al. (2024) also found larger models more compressible, with better bounds.

Two caveats run through the table. Each certificate is for a modified network, compressed or randomized, not the one SGD returned. And the bounds explain generalization by compressibility, which itself needs explaining: Lotfi et al. (2022) found that shuffling the pixels of CIFAR-10 made convolutional networks much less compressible (fully connected networks, which never used the image structure, were unaffected), and that models fitting shuffled labels were not compressible at all, as the counting argument predicts. The compression view says that trained networks on real data are simple to describe; why gradient descent finds such networks is the open part (Pruning, Sparsity & Lottery Tickets, Training in a Tiny Subspace).

When uniform convergence fails

Every bound so far, whether from VC dimension, Rademacher complexity, covering numbers or the usual PAC-Bayes argument, controls the gap between test and training error two-sidedly and uniformly over some set of networks. Nagarajan and Kolter (2019) asked whether any bound of this kind can work even when the set is cut down to the bare minimum: the networks the algorithm actually outputs on typical training sets.

DerivationA linear classifier that defeats uniform convergence
  1. w1=2n u,w2=∑i=1nyi x2,i\mathbf w_1=2n\,\mathbf u,\qquad\mathbf w_2=\sum_{i=1}^ny_i\,\mathbf x_{2,i}

    Data. Inputs x=(x1,x2)∈RK×RD\mathbf x=(\mathbf x_1,\mathbf x_2)\in\R^K\times\R^D, labels y=±1y=\pm1 with equal probability, a fixed u∈RK\mathbf u\in\R^K with ∥u∥=1/n\norm{\mathbf u}=1/\sqrt n, signal x1=2yu\mathbf x_1=2y\mathbf u and independent noise x2∼N(0,32DID)\mathbf x_2\sim\mathcal N(\mathbf 0,\tfrac{32}DI_D), with D≫nD\gg n. Algorithm. One gradient step of size 1 from zero that increases ∑iyi w⊤xi\sum_iy_i\,\mathbf w^\top\mathbf x_i:

  2. yj w⊤xj=4+∥x2,j∥2+∑i≠jyiyj x2,i⊤x2,j≈4+32±32n/Dy_j\,\mathbf w^\top\mathbf x_j=4+\norm{\mathbf x_{2,j}}^2+\sum_{i\ne j}y_iy_j\,\mathbf x_{2,i}^\top\mathbf x_{2,j}\approx4+32\pm32\sqrt{n/D}

    Training points are fitted. Since w1⊤x1,j=4n∥u∥2yj=4yj\mathbf w_1^\top\mathbf x_{1,j}=4n\norm{\mathbf u}^2y_j=4y_j and E∥x2,j∥2=32\E\norm{\mathbf x_{2,j}}^2=32, the margin of a training point is

  3. y w⊤x=4+∑i=1ny yi x2,i⊤x2≈4±32n/Dy\,\mathbf w^\top\mathbf x=4+\sum_{i=1}^ny\,y_i\,\mathbf x_{2,i}^\top\mathbf x_2\approx4\pm32\sqrt{n/D}

    Test points are classified correctly. On a fresh point the noise term has mean zero and standard deviation about 32n/D32\sqrt{n/D}, so for DD large enough the margin is about 44 and the test error is below any chosen ϵ\epsilon:

  4. yj w⊤(x1,j,−x2,j)≈4−32<0for every jy_j\,\mathbf w^\top(\mathbf x_{1,j},-\mathbf x_{2,j})\approx4-32<0\qquad\text{for every }j

    The mirrored training set is misclassified. Negate the noise, S′={((x1,j,−x2,j),yj)}S'=\{((\mathbf x_{1,j},-\mathbf x_{2,j}),y_j)\}. The noise is symmetric, so S′S' has exactly the distribution of a training set, yet

  5. No uniform bound survives. Any Sδ\mathcal S_\delta of probability at least 1−δ≥341-\delta\ge\tfrac34 contains, with positive probability, a training set SS such that S′∈SδS'\in\mathcal S_\delta too, hSh_S has test error at most ϵ\epsilon, and hSh_S misclassifies all of S′S'. Then ∣R(hS)−R^S′(hS)∣≥1−ϵ\abs{R(h_S)-\hat R_{S'}(h_S)}\ge1-\epsilon, so ϵunif-alg(n,δ)≥1−ϵ\epsilon_{\text{unif-alg}}(n,\delta)\ge1-\epsilon.

The result does not make generalization inexplicable: here hSh_S provably generalizes, and the classifier with w2\mathbf w_2 set to zero even has a non-vacuous bound, since it has very few parameters, though that bound says nothing about the classifier actually returned. What fails is a proof technique, bounding the gap uniformly over a set of networks: collectively, the algorithm's outputs fit typical-looking data adversarially, even though each one generalizes. Responses work around it. Negrea, Dziugaite and Roy (2020) bound the learned predictor through a surrogate, a partly derandomized or denoised version of it, that does enjoy uniform convergence. And uniform convergence restricted to interpolators of small norm can be tight for linear regression (Koehler, Zhou, Sutherland & Srebro, 2021; the Machine Learning course's Benign Overfitting).

Key takeaways

  • A useful bound must depend on the trained weights or the algorithm: one computed only from the architecture, the inputs and nn must exceed 0.9 for random labels, so it is vacuous for real labels too.
  • For ReLU networks a perturbation UℓU_\ell moves the output by at most eB∏j∥Wj∥2⋅∥Uℓ∥2/∥Wℓ∥2eB\prod_j\norm{W_j}_2\cdot\norm{U_\ell}_2/\norm{W_\ell}_2; with a PAC-Bayes margin lemma this gives a bound governed by ∏ℓ∥Wℓ∥22∑ℓ∥Wℓ∥F2/∥Wℓ∥22/γ2\prod_\ell\norm{W_\ell}_2^2\sum_\ell\norm{W_\ell}_F^2/\norm{W_\ell}_2^2/\gamma^2, invariant to rebalancing but numerically enormous.
  • A network described in kk bits has a gap of at most about (kln⁡2+ln⁡(2n/δ))/(2n)\sqrt{(k\ln2+\ln(2\sqrt n/\delta))/(2n)}. Networks fitting random labels need about nlog⁡2(classes)n\log_2(\text{classes}) bits, so their bounds are vacuous, while compressed real-label models give non-vacuous bounds on ImageNet and for language models, for the compressed model.
  • Nagarajan and Kolter built settings where the algorithm generalizes but every two-sided uniform-convergence bound, even over its own outputs, is at least 1−ϵ1-\epsilon; explanations must use the algorithm or surrogate predictors more directly.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Multiplying every layer of a bias-free ReLU network by 2 multiplies all its outputs by 2L2^L. Why must a margin bound divide the margin by something like ∏ℓ∥Wℓ∥2\prod_\ell\norm{W_\ell}_2?

  1. Otherwise the bound could be made as small as you like by scaling up the weights, which changes no prediction
  2. Spectral norms are cheaper to compute than Frobenius norms
  3. Larger weights always mean worse generalization
  4. The margin is undefined for large weights
Show the answer

A. Otherwise the bound could be made as small as you like by scaling up the weights, which changes no prediction

Scaling all layers by cc scales every margin by cLc^L and changes no prediction, so a bound in terms of the raw margin could be driven to zero for free. Dividing by ∏ℓ∥Wℓ∥2\prod_\ell\norm{W_\ell}_2, which scales the same way, makes the ratio scale-free.

Question 2

A network fits 50,000 uniformly random labels from 10 classes. With high probability, about how many bits must any description of it take (given the inputs), and what does a compression bound then give?

  1. About 10 bits per parameter, so the bound is small if the network is small
  2. About 50,000 bits, so the bound is about 0.5
  3. About 166,000 bits, the information in the labels, so the bound exceeds 1
  4. No bound applies, because random labels violate its assumptions
Show the answer

C. About 166,000 bits, the information in the labels, so the bound exceeds 1

The labels carry nlog⁡210≈166,100n\log_210\approx166{,}100 bits of entropy, and a network that predicts them all is a description of them, so with high probability it needs nearly that many bits. McAllester's complexity term is then about 166,100ln⁡2/100,000≈1.07\sqrt{166{,}100\ln2/100{,}000}\approx1.07: vacuous, as it must be when the test error is 90%.

Question 3

In the Nagarajan–Kolter construction, what does the noise-negated training set S′S' achieve?

  1. It is an adversarial example found by gradient ascent on the classifier
  2. It shows that the learned classifier has a large test error
  3. It has the same distribution as a real training set, yet the classifier learned from SS misclassifies all of it, so every likely collection of training sets contains a pair that defeats two-sided uniform convergence
  4. It is used to train a second classifier that generalizes worse
Show the answer

C. It has the same distribution as a real training set, yet the classifier learned from SS misclassifies all of it, so every likely collection of training sets contains a pair that defeats two-sided uniform convergence

Because the noise is symmetric, S′S' is distributed exactly like SS, so any collection of training sets of probability 1−δ1-\delta contains some SS together with its S′S'. The classifier hSh_S has test error at most ϵ\epsilon but error 1 on S′S', so the uniform-convergence gap over the algorithm's own outputs is at least 1−ϵ1-\epsilon.

Question 4

Lotfi et al. (2024) reported non-vacuous generalization bounds for models with the GPT-2 architecture. Which statement is accurate?

  1. They bound the next-token error of the original, uncompressed checkpoints
  2. Their bounds show that language models do not memorize training text
  3. They bound heavily compressed models trained in a low-dimensional parameterization (SubLoRA), with predictions smoothed toward uniform and whole documents as the i.i.d. samples; the uncompressed model's bound is vacuous
  4. Their bounds hold for any text, not only text from the training distribution
Show the answer

C. They bound heavily compressed models trained in a low-dimensional parameterization (SubLoRA), with predictions smoothed toward uniform and whole documents as the i.i.d. samples; the uncompressed model's bound is vacuous

A compression bound needs a short description, so the models are trained in a compressed parameterization; prediction smoothing keeps the log loss bounded, and documents rather than tokens are the independent samples. The bound, 12.12 bits per token against 15.62 for uniform guessing, is non-vacuous; for the original model it is vacuous.

Further reading

  • B. Neyshabur, S. Bhojanapalli & N. Srebro, "A PAC-Bayesian approach to spectrally-normalized margin bounds for neural networks," ICLR (2018).
  • P. L. Bartlett, D. J. Foster & M. Telgarsky, "Spectrally-normalized margin bounds for neural networks," NeurIPS (2017).
  • S. Arora, R. Ge, B. Neyshabur & Y. Zhang, "Stronger generalization bounds for deep nets via a compression approach," ICML (2018).
  • W. Zhou, V. Veitch, M. Austern, R. P. Adams & P. Orbanz, "Non-vacuous generalization bounds at the ImageNet scale: a PAC-Bayesian compression approach," ICLR (2019).
  • S. Lotfi, M. Finzi, Y. Kuang, T. G. J. Rudner, M. Goldblum & A. G. Wilson, "Non-vacuous generalization bounds for large language models," ICML (2024).
  • V. Nagarajan & J. Z. Kolter, "Uniform convergence may be unable to explain generalization in deep learning," NeurIPS (2019).