Extending Robust Adversarial Reinforcement Learning Considering Adaptation and Diversity

Hiroaki Shioya, Yusuke Iwasawa, Yutaka Matsuo

Introduction

Deep Reinforcement Learning (RL) typically requires millions of trials, making it impractical to train agents directly in the real world. While simulators offer a safe alternative, they suffer from "modeling errors"—the physics in a simulator (like friction or joint stiffness) never perfectly match reality, creating a "sim-to-real" gap.

A popular solution is Robust Adversarial Reinforcement Learning (RARL), where a "protagonist" agent is trained alongside an "adversary" that applies disturbing forces. The goal is to make the protagonist robust to any environment. However, standard RARL has two major flaws:

  1. Lack of Realism: The adversary might create scenarios that are incredibly difficult but physically impossible or irrelevant to the actual test domain.
  2. Lack of Diversity: A single adversary often converges on one specific way to "break" the protagonist, failing to prepare it for a wide variety of environmental shifts.

This paper enhances RARL to better bridge the sim-to-real gap. By forcing adversarial agents to stay realistic relative to a target domain and employing multiple diverse adversaries, the authors create training environments that are both challenging and relevant, leading to significantly better generalization in unseen physical environments.

Proposed Methods

The authors propose two primary extensions to the standard RARL framework:

1. Adaptation Penalty

To prevent the adversary from creating "impossible" physics, the authors add a penalty term to its objective function. This term measures the difference between the transition functions (how the state changes after an action) of the training domain and the target test domain.

  • The Goal: Force the adversary to find the "hardest" version of the environment that is still "close" to the real world.
  • Implementation: The agent periodically samples trajectories from the test domain to "refit" its understanding of the target physics.

2. Multiple Adversaries and Smart Sampling

Instead of one adversary, the authors train a committee of them. To make this effective, they introduce two sub-mechanisms:

  • Diversity Penalty: They add a KL-divergence penalty to the adversaries' objectives, essentially telling them to find different ways to challenge the protagonist rather than copying each other.
  • Rank-Based Sampling: Always training against the hardest adversary can stall learning. Instead, the authors rank samples based on "learning progress." They use linear regression on recent rewards to identify which adversarial scenarios are actually helping the protagonist improve, then sample those stochastically.

Experimental Setup

The researchers evaluated their methods using the MuJoCo physical simulator benchmark tasks within the OpenAI Gym framework. Specifically, they tested on three simulated robots: Hopper (one-legged), Walker2D (two-legged bipedal), and HalfCheetah (2D four-legged).

To test robustness, they created 169 different test domains by varying the physical parameters (like mass and friction) of these robots, simulating the unpredictable nature of real-world deployment.

Key Insights and Results

Hardness vs. Relevance: Making a task harder isn't always better. If an adversary makes a robot 100x heavier than it will ever be in reality, the protagonist learns "defensive" behaviors that might actually hurt its performance in the real world.

Performance Boost: The proposed methods significantly outperformed the standard RARL baseline. In specific test scenarios across the different robots, the adaptation and proposed methods secured the highest rewards in 5 out of 7 test domains.

Performance comparison across test domains

The "Learning Progress" Filter and Generalization: The most interesting finding is that training against the hardest possible adversary ("max") often stops the learning process entirely. By prioritizing scenarios where the agent is showing a positive "learning slope" (the "soft" sampling method), the training remains productive. In the large-scale test across 169 domains, the "soft" sampling method showed much higher generalization and sustained rewards across percentiles than the "max" method.

Reward percentiles for Hopper and Walker2d across 169 test domains

Adversarial Ensembles: Just as ensemble methods improve classification, multiple adversaries prevent the protagonist from "overfitting" to a single type of disturbance. The protagonist trained with multiple adversaries was less likely to fail completely when faced with extreme parameter shifts compared to those trained with a single adversary.

Limitations and Future Work

  • Test Domain Access: The "Adaptation" method requires some trajectories from the test domain to calculate the penalty. In a true "zero-shot" sim-to-real scenario, this data might not be available initially.
  • Hyperparameter Sensitivity: The methods introduce several new hyperparameters (like $\lambda$ for the penalty weight and $\alpha$ for ranking importance). The paper does not provide a detailed sensitivity analysis on how to tune these for new tasks.
  • Computational Cost: Training multiple adversaries simultaneously increases the computational overhead, which might be a bottleneck for more complex 3D environments.

Summary updated

BibTeX
@inproceedings{shioya2018extending,
  author = {Hiroaki Shioya and Yusuke Iwasawa and Yutaka Matsuo},
  title = {{Extending Robust Adversarial Reinforcement Learning Considering Adaptation and Diversity}},
  booktitle = {Workshops @ ICLR},
  year = {2018},
}
Figure