What is overfitting?
In one line
Ages 8 to 10: Overfitting is memorizing instead of learning, so the model does great on examples it has seen and badly on new ones.
Ages 11 to 13: You spot overfitting when a model scores much higher on its training examples than on held-back test examples.
Ages 14 to 18: An overfit model has fit the noise in its training set, and the usual remedies are more varied data, a simpler model, regularization and stopping early based on a validation set.
Overfitting happens when an AI model learns its training examples too closely, including their accidents and noise, instead of the general pattern. It scores very well on the examples it studied but badly on new ones. It is like memorizing the answers to a practice test without learning the subject.
Last reviewed: 20 October 2026 7 min read
The idea in one picture
Imagine a practice quiz where you memorize "question 3 is B" instead of learning the subject. You get 10 out of 10 on the practice quiz. On the real test, with new questions, you are lost. Your practice score told you nothing about what you knew.
Models can do the same. Here are two models trained on the same examples and tested on the same new ones (illustrative numbers):
| Score on training examples | Score on new test examples | |
|---|---|---|
| Model A | 100 of 100 | 60 of 100 |
| Model B | 85 of 100 | 82 of 100 |
Model A looks perfect in practice but drops 40 points on new cases: it has overfit. Model B is better: it scores higher on new cases, and its practice score is a fair guide to how it does on them.
How it works, step by step
- Split the data. Keep a test set aside before training.
- Train the model on the training set and note its training score.
- Score it on the test set, which it has never seen.
- Compare. A large gap, high on training and much lower on test, is the sign of overfitting.
- Fix and recheck. Use more varied examples, a simpler model or less training, then measure again on fresh data.
A little deeper (ages 11 to 13)
Every real dataset has noise: small measuring errors, odd one-off cases and some wrong labels. The general pattern is the part that will repeat in new data; the noise will not.
Picture seven dots on a grid that rise roughly in a line. A straight line through the middle of them captures the trend and misses each dot by a little. A wiggly line can pass exactly through all seven dots, but between the dots it swings wildly, so its guesses for new points are poor. The wiggly line has learned the noise.
The opposite problem is underfitting: a model too simple to catch the pattern at all, like a flat line through rising dots. It does badly on training and test data alike.
Going further (ages 14 to 18)
A standard demonstration fits curves of different complexity to the same noisy points. A degree-1 polynomial (a straight line) underfits, degree 4 approximates the true curve well, and degree 15 overfits, with a far larger error on validation data. In general, the more flexible a model, the more data it needs before it generalizes well.
Common remedies: more and more varied training data; a simpler model; regularization, which adds a penalty for large weights to the loss and tends to improve generalization; and early stopping, which halts training when the score on a validation set stops improving.
There is a subtler trap. If you keep adjusting settings until the test score looks good, you can overfit to the test set itself. Knowledge of the test set leaks into the model, and the score no longer reports how it does on new data. The fix is a separate validation set or cross-validation, keeping the test set for one final check.
Common mix-ups
- Mix-up: "Overfitting means the model is too accurate."Fact: It is accurate on the wrong thing: the examples it memorized, not new cases.
- Mix-up: "Training for longer always helps."Fact: Past a point, more training can make the test score worse, which is why early stopping exists.
- Mix-up: "A high test score proves there is no overfitting."Fact: Not if the test set was used to tune the model.
- Mix-up: "Overfitting and bias are the same thing."Fact: Overfitting is about failing on new data in general. Bias in AI is about unfair or lopsided results, often for particular groups (here bias means unfair results, not the statistics term).
Try it (no device, 5 minutes)
On squared paper, draw seven dots that rise roughly from bottom left to top right, not quite in a line. One person draws a straight line that follows the trend. The other draws a curvy line that passes through every dot. Then a third person, who did not watch, adds three new dots following the same rough trend. Which line is closer to the new dots? That gap is overfitting.
Quick check
A model scores 98% on its training examples and 55% on new ones. What is the likely problem?
Answer: Overfitting. The big gap shows it learned the training examples, not the general pattern.
Overfitting. The big gap shows it learned the training examples, not the general pattern.What is underfitting?
Answer: A model too simple to catch the pattern, so it does badly on training and new examples alike.
A model too simple to catch the pattern, so it does badly on training and new examples alike.Why should the test set not be used to choose a model's settings?
Answer: Information about the test set leaks into the choices, so the final test score no longer shows how the model does on truly new data.
Information about the test set leaks into the choices, so the final test score no longer shows how the model does on truly new data.Questions
Overfitting is when an AI model memorizes its training examples instead of learning the general pattern. It looks excellent on those examples and does poorly on new ones.
Compare its score on the training examples with its score on a test set it has never seen. A large gap, high on training and much lower on the test, is the usual sign.
An overfit model is too closely tailored to its training examples, including their noise. An underfit model is too simple to catch the pattern at all, so it does badly on training and test data alike.
Use more and more varied training data, choose a simpler model, add regularization or stop training when the score on a validation set stops improving. Always confirm with a test set the model has never seen.
A model is useful only if it works on new cases. An overfit model gives a misleading score during development and then makes more mistakes when people rely on it.
Mechna Academy is a city of machines for curious children aged 8 to 18, opening first to ages 8 to 10. In each mission, a child guesses how a machine decides, then opens its Peek Hatch to check, changes one thing and tests it on a case it has never seen. Children learn how AI works this way, and they never chat with an AI.
For grown-ups: join the waitlistPlaces are limited. The waitlist is for parents and guardians 18 and older.