TL;DR
CEIL (ContExtual Imitation Learning) is a unified algorithm that masters imitation learning across diverse settings—online, offline, cross-domain, and one-shot—without needing specialized modifications for each. By decoupling "how to act" from "what to mimic" using a bi-level optimization of hindsight embeddings, it achieves state-of-the-art performance while remaining more stable and sample-efficient than traditional adversarial methods.
What Problem Does This Paper Address?
Imitation Learning (IL) is the art of teaching an agent to perform a task by showing it expert demonstrations. Historically, the field has been highly fragmented. If you have expert actions, you use "Learning from Demonstrations" (LfD); if you only have observation videos, you use "Learning from Observations" (LfO). If you can interact with the world, it's "Online IL"; if you're stuck with a static dataset, it's "Offline IL."
The problem is that an algorithm designed for one setting (like GAIL for online LfD) often fails miserably in another (like offline LfO). Furthermore, real-world tasks are messy mixtures: you might have a few expert videos, a pile of sub-optimal robot logs, and a simulator that doesn't quite match the real robot's physics (cross-domain). The authors of CEIL sought a "generalist" algorithm—a single, ready-to-deploy formulation that handles all these variations gracefully.
Methods
CEIL is inspired by Hindsight Information Matching. In reinforcement learning, hindsight relabeling allows an agent to learn from "failures" by pretending that whatever state it reached was actually its intended goal.
CEIL formalizes IL as a bi-level optimization problem:
- The Inner Level (Learning the "How"): The agent learns a contextual policy $\pi_\theta(a|s, z)$ and a hindsight embedding function $f_\phi$. Using a self-consistency loss, the policy is trained via simple supervised regression to reach the "goal" (embedding $z$) extracted from its own past trajectories. This makes the policy an expert at reaching any state it has seen before, regardless of whether that state was "good."
- The Outer Level (Learning the "What"): To actually imitate, the algorithm searches for an optimal embedding $z^*$ that, when fed into the policy, biases the agent's behavior to match the expert's trajectory distribution.
By decoupling these two, CEIL avoids the instability of adversarial training (common in GAIL-like methods) and the need for complex reward engineering. For cross-domain tasks, they add a regularization term that encourages the embeddings to be "domain-agnostic," focusing on the task logic rather than the specific physics of the environment.
Datasets
The authors evaluated CEIL across a massive battery of benchmarks:
- Online/Offline Tasks: Standard MuJoCo environments (Hopper, HalfCheetah, Walker2d, Ant).
- Offline Datasets: The D4RL dataset, including "medium," "medium-replay," and "medium-expert" splits.
- Cross-Domain: Modified MuJoCo environments where the "expert" has different physical properties (e.g., different torso lengths) than the "learner."
- One-Shot: Scenarios where the agent is given exactly one trajectory of a new task and must immediately adapt.
Key Insights and Ideas
- Decoupling is Key: Most IL algorithms try to learn a policy and a reward/discriminator simultaneously. CEIL learns a general "navigation" policy first (inner loop) and treats imitation as a low-dimensional search problem (outer loop).
- Supervised Stability: Because the inner loop is essentially supervised learning (reaching seen states), it is significantly more stable than Reinforcement Learning-based IL pipelines.
- Hindsight as a Bridge: Hindsight relabeling naturally allows the agent to extract useful information from sub-optimal, non-expert data, which is why CEIL performs so well in offline settings where data quality varies.
- Prompt-Tuning Parallel: The authors liken their optimal embedding $z^*$ to a "prompt" in a Large Language Model. You have a pre-trained capability (the contextual policy), and you just need to find the right prompt (embedding) to elicit the desired behavior.
Key Results
- Sample Efficiency: In online tasks, CEIL reached expert-level performance much faster than baselines like GAIL or AIRL, as seen in the learning curves above.
- Offline Superiority: On D4RL benchmarks, CEIL consistently outperformed state-of-the-art offline IL methods like SMODICE and IQ-Learn, particularly in the "Learning from Observations" (LfO) setting where actions are missing.
- Robustness to Mismatch: In cross-domain settings, while other algorithms' performance crashed due to transition dynamics differences, CEIL remained robust.
- One-Shot Transfer: CEIL showed a remarkable ability to generalize to new tasks given only a single expert demonstration, outperforming baseline Behavioral Cloning approaches.
Limitations and Future Work
The authors identify a few "failure modes":
- Online LfO: While CEIL is highly effective in offline LfO, its performance in online LfO (where it must explore without seeing expert actions) is weaker. This is likely because the current version lacks an explicit exploration mechanism to find the "expert region" of the state space.
- Cross-Embodiment: While it handles different dynamics (e.g., torso length), it cannot yet handle entirely different state/action spaces (e.g., a four-legged robot imitating a human). The authors suggest that future work could involve "tokenizing" states and actions into a flat sequence, similar to how Transformers handle different modalities.
Summary updated