Confidence-Aware Imitation Learning from Demonstrations with Varying Optimality

Songyuan Zhang, Zhangjie Cao, Dorsa Sadigh, Yanan Sui

TL;DR

Confidence-Aware Imitation Learning (CAIL) is a new framework that allows robots to learn effectively from a "messy" mix of demonstrations, ranging from expert-level to completely random or even failing trajectories. By using a bi-level optimization process, CAIL automatically learns to assign "confidence scores" to demonstrations, prioritizing useful data and filtering out the noise without requiring manual labels for every trajectory.

The Problem: Learning from Imperfect Teachers

Standard Imitation Learning (IL) operates on a strong assumption: the teacher is always right. Algorithms like Behavioral Cloning or Generative Adversarial Imitation Learning (GAIL) assume that every demonstration provided is optimal. However, in the real world, data is often imperfect. Collecting large datasets usually involves a mix of highly skilled experts, mediocre performers, and perhaps even "malicious" or failing examples.

If you train a standard IL agent on this mixed bag, it will likely learn a suboptimal policy because it tries to mimic the bad behavior just as much as the good. Prior attempts to fix this required humans to manually label the "confidence" of every single action (which is tedious and biased) or relied on ranking-based methods that can be brittle if the rankings themselves are noisy or sparse. The authors of this paper sought a way to automatically identify which parts of a demonstration are worth imitating.

Methods: A Bi-Level Optimization Approach

The core of the paper is the Confidence-Aware Imitation Learning (CAIL) framework. It treats the problem as a bi-level optimization task:

  1. The Inner Loop (Policy Learning): The agent performs imitation learning—specifically using Adversarial Inverse Reinforcement Learning (AIRL)—on the provided demonstrations. Crucially, each state-action pair in the dataset is weighted by a learned confidence score ($\beta$).
  2. The Outer Loop (Confidence Learning): The framework evaluates the current policy's performance using a small, separate set of ranked trajectories (e.g., "Trajectory A is better than Trajectory B"). It then updates the confidence scores to minimize an "outer loss." If imitating a certain demonstration makes the policy perform poorly on the ranked evaluation data, its confidence score is lowered.
The CAIL framework jointly optimizes the imitation model and the confidence scores using a bi-level approach.

To make this computationally feasible for deep neural networks, the authors use a "pseudo-update" step. Instead of fully training the policy in every iteration of the confidence update, they perform a single gradient step to build a connection between the confidence values and the policy's performance.

Experimental Setup

The authors evaluated CAIL across four distinct environments:

  • MuJoCo Reacher: A simulated arm reaching for a target.
  • MuJoCo Ant: A four-legged simulated robot learning to run.
  • Franka Panda Simulation: A simulated industrial arm performing a pick-and-place task while avoiding obstacles.
  • Real UR5e Robot: A physical robot arm performing the same pick-and-place task.

In each case, the "demonstration" set was a mixture of trajectories with varying levels of optimality (from random movements to expert paths). Only a tiny fraction (5%) of the data was provided with rankings for the outer evaluation loop.

Key Insights and Results

CAIL consistently outperformed state-of-the-art baselines like AIRL, GAIL, and ranking-based methods (T-REX, D-REX).

  • Automatic Filtering: CAIL doesn't just learn a policy; it learns a "quality map" of the dataset. It can identify and ignore "malicious" demonstrations that would otherwise derail the learning process.
  • Learning from the "Best of the Worst": One of the most surprising findings is that CAIL can learn a successful policy even when no optimal demonstrations exist in the dataset. By reweighting, it can piece together a good policy from the successful segments of mediocre demonstrations.
  • Performance & Stability: In the "Ant" environment, CAIL achieved an expected return of nearly 4000, while standard AIRL struggled to reach 3000 and ranking-based methods like T-REX failed to break 0. On the real UR5e robot, CAIL showed much lower variance (higher stability) compared to AIRL and GAIL, which frequently suffered from unstable performance due to the influence of suboptimal data.
Comparison of expected returns across different environments. CAIL (red line) consistently reaches higher returns faster than baselines.

Furthermore, the authors provide a mathematical proof that their bi-level optimization converges to the optimal confidence assignments, providing a solid theoretical foundation for the empirical results.

Limitations and Future Work

While CAIL is a significant step forward, the authors note a few limitations:

  • Information Requirement: The dataset must still contain some useful information. If every single demonstration is pure random noise, there is nothing for the model to extract.
  • Dynamics Assumption: The framework currently assumes that the demonstrator and the imitator share the same physics/dynamics.

Future directions include exploring settings where the robot and the teacher have different physical capabilities and testing the system on even more complex, multi-stage tasks.

Summary updated

BibTeX
@inproceedings{zhang2021confidence,
  author = {Songyuan Zhang and Zhangjie Cao and Dorsa Sadigh and Yanan Sui},
  title = {{Confidence-Aware Imitation Learning from Demonstrations with Varying Optimality}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=RcfJUrZzhoL},
}
Figure