Skip to content

2 · How computers "learn" from examples

If AI isn't magic, how does it get good at things? The secret is examples. AI learns a lot like you do — by seeing many, many examples until it spots the pattern.

Imagine you wanted to teach a little kid the difference between a cat and a dog. You wouldn't write down rules like "a cat is exactly this wide." You'd just point at lots of cats and say "cat," and lots of dogs and say "dog." After enough examples, the kid starts to guess on their own — "that fluffy one is a cat!" They learned the pattern from examples.

AI does the same thing, just with a giant pile of examples — sometimes millions of pictures, or huge amounts of writing. People call those examples the training data ("training" like training for a sport; "data" just means information). The AI looks for patterns in the training data, and then it can make a guess about something new it has never seen.

Here's the simple loop:

StepWhat happensKid example
1. ExamplesShow the AI lots of training dataThousands of cat and dog photos, each labeled
2. Find the patternThe AI notices what's usually true"Pointy ears + whiskers → cat"
3. Make a guessShow it a new thing; it predictsNew photo → "I think that's a cat!"

Two important things follow from this:

  • AI is really making a smart guess. A good guess, often — but a guess, not a fact it looked up in a book.
  • AI is only as good as its examples. If the examples are messy, missing, or unfair, the guesses will be too. (We'll come back to that in the fairness lesson.)

You can even try this yourself. Free school programs from Code.org and MIT's Day of AI let kids train a real model — for example, teaching a computer to tell sea animals from trash — just by giving it examples. That's machine learning, and now you know the trick behind it.

Think about it. If you trained an AI on photos of only tiny puppies, what might it get wrong when it sees a big grown dog?

Sources