# Overfitting

- **Canonical URL:** https://getaimath.com/dictionary/overfitting/
- **Topics:** [AI & Machine Learning Fundamentals](https://getaimath.com/dictionary/category/ai-and-machine-learning-fundamentals/)
- **Last updated:** 2026-11-25

## What is Overfitting?

**In one sentence:** Overfitting is when a model learns its training examples too closely, including the noise, so it does badly on new data.

It is like a student who memorizes the exact practice questions instead of learning the idea. They ace the practice test but fail when the questions change. An overfit model scores great on training data but makes silly mistakes on anything new.

![Training vs. Inference: Studying Flashcards vs. Taking the Test — Simple cartoon diagram comparing AI Training (studying 1,000 flashcards and fixing mistakes until the brain learns the pattern) with AI Inference (answering a brand-new question in 1 second on test day).](https://getaimath.com/diagrams/ai-and-machine-learning-fundamentals.png)
*Napkin Diagram (AI & Machine Learning Fundamentals): Training is the long study session where the AI learns from examples; inference is test day when you actually use it.*

## What is an example of Overfitting?

A model that learned "all dogs are on green grass" because every training photo had grass is overfitting.

## Why does Overfitting matter?

Spotting and preventing overfitting is one of the most important skills in building AI.

## Overfitting vs. Underfitting

An overfitting model memorizes training quirks and stumbles on new data; an underfitting model is too simple or under-trained to capture the pattern even on training data.

| Dimension | Overfitting | [Underfitting](https://getaimath.com/dictionary/underfitting/) |
| --- | --- | --- |
| Training score | Very high (memorized) | Poor |
| Test / real-world score | Drops sharply on unseen examples | Also poor |
| Common fix | More data, regularization, early stopping | Bigger model, better features, longer training |

## Related Concepts

- [Generalization](https://getaimath.com/dictionary/generalization/): Generalization is how well an AI model handles new examples it never saw during training.
- [Underfitting](https://getaimath.com/dictionary/underfitting/): Underfitting is when a model is too simple or not trained enough, so it fails to learn the pattern even on its training data.
- [Transfer Learning](https://getaimath.com/dictionary/transfer-learning/): Transfer learning means taking what a model learned on one task and reusing it to learn a new, related task faster.
- [Model](https://getaimath.com/dictionary/model/): In AI, a model is the trained program that takes an input and produces an output, like an answer, a label or a picture.
- [Pre-training](https://getaimath.com/dictionary/pre-training/): Pre-training is the first, giant training stage where a model learns general knowledge from enormous amounts of data.
- [Algorithm](https://getaimath.com/dictionary/algorithm/): An algorithm is a step-by-step set of instructions for solving a problem or doing a task.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/overfitting/)
