"Not all AI learns from labeled examples. Some learns by doing — trying, failing, and chasing rewards, just like we do."
Level: Intermediate · Time: ~12 min · Prerequisites: Module 3
Learning Objectives
By the end of this module, you will be able to:
- Explain reinforcement learning with a game analogy
- Identify the agent, environment, action, and reward
- Recognize genetic algorithms and multi-agent systems
- Know when each approach fits
1. Reinforcement Learning: Learning by Doing
Reinforcement learning (RL) trains an agent to make good decisions by interacting with an environment and collecting rewards. No labeled dataset — the agent learns from the consequences of its actions.
The loop: the agent observes its state, takes an action, gets a reward (good or bad) and a new state, and repeats — gradually favoring actions that pay off. Over thousands or millions of rounds, it builds up a policy — a learned strategy that maps "situation" to "best move." Early on the agent explores wildly; later it exploits what it has learned, much like a new driver who stops thinking about each pedal once the moves become automatic.
Explain like I'm new: It's how you'd learn a new video game with no manual: press buttons, see what earns points or ends the game, and get better each try. The score is your reward; your improving strategy is the learned "policy."
2. The RL Vocabulary
| Term | Meaning | Game example |
|---|---|---|
| Agent | The learner/decision-maker | The player |
| Environment | The world it acts in | The game level |
| State | The current situation | Your position |
| Action | A choice | Move, jump |
| Reward | Feedback | Points, damage |
The agent's goal is to maximize total reward over time — sometimes sacrificing a small reward now for a bigger one later. This is the famous exploration vs. exploitation trade-off: do you take the good-enough option you already know (exploit), or try something risky that might be even better (explore)? Lean too far either way and the agent either gets stuck in mediocrity or never settles down. Balancing the two is one of RL's central challenges.
Real-world use case: RL trained programs to beat world champions at Go and chess, tunes data-center cooling to save energy, and helps robots learn to walk. The same "try, reward, repeat" idea scales from games to industry.
3. Other Approaches: Genetic Algorithms & Multi-Agent
- Genetic algorithms mimic evolution: create many random solutions, keep the best, "breed" and mutate them, repeat. Great for optimization problems with huge search spaces.
- Multi-agent systems have several agents interacting — cooperating or competing — like traffic simulations or market models.
Key idea: These approaches shine when there's no labeled data but there is a goal or a way to score outcomes. RL needs a reward signal; genetic algorithms need a "fitness" score. If you can measure "how good is this?", these methods can search for better answers.
4. When to Use What
- Supervised learning: you have labeled examples (most business ML)
- Reinforcement learning: sequential decisions with rewards (games, robotics, control)
- Genetic algorithms: optimization with a fitness measure (scheduling, design)
Most production AI is still supervised — RL and genetic methods are powerful but specialized.
Real-world use case: You've already met RL without knowing it: the "human feedback" step that makes chatbots polite and helpful (called RLHF) is reinforcement learning, where the reward is "did a person prefer this answer?" So even the language models in later modules owe part of their behavior to the try-reward-repeat loop.
Hands-On: Try This
Try this: Think of a skill you learned by trial and error — cooking, cycling, a sport. Name your "rewards" (a tasty meal, staying upright) and "penalties" (a burnt dinner, a fall). You were doing reinforcement learning without a dataset all along.
Common Mistakes
Common mistake: Reaching for RL on a problem that's really supervised. RL is complex, data-hungry, and hard to stabilize. If you have labeled examples, supervised learning is almost always simpler and better.
✅ Checkpoint
- What does an RL agent learn from instead of labels?
- Name the five core RL terms.
- What do genetic algorithms mimic?
Answers: 1) Rewards from its actions. 2) Agent, environment, state, action, reward. 3) Evolution — selection, breeding, mutation of solutions.
Key Takeaway: Reinforcement learning trains an agent to maximize rewards by acting in an environment — learning from consequences, not labels (games, robotics, control). Genetic algorithms mimic evolution to optimize, and multi-agent systems model interacting agents. These fit when there's no labeled data but a goal you can score — though supervised learning still dominates production.
Further Learning
Adapted from Microsoft's AI for Beginners (MIT License).