Contextual Policies Enable Efficient and Interpretable Inverse Reinforcement Learning for Populations

Ville Tanskanen, Chang Rajani, Perttu Hämäläinen, Christian Guckelsberger, Arto Klami

Introduction

Inverse Reinforcement Learning (IRL) is a powerful framework for uncovering the underlying motivations behind observed behaviors. By inferring the reward function an agent is maximizing, researchers can gain deep insights into user psychology or refine AI behavior in complex environments like video games. However, traditional IRL methods face a significant scalability challenge: they are computationally expensive, often requiring a full reinforcement learning (RL) cycle for every individual in a population. This "nested" optimization makes analyzing thousands of users practically impossible.

A Two-Stage Pipeline for Scalable IRL

To address this bottleneck, the authors propose a novel approach that leverages Contextual Reinforcement Learning (cRL) to decouple the expensive RL training from the IRL inference process.

1. Contextual RL Pre-training

The first stage involves training a single "universal" contextual policy, $\pi(s, w)$. In this formulation, $w$ represents a vector of weights for various interpretable sub-rewards (e.g., speed, safety, or specific game objectives). This policy is trained once to be optimal for any possible combination of these weights, effectively mapping out the entire space of potential behaviors before any human data is even processed.

2. Fast IRL Inference

Once the contextual policy is established, inferring an individual's preferences becomes a straightforward optimization task. By comparing a user's actual trajectory to the behaviors predicted by the contextual policy, the system can rapidly identify the weight vector $w$ that best explains the observed actions. This shift from solving a full RL problem to performing gradient-based optimization on a pre-trained model results in massive efficiency gains.

A universal contextual policy (left) can be specialized to infer distinct reward preferences for a population of users (right).

Experimental Validation

The researchers tested their framework in two distinct environments:

  • m-D Navigation Task: A synthetic environment designed to test the "identifiability" of rewards—how many distinct motivations the system can accurately distinguish.
  • Derk: A complex MOBA-style game. Using simulated populations with varying playstyles (e.g., aggressive vs. supportive), the authors demonstrated that the model could recover true reward weights with a high correlation coefficient (0.9) and successfully cluster players based on their gameplay logs.

Key Insights and Results

  • Efficiency: The proposed method achieved a 100x speedup compared to state-of-the-art adversarial IRL (AIRL), requiring only 1% of the environment interactions per user.
  • Interpretability: By using a linear reward structure based on human-understandable metrics, the inferred motivations remain transparent and actionable for designers.
  • Scalability: While the initial pre-training is computationally intensive (e.g., 11 hours for the Derk environment), the marginal cost of analyzing additional users is negligible, enabling the study of massive populations.

Limitations and Future Directions

While promising, the approach currently assumes "Boltzmann-rational" agents, whereas real human behavior is often noisier. Additionally, the method relies on domain experts to define the initial set of sub-rewards. Future work may explore automating sub-reward discovery and adapting the model to better handle the nuances of non-optimal human decision-making.

Summary updated

BibTeX
@article{tanskanen2024contextual,
  author = {Ville Tanskanen and Chang Rajani and Perttu Hämäläinen and Christian Guckelsberger and Arto Klami},
  title = {{Contextual Policies Enable Efficient and Interpretable Inverse Reinforcement Learning for Populations}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
}
Figure