← Back
FiledSeptember 16, 2026·4 min read·By The Editor

Overfitting vs Underfitting

Overfitting is memorising the training data; underfitting is never learning it. Both fail on new data, the fixes are exact opposites, and one ten-second check tells you which one you are looking at.

theorybeginnerpractical

Overfitting is learning the training data too well. Underfitting is not learning it well enough. Both produce a model that fails on new data, and the fixes are opposites — so the first job is always to work out which one you have.

The exam analogy

Figure 1 · the only analogy you need
Three students, one examOne student did not study and fails both the practice paper and the real exam. One memorised the practice answers and fails the real exam. One learned the subject and passes both.Did not studypractice: 40%exam: 38%UNDERFITTINGtoo simple to learn the material at allMemorised answerspractice: 100%exam: 45%OVERFITTINGlearned the paperLearned itpractice: 88%exam: 85%JUST RIGHTgrasped the patternSAME SUBJECT, THREE STUDENTSthe gap between the two scores is the whole diagnosis
Underfitting fails both papers. Overfitting aces the practice paper and fails the real one. The gap between the two scores is the diagnosis — which is exactly why you keep a test set the model has never seen.

Nobody would call the middle student a good student. They would say they memorised the practice paper. That is precisely what an overfitted model has done.

In plain English

Overfitting is memorising instead of understanding. The model has learned the noise in your training data — the accidents, the one-off quirks — as though those were the pattern. They will never recur, so the knowledge is worthless.

How to tell which you have

Compare training error with validation error. There are only three outcomes:

TrainingValidationDiagnosisWhat to do
HighHighUnderfittingBigger model, better features, train longer
LowHighOverfittingMore data, regularization, early stopping
LowLowFineShip it

This takes ten seconds and determines everything you do next. Getting it backwards is the most common way to waste a week: adding data to an underfitted model changes nothing, and adding capacity to an overfitted one makes it worse.

Why models overfit

Give a model enough freedom and memorising is genuinely the easiest way to reduce training error. A model with more parameters than training examples can, in principle, store the answers outright.

Training error falls forever. Validation error falls, bottoms out, then climbs — and the climb is overfitting arriving. That U-shape and the theory behind it are covered in bias vs variance: underfitting is high bias, overfitting is high variance.

The fixes

More data
The best fix for overfitting, and it does nothing for underfitting. Harder to memorise a million examples than a thousand.
Regularization
Penalise complexity. L1 and L2 are the standard tools.
Early stopping
Stop when validation loss turns up. Free, and effective.
Dropout
Randomly switch off neurons during training so the model cannot rely on any single path.
A simpler model
Fewer layers, fewer features. The blunt instrument, but it works.
A bigger model
For underfitting only. If you cannot fit the training data, you need more capacity, not less.
In plain English

Notice the last row points the opposite way. Every fix for overfitting makes underfitting worse, and vice versa. This is the whole reason the diagnosis has to come first.

Practical order of operations

  1. Overfit deliberately, first. Take 100 examples and check the model can drive training error to near zero. If it cannot, you have a bug or too little capacity — no amount of regularization will help.
  2. Then train properly and watch both curves.
  3. When validation turns up, stop, and add regularization or data.
  4. Touch the test set once, at the end. Tuning against it makes it useless as an estimate.

The traps

  • Leakage. If information from the test set reached training — a duplicated row, a feature computed over the whole dataset — you will see suspiciously good results and a model that fails in production. Suspect this whenever results look too good.
  • A validation set that is too small. Noisy validation numbers lead to confident wrong decisions.
  • Tuning on the test set. Every decision made by looking at test performance fits your model to it a little more.
  • Time-series data split randomly. If future rows land in training, the model is reading tomorrow's newspaper. Split by time.

The short version

  • Underfitting: bad at training data and new data. Too simple.
  • Overfitting: great at training data, bad at new data. Memorised.
  • Diagnose by comparing training and validation error. Ten seconds, and it decides everything.
  • The fixes are opposites. Never start changing things before diagnosing.
  • Prove you can overfit a small sample first; it tells you capacity is not the problem.
← Archive— end of essay —Front page →