# Overfitting

> The model learns its old data by heart. Then it fails on new data.

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** Overfit, Overtraining

## Think of it like

Think of it like a kid who learns the test answers by heart. The kid has not learned the subject.

## Definition

Overfitting is when a model learns its training data too closely, noise and all. It scores very well on the data it trained on. But on new data, it does much worse. It has memorised the examples, not the real pattern. More data, a simpler model or stopping training earlier can all help.

## Example

Jack's model scores 99 percent on its training photos but only 70 percent on new ones. The gap shows it has overfit.

## Why it matters

It is the most common way a model fails in real use. A great training score means little until new data agrees.

## Common mistake

Judging a model by its training score. Always check it on a validation set it has never seen.

## Three principles

- **Too close a fit.** Learns the noise, not just the pattern.
- **Great on old data.** The training score is high.
- **Bad on new data.** The real test fails.

## Related terms

- [Underfitting](https://learn.benibix.com/term/ai/underfitting)
- [Generalization](https://learn.benibix.com/term/ai/generalization)
- [Regularization](https://learn.benibix.com/term/ai/regularization)
- [Validation Set](https://learn.benibix.com/term/ai/validation-set)
- [Bias-Variance Tradeoff](https://learn.benibix.com/term/ai/bias-variance-tradeoff)
- [Early Stopping](https://learn.benibix.com/term/ai/early-stopping)
- [Data Augmentation](https://learn.benibix.com/term/ai/data-augmentation)

## Told apart from

- [Overfitting vs Underfitting](https://learn.benibix.com/compare/overfitting-vs-underfitting): People often think a bad model has just not learned enough. That is only one way to fail. An underfit model is too simple, so it does badly on old data and new data alike. An overfit model has memorised its training data, so it shines there and fails on new data. The fixes go in opposite directions.
- [Overfitting vs Data Leakage](https://learn.benibix.com/compare/overfitting-vs-data-leakage): People think a leak and overfitting are the same problem, since both make a model look better than it is. Overfitting is a model learning its training data too closely. It shows as a gap between the training score and the held-back score. A data leak is when facts from the test slip into training. It hides the gap, because the held-back score is high too. More data or a simpler model fixes overfitting. Only a cleaner split fixes a leak.

## Taught in

- [Overfitting and Underfitting](https://learn.benibix.com/learn/ai-machine-learning/overfitting-and-underfitting): Machine Learning, 3/18

![Three panels of the same dots. Underfit: a straight line that misses the curve. Good fit: a smooth curve through the middle. Overfit: a wild line that touches every dot.](https://learn.benibix.com/diagrams/nn-model-fit.svg)

---

Source: https://learn.benibix.com/term/ai/overfitting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
