Variational Model-based Policy Optimization

Yinlam Chow, Brandon Cui, Moonkyung Ryu, Mohammad Ghavamzadeh

Abstract

Model-based reinforcement learning (RL) algorithms allow us to combine model-generated data with those collected from interaction with the real system in order to alleviate the data efficiency problem in RL. However, designing such algorithms is often challenging because the bias in simulated data may overshadow the ease of data generation. A potential solution to this challenge is to jointly learn and improve model and policy using a universal objective function. In this paper, we leverage the connection between RL and probabilistic inference, and formulate such an objective function as a variational lower-bound of a log-likelihood. This allows us to use expectation maximization (EM) and iteratively fix a baseline policy and learn a variational distribution, consisting of a model and a policy (E-step), followed by improving the baseline policy given the learned variational distribution (M-step). We propose model-based and model-free policy iteration (actor-critic) style algorithms for the E-step and show how the variational distribution learned by them can be used to optimize the M-step in a fully model-based fashion. Our experiments on a number of continuous control tasks show that our model-based (E-step) algorithm, called variational model-based policy optimization (VMBPO), is more sample-efficient and robust to hyper-parameter tuning than its model-free (E-step) counterpart. Using the same control tasks, we also compare VMBPO with several state-of-the-art model-based and model-free RL algorithms and show its sample efficiency and performance.

Introduction

Reinforcement Learning (RL) faces a fundamental tension between data efficiency and stability. Model-free methods, such as Soft Actor-Critic (SAC) or Maximum a Posteriori Policy Optimization (MPO), are known for their stability but typically require a vast number of interactions with the environment. Conversely, model-based methods like Model-Based Policy Optimization (MBPO) significantly improve data efficiency by learning a simulator of the environment. However, these methods often fall into the "model bias" trap: if the learned model is even slightly inaccurate, the policy may overfit to these flaws, leading to poor performance in the real world.

Variational Model-based Policy Optimization (VMBPO) addresses this by framing RL as a probabilistic inference problem. By optimizing a single variational lower-bound objective, VMBPO jointly learns a dynamics model and a policy, ensuring that the model is specifically accurate in the regions of the state-space most critical for high performance.

Methodology

VMBPO treats the search for an optimal policy as maximizing the log-likelihood of a binary "success" variable. This is achieved through an Expectation-Maximization (EM) framework:

  1. E-Step (Variational Update): The agent fixes its baseline policy and optimizes a variational distribution comprising a policy and a dynamics model. The resulting variational dynamics model is an "exponentially twisted" version of the real environment, biased toward transitions that lead to higher rewards.
  2. M-Step (Policy Improvement): The baseline policy is updated to match the successful behaviors identified in the E-step. This step is performed entirely "offline" using synthetic data generated by the learned variational model.

Technically, VMBPO manages eight neural networks to track the policy, dynamics, value functions, and the log-likelihood ratio between the variational model and the real environment.

Experimental Results

The researchers evaluated VMBPO on standard MuJoCo continuous control benchmarks, including tasks such as Hopper, Walker2d, and HalfCheetah.

Comparative Performance

VMBPO demonstrates superior sample efficiency and asymptotic performance compared to state-of-the-art baselines like MBPO, SAC, and MPO. As shown in the performance table below, VMBPO consistently achieves higher mean returns across most tasks, outperforming both model-free and model-based alternatives.

Comparative performance of VMBPO against state-of-the-art RL algorithms.

Robustness and Scaling

A key finding is VMBPO's robustness to hyperparameter choices, showing lower variance across different configurations than its model-free counterparts. Additionally, ablation studies indicate that increasing the number of synthetic samples generated by the variational model significantly improves convergence rates, as the model becomes more accurate in later stages of training.

Training curves for VMBPO showing the impact of scaling synthetic data samples.

Conclusion

VMBPO provides a robust framework for model-based RL by unifying model and policy learning under a single objective. This approach mitigates the objective mismatch problem and results in an algorithm that is both sample-efficient and easy to tune. Future work may involve extending VMBPO to high-dimensional visual observations or exploring value-iteration variants of the EM framework.

Summary updated

BibTeX
@inproceedings{chow2021variational,
  author = {Yinlam Chow and Brandon Cui and Moonkyung Ryu and Mohammad Ghavamzadeh},
  title = {{Variational Model-based Policy Optimization}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  url = {https://openreview.net/forum?id=B8MDNDo_a7f0},
}
Figure