When AI Memorises Too Much
Learning answers vs learning the pattern. Hide some examples (train/test split) and see if the AI truly gets it.
What you'll learn
- Overfitting
- Generalisation
- Train/Test Split
In this video
Picture this. You memorise every answer in the study guide, word for word. You feel ready. But then the real test shows up with brand new questions, and suddenly you're stuck. AI can fall into this trap too, and today we'll see exactly how.
Quick flashback. Last time we taught a line to fit through these blue dots. See how it slides right through the middle? It doesn't touch every dot, and that's actually fine. Close enough is good enough.
But what if we got greedy? What if close enough wasn't enough, and we forced the line to wiggle and twist until it touched every single dot? Watch this. The line bends and curves, chasing each dot like it's collecting coins.
Boom. Look at the score up there: zero point zero zero. The line hits every single training dot, perfectly. No misses at all. This feels like a total win, doesn't it? It's not.
Now here come the orange dots. These are brand new — the AI never saw them while it was learning. They're the real test, the surprise quiz. Keep your eyes on where they land compared to that wiggly pink line.
Ouch. Look at all those red miss-lines. The wiggly curve is way off on the new dots. Train miss is zero, but test miss is huge. The AI didn't actually learn the shape of the data — it just memorised exactly where the old dots were sitting.
There's a fancy name for this whole mess. Overfitting. Sounds technical, but it just means the AI fit the training data too tightly. It memorised, when it should have learned the bigger pattern underneath.
Let's get out of dot-world for a sec. Imagine we're teaching an AI what a dog looks like. But every single photo we show it is Rex. Same fluffy guy, six times in a row. The AI sees Rex, Rex, Rex, Rex, Rex, Rex.
Now look — here come Luna, Biscuit, Max, and Bella. All real dogs. But the AI shakes its head at every one. Not Rex. Not Rex. Not Rex. It learned one specific dog by heart, and now it's failing the easiest quiz ever.
See the difference? On the left is what the AI actually picked up — just Rex. On the right is what we wanted it to learn — the whole idea of dog. Four legs, fur, wagging tail, all dogs. Memorising one example is not the same as understanding the pattern.
Okay, your turn to play. Grab that slider and crank the wiggle up slowly. Keep an eye on both numbers at the top. Train miss melts down toward zero — but test miss? Watch it shoot up. That's overfitting, right under your fingers.
So how do we catch a sneaky AI that's only memorising? Here's a detective trick that scientists use every day. We hide part of the data from the AI on purpose, like keeping a secret card up our sleeve.
We split our dots into two piles. The blue ones go to the AI for studying — that's the training set. The orange ones get locked in a drawer — that's the test set. The AI doesn't even know they exist while it learns.
Compare the two pictures. On the left, the green line does decent work on both blue and orange dots — that AI really learned. On the right, the pink wiggle nails the blue dots but flunks the orange ones. The hidden test is the honest exam, and it never lies.
Try it yourself. Drag the slider to choose how many dots stay hidden in the test pile. Too few hidden, and your test is too easy to trust. Too many hidden, and the AI barely has anything to learn from. Play around and find the sweet spot.
Here's the golden rule every AI scientist lives by. Never, ever test the AI on the same data you trained it with. It's like grading a kid on the exact homework they already saw the answers to. You'd just be tricking yourself.
Quick recap. Overfitting means the AI got too clingy with the training dots. A perfect zero on training is actually a warning sign. The fix is the train-test split — and if the AI handles unseen stuff well, that's called generalising. That's real learning.
You've watched lines learn, wiggle, and overfit. But here's the question that'll bug you next — what's actually doing the learning inside the AI? See that pulsing pink circle? Next video, we crack it open and meet the neuron.
Topics
Ready to try it yourself?
When AI Memorises Too Much is a hands-on interactive video — watch it, then play with the idea live in your browser. Free, no sign-up.
Open in Kekula →