Inverse Contextual Bandits: Learning How Behavior Evolves over Time

Alihan Hüyük, Daniel Jarrett, Mihaela van der Schaar

Understanding a decision-maker’s priorities by observing their behavior is critical for transparency and accountability in high-stakes domains like healthcare and public policy. However, human decision-making is rarely stationary. As new research emerges and guidelines shift, professionals update their internal "reward functions"—their priorities—to reflect this new knowledge. For example, the criteria for matching liver donors to recipients have evolved significantly over the last 25 years.

Standard Inverse Reinforcement Learning (IRL) struggles in these environments because it typically assumes that observed behavior is both optimal and unchanging. Applying standard IRL to a learning agent yields a blurred, average policy that represents neither their initial starting point nor their eventual expertise.

To address this gap in descriptive modeling, researchers have introduced Inverse Contextual Bandits (ICB), a framework designed to recover the trajectory of an agent's internal beliefs over time, allowing us to audit how clinical practices or economic policies actually change in response to new information.

The ICB Framework

The authors formalize the ICB problem using a graphical model. In this setup, an agent’s internal beliefs ($\beta$) and the environment's true rewards ($\rho^*$) are treated as latent (hidden) variables. These must be inferred from the observed contexts ($x$) and the actions ($a$) taken by the agent.

Graphical Model for ICB. The goal is to infer the red latent variables (beliefs and true rewards) from the blue observed variables (contexts and actions).

To solve this inference problem, the paper proposes two algorithmic approaches:

  1. Bayesian ICB (B-ICB): A parametric approach assuming the agent is a "rational learner" who updates their beliefs via standard Bayesian rules. It utilizes an Expectation-Maximization (EM) style algorithm, employing Markov Chain Monte Carlo (MCMC) to sample the hidden belief trajectories.
  2. Nonparametric Bayesian ICB (NB-ICB): A more flexible approach that does not assume a specific, rational update rule. Instead, it models the belief trajectory as a Gaussian Process (specifically a Wiener process). This assumes beliefs evolve smoothly over time but accommodates more complex, non-Bayesian learning behaviors.

Key Insights: Descriptive Auditing

Most traditional IRL research is prescriptive—it attempts to learn the best policy in order to replicate it. ICB, conversely, is descriptive. It serves as an investigative tool for auditing, helping policymakers determine if a new guideline actually changed on-the-ground behavior as intended.

A major advantage of the ICB approach is information sharing. Treating individual time steps as independent is highly data-inefficient. By modeling the trajectory of learning (either through Bayesian updates or a Gaussian Process prior), ICB algorithms share information across time steps, leading to vastly more accurate belief recovery. Furthermore, the NB-ICB method is robust enough to capture non-monotonicity; it can track "regressing" agents who might lose knowledge or become less effective over time, a significant hurdle for methods that assume continuous improvement.

Real-World Validation: The History of Liver Transplants

The researchers evaluated these methods using the OPTN dataset, a real-world registry from the Organ Procurement & Transplantation Network covering US liver transplantations from 1995 to 2020.

The results demonstrated that ICB can successfully "reverse-engineer" the history of medical practice. When applied to the OPTN data, the NB-ICB model recovered shifts in feature importance that perfectly aligned with major historical policy changes. Most notably, the model detected the exact behavioral shifts corresponding to the introduction of the MELD (Model for End-Stage Liver Disease) score in 2002.

Relative Feature Importances over Time. The shifts in importance for Creatinine and INR align with the introduction of the MELD score and subsequent policy revisions.

In addition to the real-world data, the authors validated the models using a semi-synthetic environment (real patient features combined with simulated agents using known learning strategies). Quantitatively, both B-ICB and NB-ICB significantly outperformed baselines (like B-IRL or T-REX) in recovering the agent's internal weights, especially for non-stationary agents. B-ICB was even able to extrapolate beyond suboptimal demonstrations to infer the true underlying reward function of the environment better than standard IRL methods.

Limitations and Future Directions

Currently, this work is focused on the contextual bandit setting, where an agent's actions do not affect future states. While this perfectly suits the organ allocation problem, many real-world scenarios are full Reinforcement Learning problems where actions have cascading, long-term consequences. Generalizing ICB to handle arbitrary transition dynamics is a primary direction for future research.

Additionally, the current model assumes linear reward functions to maintain interpretability—a standard practice in clinical scoring systems like MELD. Extending this framework to non-linear reward representations could capture more nuanced human behaviors, though likely at the cost of some explainability.

Summary updated

BibTeX
@inproceedings{huyuk2022inverse,
  author = {Alihan Hüyük and Daniel Jarrett and Mihaela van der Schaar},
  title = {{Inverse Contextual Bandits: Learning How Behavior Evolves over Time}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=GcoP5ASUchp},
}
Figure