Types of Agents — Utility-Based Agents — Beginner-Friendly Notes
1. What Changes vs Goal-Based
Utility-based = goal-based plus a measure of how good a state is. Not just "reach goal or not", but "which path is better, safer, cheaper, faster?"
State + Utility Function → Choose action that maximises Expected Utility
Think: GPS with preferences — fastest vs shortest vs most fuel-efficient.
2. Utility — Simple Idea
- Utility : a number scoring how desirable a state is (higher = better). Can encode safety, cost, time, happiness.
- Expected utility: when outcomes are uncertain, agent calculates weighted average: .
- Example: two paths to hospital:
- Path A: 10 min, risky road →
- Path B: 15 min, safe road → → utility-based picks B even though both reach goal.
3. Why Goals Are Not Enough
- Multiple successful plans: which to pick? Goal agent picks any; utility agent picks best.
- Conflicting goals: safety vs speed — utility trades them off numerically.
- Uncertainty: when action may succeed or fail, utility chooses best expected outcome (links to Bayes, Module 4).
4. Economics Link (for viva)
Utility comes from economics — rational agent = maximises utility, not just achieves a goal. That's why AI adopts it as the definition of rationality.
5. Quick Comparison
| Agent Type | Decision Rule |
|---|---|
| Simple reflex | if percept → action |
| Model-based | if model-state → action |
| Goal-based | if action leads to goal → do it |
| Utility-based | if action leads to highest utility → do it |
| Learning | improves any of the above from experience |
6. Example — Self-Driving Taxi
- Utility combines:
U = -time - 10 \cdot risk - fuel_cost + comfort - Agent evaluates each manoeuvre's expected utility and picks max.
7. One-Line Summary to Write in Exam
A utility-based agent selects actions by maximising a numeric utility (or expected utility under uncertainty), allowing trade-offs between competing objectives and choosing the best among multiple goal-achieving plans.
8. Quick Self-Check
- Give a state where two paths both reach the goal but have different utilities.
- Why does utility help under uncertainty?