AI Reinforcement Learning Tutorial: Reward Signals

TL;DRReinforcement learning trains an agent by reward — it learns actions that maximize a score.

An agent takes actions in an environment, receives rewards, and learns a policy that maximizes long-term reward through trial and error. It powers game-playing (AlphaGo), robotics, and (as RLHF) LLM alignment. It's powerful for sequential decisions but sample-hungry and sensitive to how you design the reward — a bad reward yields clever, unintended behavior.

Key points

Common mistakes

Try it: Explain "reward hacking" with a one-line example.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>agent → action → reward → better policy
reward hacking: reward "score" → agent loops a glitch
                instead of finishing the level</pre></body></html>
Open the interactive lesson →
Unsupervised Learning · Finding Structure Self-Supervised Learning · The Modern Shift