Iterative Regularized Policy Optimization with Imperfect Demonstrations

Gong Xudong, Feng Dawei, Kele Xu, Yuanzhao Zhai, Chengkang Yao, Weijia Wang, Bo Ding, Huaimin WangICML 2024

TL;DR

Imitation learning often struggles when expert demonstrations are flawed, and standard reinforcement learning fine-tuning methods artificially cap how much the resulting policy can improve. This paper introduces Iterative Regularized Policy Optimization (IRPO), a framework that iteratively alternates between offline imitation learning and online reinforcement learning to progressively generate better demonstrations. By continuously boosting the quality of its own training data, IRPO breaks past the limitations of imperfect initial demos to achieve state-of-the-art performance on complex control tasks.

What Problem Does This Paper Address?

Imitation Learning (IL) is a powerful way to teach AI agents by having them copy expert behavior. However, its success heavily depends on having a large, high-quality dataset of demonstrations. In the real world, demonstrations are often imperfect—plagued by human error, fatigue, or sub-optimal automated controllers.

To fix policies learned from bad data, researchers typically fine-tune them using online Reinforcement Learning (RL). To prevent the policy from forgetting how to do the task entirely during this transition, they use a mathematical constraint called Kullback–Leibler (KL) regularization, which forces the new policy to stay relatively close to the original imitation policy.

The authors identify two major flaws with this standard approach when dealing with imperfect demonstrations:

  1. Over-constrained exploration: The authors prove that KL regularization mathematically limits how much better the new policy can get compared to the flawed expert.
  2. Primacy bias: The online RL process tends to over-fit to the low-quality early experiences from the imperfect demos, making it hard for the agent to unlearn bad habits.

Methods

To solve these issues, the authors propose Iterative Regularized Policy Optimization (IRPO). Instead of a single, one-way pipeline from offline IL to online RL, IRPO uses a continuous loop designed to iteratively upgrade both the reference policy and the dataset itself.

The IRPO framework iteratively alternates between offline learning and online learning, boosting demonstration quality.

The framework consists of two main components:

  1. Iterative Training: IRPO trains a policy offline, fine-tunes it online with RL, and then uses that newly improved policy as the reference point for the next iteration of training.
  2. Demonstration Boosting: This is the core innovation. IRPO uses the online-learned policy to interact with the environment and roll out new demonstrations. It uses a simple indicator function (e.g., trajectory length) to filter these new trajectories, keeping only the best ones to upgrade the dataset. The next iteration then trains on this newly improved, higher-quality dataset.

By iteratively relaxing the constraints holding the agent back, IRPO progressively raises the ceiling on policy performance.

Datasets

The authors evaluated IRPO across four finite-horizon Markov Decision Process (MDP) tasks:

  • Articulated-body control (MuJoCo): Halfcheetah-medium-v2 and Hopper-medium-v2 from the D4RL benchmark. The imperfect demonstrations were generated by partially-trained Soft Actor-Critic (SAC) policies.
  • Robotic Arm Control (panda-gym): A modified, highly constrained "Reach" task using a basic PID controller to generate sub-optimal demonstrations.
  • Fixed-wing UAV Attitude Control: A novel, custom-built flight control environment. Demonstrations were generated using both a PID controller and raw "human play" data (unstructured expert interactions).

Key Insights and Ideas

  • The KL Regularization Trap: The authors mathematically prove that KL regularization creates a hard upper bound on policy improvement. If your demonstrator is bad, strict KL regularization guarantees your final policy will also be limited, no matter how long you train. You must improve the underlying data to raise this ceiling.
  • Better Data > Better Weights: Ablation studies revealed a fascinating insight: for the next training iteration, the data generated by the fine-tuned policy is actually more valuable than the policy weights themselves. Retraining offline on the newly generated, higher-quality data avoids primacy bias better than just continuing to update the existing neural network.
  • Simple Filters Work: The "demonstration boosting" step doesn't need a complex, perfectly engineered reward function to filter good trajectories. Even simple heuristics—like preferring shorter trajectories to reach a goal—are enough to iteratively bootstrap data quality and improve the policy.

Key Results

IRPO consistently beat three strong baseline approaches (fixed KL, annealed KL, and exponential moving average KL regularization) across all four tested environments.

Performance improvements across successive IRPO iterations on the Hopper and Attitude control tasks.
  • Massive Performance Jumps: Compared to the average of the three baselines, IRPO improved expected returns by 10.4% on HalfCheetah, 14.6% on Hopper, 38.7% on Reach, and achieved a 42.1% higher success rate on the complex UAV Attitude Control task.
  • Success with Human Play Data: On the UAV task, IRPO took a tiny dataset of unstructured human play data (just 6% the size of the PID dataset). Within two iterations, it optimized the demonstrations and the policy to achieve a success rate that rivaled models trained on the massive PID dataset.

Limitations and Future Work

  • Indicator Function Design: While simple indicator functions worked well in these experiments, designing them still requires some domain knowledge about the task. The authors note it remains an open question whether more carefully designed indicator functions could lead to even faster convergence.
  • Limited to On-Policy RL: The current experimental validation of IRPO is limited to on-policy RL algorithms (specifically PPO). The authors acknowledge that it is still unclear whether the IRPO framework can be successfully adapted to off-policy RL settings.

Summary updated

BibTeX
@inproceedings{xudong2024iterative,
  author = {Gong Xudong and Feng Dawei and Kele Xu and Yuanzhao Zhai and Chengkang Yao and Weijia Wang and Bo Ding and Huaimin Wang},
  title = {{Iterative Regularized Policy Optimization with Imperfect Demonstrations}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=Gp5F6qzwGK},
}
Figure