# Overfitting

> The Overfitting is a situation when a model memorizes training data instead of learning general patterns.

## What is overfitting in machine learning?

The situation when a model performs well on training data but poorly on new data, because it memorized specific examples and noise instead of general patterns. Prevented with more data, regularization and validation on separate data.

- Topic: Training & Architecture
- Type: concept

## Common mistakes

- Judging a model by its score on training data instead of unseen data.

## Interview questions

### What is the difference between overfitting and underfitting?

Overfitting means the model memorized training data and fails on new data. Underfitting means it is too simple to learn even the training data well.

### How do I detect overfitting?

Compare scores on training data and on a held-out validation set. A large gap, where training is much better, signals overfitting.

### How do I prevent overfitting?

Use more or more varied data, a simpler model, regularization, or stop training early when the validation score stops improving.

## Related cards

- [Dataset](https://wonderium.dev/ai/dataset.md)
- [Training](https://wonderium.dev/ai/training.md)
- [Fine-Tuning](https://wonderium.dev/ai/fine-tuning.md)
- [Benchmark](https://wonderium.dev/ai/benchmark.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/overfitting
- Last updated: 2026-11-25
