Wasserstein Robust Reinforcement Learning

Mohammed Amin Abdullah, Hang Ren, Haitham Bou-Ammar, Vladimir Milenkovic, Rui Luo, Mingtian Zhang, Jun WangarXiv 2019

TL;DR

This paper introduces Wasserstein Robust Reinforcement Learning ($\text{W}\text{R}^{2}\text{L}$), a novel algorithm that tackles the overfitting problem in reinforcement learning by formalizing robustness as a min-max game with a Wasserstein constraint. $\text{W}\text{R}^{2}\text{L}$ achieves superior performance on challenging control tasks by learning policies that are resilient to variations in environment dynamics, outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

Reinforcement learning (RL) agents, while powerful, often overfit to their training environments. This means they perform poorly when faced with even slight changes in the underlying dynamics of the real-world system they are intended to control. This is a critical issue for applications like self-driving cars or robotics, where unpredictable environmental shifts are common. Traditional RL training often relies on simulators, but creating perfectly accurate simulators is extremely challenging. Transferring policies trained in simulation to the real world is prone to failure due to these dynamic variations. The paper aims to develop an RL algorithm that is inherently robust to such changes, ensuring reliable performance across a range of environmental conditions.

Methods

The core of $\text{W}\text{R}^{2}\text{L}$ lies in its novel formulation of robust reinforcement learning as a min-max game. The agent aims to maximize its expected reward (the "max" part) while simultaneously considering the worst-case scenario of environmental dynamics within a defined uncertainty set (the "min" part). This uncertainty set is defined using the Wasserstein distance, which measures the "distance" between probability distributions. Specifically, the algorithm constrains the learned dynamics to lie within an $\epsilon$-ball of a reference dynamics model in the Wasserstein space.

To solve this min-max problem, $\text{W}\text{R}^{2}\text{L}$ employs an alternating optimization strategy:

  1. Policy Update: Given fixed dynamics parameters, the policy is updated to maximize the expected return under those dynamics. This step leverages standard RL algorithms.
  2. Dynamics Update: Given a fixed policy, the dynamics parameters are updated to minimize the worst-case performance within the Wasserstein ball. This is where the novelty lies.

A key challenge in updating the dynamics parameters is the difficulty in computing gradients and Hessians for black-box simulators or differential equation solvers. To address this, the paper proposes a zero-order optimization method. This method estimates the necessary gradients and Hessians by perturbing the dynamics parameters and evaluating the simulator's output, avoiding the need for explicit analytical derivatives. This makes the approach scalable and applicable to complex, parameterized dynamics models.

Datasets

The paper evaluates $\text{W}\text{R}^{2}\text{L}$ on a variety of MuJoCo environments. These are standard benchmarks for continuous control tasks in robotics. The specific environments used include:

  • CartPole: A classic control problem for balancing a pole.
  • Hopper: A simulated robot that needs to move forward without falling.
  • Walker2D: A bipedal robot simulation.
  • HalfCheetah: A simulated cheetah robot.

The dynamics of these environments are parameterized by variables such as friction, density, and joint properties. The experiments involve varying these parameters to create different "worst-case" scenarios for testing robustness. No new benchmarks were introduced; existing MuJoCo environments were utilized with manipulated dynamics.

Key Insights and Ideas

  • Wasserstein Distance for Dynamics Uncertainty: The paper elegantly frames the problem of dynamics uncertainty using the Wasserstein distance. This provides a principled way to define a "ball" of plausible dynamics around a reference model, ensuring that the search for worst-case scenarios remains tractable and meaningful.
  • Zero-Order Optimization for Black-Box Dynamics: The development of a zero-order optimization method for estimating gradients and Hessians is a significant contribution. This allows $\text{W}\text{R}^{2}\text{L}$ to work with parameterized dynamics models that are treated as black boxes, making it applicable to a wider range of real-world systems where analytical derivatives are unavailable or computationally prohibitive.
  • Min-Max Objective for Robustness: Formalizing robustness as a min-max game is a powerful approach. It directly optimizes for policies that perform well even under the most challenging (within the defined uncertainty) dynamics, rather than just averaging performance across variations.
  • Trade-off Between Robustness and Optimality: The paper highlights that the min-max formulation can lead to a trade-off between achieving the absolute best performance in a nominal scenario and maintaining good performance across a range of dynamics. This is an inherent characteristic of robust optimization.

Key Results

  • Superior Robustness: $\text{W}\text{R}^{2}\text{L}$ consistently outperforms standard RL algorithms (like PPO and TRPO) and existing robust RL algorithms (RARL and PR-MDP) across various MuJoCo benchmarks. This is demonstrated by significantly higher average test returns when evaluated on unseen dynamics.
  • Performance on High-Dimensional Dynamics: The algorithm shows strong performance even when dealing with high-dimensional dynamics variations, where other methods struggle. For instance, in the Hopper and HalfCheetah environments, $\text{W}\text{R}^{2}\text{L}$ maintains high average returns across a wide range of parameter changes.
  • Scalability: The zero-order optimization method enables $\text{W}\text{R}^{2}\text{L}$ to scale to problems with many dynamics parameters, which is crucial for real-world applications.
  • Impact of $\epsilon$: The experiments show that increasing the $\epsilon$ parameter (which defines the size of the Wasserstein ball) leads to increased robustness, albeit potentially at the cost of peak performance in the nominal case.

Limitations and Future Work

  • Requirement for Parameterizable Dynamics: $\text{W}\text{R}^{2}\text{L}$ requires the ability to parameterize and alter the dynamics of the environment (e.g., via a simulator or differential equation solver). It cannot be directly applied to environments where dynamics are fixed and unknown.
  • Reference Dynamics: While the exact reference dynamics $P_0$ doesn't need to be known, the algorithm relies on being able to sample from it or have access to its specification parameters.
  • Future Work: The authors suggest several interesting directions:
  • Extending robustness to other components of MDPs, such as state representations and reward functions.
  • Implementing $\text{W}\text{R}^{2}\text{L}$ on real hardware and conducting sim-to-real experiments.
  • Exploring off-policy constraint evaluation for improved efficiency and scalability.

Summary updated

BibTeX
@misc{abdullah2019wasserstein,
  author = {Mohammed Amin Abdullah and Hang Ren and Haitham Bou-Ammar and Vladimir Milenkovic and Rui Luo and Mingtian Zhang and Jun Wang},
  title = {{Wasserstein Robust Reinforcement Learning}},
  year = {2019},
  eprint = {1907.13196},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.13196},
}
Figure