Discriminator-Guided Model-Based Offline Imitation Learning

Wenjia Zhang, Haoran Xu, Haoyi Niu, Peng Cheng, Ming Li, Heming Zhang, Guyue Zhou, Xianyuan Zhan

Abstract

Offline imitation learning (IL) is a powerful method to solve decision-making problems from expert demonstrations without reward labels. Existing offline IL methods suffer from severe performance degeneration under limited expert data. Including a learned dynamics model can potentially improve the state-action space coverage of expert data, however, it also faces challenging issues like model approximation/generalization errors and suboptimality of rollout data. In this paper, we propose the Discriminator-guided Model-based offline Imitation Learning (DMIL) framework, which introduces a discriminator to simultaneously distinguish the dynamics correctness and sub-optimality of model rollout data against real expert demonstrations. DMIL adopts a novel cooperative-yet-adversarial learning strategy, which uses the discriminator to guide and couple the learning process of the policy and dynamics model, resulting in improved model performance and robustness. Our framework can also be extended to the case when demonstrations contain a large proportion of suboptimal data. Experimental results show that DMIL and its extension achieve superior performance and robustness compared to state-of-the-art offline IL methods under small datasets.

Introduction

Imitation Learning (IL) has emerged as a key technique for teaching agents complex behaviors by mimicking expert demonstrations, effectively bypassing the need for meticulously engineered reward functions. However, offline IL—where an agent learns from a static dataset without further environment interaction—faces a significant hurdle known as covariate shift. In scenarios with limited expert data, even minor errors in the agent's actions can lead to unfamiliar states, causing a compounding error effect that results in total task failure.

To mitigate this, researchers often employ a learned dynamics model to generate synthetic "rollouts," thereby augmenting the training data. However, this approach introduces its own set of challenges: if the dynamics model is inaccurate or the generated actions are suboptimal, the agent may learn incorrect behaviors. The Discriminator-guided Model-based offline Imitation Learning (DMIL) framework addresses these challenges by introducing a discriminator that acts as a filter, ensuring the agent learns only from realistic and high-quality transitions.

The DMIL Framework

The core of DMIL is a "cooperative-yet-adversarial" game involving three primary components:

  1. Imitation Policy ($\pi$): The agent attempting to replicate expert behavior.
  2. Dynamics Model ($f$): A learned simulator that predicts the next state given a state-action pair.
  3. Discriminator ($d$): A judge trained to distinguish between real expert transitions and synthetic transitions generated by the dynamics model.
The DMIL framework architecture illustrating the interaction between the policy, dynamics model, and discriminator.

A distinguishing feature of DMIL is its use of cooperative information sharing. Unlike standard Generative Adversarial Networks (GANs) where the generator and discriminator are purely adversarial, DMIL's policy and dynamics model provide their internal confidence scores (log-likelihoods) to the discriminator. This coupling allows the discriminator to make more informed judgments about the realism and optimality of a rollout. Consequently, the policy learns to stay within regions where the dynamics model is reliable, while the dynamics model is pushed to improve in areas the policy frequently visits. For datasets containing significant amounts of non-expert data, the framework can be extended to D2MIL, which employs a second discriminator to leverage suboptimal demonstrations effectively.

Experimental Results

The DMIL framework was rigorously tested on standard benchmarks, including D4RL MuJoCo tasks and Adroit human manipulation tasks, as well as on a real-world wheel-legged robot.

Sample Efficiency and Robustness

DMIL demonstrates remarkable sample efficiency, maintaining high performance even when expert data is extremely scarce. On MuJoCo tasks with only 5% of the original expert dataset, DMIL achieved scores nearly double those of traditional Behavior Cloning (BC). In the Walker2d task with just 2% data, DMIL reached a score of 105.55, while BC's performance plummeted to 58.34. Furthermore, DMIL proved highly robust to data corruption; when 20% of the training data was injected with Gaussian noise, DMIL's performance remained stable, whereas other model-based baselines experienced significant degradation.

Qualitative Analysis via t-SNE

Visualizing the state-action space using t-SNE provides insight into how DMIL handles varying qualities of policies and models. The discriminator effectively identifies rollouts that deviate from the expert distribution, whether due to an inaccurate dynamics model or a suboptimal policy. This filtering mechanism ensures that the imitation policy is trained on data that closely mirrors true expert behavior.

t-SNE visualizations of expert data vs. model rollouts (a-d) and normalized evaluation scores (e) across different policy and model quality settings.

Real-World Application

The framework's practical utility was validated on a custom wheel-legged robot. Tasked with balancing and moving forward based on limited human demonstrations, DMIL was the only method that enabled the robot to maintain a stable balance for over 30 seconds. Other methods typically resulted in immediate crashes or uncontrollable oscillations, demonstrating DMIL's superior robustness in real-world, hardware-constrained settings.

Conclusion

DMIL offers a powerful solution for offline imitation learning, particularly in data-constrained environments. By integrating a discriminator that guides both the policy and the dynamics model, the framework effectively overcomes the pitfalls of model error and covariate shift. Future work will focus on extending DMIL to higher-dimensional latent spaces and incorporating temporal modeling to further enhance its capabilities in complex, partially observable real-world scenarios.

Summary updated

BibTeX
@inproceedings{zhang2022discriminator,
  author = {Wenjia Zhang and Haoran Xu and Haoyi Niu and Peng Cheng and Ming Li and Heming Zhang and Guyue Zhou and Xianyuan Zhan},
  title = {{Discriminator-Guided Model-Based Offline Imitation Learning}},
  booktitle = {Conference on Robot Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=RzhhFh4rkWu},
}
Figure