Accelerated Policy Learning with Parallel Differentiable Simulation

Jie Xu, Viktor Makoviychuk, Yashraj S. Narang, Fabio T. Ramos, Wojciech Matusik, Animesh Garg, Miles Macklin

Abstract

Deep reinforcement learning can generate complex control policies, but requires large amounts of training data to work effectively. Recent work has attempted to address this issue by leveraging differentiable simulators. However, inherent problems such as local minima and exploding/vanishing numerical gradients prevent these methods from being generally applied to control tasks with complex contact-rich dynamics, such as humanoid locomotion in classical RL benchmarks. In this work we present a high-performance differentiable simulator and a new policy learning algorithm (SHAC) that can effectively leverage simulation gradients, even in the presence of non-smoothness. Our learning algorithm alleviates problems with local minima through a smooth critic function, avoids vanishing/exploding gradients through a truncated learning window, and allows many physical environments to be run in parallel. We evaluate our method on classical RL control tasks, and show substantial improvements in sample efficiency and wall-clock time over state-of-the-art RL and differentiable simulation-based algorithms. In addition, we demonstrate the scalability of our method by applying it to the challenging high-dimensional problem of muscle-actuated locomotion with a large action space, achieving a greater than 17x reduction in training time over the best-performing established RL algorithm.

Introduction

Deep Reinforcement Learning (RL) has achieved remarkable feats in robotics, but it is notoriously "data-hungry" and slow. Traditional RL treats the environment as a black box, relying on trial-and-error to estimate gradients and improve policies. Differentiable simulators offer a potential shortcut by providing exact analytical gradients, which inform the agent precisely how a small change in action affects future rewards.

However, utilizing these gradients for complex, contact-rich tasks—such as a robot walking and impacting the ground—is exceptionally difficult. Over long trajectories, these gradients tend to either "explode" or "vanish," and the optimization landscape becomes a jagged mess of local minima where agents frequently get stuck.

Short-Horizon Actor-Critic (SHAC)

To address the limitations of existing differentiable simulation methods, the researchers propose a two-pronged solution: a high-performance simulator and the Short-Horizon Actor-Critic (SHAC) algorithm.

The Problem of Gradient Chaos

Standard gradient-based optimization over long trajectories often fails due to the highly non-smooth nature of contact physics. As shown in the objective loss landscape of traditional Backpropagation Through Time (BPTT), the optimization surface is riddled with discontinuities and local minima that prevent convergence on stable policies.

The jagged objective loss landscape of Backpropagation Through Time (BPTT) in contact-rich environments.

The SHAC Solution

Instead of calculating gradients through a massive 1000-step trajectory, SHAC breaks the task into short windows (e.g., 32 steps).

  1. The Actor: Uses the simulator's analytical gradients to optimize behavior within the short window.
  2. The Critic: A neural network that estimates the long-term value of the state at the end of that window.

Crucially, the critic acts as a smooth surrogate. It "absorbs" the noisy, non-smooth physics of the distant future, providing the actor with a stable target to aim for. This "Goldilocks" horizon—short enough to avoid gradient explosion but long enough to capture meaningful physics—is the key to SHAC's success.

Experimental Evaluation

The researchers evaluated SHAC on several standard and high-dimensional physical control benchmarks, including CartPole, Ant, and Humanoid models. To test the scalability of the method, they introduced the Humanoid MTU (Muscle-Tendon Units) challenge. This model features a lower body actuated by 152 muscles, creating a massive action space that is typically computationally prohibitive for standard RL.

Comparison between a standard boxy humanoid model and the high-dimensional Humanoid MTU with 152 muscle-tendon units.

Key Results and Insights

SHAC demonstrates significant improvements across all metrics compared to state-of-the-art algorithms like PPO and SAC:

  • Speed: On the complex Humanoid MTU task, SHAC achieved a 17x speedup in wall-clock time compared to PPO. It reached a high-quality gait in approximately 35 minutes, whereas PPO required over 10 hours to achieve a less stable result.
  • Sample Efficiency: SHAC is vastly more efficient, requiring millions fewer simulation steps. For the Humanoid MTU, it was 382x more sample-efficient than PPO.
  • Robustness: Unlike previous differentiable simulation methods, SHAC did not get stuck in local minima on contact-rich tasks. It successfully learned stable running gaits for the Humanoid where other gradient-based methods failed.

Conclusion

SHAC represents a significant step forward in making differentiable simulation practical for complex robotics tasks. By leveraging the critic as a landscape smoother and utilizing truncated learning windows, the algorithm overcomes the traditional pitfalls of analytical gradients. While current limitations include the computational overhead of the backward pass and the requirement for a differentiable simulator, the massive gains in training speed and sample efficiency suggest a promising future for gradient-based policy learning.

Summary updated

BibTeX
@inproceedings{xu2022accelerated,
  author = {Jie Xu and Viktor Makoviychuk and Yashraj S. Narang and Fabio T. Ramos and Wojciech Matusik and Animesh Garg and Miles Macklin},
  title = {{Accelerated Policy Learning with Parallel Differentiable Simulation}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=ZSKRQMvttc},
}
Figure