Go on — have a real try. A cat has four legs. So does a dog, a horse, a table. A cat has pointed ears and whiskers. So does a fox. A cat is small and furry. So is a rabbit, and a very fluffy slipper. Every rule you write down, the world hands you a cat that breaks it: a hairless cat, a cat curled into a ball with no legs showing, a kitten the size of your palm, a cat seen from behind in the dark. You know one instantly when you see it. But writing down the exact rule, in words, that catches every cat and nothing else? It turns out to be close to impossible.
This is a real wall, and for decades it stopped artificial intelligence cold. Back in Lesson 1, Babbage's engine did exactly what its instruction cards told it — follow this step, then this one. That works beautifully for sums, where the rule is clean. But there is no clean rule for a cat. So people tried writing thousands of rules by hand — if pointy ears AND whiskers AND... — and the systems stayed brittle and clumsy, fooled by anything the rule-writer hadn't thought of.
Then came a different idea, and it is one of the most important turns in this whole story. What if nobody writes the rule at all? What if, instead of telling the machine the answer, you show it — example after example after example — and let it work out the pattern for itself? That idea has a name: machine learning. And it is how nearly every clever thing your devices do today actually works.
This problem has a name among the people who study it: Polanyi's paradox — "we know more than we can tell." You can ride a bike, recognise a friend's face in a crowd, or tell a cat from a dog in a heartbeat, yet you could never write down the full set of rules for how you do it. Teaching by example is the way around a paradox that sits inside your own head.
Machine learning sounds mysterious until you have the four plain words it is built from. Once you have them, almost everything else in this subject — right up to the chatbots you can talk to — is these same four ideas, made bigger. Here they are, with a small example: teaching a machine to tell apples from oranges.
The examples you show it. Here, a big pile of fruit photos — the more the better, and the more varied the better.
The right answer attached to each example. Every photo comes marked "apple" or "orange", usually by a person.
The things it looks at to decide — here, the colour and the shape. Features are the clues.
The pattern it builds from all those examples — the thing it ends up "knowing", which it can use on fruit it's never seen.
So the shape of it is this. You gather training data (lots of fruit), each piece carrying a label (apple or orange). The machine looks at the features of each one (its colour, its shape) and slowly notices that oranges tend to be orange and round, apples tend to be red or green and a touch taller than they are wide. That noticed pattern is the model. Crucially, no person ever wrote "oranges are orange" — the machine drew that line itself, out of the examples.
Hold the two side by side. Babbage's engine followed a rule a person wrote, exactly and forever. A machine-learning model builds its own rule, from examples, and would build a different one if you showed it different examples. One is a machine that obeys. The other is a machine that forms a pattern. That difference is the reason this lesson closes the first chapter — it's the hinge the rest of the subject turns on.
Choosing the right features is so important that it has its own job title: feature engineering. For years, the cleverness in machine learning was mostly humans deciding what the machine ought to look at. One of the big shifts of the last decade is that the most powerful systems now work out their own features too — a thread you'll pick up in the next chapter, with neural networks.
Here is the apples-and-oranges idea drawn as a picture. Each piece of fruit becomes a dot. We place it using its two features: how round it is goes across the bottom, how orange its colour is goes up the side. When you plot all the labelled examples, something lovely happens — the two kinds fall into two clumps, and the model is nothing more than the line that best separates them.
This is exactly the kind of thing you've been doing in Maths with straight-line graphs: points on a grid, and a line drawn through them. Here the line is doing a job — everything on one side, it calls an apple; everything on the other, an orange. "Learning", for a simple model like this, really does mean finding the best place to put that line. And it ties straight back to Lesson 5: remember the neuron that adjusted its weights until it decided correctly? Those weights are what tilts and shifts this very line. A neuron learning is a line finding its place.
In real systems the picture isn't flat — it can have hundreds or even thousands of features, so the "line" becomes a slicing surface in a space with hundreds of directions, far too many to draw or even picture. The mathematicians have a wonderfully deadpan name for working in spaces you can't see: they call it operating in "high-dimensional space", and they do it with the same maths you'd use for a flat graph, only more of it.
A model doesn't arrive knowing where to put the line. It starts off guessing, and gets better by going round and round a loop — making a guess, checking it against the real labels, and nudging itself when it's off. Read the diagram round once, in the direction of the arrows, and you'll have the heart of how every machine-learning system on Earth is trained.
Tap each card — the four words from this lesson, in your pocket.
That little "nudge the model" step has a real name — training — and on big systems it can run that loop billions of times, on thousands of computers at once, for weeks. The maths of which way to nudge is the same idea as rolling downhill to find the lowest point in a valley — feel for the slope, step downhill, repeat. You'll meet that hill properly in the next chapter.
Let's walk through it as if you were the teacher. We'll keep it to a tiny set of fruit, sorted by two features — apples and oranges. Reveal each step, and have a guess about what the model will do before you move on. Watch especially for the last example, where it goes a little astray — because that slip teaches you more than all the tidy ones.
This is why serious machine learning always keeps two separate piles of examples: a training set to learn from, and a test set it has never seen, held back to check it on. It's the same reason a teacher sets an exam with fresh questions, not the exact ones you revised — passing the questions you've already seen proves nothing. The real test is the question you've never met.
Here is the idea I most want you to carry out of this lesson, because it matters far beyond fruit. A model has no knowledge of its own. It has only what its examples gave it. So if the examples are narrow, or old, or skewed, or careless — the model learns those flaws, faithfully, and hands them back to you wearing the calm, confident face of a computer. People sum it up in four blunt words:
"Garbage in, garbage out." A rule as old as computing itself
You saw it with the peach: show a model only oranges and apples, and a peach becomes an orange. But turn that up to things that matter. A system shown handwriting from only adults may stumble on a child's. A system trained on yesterday's slang may be baffled by today's. The machine is not careless and it is not cruel — it is a faithful mirror of whatever it was shown. The data is never neutral: what you show a learner shapes what it learns. That holds for a machine, and — if you think about it — for a person too.
This is the thinking-move to keep for life: when something — or someone — gives you a confident answer, a good question to ask quietly is, what examples were you learning from? We'll come back to this hard, and properly, in a later lesson all about the mistakes AI makes — where the polished, confident answer turns out to be flatly untrue, and where examples that lean one way can quietly make a machine unfair without anyone meaning it to.
There's a related trap with its own name: overfitting. It's when a model memorises its examples instead of learning the real pattern — like revising only past exam papers until you can recite them, then being thrown the moment a question is worded a new way. An overfitted model is dazzling on the examples it has seen and shaky on everything else. The cure is the same as for revision: more, and more varied, practice.
This isn't a far-off lab idea. Learning from examples is already woven quietly through your day, doing real and useful work. Once you can name it, you'll spot it everywhere:
Trained on millions of emails labelled "spam" or "not spam", it learned the patterns of junk — and quietly keeps your inbox clear.
The post office sorts letters with systems trained on thousands of examples of messy human handwriting — turning a scrawled postcode into the right town.
The suggestions on a music or video app are a model trained on what people who liked what you like went on to enjoy.
The little box that finds a face to focus on was trained on a vast pile of photos labelled "face here" — and "no face here".
Every one of these is the same four words from earlier — training data, labels, features, a model — pointed at a different job. None of them was hand-coded with rules for "what spam looks like" or "what a face is". Each was shown, and learned. And this is also where this lesson reaches back to Science: telling apples from oranges is really a kind of classifying — the same move you make sorting living things into groups by their features. A machine learning to classify is doing, with maths, what a naturalist does with a hand lens and a field guide.
You've now met the engine room of modern AI. From here it only gets more wonderful. Next, we open up neural networks properly — many of Lesson 5's neurons stacked into layers, learning features all by themselves. Then a machine that taught itself to play Go and beat the finest human alive with a move no person would have played. And finally the language models you can actually sit and talk to. Same four words, underneath, all the way up.
The recommendation idea was so valuable that in 2006 a film-streaming company offered a one-million-dollar prize to anyone who could improve its "you might like" model by a mere ten per cent. It took teams around the world nearly three years to claim it — proof that nudging a model those last few points better is some of the hardest, and most prized, work in the field.
Fresh one. The whole pile of examples you show the machine to learn from — each one carrying its right answer — is called the training ______. What word fills the gap?
Fresh one. When a model memorises its examples instead of learning the real pattern — dazzling on what it has seen, shaky on anything new — that has a one-word name. It starts with "over". What is the word?
Imagine you're building a model to do one job: tell a photo of your handwriting from a photo of someone else's. You know the rule now — it learns only from the examples you give it. So think it through: what examples would you gather, and why? And here's the sharper half — what could go quietly astray with the examples, the way the tank model secretly learned the weather, or the peach slipped through? There's no single settled answer. Make a plan, then poke a hole in your own plan.
Start with the examples you'd collect. Then turn on yourself: how could those very examples teach it the misleading pattern without anyone noticing?
strong Your plan to gather plenty of both kinds of writing is exactly the instinct this lesson was hoping to plant — you've understood that a model needs to see what something is and what it isn't, not one side alone. That's the part most people miss.
try this The hole you poked in your own plan is the sharpest thing here, so push on it once more. You spotted one way the examples could mislead it — now ask: is there a difference between your samples and everyone else's that has nothing to do with handwriting at all? The pen, the paper, the lighting? That's how the tanks became the weather.
to add One thing to carry forward: a good test of any plan like this is to imagine the laziest shortcut the model could take to look clever. If there's a "cheat" sitting in your data, it will find it. A question worth holding: how would you check it had actually learned handwriting, and not the cheat?
There's no short film slotted into this lesson — but there's a lovely one to watch with Dad when you have twenty minutes, that shows the very idea you've now met, in someone's own words.
The TED talk "How we teach computers to understand pictures" by Fei-Fei Li tells the true story of ImageNet — the enormous, hand-labelled pile of photographs that taught machines to see, and changed the field forever. It is the four words of this lesson — data, labels, features, a model — playing out for real, told warmly by the scientist who built it. About 18 minutes, and fine for both you and Isabel (13 and 15) — though it's one Dad will enjoy alongside you.
And if you'd rather read than watch: try training a model yourself in a browser. Search for Google's "Teachable Machine" with Dad — you show your webcam a few examples of two things (say, a thumb up and a thumb down), press a button, and watch it learn the difference in front of you, in about a minute. It is this whole lesson, made real with your own hands — training data, a model, and a prediction, all in one sitting.
You started this lesson trying to write the rule for a cat, and found you couldn't — so you met the idea that changed everything: don't write the rule, show the examples, and let the machine form the pattern itself. You learned the four words it all rests on — training data, labels, features, a model — watched a model learn by looping, sorted fruit and saw it stumble on a peach, and took away the line worth keeping for life: a machine is only as good as its examples; the data is never neutral. That completes the first chapter of your AI story, Florence. From here, the machines start to get genuinely astonishing — neural networks that find their own features, a program that out-played the greatest Go player alive, and the language models you can sit and talk to. You've built the foundation. Next, we build up.