Lesson 6 of 12 · How machines learn · Teacher's plan
Learning from rewards
A warmer or colder clapping game and a browser lab where students design a reward for a walking robot show that a machine learns exactly what you reward.
Students will be able to
- describe learning from rewards as trying, getting feedback and adjusting
- explain that a machine learns what the reward measures, which may differ from what we meant
- spot a loophole in a reward and suggest a better one
- compare learning from rewards with learning from labelled examples
Prepare
- A hidden task written on a folded slip, such as "touch the window" or "pick up the red pen"
- A projector and one teacher device with internet, or a few devices for pairs
- The ManuAI page /play/lab/kit-learns-to-walk loaded in advance (free, no account)
- One worksheet per student
Words to know
- Reward:
- A signal that says "that was good", given after an action.
- Feedback:
- Information about how well you did, which you use to adjust what you do next.
- Loophole:
- A way to get the reward without doing what was really wanted.
Main activity · In the browser: ManuAI
Warmer or colder, then teach a robot to walk
One student finds a hidden task only from the class clapping louder or softer. Then, on one projected screen or in pairs, the class designs a reward in a ManuAI lab where a program teaches a fox character to walk, and watches it find loopholes when the reward is careless.
ManuAI pages for this lesson
- Kit learns to walk ai.manusignal.com/play/lab/kit-learns-to-walk
- Teach Kit a beat (extra) ai.manusignal.com/play/lab/teach-kit-a-beat
The 45-minute plan · 45 minutes
| Warm-up8 min | Warmer or colder clapping
|
|---|---|
| Activity17 min | Kit learns to walk
|
| Practice15 min | Design a reward on paper
|
| Wrap-up5 min | You get what you reward
|
Teacher tips
- Devices: one projected screen is enough for this lesson. The ManuAI labs are free and need no account. Never ask students to create accounts on other sites.
- Clapping game in a large class: let one row clap at a time, or use a single clapper with a drum or desk tap to keep the noise manageable. Choose a task that is safe and stays inside the room.
- Misconception: "the robot is being naughty" or "cheating on purpose". It has no intentions. It repeats whatever raised its score, so the loophole is a sign that the reward was written loosely.
Exit ticket answers
- A walking robot was rewarded only for distance moved forward. It learned to throw itself forward and fall. Why? B. Falling forward earned the reward, and the reward did not mention staying upright
- What is a loophole in a reward? Give an example. A good answer: A way to get the points without doing what was really wanted. For example, a robot rewarded for picking up rubbish could drop it and pick it up again.
- In learning from rewards, what does the learner get after each try? D. A score or signal saying how good the try was