Landmark 3 stops to get here

Generalization

A model's ability to perform well on new data it never saw during training, which is the whole point of learning from examples.

Your route here

3 stops · basics first
  1. Machine Learning ✓ understood

    Building systems that learn patterns from data instead of following hand-written rules, getting better at a task as they see more examples.

  2. Dataset ✓ understood

    A collection of data examples used for training, validating, or testing machine learning models.

  3. Training Data ✓ understood

    The examples a model learns its weights from, kept separate from the validation and test data used to check how well it generalizes.

  4. Generalization · you are here ✓ understood

Picture it

Memorizes

  • Near-perfect on training examples
  • Falls apart on new inputs
  • Learned the quirks of one sample

Generalizes

  • Good on training examples
  • About as good on unseen data
  • Learned the pattern behind the data
Notice both models can score well on training data; only the held-out score tells you which one actually learned the task.

Generalization is what separates learning from memorizing. A model is trained on a finite sample of examples, but it is useful only if it does well on inputs it has never seen: next month’s emails, a new patient’s scan, a question nobody asked during training. A model that generalizes has picked up the pattern behind its training data rather than the particulars of it.

How it’s measured

You can’t measure generalization on the data the model learned from, because a model can score perfectly there by rote. Instead you hold data back. The error on a separate test set estimates the generalization error, the expected error on fresh inputs. The difference between training error and test error is the generalization gap.

This only works under an assumption worth stating out loud: training and test examples are drawn independently from the same distribution. When the real world drifts away from the training data, a model can generalize well on paper and still fail in use.

Too simple, too flexible

Two things decide whether a model generalizes: how well it fits the training data, and how small the gap is. A model with too little capacity can’t fit the data at all, which is underfitting. A model with too much capacity for the amount of data can fit the noise too, which is overfitting: training error keeps falling while test error rises. The bias-variance tradeoff is the classical account of this balance, and regularization is the family of tools for nudging a model toward simpler solutions.

The open question

Deep networks complicate the classical story. Zhang and colleagues showed in 2016 that standard image classifiers can perfectly fit training labels that were assigned at random, which by definition can’t generalize. The same networks, trained on real labels, generalize well. So capacity alone doesn’t explain what these models do, and why large networks generalize as well as they do is still an active research question.

Where it sits

Generalization

Leads to

Nothing yet: a destination in its own right.

Explore nearby

Sources

  1. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning . MIT Press, 2016; section 5.2, Capacity, Overfitting and Underfitting
  2. Chiyuan Zhang et al., "Understanding deep learning requires rethinking generalization" . ICLR 2017