Skip to content

Overfitting and Underfitting

How to tell when a model has memorised noise or missed the pattern, and the standard ways to fix each.

Editorial team 2 min read

A good model captures the real pattern in data and ignores the noise. Two failure modes pull in opposite directions.

Underfitting

The model is too simple to capture the pattern. It performs poorly on both training and validation data. A straight line fitted to clearly curved data underfits. Fixes include using a more flexible model, adding informative features or training longer.

Overfitting

The model is too flexible and learns the noise and coincidences in its training data. It scores very well on training data and noticeably worse on validation data. A decision tree allowed to grow without limit will often memorise every training example.

Reading the Gap

Training score Validation score Diagnosis
Low Low Underfitting
High Close to training Good fit
Very high Much lower Overfitting

Fixing Overfitting

  • Get more, and more varied, training data.
  • Simplify the model or limit its complexity (tree depth, number of features).
  • Add regularisation, which penalises extreme parameter values.
  • Use early stopping or dropout for neural networks.
  • Check for data leakage — a feature that secretly contains the answer produces suspiciously good scores that vanish in production.

The Bias–Variance Trade-off

Underfitting is high bias (wrong assumptions); overfitting is high variance (too sensitive to the particular sample). Good modelling finds the balance.

More in AI foundations

All AI foundations guides →
AI foundations Guide · 2 min

What Is Artificial Intelligence?

A plain-language definition of AI, the difference between narrow and general AI, and why today's systems are mostly about learning patterns from data.

AI foundations 2 min read 7 Oct 2026

AI foundations Guide · 2 min

A Short History of AI

From the 1956 Dartmouth workshop to large language models: the booms, the 'AI winters' and the ideas that shaped the field.

AI foundations 2 min read 5 Oct 2026

AI foundations Guide · 2 min

How Machines Learn From Examples

The core loop of machine learning — data, model, loss and optimisation — explained without equations.

AI foundations 2 min read 4 Oct 2026