Source-linked AI summary

When to Trust Your Model: Model-Based Policy Optimization

Michael Janner, Justin Fu, Marvin Zhang, Sergey Levine

arXiv:1906.08253v3cs.LGcs.AIstat.ML

TL;DR

Model-based reinforcement learning must balance efficient data generation against bias from inaccurate model-generated data. The paper analyzes this tradeoff and develops MBPO, whose short model rollouts improve sample efficiency while retaining strong asymptotic performance and avoiding failures of prior model-based methods.

  • Problem

    Model-based reinforcement learning must balance easy data generation against bias from model-generated data, while model error can make model-based methods perform worse asymptotically.

  • Method

    The paper combines monotonic-improvement analysis with empirical estimates of model generalization and uses MBPO to branch short model-generated rollouts from real data.

  • Results

    MBPO learns substantially faster than prior model-based and model-free alternatives, retains competitive model-free asymptotic performance, and avoids model exploitation and long-horizon failures.

  • Takeaways & Limitations

    Careful use of short model-based rollouts can provide model-based sample-efficiency benefits without the usual pitfalls of long or inaccurate model rollouts.

  • Takeaways & Limitations

    The theoretical bound is pessimistic about model error under policy shift and, taken literally, selects zero model rollout length.

Abstract

from arXiv · show

Designing effective model-based reinforcement learning algorithms is difficult because the ease of data generation must be weighed against the bias of model-generated data. In this paper, we study the role of model usage in policy optimization both theoretically and empirically. We first formulate and analyze a model-based reinforcement learning algorithm with a guarantee of monotonic improvement at each step. In practice, this analysis is overly pessimistic and suggests that real off-policy data is always preferable to model-generated on-policy data, but we show that an empirical estimate of model generalization can be incorporated into such analysis to justify model usage. Motivated by this analysis, we then demonstrate that a simple procedure of using short model-generated rollouts branched from real data has the benefits of more complicated model-based algorithms without the usual pitfalls. In particular, this approach surpasses the sample efficiency of prior model-based methods, matches the asymptotic performance of the best model-free algorithms, and scales to horizons that cause other model-based methods to fail entirely.

1 Introduction

The paper addresses the tension between model-based data efficiency and model bias by analyzing model use and introducing MBPO, which relies on short model rollouts.

  • Model-based methods learn predictive environment models for policy optimization, while model-free methods learn direct state-to-action mappings.
  • Model-based reinforcement learning can learn quickly, but model inaccuracies can limit policy quality and asymptotic performance.
  • The paper analyzes model-based algorithms with monotonic improvement guarantees and uses empirical model error to obtain a more realistic tradeoff for model usage.
  • MBPO separates task horizon from model horizon by using short model-generated rollouts branched from real data.
  • MBPO learns faster than prior model-based alternatives, retains the asymptotic performance of competitive model-free algorithms, and avoids model exploitation and long-horizon failures.

2 Related work

Prior work combines learned models with planning or model-free learning, but model error and long-horizon predictions limit reliability; theoretical analyses study return discrepancies under policy constraints or rollout-length choices.

  • Model-based methods are attractive for data efficiency, especially in low-data settings, but neural predictive models can combine efficiency with broader applicability.
  • Learned models can augment model-free methods through planning, extra Q-function training examples, value targets, or policy context, but performance degrades with increasing model error.
  • Planner-like methods without environment-consistent intermediate predictions can match model-free asymptotic performance but may forgo model-based sample-efficiency benefits.
  • Long model rollouts become unreliable as learned dynamics accumulate inaccuracies, motivating ensembles and other methods to reduce model exploitation.
  • Existing theoretical analyses bound model-versus-real return discrepancies using trust regions, whereas this paper considers rollout length from estimated model generalization capacity.
  • The monotonic model-based policy optimization procedure initializes a policy and predictive model, collects real data, trains the model by maximum likelihood, and optimizes the policy under the model.

3 Background

