Models and planning
A model predicts how the environment responds to an action. A distribution model gives the full , which is what dynamic programming needs. A sample model only draws one outcome at a time, as a simulator does; it is easier to build and is enough for sampling-based methods (Sutton & Barto, 2018). Planning here means any computation that uses a model to improve a policy. One simple form reuses the methods you already know. Draw a state and an action, ask the sample model for , and apply a Q-learning update to the simulated transition as if it were real. This is Q-planning: Q-learning on simulated experience. With a correct model and enough updates it converges to of the model, for the same reasons Q-learning does.Dyna-Q
Dyna-Q (Sutton, 1990) runs learning and planning side by side. Every real transition is used three times: for a direct Q-learning update, to update the model, and as one of the transitions that planning can replay later.When the model is wrong
The model above is a table of the last observed outcome, so it is exactly right in a deterministic world that does not change. If the environment changes, for example a shortcut opens in the maze, the model stays wrong until the agent happens to try the changed transition, and the greedy policy gives it no reason to. Dyna-Q+ adds an exploration bonus to simulated rewards, , where is the number of steps since the state-action pair was last tried in the real environment. Transitions that have not been checked for a long time look more attractive, so the agent tests them and corrects the model.Prioritized sweeping
Dyna-Q picks planning updates at random, so most of them change nothing, especially early on, when almost all values are still zero. Prioritized sweeping keeps a queue of state-action pairs ordered by how much their value would change. After a value changes, the predecessors of that state, the pairs that the model says lead into it, are queued with a priority equal to the size of their pending update. Planning then works backward from wherever values are actually changing.Planning at decision time
Dyna plans in the background and stores the result in . Decision-time planning plans from the current state each time the agent must act, and keeps only the chosen action. The simplest version runs rollouts: from the current state, simulate each action followed by some fixed policy many times with the model, and pick the action with the best average return. Monte Carlo tree search (MCTS) builds a search tree from the current state instead. It spends more simulations on the branches that look promising and uses the statistics in the tree to choose the action. AlphaZero combined MCTS with a network that predicts values and action probabilities and learned to play Go, chess and shogi from self-play. MuZero kept the search and replaced the game rules with a learned model, so the same method works where no simulator exists.Learned world models
For high-dimensional observations, such as images, the model is usually learned in a compressed latent space: an encoder maps the observation to a latent state, a dynamics network predicts the next latent state and the reward from the current one and the action, and a decoder can reconstruct the observation. The policy can then be trained entirely on trajectories imagined in the latent space. Ha and Schmidhuber’s world model (Ha & Schmidhuber, 2018) trained a small controller inside a learned model of a racing game. The Dreamer line of agents learns the actor and the critic from imagined latent rollouts; DreamerV3 (Hafner et al., 2023) uses one set of hyperparameters across Atari, continuous control and Minecraft. The World Models chapter covers these architectures in detail.Model predictive control
Model predictive control (MPC) is decision-time planning with a model of the dynamics, as used in control engineering. At every step it optimizes a sequence of actions over a short horizon, executes only the first action, observes the new state and optimizes again. The model can be derived from physics or learned from data. With a learned model and a sampling optimizer such as the cross-entropy method, MPC gives a model-based agent that needs no policy network at all; replanning at every step corrects for errors in the model as they show up. Key references: (Sutton & Barto, 2018; Ha & Schmidhuber, 2018; Hafner et al., 2023); Sutton (1990), Integrated architectures for learning, planning, and reacting based on approximating dynamic programming.References
- Ha, D., Schmidhuber, J. (2018). World Models. arXiv [cs.LG]. Link
- Hafner, D., Pasukonis, J., Ba, J., Lillicrap, T. (2023). Mastering diverse domains through world models. arXiv [cs.AI]. DOI
- Sutton, R., Barto, A. (2018). Reinforcement Learning: An Introduction. Link
Found an error on this page? Report an issue.

