Overfitting
Overfitting happens when a model learns its training examples so specifically that it performs poorly on new examples.
A flexible model can discover real signal, but it can also fit random quirks in a finite training sample. Those quirks exist in the training set but not in fresh data, so fitting them buys nothing later. The result is overfitting: excellent memory of the sample and weak generalization.
Checking on unseen validation data tests whether the learned rule transfers beyond that sample. When training and validation loss drift apart, treat that gap as a warning sign. Leakage between the splits can make that comparison look better than it really is.
Overfitting can come from unrepresentative data, an overly complex model, or both. Common fixes include ending training once validation results begin to slip and adding a penalty for large weights. Keep the final test set out of every one of those choices.
A low training error can hide a model that learned noise or accidental details instead of a reusable pattern.
Follow one shortcut from training success to a new-data failure.
- 1 · sampleThe training set contains both a useful pattern and coincidences that will not persist.
- 2 · fitA more flexible model has room to fit those coincidences as well as the real pattern.
- 3 · compareTraining loss keeps falling or levels off, while validation loss turns upward.
- 4 · correctCharging a cost for big weights nudges the model toward a simpler rule, leaving less room to overfit.
Overfitting is a gap between remembering the sample and generalizing beyond it.
| Who | What they ask | What it works with |
|---|---|---|
| Fraud team | “Did the model learn fraud signals or yesterday's merchant IDs?” | Training and validation scores by time period |
| Vision engineer | “Is the classifier using the object or a camera watermark?” | Errors on images from unseen cameras |
| Model trainer | “Did another epoch help outside the training set?” | Training and validation loss curves |
- Naming overfitting separates training-set fit from performance on unseen examples.
- Validation curves can expose it when training performance stays strong but validation performance weakens.
- Once named, it points to fixes such as early stopping, which halts training before the model has finished converging.
- A good validation score only carries over when real-world data looks statistically like the training and validation splits.
- Blaming model size alone misses the other common cause, which is training data that fails to reflect real use.
- Cross-validation scores can still come out too rosy when held-out data leaks into the model-building steps.
Sources used
This explainer is written in original language. The links below support its factual claims.
- docsOverfitting, Google for Developers · read 27 Sept 2026
- docsUnderfitting vs. Overfitting, scikit-learn · read 27 Sept 2026
- docs3.5. Validation curves: plotting scores to evaluate models, scikit-learn · read 27 Sept 2026
- paperDropout: A Simple Way to Prevent Neural Networks from Overfitting, Journal of Machine Learning Research · read 27 Sept 2026
- docs12. Common pitfalls and recommended practices, scikit-learn · read 27 Sept 2026
- docsOverfitting: L2 regularization, Google for Developers · read 27 Sept 2026