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

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

TL;DR

Reinforcement learning (RL) policies trained in a simulator often fail when deployed in the real world due to differences in physics, a challenge known as "off-dynamics" RL. This paper introduces DARAIL, a novel framework that combines reward-shaping domain adaptation with imitation learning from observation to successfully transfer an agent's behavior across differing dynamics settings. By focusing on mimicking state trajectories rather than specific actions, DARAIL prevents the severe performance degradation typically seen in direct policy deployment.

What Problem Does This Paper Address?

In many real-world applications of reinforcement learning—such as autonomous driving or medical treatment—training an agent directly in the target environment is too costly, dangerous, or impractical. Instead, researchers train agents in simulated "source" domains. However, when the policy is deployed to the "target" domain, differences in transition dynamics (e.g., friction, gravity, or broken actuators) cause performance to plummet.

Prior approaches like Domain Adaptation with Rewards from Classifiers (DARC) attempt to fix this by modifying the reward function during source training to encourage the agent to visit states that would be optimal in the target domain. However, the authors identify a critical flaw: directly deploying this source-optimized policy into the target domain still fails because the same actions produce entirely different state transitions under different physics.

Methods

To bridge this gap, the authors propose DARAIL (Domain Adaptation and Reward Augmented Imitation Learning). The framework operates in two main stages:

  1. Source Domain Adaptation: DARAIL first uses a reward-modification method (like DARC) to train a policy in the source domain. This generates a set of "expert" trajectories that resemble what an optimal policy should look like in the target domain.
  2. Imitation Learning from Observation (ILfO): Instead of directly deploying the source policy, DARAIL uses a generative adversarial imitation learning framework (specifically GAIfO) to train a new policy in the target domain. Crucially, it mimics only the states ($s_t, s_{t+1}$) of the expert trajectories, not the actions. This allows the target policy to discover the correct actions required to achieve those states under the target domain's unique physics.
Learning framework of DARAIL compared to standard DARC performance degradation.

The Reward Augmented Estimator (RAE)

A key technical contribution of DARAIL is the Reward Augmented Estimator (RAE). Pure adversarial imitation learning can suffer from high variance and biased reward estimations under dynamics shifts. RAE combines the adversarial discriminator's signal with the ground-truth reward from the source domain, acting similarly to a "doubly robust" estimator in off-policy evaluation to stabilize policy optimization.

Datasets

The method was evaluated using four standard continuous control benchmark environments from the OpenAI MuJoCo suite:

  • HalfCheetah-v2
  • Ant-v2
  • Walker2d-v2
  • Reacher-v2

To simulate off-dynamics shifts, the authors introduced two types of modifications to the target environments:

  • Broken Environments: Freezing specific joint actions to zero torque (either permanently or with a probability $p_f$).
  • Modified Physics Parameters: Altering the configuration files to scale gravity or density to $0.5\times$ or $1.5\times$ of their original values.

Key Insights and Ideas

  • State Matching over Action Matching: When physics change, actions lose their original meaning. Mimicking what the agent looks like (states) rather than what the agent did (actions) is essential for successful cross-domain transfer.
  • Direct Deployment Suboptimality: The paper clearly demonstrates that existing reward-shaping methods only guarantee that the source-domain behavior resembles target optimal trajectories; they do not guarantee performance when that exact policy is deployed under target physics.
  • Leveraging Source Rewards: Even when dynamics change, the underlying task reward often remains the same. Incorporating the source domain's ground-truth reward into the target domain's imitation learning step drastically stabilizes the adversarial training process.

Key Results

DARAIL significantly outperformed pure modified reward methods (like DARC) and several competitive baselines (including MBPO, MATL, and GARAT) across the benchmark tasks.

As shown in the authors' evaluation under a severe $1.5\times$ gravity shift, directly deploying a DARC policy results in massive performance drops, whereas DARAIL successfully recovers near-optimal target performance:

Table 2: Comparison of DARAIL with DARC, 1.5 gravity.

Additionally, the authors found that DARAIL is highly robust to hyperparameters like importance weight clipping, which frequently destabilizes alternative baseline methods like Importance Sampling for SAC (IS-ACL).

Limitations and Future Work

While DARAIL shows strong performance, it relies on an initial domain adaptation step (like DARC) to generate high-quality state pairs. If the dynamics shift is exceptionally extreme, or if target domain data is too scarce, the initial trajectory generation might fail.

Furthermore, the method has only been validated within simulated MuJoCo environments. Testing DARAIL on real-world sim-to-real robotic platforms remains an open challenge. The authors suggest that future work should also explore off-dynamics RL under explicit safety constraints.

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