Introduction
Imitation Learning (IL) enables agents to acquire complex behaviors by mimicking expert demonstrations. However, a significant challenge arises when the agent's environment differs from the expert's—a common scenario in real-world robotics where physical parameters like friction, gravity, or joint dynamics may vary. Standard adversarial methods, such as Generative Adversarial Imitation Learning (GAIL), often fail in these "cross-domain" settings because the discriminator learns to distinguish agents based on environmental physics rather than task-relevant behavior.
Problem Statement: The Physics Detector Trap
In adversarial IL, a discriminator acts as a judge, providing a reward signal based on how closely the agent's state-action pairs match the expert's. When the student and expert operate in different physical environments, the discriminator often "cheats" by identifying low-level physical discrepancies (e.g., differences in acceleration due to gravity). This leads to a useless reward signal, preventing the agent from learning the underlying task. This phenomenon effectively turns the discriminator into a physics detector rather than a behavior evaluator.
Methodology
ADAIL (Adaptive Adversarial Imitation Learning) overcomes this by introducing a dynamics-aware policy and a physics-invariant discriminator.
Dynamics Posterior
The agent includes a module ($Q_\phi$) that observes short sequences of transitions to infer the current environment's dynamics, represented as a latent context vector ($c$). The policy is then conditioned on this embedding, allowing it to adapt its strategy to the perceived physics. The paper explores both supervised regression to ground-truth parameters and unsupervised VAE-based learning of these embeddings.
Dynamics-Invariant Discriminator
To prevent the discriminator from exploiting physical differences, ADAIL employs a Gradient Reversal Layer (GRL). This architectural choice forces the discriminator to learn features that are predictive of expert behavior but uninformative regarding the specific environment dynamics. By "blinding" the judge to physics, it is forced to focus purely on the high-level goals of the task.
Experimental Setup
The researchers evaluated ADAIL on four continuous control benchmarks: Gym CartPole-V0 and MuJoCo's Hopper, HalfCheetah, and Ant. Dynamics were varied by manipulating force magnitudes, gravity components, and friction coefficients. For each task, only 16 expert demonstrations from a single source environment were provided, testing the agent's ability to generalize to a wide range of target environments.
Results and Discussion
ADAIL demonstrated significant robustness to environmental shifts compared to standard GAIL and other baselines.
Key findings include:
- Superior Generalization: In the HalfCheetah environment, ADAIL achieved an average score of 4283, outperforming both the PPO Expert (2991) and GAIL with dynamics randomization (3182).
- Robustness to Extreme Shifts: In CartPole, ADAIL maintained performance even when the direction of the applied force was flipped—a scenario where standard GAIL failed entirely.
- Unsupervised Adaptation: A VAE-based version of ADAIL, which learns physics representations without explicit labels, performed nearly as well as the supervised version, highlighting its potential for real-world applications where exact physical parameters are unknown.
Conclusion
ADAIL provides a robust framework for cross-domain imitation learning. By explicitly modeling environmental dynamics and ensuring the discriminator remains task-focused through gradient reversal, ADAIL allows robots to learn from limited demonstrations and adapt to diverse physical conditions. Future work may explore the application of this method to more complex, non-Markovian environments using recurrent architectures to capture long-term physical properties.
Summary updated