The paper formulates reinforcement learning as optimization in an MDP with unknown dynamics and reward function, using learned predictive models to support model-based methods.

  • An MDP is defined by state and action spaces, transition dynamics, rewards, a discount factor, and an initial-state distribution.
  • Reinforcement learning seeks an optimal policy that maximizes expected discounted rewards.
  • Model-based methods learn the unknown transition distribution from interaction data, typically through supervised learning.
  • The reward function is also assumed unknown and is predicted as a learned function of state and action.

4 Monotonic improvement with model bias

The paper derives bounds connecting model returns to true returns through model generalization error and policy distribution shift, then uses empirical generalization estimates to justify short branched model rollouts.

  • Model-based policy optimization alternates policy optimization under a learned model, data collection under the updated policy, and model retraining.
  • The bound controls generalization error with ϵm and policy distribution shift with ϵπ, using validation loss and policy divergence estimates in practice.
  • A monotonic-improvement guarantee requires model-return improvement to exceed a bound C determined by generalization error and policy shift.
  • Full model rollouts can compound model errors, with the bound scaling quadratically with the effective horizon and potentially favoring real data over inaccurate models.
  • MBPO uses short k-step model rollouts branched from states in the previous policy’s state distribution, and its refined analysis can motivate nonzero model usage.
  • More training data reduces both model error on the training distribution and its sensitivity to nearby policy distributions.

5 Model-based policy optimization with deep reinforcement learning

The practical MBPO implementation combines probabilistic ensemble dynamics models with SAC and generates many short rollouts from replay-buffer states. Its training curves show asymptotic performance similar to strong model-free methods while learning faster than model-based baselines.

  • MBPO uses a bootstrap ensemble of probabilistic neural-network dynamics models with Gaussian outputs and diagonal covariance.
  • The policy is optimized with Soft Actor-Critic, alternating Q-function evaluation with actor improvement based on expected KL-divergence.
  • MBPO starts k-length model rollouts from replay-buffer states rather than the model’s initial-state distribution, separating model horizon from task horizon.
  • Many short rollouts can produce a large model-sample set for policy optimization even when each rollout has a short horizon.
  • 300 thousand steps on Ant matches SAC at 3 million steps, according to the reported training curves.

6 Experiments

The experiments compare MBPO with model-free and model-based baselines, then test how rollout length, value expansion, and model exploitation affect performance. MBPO learns substantially faster while retaining strong final performance, and short model rollouts are consistently effective.

  • Comparative evaluation: MBPO is evaluated against state-of-the-art model-free and model-based algorithms on standard full-length MuJoCo continuous-control tasks.The evaluation addresses both benchmark performance and appropriate model usage.
  • Comparative evaluation: MBPO learns substantially faster than prior model-free methods while attaining comparable final performance and handling higher-dimensional tasks that challenge PETS.On Ant, MBPO matches SAC’s performance at 300 thousand steps versus 3 million steps for SAC.
  • Design evaluation: Increasing SAC’s gradient updates marginally accelerates learning, but cannot match MBPO’s sample efficiency without model-generated data.The comparison uses similarly high update-to-environment-sample ratios to isolate the model’s contribution.
  • Design evaluation: Single-step model rollouts retain much of MBPO’s benefit, while 500-step rollouts are too inaccurate for effective policy optimization.A rollout schedule increasing from k = 1 to 15 performs best on Hopper, but single-step rollouts remain difficult to beat.
  • Design evaluation: Single-step model rollouts also provide a surprisingly effective baseline for value expansion, while MBPO outperforms the evaluated value-expansion approaches.Preliminary experiments found no improvement from adding improved target-value estimates to MBPO.
  • Design evaluation: Short rollouts avoid model exploitation: model and real-environment returns are highly correlated, despite accumulated prediction uncertainty over long sequences.Figure 4 compares a 450-step real trajectory with 1000 model rollouts and their cumulative returns.

7 Discussion

