Training reinforcement learning (RL) agents in simulation is a cost-effective and safe alternative to training directly on physical hardware. However, policies trained in simulation often fail when deployed in the real world due to the "reality gap"—the inevitable mismatch between simulated physics and real-world dynamics.
To bridge this gap, researchers frequently use Domain Randomization (DR). By randomizing simulator parameters (such as mass, friction, or joint damping) during training, the policy learns to be robust to environmental variations. Unfortunately, DR introduces a "Goldilocks" dilemma:
- Too narrow: The policy overfits to the specific simulated conditions and fails in reality.
- Too wide: The policy becomes overly conservative, or the learning process collapses entirely because the agent is overwhelmed by physically impossible or unsolvable environments.
Manually tuning these parameter distributions is tedious and time-consuming. Existing automated methods often require expensive real-world data to guide the tuning, rely on predefined reference distributions, or suffer from sample inefficiency.
This paper introduces DORAEMON (DOmain RAndomization via Entropy MaximizatiON), an automated DR method that progressively maximizes the diversity of simulated physics parameters while ensuring the agent maintains a high success rate. This curriculum-like approach yields highly adaptable policies capable of zero-shot transfer to real-world robots, entirely eliminating the need for real-world data to tune the simulator.
The DORAEMON Approach
Instead of manually guessing the optimal range of physics parameters, DORAEMON frames the parameter distribution as a constrained optimization problem. The core components of the method include:
- Entropy Maximization: The algorithm actively seeks to maximize the entropy (diversity and width) of the parameter distribution. It constantly pushes the boundaries to expose the agent to the widest possible variety of environments.
- Success Rate Constraint: To prevent the policy from collapsing under excessive randomness, the entropy maximization is strictly constrained. The distribution is only allowed to widen if the agent's probability of success (e.g., reaching a designated goal) remains above a user-defined threshold, $\alpha$ (e.g., 50% or 90%).
- Backup Optimization (Backtracking): If the distribution becomes too broad and the agent's success rate drops below the $\alpha$ threshold, DORAEMON employs a backup step. It automatically backtracks to a slightly narrower, easier distribution within a safe "trust region" to recover performance.
The agent is trained using Soft Actor-Critic (SAC) and is provided with a history of past states and actions. This historical context allows the policy to implicitly infer the hidden dynamics of the environment on the fly.
Key Insights
- Curriculum Learning is Crucial: Gradually widening the parameter distribution acts as a curriculum, gently ramping up the difficulty. This approach is vastly more effective than training the agent on the widest possible distribution from the start.
- Success Rate > Average Return: Using a binary "success/fail" metric to constrain the algorithm is significantly more stable than using average reward. In highly randomized physics, agents can experience catastrophic negative rewards in physically impossible states. A binary success metric ignores the magnitude of these failures, preventing them from skewing the optimization process.
- Backtracking Prevents Collapse: The backup optimization step is critical to DORAEMON's stability. In standard automated DR, hitting a wall of unsolvable parameters can permanently derail training. DORAEMON's ability to smoothly retreat to easier distributions keeps the learning process on track.
Experimental Results
The authors evaluated DORAEMON across both simulated benchmarks and a physical robotic task.
Sim-to-Sim Benchmarks: Evaluated on six standard continuous control tasks from the OpenAI Gym MuJoCo suite (CartPole, SwingUpCartpole, Hopper, Walker2D, HalfCheetah, Swimmer), DORAEMON consistently achieved higher global success rates across the widest range of parameters compared to baselines like AutoDR and LSDR. It also demonstrated superior sample efficiency.
Sim-to-Real Transfer: To test real-world applicability, the authors introduced PandaPush, a robotic manipulation task where a 7-DoF Franka Panda robotic arm must push a box to a target location. The box has an unknown center of mass, and the simulation randomizes 17 different dynamics parameters (including box mass, surface friction, and joint damping).
In the physical PandaPush task, DORAEMON achieved a 60% zero-shot success rate (successfully pushing the box within 3cm of the goal), with an average final distance of 2.68 cm. It significantly outperformed baseline methods on real hardware: LSDR achieved a 46.7% success rate, and AutoDR achieved 26.7%. Notably, a policy trained on a fixed, wide distribution (Fixed-DR) completely failed to learn anything meaningful, resulting in a 0% success rate in reality.
Limitations and Future Directions
While highly effective, DORAEMON does exhibit a limitation regarding catastrophic forgetting. When the algorithm backtracks to an "easier" distribution to recover its success rate, the policy can sometimes forget how to handle the harder dynamics it had previously mastered.
Future work could address this by adding a constraint that forces the current policy to stay close to the best-performing historical policy. Additionally, exploring multimodal distributions—rather than simple bell curves or uniform ranges—could allow the algorithm to "skip over" specific pockets of physically impossible parameters without having to shrink the entire distribution.
Summary updated