Search

Search papers and lessons

Understanding deep learning requires rethinking generalization

Chiyuan Zhang, Samy Bengio, Moritz Hardt et al. · 2016

Zhang and colleagues showed that large image networks reach zero training error on randomly labelled data, so the usual complexity measures cannot explain why the same networks generalise on real labels.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Learning basics
  • Discrete math
  • Linear algebra
  • Optimizers
  • ReadReady to readNot yet

TL;DR

Standard theory says a model generalises when it is simple enough, or when regularisation keeps it simple. Zhang, Bengio, Hardt, Recht and Vinyals trained large image networks on CIFAR-10 and ImageNet with the labels replaced by random ones. The networks still reached zero training error, with the same settings and the same optimiser, so their capacity was large enough to memorise any labelling. That result means the usual complexity measures cannot tell good networks from bad ones on their own.

Builds on: Overfitting, Empirical Risk Minimization, Stochastic Gradient Descent, Rademacher Complexity, VC Dimension · Leads to: weight decay and other regularisers as tools that matter in practice, and the search for generalisation measures that depend on the data and on training

Why it mattered

The paper changed how researchers talk about deep learning theory. Before it, a common explanation for why large networks generalise was that the model family was small in some measurable sense, or that regularisation kept it small. The paper showed that a standard image network can have a million-plus parameters, reach 100%100\% training accuracy on pure noise labels, and still reach high accuracy on real labels when trained the same way. Any measure that depends only on the family, and not on the data labels, has to give the same answer in both cases.

Its ideas are now part of the basic vocabulary of generalisation research. The contrast between a model's capacity to fit and its behaviour on real data is used to motivate implicit regularisation studies, early stopping as a regulariser, and norm-based bounds. It also gave a clean experimental recipe, the randomisation test, that other groups reuse to test whether a proposed bound says anything about a given network.

The problem

Classical learning theory ties generalisation to capacity. The VC dimension is the largest number of points on which the family can produce every possible labelling. The Rademacher complexity measures how well the family fits random ±1\pm 1 signs on the data. If either measure is small, the gap between training and test error is small. For neural networks with many more parameters than examples, these bounds are very large, which is why the field expected regularisation to be essential.

The paper asks a sharper question. If the family can fit random labels, its complexity is large and the bound is useless. Yet trained networks on real labels generalise. Which property of the network and the training process separates the two cases? The paper argues that the classical measures, and the stability analyses of stochastic gradient descent available at the time, cannot make that separation at all.

How it works

The method is a randomisation test. The same architecture and the same optimiser run twice: once on the true labels, and once on a copy of the data where each label is replaced by a random class.

  1. Take a training set of images with true labels, for example CIFAR-10 with ten classes.
  2. Make a copy in which every label is a uniformly random class, independent of the image.
  3. Train the same network, with the same learning rate schedule and the same stochastic gradient descent, on each copy.
  4. Track the training loss over steps. On true labels it falls smoothly; on random labels it stays high for a while, then falls to zero.
  5. Measure the test accuracy after training. On true labels it is high; on random labels it sits at chance, about 10%10\% for ten classes.
  6. Compare: both runs reach zero training error, so the difference lies entirely in how the test error behaves.
00.20.40.60.8100.20.40.60.81fraction of labels randomisedtest accuracy
  • test accuracy (schematic)
  • chance on ten classes
Schematic only, not the paper's measured curve: as the label randomisation grows, test accuracy falls from its high value on true labels toward the chance level of 0.1 for ten classes, while training error stays at zero.

The paper also varies the amount of randomisation between 00 and 11, corrupting each label with some probability, and varies the inputs as well, by shuffling pixels or replacing them with Gaussian noise. In every case the network fits the training set, and the test error rises as the signal in the labels falls.

The math

The empirical Rademacher complexity

For a hypothesis class H\mathcal{H} and sample {x1,…,xn}\{x_1, \dots, x_n\}, the empirical Rademacher complexity is

R^n(H)=Eσ[sup⁡h∈H1n∑i=1nσih(xi)],\hat{\mathfrak{R}}_n(\mathcal{H}) = \mathbb{E}_{\sigma}\left[\sup_{h \in \mathcal{H}} \frac{1}{n}\sum_{i=1}^{n} \sigma_i h(x_i)\right],

where σ1,…,σn\sigma_1, \dots, \sigma_n are independent random signs in {±1}\{\pm 1\}. This is the quantity the Rademacher lesson builds up step by step. It measures how well H\mathcal{H} can fit random labels on the sample, and the randomisation test is an experiment that measures exactly that.

The consequence for the networks

If a network class fits every random labelling of a sample of size nn, then for each sign pattern σ\sigma some hh in the class matches it, so the supremum is 11 for every σ\sigma. Hence

R^n(H)=1.\hat{\mathfrak{R}}_n(\mathcal{H}) = 1.

The paper observes exactly this behaviour, so the expected Rademacher complexity bound is trivial for these networks: the generalisation bound from the Rademacher lesson has a term 2Rn2\mathfrak{R}_n that equals 22, which exceeds the largest possible loss of a [0,1][0,1]-valued loss, and so it is vacuous.

