Gradient-based Planning with World Models

Jyothir S. V, Siddhartha Jalagam, Yann LeCun, Vlad SobalarXiv 2023

Abstract

The enduring challenge in the field of artificial intelligence has been the control of systems to achieve desired behaviours. While for systems governed by straightforward dynamics equations, methods like Linear Quadratic Regulation (LQR) have historically proven highly effective, most real-world tasks require a general problem-solver and demand world models with dynamics that cannot be easily described by simple equations. Consequently, these models must be learned from data using neural networks. Most model predictive control (MPC) algorithms designed for visual world models have traditionally explored gradient-free population-based optimisation methods, such as Cross Entropy and Model Predictive Path Integral (MPPI) for planning. However, we present an exploration of a gradient-based alternative that fully leverages the differentiability of the world model. In our study, we conduct a comparative analysis between our method and other MPC-based alternatives, as well as policy-based algorithms. In a sample-efficient setting, our method achieves on par or superior performance compared to the alternative approaches in most tasks. Additionally, we introduce a hybrid model that combines policy networks and gradient-based MPC, which outperforms pure policy-based methods, thereby holding promise for gradient-based planning with world models in complex real-world tasks.

Introduction

In Reinforcement Learning (RL), agents generally fall into two categories: model-free, which learn purely by trial and error, and model-based, which learn a "world model"—a mental simulator of their environment. While world models are powerful, the "planners" used to navigate them have traditionally been a bottleneck. Most current methods use gradient-free optimization, such as the Cross-Entropy Method (CEM). These methods work by sampling thousands of random action sequences, evaluating them via the world model, and narrowing down the search. However, this approach is computationally expensive and scales poorly as the complexity of the action space increases.

Since modern world models are built with differentiable neural networks, this research explores using gradients to "nudge" actions toward the optimal path instead of relying on random sampling.

Methods

The proposed approach is built upon the Recurrent State Space Model (RSSM), a standard architecture that splits the world's state into deterministic and stochastic components. Two primary planning variations are introduced:

  1. Grad-MPC (Gradient-based Model Predictive Control): Instead of sampling random actions, this planner takes an initial set of actions and uses backpropagation through the world model to calculate exactly how to adjust those actions to maximize the predicted reward. It performs gradient descent directly on the action sequence.
  2. Policy + Grad-MPC: This hybrid approach uses a policy network to provide a "warm start" action sequence based on learned general behaviors. The Grad-MPC then fine-tunes this sequence using the world model's gradients, combining the intuition of a policy with the precision of a planner.
The gradient-based planning loop with a differentiable world model.

Experimental Setup

The methods were evaluated using the DeepMind Control Suite (DMC), a benchmark for continuous control tasks. The study focused on a "sample-efficient" setting, limiting agents to 100,000 environment steps.

Examples of tasks from the DeepMind Control Suite used for evaluation, including Cheetah, Ball in Cup, Reacher, and Walker.

The tasks included:

  • Dense Reward Tasks: Cartpole Swingup, Reacher Easy, Finger Spin, Walker Walk, and Cheetah Run.
  • Sparse Reward Tasks: Ball in Cup Catch and Cartpole Swingup Sparse, where rewards are only given for reaching the final goal.

Key Results

  • Sample Efficiency: In the 100k step benchmark, Grad-MPC outperformed or matched established baselines like PlaNet and Dreamer. Notably, in the Reacher Easy task, Grad-MPC achieved a score of 663 ± 25, significantly higher than PlaNet’s 82 ± 174.
  • Sparse Reward Performance: The hybrid Policy + Grad-MPC model excelled in environments with rare rewards. In the Ball in Cup Catch task, the hybrid model reached a score of 725.6, compared to 608.5 for a pure policy-based approach.
  • Candidate Scaling: Increasing the number of initial action "candidates" before applying gradients consistently improved performance, helping the agent avoid local minima.

Discussion and Future Work

The primary limitation of gradient-based planning is the Local Minima Problem. Because gradient descent is a greedy optimizer, it can get stuck in sub-optimal solutions if the initial guess is poor. This is why the hybrid approach and multiple candidates are crucial.

Future research aims to move toward Hierarchical Planning. A high-level policy could set sub-goals (e.g., "grab the pan"), while Grad-MPC handles the precise, high-dimensional motor control needed to execute them. Additionally, integrating regularization and more robust world-modeling techniques could further stabilize gradient-based planning for complex real-world applications.

Summary updated

BibTeX
@misc{v2023gradient,
  author = {Jyothir S. V and Siddhartha Jalagam and Yann LeCun and Vlad Sobal},
  title = {{Gradient-based Planning with World Models}},
  year = {2023},
  eprint = {2312.17227},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.17227},
}
Figure