The math under the botStop 5 of 6
› Ages 8–16 · about 20 minutes
Cross off the bad move
Sequential decisions and reinforcement learning
A score after the fact can change the next try.
Tonight
Play a tiny game against a paper robot. When it loses, cross off the move that led there. Play again. It stops choosing the crossed-off move. Nobody handed it the right move. It only learned which tries went badly. When a person later says which of two answers they like better, that pick is a score of the same kind, used on a language model.
Say it in one sentenceYou can learn a better habit from a score, even when nobody shows you the right answer.
Already in the library
Textbook names
For ages 13–16 and the grown-up. One sentence each. The picture above is the lesson.
- Reward
- The score at the end, or along the way.
- Policy
- The habit: what you do in each situation.
- Credit assignment
- Deciding which earlier step deserves the blame or the praise.
- Preference
- A person picking the answer they like better, when there is no single right sentence.
- Search at answer time
- Trying several drafts and keeping the one that scores best, instead of trusting the first.
The rest of this field
Markov decision processes, the Bellman equations, and policy gradients are the formal version of scoring a situation and then changing the habit. PPO, DPO, and rewards you can check by a program are ways to do that to a language model without letting the habit change so fast that it breaks. Monte Carlo tree search is the same idea as trying several drafts, drawn as a tree.