Model-based Reinforcement Learning with Scalable Composite Policy Gradient Estimators

Paavo Parmas, Takuma Seno, Yuma AokiICML 2023

This paper introduces Total Propagation X (TPX), a scalable algorithm designed to stabilize gradient estimation in model-based reinforcement learning (MBRL). By intelligently combining two classic gradient estimators, the authors enable state-of-the-art agents like Dreamer to plan over much longer horizons without succumbing to the "exploding gradient" problem common in chaotic systems.

The Challenge of Gradient Estimation in MBRL

In MBRL, an agent learns a model of the world and uses it to "imagine" future trajectories, which helps improve its policy. To update the policy, the system must calculate the gradient of the expected reward. There are two primary methods for this, each with significant trade-offs:

  1. Reparameterization (RP) Gradients: These are efficient and have low variance because they "backpropagate" directly through the model. However, in chaotic systems (common in physics-based control), small changes in early actions lead to massive changes later, causing gradients to explode.
  2. Likelihood Ratio (LR) Gradients: These are robust to chaos because they do not differentiate through the dynamics. Unfortunately, they suffer from extremely high variance, making the learning process impractically slow.

A prior method called Total Propagation (TP) combined these two using Inverse Variance Weighting (IVW). It essentially trusted the "cleaner" RP gradient when it was stable and switched to the "safer" LR gradient when the system became chaotic. However, the original TP algorithm did not scale. It required computing individual gradient samples for every single model parameter, which is computationally ruinous for modern deep neural networks.

Enter Total Propagation X (TPX)

To resolve this scalability bottleneck, the authors propose Total Propagation X (TPX). TPX introduces three key innovations to make composite estimators viable for modern deep RL:

  • Node-wise Variance Estimation: Instead of estimating the variance of gradients at the parameter level, TPX estimates them at the state or latent level. This avoids the need for per-parameter gradient samples, making it fully compatible with standard automatic differentiation (AD) frameworks.
  • Coordinate-wise Weighting: Unlike the original TP, which used a single scalar weight to balance LR and RP, TPX uses a tensor-valued weight. This allows the algorithm to apply different mixing ratios to different dimensions of the state space—a crucial feature when some parts of a system are chaotic while others remain stable.
  • Covariance Inclusion: TPX accounts for the correlation between LR and RP estimators, leading to a more theoretically optimal weighting scheme.
Computational graph of TPX showing node-wise variance estimation at the latent state level.

These calculations are implemented using Proppo, a new software framework designed by the authors to handle complex "message-passing" gradient calculations automatically.

Experimental Validation and Key Insights

The researchers evaluated TPX across several benchmarks, including classic control tasks (Cart-pole), high-dimensional visual environments from the DeepMind Control Suite (DMC), and a minimalistic Chaotic RNN experiment designed to test phase transitions into chaotic behavior.

Overcoming the Planning Horizon Problem

The authors discovered that the state-of-the-art Dreamer algorithm, which relies exclusively on RP gradients, works well for short horizons (e.g., $H=15$) but fails completely when asked to plan further ahead ($H=60$). TPX fixes this issue entirely, proving that the failure isn't in the world model itself, but in the gradient estimator. On DMC tasks, TPX maintained high performance and matched or exceeded Dreamer’s best results at any horizon.

Dimensionality and Efficiency

In multi-dimensional systems, chaos is rarely uniform. One dimension might be exploding while another is perfectly stable. TPX’s ability to weight these coordinates independently is what allows it to outperform simpler scalar-based combinations. Furthermore, TPX is remarkably efficient. It provides the stability of LR and the efficiency of RP with only a 14% to 40% increase in computation time per iteration compared to standard Dreamer.

Order-of-Magnitude Variance Reduction

Using a metric called Expected Signal-to-Noise Ratio (ESNR), the authors showed that TPX consistently provides more accurate gradients than either RP or LR alone. In the chaotic RNN experiment, TPX achieved gradient variances that were orders of magnitude lower than standard methods right at the "edge of chaos."

Gradient variance comparison showing TPX achieving orders of magnitude lower variance in chaotic regimes.

Limitations and Future Work

While TPX represents a significant step forward, the authors note a few areas for future improvement:

  • Bias in Baselines: The current implementation of the LR component in TPX uses a simple mean baseline for variance reduction. Using a more sophisticated critic-based baseline could further improve performance.
  • Hyperparameter Tuning: TPX is robust enough that the authors kept Dreamer's original hyperparameters for a fair comparison. Re-tuning hyperparameters specifically for the more stable TPX gradients could unlock even better performance.
  • Discontinuities: While TPX handles chaos well, it does not explicitly address non-differentiable discontinuities (like hard physical contacts), which remains a known weakness of RP gradients.

Ultimately, TPX's ease of implementation and scalable design open the door for experimenting with Inverse Variance Weighting on many complex tasks beyond just MBRL.

Summary updated

BibTeX
@inproceedings{parmas2023model,
  author = {Paavo Parmas and Takuma Seno and Yuma Aoki},
  title = {{Model-based Reinforcement Learning with Scalable Composite Policy Gradient Estimators}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=rDMAJECBM2},
}
Figure