Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers

Shreyas Chaudhari

TL;DR

This paper introduces DARC, a novel reinforcement learning (RL) approach for domain adaptation that tackles changes in environment dynamics. By learning auxiliary classifiers to distinguish between source and target domain transitions, DARC modifies the reward function in the source domain to effectively train a policy for the target domain, achieving near-optimal performance with significantly less target domain experience.

What Problem Does This Paper Address?

Reinforcement learning agents often require vast amounts of data to learn effective policies. In real-world applications like autonomous driving or robotics, collecting this data in the target environment can be expensive, dangerous, or even impossible. While simulators (source domains) offer a cheaper and safer alternative, they often have different dynamics than the real world. Simply training in a simulator and deploying the policy directly in the real world usually leads to poor performance because the agent's learned behaviors, optimized for the simulator's dynamics, may be unsafe or ineffective in the target environment. Existing domain adaptation methods often focus on adapting to changes in observations, but this paper specifically addresses the more challenging problem of adapting to changes in the underlying dynamics of the environment.

Methods

The core idea behind DARC (Domain Adaptation with Rewards from Classifiers) is to make the agent's experience in the source domain "look like" its experience in the target domain. This is achieved by modifying the reward function in the source domain. Instead of learning a full dynamics model, DARC uses two simple binary classifiers:

  1. State-Action Classifier: Distinguishes between source and target domain transitions based on the current state and action ($s_t, a_t$).
  2. State-Action-Next State Classifier: Distinguishes between source and target domain transitions based on the current state, action, and the next state ($s_t, a_t, s_{t+1}$).

These classifiers are trained to predict whether a transition originated from the source or target domain. The output of these classifiers is then used to compute a reward correction term, $\Delta r$. This $\Delta r$ penalizes the agent for taking transitions in the source domain that are more likely in the source than in the target domain. Intuitively, this encourages the agent to learn policies that are robust to the dynamics differences. The modified reward ($r + \Delta r$) is then used to train a standard maximum entropy RL algorithm (like SAC) in the source domain. The authors provide a theoretical guarantee that this approach yields a near-optimal policy for the target domain under a mild assumption.

Datasets

The paper evaluates DARC on several simulated robotic control tasks, including:

  • Broken Reacher: A 7-DOF robot arm with a broken joint in the target domain.
  • Broken Half Cheetah: A half-cheetah robot with a broken joint in the target domain.
  • Broken Ant: An ant robot with a broken joint in the target domain.
  • Half Cheetah Obstacle: A half-cheetah robot where the target domain includes an obstacle not present in the source domain.
  • Archery Experiment: A simple physics-based simulation to visualize reward modification under wind conditions.
  • Humanoid: A humanoid robot experiment focusing on adapting to a different termination condition (falling).

These environments are derived from existing benchmarks (e.g., OpenAI Gym) but modified to create domain shifts in dynamics.

Key Insights and Ideas

  • Reward Modification as a Unified Solution: The paper elegantly frames domain adaptation for dynamics shifts as a reward modification problem, avoiding the need for explicit dynamics model learning.
  • Classifiers as Dynamics Indicators: Using simple classifiers to distinguish source/target transitions is a surprisingly effective way to infer dynamics discrepancies without complex model estimation.
  • Penalizing "Source-Specific" Behaviors: The core intuition that penalizing transitions that are "too source-like" helps the agent learn more generalizable policies is powerful.
  • Theoretical Guarantees: Providing a formal guarantee that the learned policy is near-optimal in the target domain significantly strengthens the method's credibility.
  • Scalability to High Dimensions: The approach's reliance on classifiers rather than full dynamics models makes it suitable for high-dimensional state spaces, a common challenge in RL.

Key Results

  • DARC consistently outperforms baselines like "RL on Source" and "Importance Weighting" across various robotic control tasks.
  • On tasks with crippled robots, DARC matches or surpasses the asymptotic performance of training directly on the target domain, despite using significantly less target domain experience (5-10x less).
  • The method successfully adapts to domain shifts in termination conditions, leading to safer behavior in the target domain.
  • Ablation studies confirm the importance of using two classifiers and the benefit of input noise regularization for classifier stability.
  • The paper demonstrates that DARC can even handle some violations of its core assumption (e.g., the half cheetah obstacle task), showing its practical robustness.

Limitations and Future Work

  • Stochasticity Assumption: The theoretical guarantees rely on the source domain dynamics being sufficiently stochastic. The authors suggest that adding noise or using ensemble sources can satisfy this.
  • Combined Dynamics and Observation Adaptation: While DARC primarily addresses dynamics, the paper notes that it could be combined with observation adaptation techniques for even broader applicability.
  • Investigating the $\Delta r$ Weight: The paper suggests future work to explore how to dynamically adjust the weight of the $\Delta r$ term to better balance exploiting the source domain and avoiding dynamics discrepancies.
  • Learning Dynamics for the Source Domain: The authors mention using their variational perspective to learn dynamics for the source domain as a future direction.

Summary updated

BibTeX
@inproceedings{chaudhari2021off,
  author = {Shreyas Chaudhari},
  title = {{Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=eqBwg3AcIAK},
}
Figure