On the Effective Horizon of Inverse Reinforcement Learning

Yiqing Xu, Finale Doshi-Velez, David Hsu · DOI

TL;DR

This paper reveals that for Inverse Reinforcement Learning (IRL), using a shorter "effective horizon" than the true one can lead to better and faster results, especially with limited expert data. The authors provide a theoretical framework and experimental validation showing that this shorter horizon helps prevent overfitting by simplifying the learned policy class.

What Problem Does This Paper Address?

Inverse Reinforcement Learning (IRL) aims to infer an agent's reward function from expert demonstrations. A common approach involves using a forward reinforcement learning (RL) or planning step over a specific time horizon to find an optimal policy that matches the expert's behavior. The choice of this "time horizon" (or its equivalent, the discount factor) is crucial. However, it's often assumed that this horizon should match the ground truth. This paper questions that assumption, observing that a shorter effective horizon than the true one can surprisingly yield superior results, particularly when expert data is scarce. The core problem is understanding why this happens and providing a principled way to choose this effective horizon.

Methods

The authors propose a theoretical analysis of the relationship between the effective horizon and IRL performance. They formally analyze how the time horizon influences the complexity of the policy class that an IRL algorithm can learn. A shorter horizon leads to a simpler policy class, which helps mitigate overfitting when data is limited. Conversely, a longer horizon allows for more complex policies but increases the risk of overfitting with scarce data.

They derive theoretical bounds on the reward function estimation error and the resulting policy performance gap. These bounds decompose the error into two components: one related to reward estimation error (which increases with horizon) and another related to policy optimization error (which decreases as the horizon approaches the ground truth). This trade-off suggests an optimal intermediate horizon.

To validate their theory, they extend two popular IRL algorithms, Linear Programming IRL (LP-IRL) and Maximum Entropy IRL (MaxEnt-IRL), by incorporating cross-validation. This allows them to jointly learn both the reward function and the effective horizon.

Datasets

The authors evaluated their methods on four benchmark tasks:

  • Gridworld-simple: Sparse rewards, 10x10 states, 4 goals.
  • Gridworld-hard: Sparse rewards, 15x15 states, 6 goals.
  • Objectworld-linear: Denser rewards based on object features, linear relationship.
  • Objectworld-nonlinear: Denser rewards based on object features, non-linear relationship.

These tasks are adapted from existing benchmarks, varying in reward sparsity and complexity. The amount of expert data was varied as a percentage of the state space size.

Key Insights and Ideas

  • Shorter is Better (Sometimes): The most striking insight is that an effective horizon shorter than the ground truth can lead to better IRL performance, especially with limited data. This challenges the intuition that one should always aim for the true horizon.
  • Horizon as a Regularizer: The effective horizon acts as a form of regularization. A shorter horizon restricts the complexity of the policy class the IRL algorithm can learn, effectively preventing overfitting to limited expert data.
  • Trade-off is Key: The optimal effective horizon balances two competing errors: reward estimation error (worse with longer horizons due to overfitting) and policy optimization error (worse with shorter horizons due to limited temporal reasoning).
  • Joint Learning is Natural: The paper argues that it's more natural and effective to learn the reward function and the effective horizon jointly, rather than assuming a fixed, ground-truth horizon.

Key Results

  • Theoretical Bounds: The authors derived theoretical bounds showing that a shorter effective horizon improves generalization of the learned reward function with limited data.
  • Empirical Validation: Experiments with LP-IRL and MaxEnt-IRL on four tasks consistently showed that the optimal effective horizon (y or T) was less than the ground-truth horizon (yo or To).
  • Performance Improvement: The cross-validation approach for jointly learning the reward and horizon yielded policies with lower error counts compared to using the ground-truth horizon.
  • Data Efficiency: The benefits of a shorter effective horizon were more pronounced when expert data was scarce. As data increased, the optimal horizon tended to increase, but often remained below the ground truth.

Limitations and Future Work

  • Assumptions: The theoretical analysis relies on certain assumptions about the reward function (e.g., uniqueness of optimal actions) and the MDP structure.
  • Generalization: While the paper shows effectiveness on Gridworld and Objectworld tasks, further validation on more complex, real-world robotics or autonomous driving scenarios would be beneficial.
  • Algorithm Extensions: The authors suggest that their findings can inform the design of new IRL algorithms that explicitly consider the horizon as a learnable parameter. Future work could explore more sophisticated methods for jointly learning rewards and horizons.

Summary updated

BibTeX
@misc{xu2023effective,
  author = {Yiqing Xu and Finale Doshi-Velez and David Hsu},
  title = {{On the Effective Horizon of Inverse Reinforcement Learning}},
  year = {2023},
  eprint = {2307.06541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.06541},
}
Figure