Introduction: Two Ways to Fail
Your model can fail in two completely opposite ways.
Underfitting: the model is too simple for the data. It fails to catch even the real regularities. Its error on the training data itself is already high, that is the telltale sign.
Overfitting: the model is too flexible. It learns the training data by heart, accidents included. Training error very low, error on fresh data high, the gap between the two is what gives it away.

This is the bias-variance trade-off: the foundation of all statistical learning.
Bias vs Variance

Bias
This is the model's systematic error. It makes overly simplistic assumptions and sticks with them.
Example: you predict that all Paris apartments cost 400k euros (your average), regardless of square footage. That's biased: you're systematically off.
Cause: model too simple for the data.
Variance
Sensitivity to small variations in the data. The model changes drastically if you slightly change the data.
Example: a very deep decision tree learns individual noise. Change one training sample = completely different tree.
Cause: model too complex, overfitting.
The Error Decomposition
Three terms to name. Bias is the systematic gap between what the model predicts on average and the truth; it appears squared for a technical reason, in the derivation this error enters as a distance, and distances combine through their squares, as in Pythagoras. Variance is the spread of the predictions when you perturb the training data slightly. Irreducible noise is the genuinely unpredictable part of the data itself: nobody, human or machine, can guess it, and it therefore sets an error floor no model can cross.
In one sentence: a model's error breaks down into what it misses systematically, what it misses at random, and what nobody could have guessed.
Ideal: small bias + small variance.
Underfitting: high bias + low variance (systematically wrong but stable).
Overfitting: low bias + high variance (fits the training data but unpredictable).
High bias, low variance = all shots to the left (grouped but misplaced). Low bias, high variance = shots scattered around the target. Ideal = all shots in the center.
Recognizing Underfitting
Signs:
- High training error. The model can't even learn its own data well.
- Validation error similar to training error. No gap.
- Poor performance everywhere. 50% accuracy on a two-class problem is exactly what a coin flip achieves.
Solutions:
- Increase complexity: more layers, more neurons
- Supply more informative input variables
- Reduce regularization (the "brakes" on complexity)
- Train longer
- Try a better architecture
Recognizing Overfitting
Signs:
- Large gap between training and validation error. Train = 2%, Validation = 15%.
- Validation error that turns back up over epochs (an epoch is one complete pass over the training data). It falls at first, then rises.
- Perfect in the lab, terrible in production. Your numbers are excellent, but the user sees a model that doesn't work.
Zero overfitting is nearly always disguised underfitting. The right setting leaves a small gap between training and validation: flexible enough to catch the real regularities, not flexible enough to learn the noise.
Learning Curves: Your Best Diagnostic Tool
Plot two curves: training error and validation error over epochs.
Underfitting
Both curves stay high and close together. Adding more data? It won't help (there isn't enough capacity to learn).
Overfitting
Training error goes down (the model is learning). Validation error goes back up (overfitting to noise). Growing gap = classic signal.
Ideal
Both curves go down together and stabilize low, with a small gap (0.5-5% max).

Train/validation/test: the short version
This diagnosis assumes you have data the model has never seen. Hence the rule: never measure a model on the data that trained it, or you measure its memory rather than its understanding.
So the dataset gets cut in three:
- The training set (70-80%): the data the weights are fitted on.
- The validation set (10-15%): the data you watch during development, to pick settings and decide when to stop. The model never trains on it.
- The test set (10-15%): the data you touch once, right at the end. It is the only honest estimate of real performance.
Why three and not two? Because if the same batch serves both to choose the settings and to measure the result, the measurement runs optimistic: trying a hundred configurations and keeping the best on that batch also selects the luckiest fluctuation.
When data is scarce, a variant lets you use all of it: cross-validation, where you cut into parts and each part takes its turn as the evaluation set.
All of that (the proportions, stratified splits, the special case of time-ordered data, and the trap of data leakage) is covered in detail in Train/validation/test. This page sticks to the diagnosis.

Practical Solutions Against Overfitting
1. More Data
The best solution if you can. More diversity makes memorization impossible.
2. Data augmentation
Create variants of your data without actually creating truly new data.
Images: rotation, left-right mirroring, zoom, random crop, added grain, brightness shifts. A mirrored cat is still a cat, so the label does not change, that is the whole condition to respect.
Text: paraphrase, synonym substitution, back-translation (translate then translate back to keep the meaning while varying the phrasing).
Tabular data: add slight random noise, or use SMOTE (Synthetic Minority Oversampling Technique), which manufactures new examples of the rare class by interpolating between existing ones.
Methods like RandAugment and AutoAugment go further: they search for which transformations help most, instead of leaving a human to choose.

3. Regularization
Add penalties that force the model to stay simple.
L2 (weight decay): penalizes large weights.
Dropout: randomly deactivates neurons.

Early stopping: stop before the model starts overfitting.
(Details in the next section.)
4. Early Stopping
Super simple and super effective. Monitor the validation error during training. As soon as it stops going down (or starts going back up), stop and keep the best weights.
- Epoch 1-10: validation error decreases (keep the weights)
- Epoch 11-15: validation error goes back up (stop, use epoch 10 weights)
Zero computational overhead. Almost always helps.

5. Reduce Complexity
Fewer layers, fewer neurons, simpler model.
Warning: too simple = underfitting.
6. Ensembles of models
Combine several models, either by majority vote or by stacking (a second model learns to arbitrate between the first ones). This mechanically reduces variance.
Example: 10 decision trees instead of 1. The random variation of one is canceled out by the others.

Double descent: the counter-example
The reasoning above suggests a simple curve: the bigger the model, the lower the error, up to a turning point past which it overfits. Observation contradicts that picture once you push size very far.
Belkin and co-authors described in 2019 what they call double descent: error on fresh data falls, then rises around the point where the model has just enough parameters to memorize the training set exactly, then falls again as you keep growing it well beyond.
Reconciling modern machine learning practice and the bias-variance trade-off (Belkin et al., 2019)It is tempting to conclude that this explains the success of large language models. Careful: the link is plausible and often asserted, but it is not established. Keep the cautious version, the bias-variance trade-off describes the regime of modest-sized models well, and stops being sufficient in the regime of massively oversized ones.

Quick Diagnostic Checklist
- Plot training error vs validation error
- Large train/validation gap? -> Overfitting. Regularize, add data, reduce complexity
- High training error? -> Underfitting. Increase capacity, train longer
- Both low and close? -> Good fit. Validate on test set
- Check your data: labeling errors and outliers impose an error floor nothing will cross
Being able to make this diagnosis quickly is what separates the experienced practitioner from the beginner.
Why This Matters
Overfitting and underfitting are the two main enemies of applied ML. Until you master how to recognize and fix them, you're building blind. It's the most important thing after having data.
1. On the learning curves, what gives overfitting away?
2. Your model shows exactly the same error on training and validation, with no gap at all. Good news?
3. The training and validation error curves both stay high and close together. What should you do?
4. Why is the dataset cut into three sets (training, validation, test) rather than just two?
5. What does early stopping consist of?