Learning curves and early stopping: knowing when to stop training
10 questions on learning curves, rising validation error, the effective number of parameters, and how early stopping resembles weight decay.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
How does early stopping relate to the effective complexity of a network?
- It increases complexity by adding units
- Stopping before the training error is minimised limits the effective complexity, which grows as training proceeds
- It has no effect on complexity
How it works
- One question per screen. An answer is final once sent.
- You see right away whether you were right, with a short explanation.
- The stopwatch runs: on equal scores, the faster player ranks first.
- Only your best attempt counts, so replaying is never risky.
About this quiz
Training a network for longer feels like it should always help. The error on the training data keeps falling, step after step, and a falling number is hard to resist. But a model that has been coaxed to fit its training data ever more tightly may be learning the quirks of that particular sample, not the pattern behind it. At some point, the model that does best on new data is not the one that fits the training data best. Learning curves are the tool that shows where that point lies, and early stopping is the habit of acting on what they show.
This quiz is about reading the curves. A learning curve plots an error measure against the number of training iterations, usually twice: once for the training data and once for held-out validation data. You will see the typical shapes, why they diverge, and what decision they suggest. You will practise with scenarios where a curve has dipped and risen, and where a team has to decide which saved version of a model to keep. You will also see why the second curve must come from data that the model never trains on.
There is also a deeper layer. Early stopping can be understood as a way of limiting the model's effective complexity, because the number of parameters that are really in use grows as training proceeds. For a simple quadratic error surface, the effect of stopping early turns out to be similar to adding a weight decay penalty, and the product of the number of steps and the learning rate plays the role of the inverse of the penalty strength. The quiz asks which weights are held near zero by early stopping, and what it means to say that two forms of regularisation are related.
Typical misconceptions include watching the training curve to decide when to stop, which tells you nothing about generalisation, believing that an early stop is a sign of a failed run, and thinking that early stopping and weight decay are unrelated tricks. In practice they often work together, and the learning curve is the cheapest diagnostic in machine learning. Learning curves are also the first thing to look at when a training run misbehaves. A curve that falls and then flattens at a high level points to a model that is too simple or a learning rate that is too low. A curve that is jagged suggests noisy updates or a rate that is too high. A large and widening gap between training and validation error points to overfitting. Reading these shapes quickly is one of the most valuable practical skills in the field, and it costs nothing but a plot.
The quiz suits learners who have trained models and seen error curves, and practitioners who rely on early stopping without having examined why it works. It uses only simple reasoning and round numbers. There are 10 questions, each with an explanation, and it takes about four minutes.
Questions and answers
›How long does the quiz take?
About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. Each answer comes with an explanation, and some include the reasoning behind the curves.
›What is a learning curve?
It is a plot of a performance measure, such as the error, against the progress of an iterative training process, for example the iteration or epoch number. It is common to draw two curves on the same axes, one for the training set and one for a validation set. Together they show how learning is progressing and where generalisation starts to suffer.
›Why does the validation error rise when the training error keeps falling?
The training error measures how well the model fits the data it is learning from, and a flexible model can keep improving that fit by absorbing noise. The validation error measures performance on fresh data. Once the model begins to fit noise, the training error still improves but the validation error gets worse, which is the signature of overfitting.
›What is early stopping?
It is the practice of halting training at the point where the validation error is lowest, instead of continuing until the training error is minimal. In practice the weights are often saved at regular intervals, and the saved version with the best validation score is the one that is kept. It costs nothing extra and acts as a regulariser.
›Why does early stopping control complexity?
A network starts training with weights near their small initial values, so few parameters are effectively in use. As training proceeds, more of them become active, and the effective complexity of the model grows. Stopping before the training error reaches its minimum therefore stops the model before it reaches its most flexible state.
›How is early stopping related to weight decay?
For a simple quadratic error surface, the path that gradient descent follows from small initial weights first moves along the directions in which the error matters most, and only later along the flatter ones. Stopping part way leaves the flatter directions close to zero, which is just what weight decay does. The product of the learning rate and the number of steps behaves like the inverse of the penalty strength.
›Why do I need a separate validation set?
If the same data were used both for training and for deciding when to stop, the stopping point would be chosen by a curve that keeps falling, and the model would never be judged on anything it had not seen. Held-out data provides an honest estimate of how the model will behave on new cases.
›Is early stopping always the best form of regularisation?
No. It is one tool among several, and it is often combined with others, such as weight decay and data augmentation. In some very large models, training continues to zero training error and still generalises well, a surprising behaviour that is the subject of the quiz on double descent.