Model-Based Deep Reinforcement Learning #
A model-based agent can ask what might happen before committing to a real action. It uses a known simulator or a learned model to compare possible futures. This can reduce real interactions, but planning costs computation and a learned model can make compounding prediction errors.
Course Content covered in this module:
- Upper-Confidence-Bound Action Selection
- Monte Carlo Tree Search
- AlphaGo Zero/AlphaZero, MuZero and PlaNet
1. Planning With an Environment Model #
Model-free learning estimates a value or policy from experience without using a model to plan. Model-based methods use a model’s predictions to evaluate actions that have not yet been taken in the real environment. The model can be exact, as with known game rules, or learned from data. In a learned model, inaccurate long-horizon predictions can make a plan look better than it really is.
2. Upper Confidence Bounds in a Search Tree ☆ #
At a node, treat each possible action as a local choice. UCT adapts the bandit exploration principle to the tree, balancing a high estimated return against the need to visit less explored branches:
\[ \operatorname{UCT}(s,a) =\overline Q(s,a)+c\sqrt{\frac{\ln N(s)}{N(s,a)}}. \]Here \( N(s) \) is the parent’s visit count, and \( N(s,a) \) counts traversals of the action. Handle unvisited actions separately, for example by exploring them before applying the formula. This score guides search; it need not be the rule for choosing the final real action.
Example: With parent count 20 and exploration constant 1, action A with mean return 0.7 and count 10 has a score of about 1.25. Action B with mean return 0.6 but only two visits has a score of about 1.82, so search explores B despite its lower current mean.
3. The Four Phases of Monte Carlo Tree Search ☆ #
flowchart TD
S["Select a branch"] --> E["Expand a child"]
E --> V["Evaluate the leaf"]
V --> B["Back up the result"]
B --> |"Budget remains"| S
B --> |"Budget exhausted"| A["Choose a real action"]
style S fill:#90CAF9,stroke:#1E88E5
style V fill:#E1F5FE,stroke:#1E88E5
style A fill:#90CAF9,stroke:#1E88E5
- Selection: follow tree edges using a score that balances exploitation and exploration.
- Expansion: add a child for an action not yet represented, unless the node is terminal.
- Evaluation: estimate how good the new leaf is, for example by rolling out a simulated game or querying a learned value function.
- Backpropagation: update the visit counts and backed-up returns on the selected path. This is a tree-statistics update, not neural-network backpropagation. For alternating two-player zero-sum games, keep the value perspective consistent when backing up results.
After the search budget is spent, a common real-action rule is to take the most visited root action. A search implementation may instead select by estimated return. Once the environment moves, the corresponding subtree can sometimes be reused.
4. AlphaZero, MuZero and PlaNet #
| Method | What the planner uses | How it plans |
|---|---|---|
| AlphaZero | Known game rules, network policy priors and a leaf-value estimate | MCTS guides self-play, and the search visit distribution and game outcome train the network |
| MuZero | Learned latent dynamics and predictions of reward, policy and value | MCTS searches over latent states without requiring the complete transition rules or pixel reconstruction |
| PlaNet | A learned latent dynamics model from image observations | Compares candidate action sequences by predicted reward in latent space, executes an action and replans |
AlphaZero’s policy head guides the search and its value head estimates the position. It does not simply output a table of Q-values. MuZero learns the predictions needed for search, rather than the entire observable world. PlaNet also plans in latent space, but it evaluates candidate action sequences for control rather than running the same game-tree search.
Practice Questions #
- Which MCTS phase chooses an existing branch, and which adds a new child?
- Recalculate the UCT example with the exploration constant set to zero.
- Why can MuZero be model-based even though it does not reconstruct future observations?
References #
- Consolidated DRL slides, PDF pp. 362–401; recording 14.