The paper combines theoretical and empirical analyses to determine when model-generated data is useful for policy optimization. It concludes that truncated rollouts make model usage effective, yielding faster learning, strong asymptotic performance, and better scaling to long-horizon tasks.

  • Discussion: Monotonic-improvement analysis alone is too pessimistic to justify model usage, but empirical model-generalization estimates support truncated model rollouts.The resulting tradeoff accounts for model performance outside its training distribution.
  • Discussion: MBPO rivals the best model-free algorithms asymptotically, learns substantially faster than prior model-based and model-free methods, and scales to long-horizon tasks.The discussion identifies these outcomes as consequences of the paper’s theoretical and empirical analysis.
  • Discussion: Model rollouts as short as a single step can provide pronounced benefits to policy optimization.The paper’s design experiments associate short rollouts with effective model use.

A Model-based Policy Optimization with Performance Guarantees

The paper develops return bounds for model-based policy optimization and branched rollouts by decomposing policy and model errors before and after a branch. These bounds motivate using short model rollouts and distinguish model error measured under the current policy from error measured under the data-collecting policy.

  • A Model-based Policy Optimization with Performance Guarantees: The analysis introduces model-based policy optimization with bounded model error and policy divergence, using return bounds to relate model and true performance.The proof adds and subtracts returns under the data-collecting policy, then bounds the resulting terms.
  • A Model-based Policy Optimization with Performance Guarantees: Branched rollouts switch from an initial policy and dynamics to a new policy and dynamics for k steps, with branch points weighted proportionally to γ^t.This construction separates errors before and after the branch.
  • A Model-based Policy Optimization with Performance Guarantees: Theorem A.2 bounds branched-rollout returns using model error under the new policy and policy divergence, but this condition is difficult to apply in practice.Supervised learning typically controls model error under the dataset collected by the previous policy instead.
  • A Model-based Policy Optimization with Performance Guarantees: The branched-rollout proofs combine pre-branch policy error with post-branch model and policy errors to complete the return guarantees.The final construction adds L1 from Theorem A.2 to the separately bounded L3 and L4 terms.
  • A Model-based Policy Optimization with Performance Guarantees: Theorem A.3 instead bounds model error under the previous policy, extending the decomposition to separate post-branch model and policy discrepancies.The proof introduces a reference rollout that uses the old policy under the learned model after branching, then splits the remaining difference into L3 and L4.

B Useful Lemmas

The appendix develops technical bounds that propagate transition and policy divergences into state-marginal, occupancy, and return differences. For branched rollouts, the post-branch error grows with branch length k before being converted into a discounted return bound.

  • B Useful Lemmas: The lemmas bound joint-distribution variation, state-marginal error, and branched returns under separate pre- and post-branch divergences.The assumptions track model and policy discrepancies before and after the branch.
  • B Useful Lemmas: The technical results also provide a tighter bound using expected TVD of conditional distributions in addition to marginal TVD.This alternative decomposition separates conditional and marginal discrepancies.
  • B Useful Lemmas: The proofs derive state-visitation error recursively from the previous timestep’s error plus the current transition divergence.The initial state distribution is not modeled, so the appendix sets ϵ0 = 0.
  • B Useful Lemmas: For t ≤ k, state-action marginal TVD is bounded by t(ϵpost_m + ϵpost_π) + ϵpost_π, and therefore by k(ϵpost_m + ϵpost_π) + ϵpost_π.The bound accumulates post-branch model and policy divergences over the branch horizon.
  • B Useful Lemmas: The state-marginal bound is converted into a returns bound by averaging discounted errors over time and multiplying by 2rmax/(1−γ).This connects occupancy discrepancies to differences in expected returns.

C Hyperparameter Settings

Table 1 lists the hyperparameter settings used for MBPO results in Figure 2 and defines thresholded linear schedules over epochs.

  • C Hyperparameter Settings: Table 1 reports MBPO hyperparameter settings for the Figure 2 experiments.Its notation x → y over epochs a → b denotes a thresholded linear function.
Loading 1906.08253v3…