Kernel Density Bayesian Inverse Reinforcement Learning

Aishwarya Mandyam, Didong Li, Jiayu Yao, Diana Cai, Andrew Jones, Barbara E. Engelhardt

TL;DR

KD-BIRL introduces a novel framework for Bayesian Inverse Reinforcement Learning that drastically reduces the amount of expert demonstration data needed to infer an agent's reward function. By leveraging conditional kernel density estimation (CKDE), the algorithm incorporates data from prior training tasks with known rewards to accelerate posterior concentration on a new test task. Furthermore, this work provides the first-ever theoretical guarantees of posterior consistency for a Bayesian IRL algorithm.

What Problem Does This Paper Address?

Inverse Reinforcement Learning (IRL) aims to deduce an agent's underlying reward function simply by watching them perform a task. Bayesian IRL takes this a step further by learning a probability distribution over possible reward functions, which allows researchers to quantify uncertainty—a feature that is absolutely vital in high-stakes domains like healthcare.

However, Bayesian IRL has a massive Achilles' heel: it typically requires an enormous amount of high-quality expert demonstration data to accurately narrow down (or "contract") the posterior distribution around the true reward function. In fields like clinical medicine or experimental biology, expert trajectories (e.g., patient treatment paths or cellular migration data) are incredibly scarce and expensive to collect. While meta-IRL approaches exist to handle multi-task settings, they are incapable of utilizing domains where the reward functions of prior training tasks are already known.

Methods

The authors introduce Kernel Density Bayesian Inverse Reinforcement Learning (KD-BIRL). The core innovation lies in how the likelihood function is calculated:

  1. Conditional Kernel Density Estimation (CKDE): Instead of using the traditional, computationally grueling method of calculating the optimal Q-value function ($Q^*$) for every single reward function sample during Markov Chain Monte Carlo (MCMC) iterations, KD-BIRL uses a non-parametric CKDE.
  2. Leveraging Prior Knowledge: The CKDE estimates the likelihood of a state-action pair given a candidate reward function by measuring its distance to a dataset of training tasks where both the expert demonstrations and the ground-truth reward functions are explicitly known.
  3. Feature-Based Scaling: To prevent the "curse of dimensionality" inherent to kernel density methods, the authors parameterize the reward function as a linear combination of weights and low-dimensional state-action features ($R(s,a) = w^\top \phi(s,a)$). For complex, continuous environments, they train a Variational Autoencoder (VAE) to learn this low-dimensional feature mapping ($\phi$).
  4. Posterior Sampling: Sampling is conducted via a Hamiltonian Monte Carlo (HMC) algorithm implemented in Stan.

Datasets

The algorithm was evaluated on two distinct simulation environments:

  • Gridworld: Discrete state spaces of varying sizes ($2\times2$, $5\times5$, and $10\times10$) used to evaluate how the method scales under standard reward parameterizations.
  • Simulated Sepsis Treatment Environment (Gymic): A highly challenging, continuous state-space environment modeling ICU patient vitals and demographics (46 physiological covariates, such as heart rate, glucose, and blood urea nitrogen). The action space consists of 24 discrete treatment combinations.

Key Insights and Ideas

  • Bypassing the MDP Loop: Traditional Bayesian IRL requires solving a Markov Decision Process (MDP) to find $Q^*$ at every single sampling step. KD-BIRL completely bypasses this computational bottleneck because its CKDE-based posterior distribution does not depend on $Q^*$.
  • Likelihood vs. Prior Transfer: Rather than trying to compress prior task knowledge into an informative prior distribution (which can introduce dangerous biases or reduce sensitivity to new data), KD-BIRL injects this knowledge directly into the likelihood function via cross-task data points.
  • A Theoretical Milestone: The paper bridges a long-standing gap in IRL literature by providing the first mathematical proof of asymptotic posterior consistency (Theorem 5.2), proving that the posterior measure will successfully contract to the true reward function's equivalence class as data approaches infinity.

Key Results

The primary evaluation metric used was Expected Value Difference (EVD), which measures the performance gap between a policy optimized on the true reward function versus one optimized on the inferred reward function (lower is better).

  • Superior Low-Data Performance: In the continuous Sepsis environment, KD-BIRL consistently achieved lower or comparable EVD with significantly fewer test demonstrations ($n < 1000$) compared to the baseline method, AVRIL (Approximate Variational Reward Imitation Learning).
  • Tighter Uncertainty Bounds: When AVRIL was given an informative prior from training tasks, it exhibited massive variance and high standard error. KD-BIRL, by contrast, maintained tight, highly concentrated posterior distributions around the true parameters.
  High EVD (Poor)  ▲
                   │      /─── AVRIL
                   │     /
                   │    /───── AVRIL (Informative Prior) [High Variance]
                   │   /
                   │  /─────── KD-BIRL (Ours) [Low Variance, Fast Convergence]
  Low EVD (Good)   │ └───►
                   └────────────────────────►
                     Few (n < 1000)      Many
                        Expert Demonstrations

Limitations and Future Work

  • Assumption of Expert Optimality: The framework assumes that all training task demonstrations are perfectly optimal. If the historical training data contains suboptimal or noisy behavior, the CKDE likelihood estimation accuracy degrades.
  • Feature Dependency: The success of the feature-based reward variant relies heavily on the assumption that the state-action features ($\phi$) perfectly capture all relevant information.
  • Future Directions: The authors suggest exploring alternative non-parametric density estimators to approximate the likelihood, such as diffusion models or Gaussian processes, which could potentially speed up the CKDE process or scale to even higher-dimensional reward functions.

Summary updated

BibTeX
@article{mandyam2024kernel,
  author = {Aishwarya Mandyam and Didong Li and Jiayu Yao and Diana Cai and Andrew Jones and Barbara E. Engelhardt},
  title = {{Kernel Density Bayesian Inverse Reinforcement Learning}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=B80WUNhTAw},
}
Figure