Bayesian Counterfactual Risk Minimization

Ben London, Ted SandlerICML 2019

Summary: This paper introduces a Bayesian framework for learning from logged bandit feedback, moving beyond traditional frequentist approaches. By applying PAC-Bayesian analysis, the authors derive a novel "Logging Policy Regularization" (LPR) technique that keeps a new policy close to the one that generated the data. The result is a method that is simpler, faster, and often more accurate than state-of-the-art variance-regularization methods.

The Challenge of Counterfactual Risk Minimization

In many industrial settings—like recommendation engines or ad placement—we want to improve our decision-making "policy" using logs from the past. This is known as Counterfactual Risk Minimization (CRM) or offline policy optimization.

The challenge is two-fold:

  1. Incomplete Feedback: We only know the reward for the action the old system actually took, not for the actions it didn't take.
  2. Selection Bias: The data is biased toward the choices of the old "logging policy."

Standard techniques use Inverse Propensity Scoring (IPS) to correct this bias, but IPS suffers from massive variance when the new policy differs significantly from the old one. Previous solutions (like the POEM algorithm) used complex frequentist variance-based regularization to keep the new policy in check. This paper asks: Can we achieve the same stability more elegantly using Bayesian principles?

A Bayesian Approach to CRM

The authors reframe CRM through the lens of PAC-Bayesian analysis. Instead of just learning a single best policy, they consider a distribution over policies (a posterior) and compare it to a starting point (a prior).

  • The Prior as the Logging Policy: The core insight is treating the logging policy not just as a source of bias, but as an informative prior. If the logging policy was reasonably good, the new policy shouldn't stray too far from it without strong evidence.
  • Logging Policy Regularization (LPR): Using a class of "Mixed Logit Models," the authors prove that the complexity penalty (KL divergence) in their Bayesian bound simplifies to the $L_2$ distance between the parameters of the new policy and the logging policy.
  • Two-Step Learning for Unknown Logs: If the parameters of the logging policy are unknown (common in legacy systems), the authors propose a two-step process: first, "reverse engineer" the logging policy from the observed actions, then use those learned parameters to regularize the training of the new policy.
  • Convex Objective: They derive a weighted negative log-likelihood (WNLL-LPR) objective that is convex, ensuring global convergence and easy implementation using standard optimization tools like AdaGrad.

Experimental Setup

The authors evaluated their approach using a "supervised-to-bandit" conversion on two standard image classification benchmarks: Fashion-MNIST (70,000 grayscale images of apparel) and CIFAR-100 (60,000 color images across 100 categories).

To simulate the bandit setting, they trained a small "logging policy" on a tiny subset of data, used it to select actions (labels) for the rest of the dataset, and only revealed the reward (1 if correct, 0 if wrong) for those specific selections.

Key Insights and Results

  • The Logging Policy is a Safety Net: Standard $L_2$ regularization pulls parameters toward zero (a uniform/random policy). LPR pulls them toward the logging policy. If the logging policy is better than random, LPR provides a much more intelligent starting point.
  • Simplicity Wins: Variance regularization requires calculating the sample variance of rewards, which is computationally expensive and makes the optimization landscape "bumpier." LPR achieves similar stability by simply penalizing the distance from the old parameters.
Test reward comparison between IPS-L2 and IPS-LPR across varying logging policy accuracies (inverse temperature).
  • Superiority over $L_2$: On both datasets, LPR consistently outperformed standard $L_2$ regularization. As shown in the figure above, as the logging policy became more accurate (higher inverse temperature $\epsilon$), the gap between LPR and $L_2$ widened.
  • Competitive with State-of-the-Art: LPR performed as well as, or better than, the more complex POEM algorithm. On the challenging CIFAR-100 task, LPR methods significantly outperformed the logging policy, while frequentist baselines often struggled to even match it.
  • Efficiency: The LPR methods were approximately 25% faster to train than POEM because they only require a single pass over the data per epoch and use simpler gradient calculations.

Limitations and Future Work

  • The "Better than Random" Assumption: LPR relies on the logging policy being an informative prior. If the logging policy is actually worse than random guessing, LPR could theoretically hurt performance.
  • Fixed Variance: In the experiments, the authors fixed the posterior variance ($\sigma^2$) to a small value for simplicity. While the theory allows for optimizing this variance, the practical impact of doing so remains an area for further exploration.
  • Complex Covariances: The current work uses isotropic (simple) covariances. Future research could investigate whether more complex covariance structures in the Bayesian prior could capture more nuanced relationships between actions.

Summary updated

BibTeX
@inproceedings{london2019bayesian,
  author = {Ben London and Ted Sandler},
  title = {{Bayesian Counterfactual Risk Minimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
}
Figure