Learning by trial and error

Some problems have no answer key, only feedback. Balance exploring against exploiting, watch an agent learn to cross a gridworld from rewards alone, and see how the same ideas fine-tune language models and why they can be gamed.

Level
Intermediate
Length
5 lessons, 2 hr
Assumes
The machine learning and neural networks tracks.
Builds on
How machines learn and Neural networks
  1. 1Explore or exploit: banditsWith no answer key, a learner has to try things to find out what pays. Race three classic strategies on five slot machines and measure what exploring costs.20 min
  2. 2States, actions, and rewardsWhen actions change your situation, rewards can arrive long after the choices that earned them. Values and the Bellman equation turn that into a plan.25 min
  3. 3Learning from experience: Q-learningNo map, no model, just moves and rewards. Watch an agent learn a maze from scratch with temporal difference updates, and see why Q-learning and SARSA walk a cliff differently.25 min
  4. 4Policy gradientsSkip the values and adjust the policy itself, nudging up the chance of whatever worked. Train REINFORCE live and see why a baseline makes it steadier without making it wrong.25 min
  5. 5Rewarding LLMs, and reward hackingHow reinforcement learning fine-tunes language models from human comparisons and automatic checks, and why optimizing any measured reward too hard can make the real goal worse.25 min

Labs in this track

Try "embedding", "softmax", "overfitting", or "backpropagation".