L054 · Under the hood · 2 min

Overfitting: learning the answers, missing the lesson

A model overfits when it memorises its training examples so closely that it fails on anything new.

01 · The idea

The goal of training is to learn general patterns. A model that spots cats should recognise a cat it has never seen, in a new pose, under new light.

Sometimes a model clings to details of its training set instead. Maybe every cat photo it saw was taken indoors, so it decides that sofas mean cat. It scores perfectly on those photos and stumbles on real ones.

Builders guard against this by testing on data the model never saw during training, adding more varied examples, and stopping training before the model starts memorising.

It also explains why a model can ace a well-known test and still struggle on your own tasks. Strong scores on familiar questions do not prove it will handle unfamiliar ones.

02 · Think of it like this

It is the student who memorises last year's exam answers. Same questions, full marks. Change the numbers and they are lost, because they never learned the method.

03 · Do it now

04 · Quick check

A model gets 100% on its training photos but fails on new ones. What is this called?