Train the Puppy
Train a virtual puppy to find its treat. You set the rewards and penalties, and watch it learn by trial and error. Five missions plus a maze builder.
Fetch the treat
The puppy knows nothing. Press Train and watch it learn, by trial and error, how to reach the treat. The arrows show what it thinks is the best move.
- Cost of each move: 0.1 (fixed)
- Tries so far
- 0
- Found the treat
- –
- Curiosity
- 100%
- Test runs
- 0
After each move the puppy updates its notes: new note = old note + 0.5 × (reward + 0.95 × best next note − old note). At first it explores at random (curiosity); later it mostly follows its best notes. The “found the treat” count covers the last 20 tries.
The science behind it
Read these after a few missions.
What is machine learning?
Computers that learn from examples and experience, instead of following instructions step by step. The big idea in plain words.
How a puppy learns: reinforcement learning
Trial, error and rewards. See how a computer can learn a maze with nobody telling it the way.
Be careful what you reward
Why AI does what you ask, not what you meant, and how a puppy found a loophole.
Be the algorithm: train a puppy with paper and a friend
A no-computer activity where one person is the puppy and another is the trainer. Learn reinforcement learning by doing it.
Using Train the Puppy in class or for self-study
The puppy really learns: it uses Q-learning, a classic reinforcement-learning method, so nothing is scripted. Missions 1 and 3 show learning from trial and error. Mission 2 shows how a penalty changes behaviour. Missions 4 and 5 show reward hacking, where a machine finds a loophole in the rewards. The training can be paused and tested at any time, which makes it good for “predict, then test” questions. See the no-computer version of this activity.