Error Bounds of Imitating Policies and Environments

Tian Xu, Ziniu Li, Yang Yu

Imitation Learning (IL) offers a powerful alternative to traditional Reinforcement Learning (RL) by allowing an agent to learn directly from expert demonstrations rather than relying on trial-and-error with sparse rewards. However, the theoretical understanding of why certain imitation methods succeed where others fail has lagged behind their empirical success.

This paper provides a rigorous theoretical foundation for these performance differences. By analyzing the "value gap"—the difference in performance between an expert and an imitator—the authors mathematically prove that Generative Adversarial Imitation Learning (GAIL) fundamentally outperforms Behavioral Cloning (BC) over long planning horizons. Crucially, they extend this logic to Model-Based Reinforcement Learning (MBRL), demonstrating that adversarial training principles can be used to build significantly more accurate "world models."

The Problem: Compounding Errors in Policies and Models

The most straightforward approach to imitation learning is Behavioral Cloning (BC), which frames the problem as supervised learning: it minimizes the discrepancy between the expert's actions and the agent's actions at a single time step. While simple, BC notoriously suffers from "compounding errors." A tiny mistake at step one puts the agent in a slightly unfamiliar state, leading to a larger mistake at step two, eventually causing the agent to drift entirely off course.

Newer methods like Generative Adversarial Imitation Learning (GAIL) often perform better in practice by matching the "occupancy measure"—the overall distribution of state-action pairs visited by the expert. While GAIL's empirical superiority is well-known, the theoretical "why" was under-explored.

Furthermore, the authors identify a parallel issue in Model-Based RL. Most MBRL systems use BC-like, one-step prediction objectives to learn their environment transition models. The authors ask: Does the compounding error problem also plague our world models, and can we fix it using the same adversarial logic we use for policies?

Methodology: The Environment as a "Dual Agent"

To address this, the authors compare the theoretical error bounds of BC and GAIL.

The Novel Twist: The authors treat the environment transition model as a "dual agent." Just as a policy predicts an action given a state, a transition model predicts the next state given a state and action. By applying GAIL-style distribution matching to the transition model, they propose a way to learn environment dynamics that avoids the compounding errors typical of standard world models.

Key Theoretical Insights

  • The Horizon Factor (Linear vs. Quadratic Error): The "effective planning horizon" is defined as $1/(1-\gamma)$, where $\gamma$ is the discount factor. The paper mathematically proves that BC’s error grows quadratically, $O(H^2)$, while GAIL’s error grows linearly, $O(H)$. This means as tasks get longer and more complex, BC fails exponentially faster than GAIL.
  • Distribution Matching is Key: GAIL succeeds because it uses a discriminator to evaluate the long-term distribution of states, rather than just the immediate next step. This global view prevents the "drifting" that causes compounding errors.
  • Adversarial World Models: Because standard MBRL world models are trained to minimize one-step prediction error, they suffer from the same $O(H^2)$ quadratic error growth as BC. By using an adversarial objective to match the distribution of transitions, developers can build world models that are much more stable for long-term planning.
  • Complexity Trade-off: The paper introduces a "compatible coefficient" to highlight a trade-off: while a simpler discriminator in GAIL reduces estimation error, it might not be powerful enough to distinguish the expert from the agent. There is an optimal "Goldilocks" zone for discriminator complexity.

Empirical Results

The researchers evaluated their theories using standard MuJoCo benchmark tasks (HalfCheetah-v2, Hopper-v2, Walker2d-v2) with expert demonstrations generated by the Soft Actor-Critic (SAC) algorithm.

Relative performance of imitation learning algorithms across different discount factors.
  • Policy Performance: In experiments varying the discount factor $\gamma$ (and thus the effective horizon), BC’s performance plummeted as the horizon increased. In contrast, GAIL and its variants (like WGAIL) remained robust, matching the expert even at long horizons.
  • Environment Modeling: When training world models, the GAIL-style approach resulted in significantly lower policy evaluation errors across all three MuJoCo environments compared to the standard BC-style approach.
  • Generalization: The authors also demonstrated that GAIL can generalize well even with incomplete trajectories, provided the state-action occupancy measures are sufficiently covered in the training data.

Limitations and Future Work

While the paper establishes strong theoretical bounds, the analysis focuses primarily on the global optima of the objectives. It does not deeply explore the training stability or the specific convergence properties of the stochastic policy gradient descent used in practice. Additionally, the paper assumes the policy class is expressive enough to perfectly contain the expert (realizability). Future work could investigate scenarios where the imitator's neural network is significantly less capable than the expert's, or integrate these adversarial world models into a full "Dyna-style" MBRL loop to measure the final impact on sample efficiency.

Summary updated

BibTeX
@inproceedings{xu2020error,
  author = {Tian Xu and Ziniu Li and Yang Yu},
  title = {{Error Bounds of Imitating Policies and Environments}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=CEF_dvCyB4T},
}
Figure