Mansori

How AI Learns From Examples

About this lesson, for parents and teachers

This robot wants to tell Fluffy monsters from Spiky monsters, but nobody has taught it yet. You are the teacher. Every example you give helps it learn.

Ages 6–8 · about 7 minutes · builds on Teach the Robot: Apple or Banana? · leads to AI Guesses by Looking at Neighbours

Try this

  1. Tap a new monster at the top, then tap the pile it belongs in: Fluffy or Spiky.
  2. Watch the quiz at the top. Each green tick is a monster the robot now guesses right.
  3. In round 2, some monsters are in the wrong pile. Tap one to move it and see the score change.
  4. In round 3 the quiz is harder. Teach the robot with all 6 new monsters.

How it works

This robot learns the way many real AI programs do: from examples. It is not given a rule like spiky things are Spiky. Instead, it looks at the monsters in its two piles. To guess a new monster, it finds the example that looks the most similar and copies that example's label.

With only two examples, the robot gets confused. It notices size as much as spikes, so a small fluffy monster might look more like the small spiky example. When you add more examples of different sizes, the robot sees that size does not decide the group, and its quiz score goes up.

Examples also need the right labels. When someone puts a spiky monster in the Fluffy pile, the robot learns something wrong and starts making mistakes on monsters that look like it. Fixing the labels fixes the robot. Bad examples teach bad answers. This is why the people who build AI check their examples so carefully before training.

The quiz is a set of monsters the robot never learned from. That is called test data. Engineers always test an AI on new examples, because what matters is how well it guesses things it has not seen before. A robot that only memorises its examples is not much use. A good robot can guess well on brand new monsters, and your quiz score shows exactly how well it does.

Where engineers use this

Photo apps learn to recognise faces, pets and food from millions of labelled pictures, and engineers spend a lot of time finding and fixing wrong labels in that data.

Words to know

Example
One thing the computer learns from, like one monster in a pile.
Label
The name we give an example, like Fluffy or Spiky.
Training
Teaching a computer by giving it lots of labelled examples.
Test
Checking the computer on new examples it has never seen.

Talk about it

Goal: Give a computer more and better examples and watch its guesses get more accurate.

  • Why did the robot do better after it saw monsters of many different sizes?
  • What happened when monsters were in the wrong pile? Why?
  • If you wanted to teach a robot to recognise your family, what examples would you show it?

Without a screen: Collect 12 leaves, buttons or toy cars. Pick a secret rule (for example, has a pointy tip). Show your child a few examples sorted into two piles without telling the rule, and ask them to guess where new ones go. Then add more examples, or put one in the wrong pile on purpose, and talk about how it changes their guesses.

Curriculum links: AI4K12 Big Idea 3 (computers can learn from data); CSTA K-12 1A-DA-07 (identify and describe patterns in data visualizations and use them to make predictions)

Questions

How does AI learn, explained for kids?
Many AI programs learn from examples instead of rules. People show them lots of examples with the right answer, and the program finds patterns it can use to guess the answer for new things.

What is training data?
Training data is the set of labelled examples a computer learns from. More examples, from lots of different kinds, and correct labels usually make the computer's guesses better.

Can AI make mistakes?
Yes. If an AI learned from too few examples, from examples that are all alike, or from examples with wrong labels, it will make mistakes. That is why people test AI carefully on new examples.