In many situations, we need to find a value or make a decision that gives us the best possible result, but the right choice is not known beforehand. We may be adjusting a recipe, tuning a setting, aiming at a target, or trying to improve a prediction.
The challenge is that we cannot always know in advance which choice will give us the best result. We have to make a choice, observe what happens, and determine whether we are moving closer to the result we want.
Let's play a game where you'll make a series of choices to move closer to the best possible result. At each step, observe what happens and decide which direction to move next.
Let's see what that looks like π
You're competing in the Royal Archery Trial, blindfolded. Somewhere far out on the field is a hidden target. You can't see it, and no one will ever tell you exactly where it is. After each shot, all you'll learn is how far you missed by, and whether you went too far or not far enough.
Choose a power, release the arrow, and use your miss to guess better next time.
Set your power and release your first arrow, every shot teaches you something.
Look at how your error shrank shot after shot:
Sit with these for a moment. There's no single correct wording, just think them through in your own words.
Tap a card to open it up and see the idea behind what you just did.
Press play to watch your own attempts line up, in order, and see exactly where each adjustment came from.
What you just did, shoot, measure the miss, adjust, repeat, is exactly how machines learn. This strategy is called Gradient Descent. Here's the mapping:
| You (the archer) | β the Optimizer |
| Bow power | β the Parameter being tuned |
| Distance you missed by | β the Loss (error) |
| Warmer / colder feedback | β the Gradient (which direction to adjust) |
| Nudging the power each shot | β a Gradient Descent update step |
| The blindfold | β never seeing the loss function directly, only local feedback |
New situations to think through using what you just discovered.