← All posts

aiNov 17, 20261 min read

Overfitting: When AI Memorises Instead of Learning

Imagine a student who memorises every answer in last year’s exam paper. They score 100% on that paper. Then the real exam arrives with slightly different questions, and they fail. Machine learning has the same trap, and it is called overfitting.

Animated explainer: two models learn from the same ten dots; Model A bends through every dot, Model B draws a smooth trend; when new dots arrive, Model A's error is 0.40 and Model B's is 0.22
Animation: generated entirely by code to illustrate the idea; the data are synthetic.

In the animation, two models learn from the same ten blue dots. Model A bends itself to pass through every single dot, so its error on the data it trained on is zero. Model B draws a smooth curve that follows the overall trend and misses a few dots slightly. Then new data arrives, the white circles it has never seen. Model A’s error jumps to 0.40, especially at the edges where its curve swings wildly. Model B’s error is 0.22, about half. The model that looked worse during training is the better one in the real world.

This is why AI engineers never judge a model only on its training data. They always keep some data hidden and test on it, and they use tricks like simpler models, more data, or “regularisation” to stop the model from memorising noise. A good model doesn’t have to fit every dot perfectly. It has to make good predictions on data it has never seen.

Comment

Comments · 1

Add a comment

Your email is never shown. Comments appear after a quick check.