TL;DR
Reinforcement learning needs many interactions with the environment, and a learned model of the environment can supply cheap extra data. The problem is that a model is wrong in places, and a policy trained on its mistakes gets worse. MBPO trains an ensemble of models, starts short simulated rollouts from states in the real data, and trains a policy on both real and simulated transitions. It learns much faster than model-free methods, reaches their final performance on standard benchmarks, and stays stable on long episodes where earlier model-based methods failed.
Builds on: Model-Based Reinforcement Learning, Soft Actor-Critic, Ensemble Learning · Leads to: later model-based methods that reuse short branched rollouts for policy learning
Why it mattered
Model-free methods such as SAC were the reliable choice by 2019, but they consumed millions of environment steps to learn tasks like a walking robot. Model-based methods were far more sample-efficient, yet they often reached lower final scores.
MBPO showed that the model did not need to be perfect to help. Its experiments use the standard full-length MuJoCo benchmarks, and it reaches the final returns of the best model-free methods while needing far fewer environment steps. The paper's central idea, that short rollouts from real data are safe, became a common design choice in later work on model-based policy learning.
The problem
In reinforcement learning, a policy chooses actions to maximize the expected sum of discounted rewards in a Markov decision process. A model-based method learns the transition distribution p_theta(s' given s and a) from data, then uses it to generate training samples. The trouble is that policy optimization is good at finding the places where the model is wrong. The policy drifts toward actions that look good only under the model, and the true return collapses. The paper calls this model exploitation.
Long simulated rollouts make this worse. An error at one step changes the state for the next step, so the errors compound over the horizon. Earlier methods either limited themselves to short tasks or rolled out from the start state, which ties the rollout length to the task length. The paper asks a precise question: when is it worth using model data at all, and how long should a model rollout be?
The prerequisites set the terms. Model-Based Reinforcement Learning is the family this paper belongs to, Ensemble Learning is how the model's uncertainty is estimated, and Soft Actor-Critic is the policy learner the paper uses on top of the model data.
How it works
The algorithm runs in a loop. The following walkthrough follows the practical version in the paper's Algorithm 2.
- Collect real data. The current policy acts in the real environment for E steps, and every transition (s, a, s', r) is added to the environment dataset D_env.
- Train the model ensemble. Every few steps, the ensemble of B probabilistic networks is trained on D_env by maximum likelihood. Each member outputs a Gaussian over the next state and the reward. The members start from different random initializations and see the data in different orders, so where they disagree, the model is uncertain.
- Branch short rollouts from real states. Sample M states uniformly from D_env. From each state, run a rollout of k steps, where at each step the action comes from the current policy and the next state comes from one ensemble member chosen at random. Every simulated transition is added to a model dataset D_model.
- Update the policy on the mixed data. Run G gradient updates of the policy and Q-functions, sampling from D_model. The number G is a hyper-parameter, and the paper uses many updates per real environment step, because the simulated data is cheap to sample.
- Repeat. Go back to step 1 with the improved policy.
Here is a tiny instance of step 3. Take M = 2 real states, s_1 and s_2, and rollout length k = 2. Each rollout takes 2 model steps, so the two rollouts add 2 times 2 = 4 simulated transitions to D_model. Check: the rollouts start in D_env, so they never begin in a state the model has not seen, and the model is queried only for two steps from each start.
flowchart LR R[real environment] -->|E steps| DE[(D_env)] DE -->|train| ENS[ensemble of models] DE -->|sample M start states| B[branch] B -->|k-step model rollout| DM[(D_model)] ENS --> B DE -->|mixed data| PI[SAC policy update, G steps] DM --> PI PI -->|act| R
The math
We use the paper's notation. The environment is a Markov decision process with states s, actions a, transition distribution p, reward r, and discount factor gamma between 0 and 1. The model is p_theta, the policy is pi, and the true and model returns of a policy are eta[pi] and eta-hat[pi].
Step 3 in symbols: the branched rollout
A branched rollout begins at a state drawn from the data the policy pi_D collected, then takes k steps. Each step uses the current policy pi's action and the learned model's next state. The paper bounds the true return of this scheme, and it uses a simplified version of that bound to choose the rollout length. Here eta-branch[pi] is the expected return of the branched scheme under the model. The bound has three parts:
Here r_max is the largest reward, epsilon_pi bounds how far the policy has moved from pi_D, and epsilon_m' is the model error on the current policy's state distribution. The first two terms shrink as k grows, since gamma^k goes to zero. The third term grows linearly with k, because each model step adds error.
Step 2 and 4 in symbols: the ensemble and the policy
The ensemble members each output a diagonal Gaussian, with mean mu_i(s, a) and covariance Sigma_i(s, a). The paper writes this as
A prediction picks i uniformly at random. The policy is trained with soft actor-critic. Its update minimizes the expected KL divergence between the policy and a distribution proportional to the exponential of the soft Q-function.
The model error term
The paper cannot measure epsilon_m' directly during training, so it approximates it as a line in the policy shift:
The slope is estimated empirically from Figure 1, where a model trained on the data of one policy is tested on policies that have moved away from it. The rollout length is then chosen to minimize the bound's bracket. The model term is what limits k: the longer the rollout, the more it grows.
Results
The paper evaluates on six MuJoCo continuous-control tasks: Half Cheetah, Inverted Pendulum, Walker2d, Ant, Hopper and Humanoid. Results are averaged over several random seeds, and the baselines include SAC, PPO, PETS, STEVE and SLBO. MuJoCo is a physics simulator used for robot-like control tasks.
The main claims are:
- MBPO learns substantially faster than prior model-free methods while reaching comparable final performance.
- MBPO matches the final performance of the best model-free algorithms, and it scales to the high-dimensional Ant task.
- Short model rollouts are enough. Fixing the rollout length at 1 keeps much of the benefit, while long rollouts from real states perform worse.
Take gamma = 0.9, epsilon_pi = 0.1, and epsilon_m' = 0.01. Compute the three terms of the bracket for a few values of k.
- For k = 0: the first term is 0.9 to the power 1, times 0.1 divided by 0.01, which is 9.0. The second term is 1 times 0.1 divided by 0.1, which is 1.0. The third term is 0. The total is 10.0.
- For k = 1: the first term is 0.9 squared times 10 = 8.1. The second term is 0.9. The third term is 1 times 0.01 divided by 0.1 = 0.1. The total is 9.1.
- For k = 3: the first term is 0.9 to the fourth power times 10, which is 6.561. The second term is 0.729. The third term is 0.3. The total is 7.59.
- Interpretation: the bound falls as k grows, because the discounted terms shrink faster than the model term grows. In this setting a longer rollout is better for the bound. The paper's point is that the balance flips when epsilon_m' is large, so the best k depends on how accurate the model is.
Take gamma = 0.99, epsilon_pi = 0.01, and epsilon_m' = 0.001.
- The first term is gamma to the power k+1, times 0.01 divided by (1 - 0.99) squared. Since (1 - 0.99) squared = 0.0001, the first term is gamma to the power k+1 times 100.
- The third term is k times 0.001 divided by 0.01 = 0.1 k.
- At k = 1 the third term is 0.1 and the first term is 0.99 squared times 100, which is about 98.0. At k = 10 the third term is 1.0 and the first term is 0.99 to the power 11 times 100, which is about 89.5.
- The second term is , which is about 0.99 at k = 1 and 0.90 at k = 10. Totals: about 99.1 at k = 1 (98.0 + 0.99 + 0.1) and about 91.4 at k = 10 (89.5 + 0.90 + 1.0).
- Interpretation: with a discount near 1 the discounted terms decay slowly, so the bound keeps favouring longer rollouts here. The linear model term grows only 0.1 per step, so in this setting the bound is not what limits k; the real limit is how fast the model error grows in practice.
Suppose a model-based method reaches a return of 3000 after 300 thousand real environment steps, while SAC needs 3 million steps to reach the same return. These numbers are illustrative, not the paper's.
- Ratio of environment steps: 3,000,000 divided by 300,000 = 10.
- Interpretation: the model-based method reaches the same return with one tenth of the real environment interaction.
- Caveat: the ratio compares environment steps, not computation. The method performs many gradient updates per real step, so it does much more computation per real sample. The advantage is in data, which is the scarce resource on a physical robot.
What the results do not show
It is tempting to think that model-based learning always beats model-free learning. In fact the paper shows that the benefit depends on keeping the model rollouts short and mixing them with real data. Long rollouts from the initial state distribution were the failure mode of earlier methods.
It is tempting to think that a more accurate model always gives a better policy. In fact the paper finds that model error grows with the policy's shift, and the useful rollout length is set by that growth. Its ablations show that a single-step rollout already captures most of the benefit.
It is tempting to think that the theory alone justifies the method. In fact the bound depends on model errors that are hard to measure, so the choice of rollout length is motivated partly by empirical measurements of how well models generalize.
When to use it: continuous control with a costly real environment, where a learned model can be trained on the collected data and the policy can handle the extra gradient updates.
When not to use it: settings where the model cannot generalize beyond its training distribution, or where the real environment is cheap to sample, since the extra model machinery then gives little gain.
Alternatives: model-free methods such as Soft Actor-Critic alone, which need more real data but no model, and value-expansion methods that use the model only to improve target values.
Reading guide
- Section 1, Introduction (needs Model-Based Reinforcement Learning): the two categories of methods and the claim of short rollouts. Read this first.
- Section 2, Related work (needs Ensemble Learning and Bootstrap Sampling): the ensemble and model-exploitation literature. Skim it on a first pass.
- Section 3, Background (needs Markov Decision Process, Bellman Equation and Value Function): the setup and the notation for returns. The reward is written r, the discount gamma, and the model p_theta.
- Section 4, Monotonic improvement (needs Trust Region Policy Optimization (TRPO), Kullback–Leibler Divergence and Gaussian (Normal) Distribution): the bounds on the true return. They are the reason for the design, so read the final bound and the choice of rollout length carefully.
- Section 5, The practical algorithm (needs Soft Actor-Critic, Maximum Entropy Reinforcement Learning and Ensemble Learning): the ensemble, the policy learner, and Algorithm 2.
- Section 6, Experiments (needs Policy Gradient for the baselines): the main results figure first, then the ablation figure.
Check yourself
QuestionIn one sentence, what is model exploitation, and why do long model rollouts make it worse?Show answer
Model exploitation is when a policy learns to take actions that look good under the learned model but are not good in the real environment. Long rollouts make it worse because the model's errors compound over each step, so later states drift far from anything the model learned from.
QuestionWith gamma = 0.9, epsilon_pi = 0.1 and epsilon_m' = 0.01, what is the bound's bracket for k = 1, and how does it compare with k = 0?Show answer
For k = 1 the bracket is 8.1 + 0.9 + 0.1 = 9.1. For k = 0 it is 9.0 + 1.0 + 0 = 10.0. The k = 1 bracket is smaller, so the bound is tighter for a one-step rollout in this setting.
QuestionWhy does MBPO branch its rollouts from states in the real data, rather than starting every rollout from the initial state of the environment?Show answer
Starting from the initial state ties the rollout length to the task horizon, and long model rollouts compound errors. Branching from real states lets MBPO use short rollouts, which the bound says are safe, while still generating many samples from the replay buffer.
QuestionA paper reports that a method matches SAC's final return with one tenth of the environment steps. Why might that still not mean it is cheaper in total compute?Show answer
The method may run many gradient updates per real step, so it uses more computation per real sample. The saving is in real data, which is the scarce resource, not in total compute.
Sources
- Janner, Fu, Zhang and Levine. "When to Trust Your Model: Model-Based Policy Optimization" (2019): https://arxiv.org/abs/1906.08253
- DOI record for the paper: https://doi.org/10.48550/arXiv.1906.08253