EPOpt: Learning Robust Neural Network Policies Using Model Ensembles

Aravind Rajeswaran, Sarvjeet Ghotra, Balaraman Ravindran, Sergey Levine

Training robots in the real world is notoriously difficult. It is slow, expensive, and—if your reinforcement learning (RL) agent decides to "explore" by driving into a wall—potentially dangerous. The obvious solution is to train agents in simulation first. However, simulators are never perfect representations of reality. This "reality gap" (or model mismatch) means a policy that performs like a pro in a simulated environment often fails completely when deployed on physical hardware.

In their ICLR 2017 paper, EPOpt: Learning Robust Neural Network Policies Using Model Ensembles, Aravind Rajeswaran and colleagues propose a clever two-step solution: first, make the policy robust to a wide range of simulated worlds, and second, use real-world data to figure out which of those simulated worlds looks most like reality.

The Brittleness of Deep RL

Deep RL is highly susceptible to overfitting. Because deep neural networks are excellent at finding patterns, they often overfit to the specific, sometimes unrealistic, physics of a simulator. For instance, if the simulator assumes a robot's torso weighs exactly 6kg, but the real robot weighs 5kg, the learned policy might fail entirely.

To solve this, researchers usually look at Model-Based RL (using a simulator to save time) or Robust Control (preparing for the worst-case scenario). However, standard model-based methods often rely on a single "best guess" simulator, while traditional robust control is often too conservative for complex, high-dimensional tasks like walking. EPOpt aims to find the sweet spot: a policy that isn't just "average" across many worlds, but specifically prepared for the most difficult variations.

The EPOpt Algorithm

The authors introduce the EPOpt-$\epsilon$ algorithm, which tackles the sim-to-real gap through two main phases:

  1. Robust Policy Search: Instead of maximizing the average reward across a distribution of simulators, EPOpt uses a "soft" max-min objective. It samples a batch of trajectories from an ensemble of models (with varying mass, friction, etc.) and performs gradient updates using only the worst-performing subset (the $\epsilon$-percentile). This approach is based on the Conditional Value at Risk (CVaR) metric, effectively forcing the agent to prioritize succeeding in the most challenging environments.
  2. Source Domain Adaptation: Once a robust policy is found, it is deployed in the "target" (real) world. The resulting real-world data is then used to update the probability distribution of the simulated ensemble using Bayesian inference. If the real robot's behavior matches a specific subset of simulated parameters, the ensemble "tilts" toward those parameters for the next round of training.

Experimental Setup

The researchers evaluated EPOpt on two classic high-dimensional benchmarks in the MuJoCo physics engine: the 2D Hopper (a one-legged hopping robot) and the Half-Cheetah (a two-legged running robot). To simulate the reality gap, they created ensembles by varying physical parameters like torso mass, ground friction, joint damping, and armature (inertia).

Key Insights

  • The Tail Matters: Standard RL optimizes for mean performance. EPOpt argues that for safety and transferability, we should optimize for the "tail" of the distribution—the edge cases where things go wrong.
  • Adversarial Training as a Regularizer: By focusing on the $\epsilon$-percentile of worst outcomes, the algorithm discourages the policy from exploiting specific simulator quirks that won't generalize to the real world.
  • Robustness to the Unknown: Surprisingly, training on an ensemble of some parameters (like friction) made the policy more robust to unmodeled effects (like changes in mass) that weren't even included in the training ensemble.
  • Sample Efficiency: Because the heavy lifting is done in simulation, the agent needs very few real-world interactions (as few as 10-11 episodes) to adapt its ensemble and achieve high performance.

Key Results

EPOpt demonstrated significant improvements in stability and reliability compared to standard baselines.

Performance across varying torso masses for specific models vs. the EPOpt ensemble.
  • Stability under Mismatch: In the Hopper task, a standard TRPO (Trust Region Policy Optimization) agent trained on a specific 6kg model failed immediately if the mass shifted to 4kg or 8kg. In contrast, the EPOpt ensemble agent remained stable and high-performing across the entire tested range (3kg to 9kg).
  • Superior Worst-Case Performance: When evaluating the 10th percentile of returns (a proxy for reliability), EPOpt significantly outperformed "Maximum Likelihood" models that only trained on average parameters.
  • Fast Adaptation: In experiments where the target domain was far outside the initial training distribution, EPOpt’s Bayesian adaptation narrowed the performance gap in just a few iterations. Model-free methods would have required tens of thousands of real-world trajectories to achieve the same adaptation.

Limitations and Future Work

The authors acknowledge that their Bayesian adaptation currently relies on sampling the parameter space, which becomes computationally expensive as the "dimension of uncertainty" (the number of physical parameters) increases.

Future directions include exploring non-parametric distributions for the ensemble and moving toward "simulator-free" adaptation, where the physics engine itself is replaced by a learned neural network model that can be updated even more flexibly with real-world data.

Summary updated

BibTeX
@inproceedings{rajeswaran2017epopt,
  author = {Aravind Rajeswaran and Sarvjeet Ghotra and Balaraman Ravindran and Sergey Levine},
  title = {{EPOpt: Learning Robust Neural Network Policies Using Model Ensembles}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=SyWvgP5el},
}
Figure