The expressivity construction

The paper also gives a theoretical reason the fit is possible. It exhibits a two-layer ReLU network with p=2n+dp = 2n + d parameters that can express any labelling of any sample of nn points in dd dimensions. Here pp counts the trainable parameters, nn is the number of training points, and dd is the input dimension. The count matters: once the parameter count exceeds the number of data points, as it usually does in large networks, memorising arbitrary labels is possible in principle. The construction is an existence result; it does not say that stochastic gradient descent finds such a network, which the experiments show it does.

Results

The main numbers come from CIFAR-10 and ImageNet. The table below gives a subset of the paper's Table 1 for CIFAR-10, with the models trained on true labels and on random labels, both without data augmentation or weight decay.

ModelParametersLabelsTrain accuracyTest accuracy
Inception1,649,402true100.0%85.75%
Inception1,649,402random100.0%9.78%
AlexNet1,387,786true100.0%76.07%
AlexNet1,387,786random99.82%9.86%

Other findings reported by the paper:

  • Regularisation helps but is not the explanation. Turning off data augmentation and weight decay on Inception drops test accuracy from 89.05%89.05\% to 85.75%85.75\%, a real effect but far from the gap between good and random behaviour.
  • On ImageNet, Inception's top-1 accuracy without any regularisation is 59.80%59.80\%, against 0.1%0.1\% for random guessing. Data augmentation alone raises it to 72.95%72.95\%, so the known symmetries of images carry more of the benefit than the weight penalty does.
  • With a random-label fraction pp between 00 and 11, the networks still fit the training set. As pp approaches 11, test error approaches 90%90\%, the error of random guessing on CIFAR-10. The time to fit grows with pp, but only by a constant factor in the experiments.

Limits: the experiments use image networks trained with stochastic gradient descent and standard tricks, on two datasets. The paper does not establish a general theory of which networks generalise, and its expressivity construction uses very large width. The numbers are observations about one training regime, so read them as evidence about that regime.

Reading guide

The paper is short and mostly experimental. Read it in this order, with the prerequisite lessons it needs.

  • Introduction. Needs Overfitting and Empirical Risk Minimization for the generalisation gap, and the VC and Rademacher measures named in the first paragraphs. Read the contributions list as the paper's summary.
  • Experiments on effective capacity. Needs Stochastic Gradient Descent for the training procedure and Rademacher Complexity for the implication discussion that follows. The learning curves on true and random labels are the core evidence.
  • Experiments on regularisation. Needs weight decay and data augmentation, which the paper toggles on and off, and Overfitting for why regularisers are used at all.
  • Expressivity construction. Needs basic linear algebra, enough to see how a network's output on the training points can be set to match any labelling. The result is a theorem with a short proof; check the parameter count against 2n+d2n + d.
  • Discussion of stability and implicit regularisation. Needs VC dimension to see why classical measures are too coarse here.

Check yourself

QuestionWhy does a network that reaches zero training error on random labels make a Rademacher-style bound useless for that network class?Show answer

The Rademacher bound depends on the class's ability to fit random signs. Zero training error on random labels means that for each sign pattern some network in the class matches it exactly, so the empirical complexity is 11. The bound has a term 2Rn2\mathfrak{R}_n that equals 22, which is larger than any loss in [0,1][0,1]. The bound therefore says nothing about the true risk.

QuestionA two-layer ReLU network has p=2n+dp = 2n + d parameters. With n=1000n = 1000 points in d=50d = 50 dimensions, how many parameters does it have, and is that enough in principle to express any labelling of the sample?Show answer

Compute 2×1000+50=20502 \times 1000 + 50 = 2050 parameters. The paper's construction says that 2n+d2n + d parameters suffice to express any labelling, so yes, in principle. The result is an existence claim, not a claim about what training finds.

QuestionIn the randomisation test, why is the same learning rate schedule kept when training on random labels?Show answer

The point of the test is to change only the labels and nothing else about the learning problem. If the schedule were tuned for random labels, the difference in behaviour could come from the tuning rather than from the labels. Keeping the schedule fixed shows that the optimiser fits random labels with its standard settings.

QuestionOn CIFAR-10, Inception trained on true labels without augmentation or weight decay reaches 85.75%85.75\% test accuracy, and with random labels reaches 9.78%9.78\%. Which of these gaps is explained by regularisation?Show answer

The regularisation effect is small: removing augmentation and weight decay drops test accuracy from 89.05%89.05\% to 85.75%85.75\%, about 33 points. The gap from 85.75%85.75\% down to 9.78%9.78\% comes from the labels, which the network cannot generalise from, while still fitting the training set. Regularisation changes the first gap, not the second.

QuestionWhy does the paper argue that uniform stability alone cannot separate true labels from random ones?Show answer

Uniform stability asks how much a learned rule changes when one training example is replaced. The paper's argument is that bounds of this kind, such as the one of Hardt and colleagues, do not single out the true labelling from the random one on the same inputs, so they cannot separate a model that generalises from one that memorises.

Sources

Read the full paper

Chiyuan Zhang, Samy Bengio, Moritz Hardt et al., 2016. arXiv:1611.03530