Off-Dynamics Reinforcement Learning via Domain Adaptation and Reward Augmented Imitation

Yihong Guo, Yixuan Wang, Yuanyuan Shi, Pan Xu, Anqi Liu

Deploying reinforcement learning (RL) agents from simulation to the real world often fails because the "physics" of the two environments do not match—a challenge known as off-dynamics RL. While previous methods attempted to bridge this gap by modifying rewards within the simulator, new research from Johns Hopkins, UCSD, and Duke suggests that reward modification alone is insufficient for robust transfer.

The proposed solution, DARAIL (Domain Adaptation and Reward Augmented Imitation Learning), introduces a two-step approach: first, identifying optimal behavior in a source domain (simulator), and then utilizing imitation learning to teach an agent how to achieve those results under the target domain's actual physics.

The Off-Dynamics Problem

In high-stakes applications like autonomous driving or robotic surgery, training agents directly in the target environment is often impossible due to the high cost of failure. Instead, agents are trained in a source domain. However, even minor discrepancies in gravity, friction, or joint health—referred to as dynamics shifts—can cause a policy that succeeded in simulation to fail during deployment.

Existing state-of-the-art methods like DARC (Domain Adaptation with Rewards from Classifiers) try to compensate by modifying the reward function in the source domain to match the distribution of an optimal agent in the target domain. However, matching distributions in the source domain does not guarantee optimal performance in the target domain. As illustrated in the performance gap below, a policy optimized for a "broken" simulator performs significantly worse when deployed in a healthy target environment.

Performance gap between training and evaluation (left) and the DARAIL framework architecture (right).

The DARAIL Framework

DARAIL introduces a robust transfer pipeline designed to overcome the "direct deployment trap," where a policy (a mapping of states to actions) fails because the same action leads to different state transitions in a new environment.

  1. Expert Generation: The framework first uses DARC to train a policy in the source domain. This policy is "expert-like" because it has learned to produce trajectories that should be optimal in the target domain.
  2. Imitation from Observation (IfO): Rather than copying the state-to-action mapping, DARAIL treats the source trajectories as expert demonstrations. It employs a framework similar to GAIfO (Generative Adversarial Imitation from Observation) to teach a new policy in the target domain to mimic these state-space sequences.
  3. Reward Augmented Estimator (RAE): The core innovation is the RAE, which stabilizes adversarial imitation learning. Standard discriminators can provide noisy signals under dynamics shifts. The RAE combines the discriminator's signal with the ground-truth reward from the source domain, weighted by transition importance. This acts as a "doubly robust" estimator, significantly stabilizing the learning process.

Experimental Results

The researchers evaluated DARAIL on four MuJoCo continuous control tasks: HalfCheetah, Ant, Walker2d, and Reacher. They tested two types of dynamics shifts: "Broken Environments" (e.g., freezing a joint in the source) and "Parameter Shifts" (e.g., scaling gravity by 1.5x).

DARAIL consistently outperformed DARC and other competitive baselines. In "broken" environment tests, DARAIL achieved performance levels much closer to the target's optimal reward than previous methods.

Performance comparison in broken source environments. DARAIL shows significant gains over DARC Evaluation.

Key findings include:

  • Robustness to Weight Clipping: Unlike standard importance sampling, DARAIL's RAE remains stable across various clipping intervals, making it easier to tune.
  • Theoretical Soundness: DARAIL's error bound relaxes previous assumptions that optimal policies must receive similar rewards in both domains, proving its efficacy even when source and target domains differ drastically.

Conclusion

DARAIL represents a significant advancement in sim-to-real transfer by shifting the focus from reward-matching in the source to state-imitation in the target. While it currently relies on a successful initial source policy, its ability to re-learn actions for target physics provides a more reliable path for deploying RL in complex, real-world environments.

Summary updated

BibTeX
@inproceedings{guo2024off,
  author = {Yihong Guo and Yixuan Wang and Yuanyuan Shi and Pan Xu and Anqi Liu},
  title = {{Off-Dynamics Reinforcement Learning via Domain Adaptation and Reward Augmented Imitation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=k2hS5Rt1N0},
}
Figure