Skip to main content

What is overfitting, and how do you spot it?

Machine learning basics · Beginner 1

Short answer

Overfitting is when a model learns the training data too closely, including its noise, so it does well on training data but badly on new data. You spot it when training performance keeps improving while validation performance stops improving or gets worse.

Deeper answer

A model that memorises rather than generalises looks great in training and fails in use. The standard check is to hold out data the model never trains on and compare scores. A large gap between training and validation scores is the signal.

Common remedies are more and more varied data, a simpler model, regularisation, early stopping and data augmentation. The same idea appears with LLM apps: a prompt tuned on five examples can overfit to them, which is why you test prompts on a separate, varied set.

What a strong answer covers

Answer it out loud in the mock interview about 1 min

Follow-ups to expect

Common mistakes

Learn it

Cross-validation and leakage

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.