Distributionally Robust Policy Evaluation under General Covariate Shift in Contextual Bandits

Yihong Guo, Hao Liu, Yisong Yue, Anqi Liu

Abstract

We introduce a distributionally robust approach that enhances the reliability of offline policy evaluation in contextual bandits under general covariate shifts. Our method aims to deliver robust policy evaluation results in the presence of discrepancies in both context and policy distribution between logging and target data. Central to our methodology is the application of robust regression — a distributionally robust technique tailored here to improve the estimation of conditional reward distribution from logging data. Utilizing the reward model obtained from robust regression, we develop a comprehensive suite of policy value estimators, by integrating our reward model into established evaluation frameworks, namely direct methods and doubly robust methods. Through theoretical analysis, we further establish that the proposed policy value estimators offer a finite sample upper bound for the bias, providing a clear advantage over traditional methods, especially when the shift is large. Finally, we designed an extensive range of policy evaluation scenarios, covering diverse magnitudes of shifts and a spectrum of logging and target policies. Our empirical results indicate that our approach significantly outperforms baseline methods, most notably in 90% of the cases under the policy shift-only settings and 72% of the scenarios under the general covariate shift settings.

Introduction

In contextual bandits, algorithms make decisions (actions) based on specific situations (contexts) to maximize rewards. A critical challenge in deploying these systems is Offline Policy Evaluation (OPE): estimating the performance of a new "target" policy using historical data collected by a different "logging" policy.

Reliable OPE is often hindered by Distribution Shift. This shift typically manifests in two ways:

  1. Policy Shift: The target policy selects actions differently than the logging policy.
  2. Context Shift: The distribution of contexts in the target environment differs from the logging environment (e.g., training on one demographic and deploying on another).

When both shifts occur simultaneously, it is termed General Covariate Shift (GCS). Traditional OPE methods, such as Inverse Propensity Scoring (IPS), often suffer from high variance when the target policy explores regions poorly covered by logging data. Conversely, Direct Methods (DM) that predict rewards can be heavily biased toward the logging distribution.

Illustration of General Covariate Shift (GCS) involving both context shift (Ps to Pt) and policy shift (β to π).

Methodology: Robust Regression for OPE

The core of this work is a novel family of estimators (DM-GCS, DR-GCS) built upon Robust Regression. Unlike standard empirical risk minimization, which minimizes error solely on logging data, this approach frames reward estimation as a minimax game between a predictor and an adversary.

Key Components

  • Minimax Optimization: The predictor aims to minimize loss while an adversary maximizes it over the target distribution, ensuring the model is prepared for the "worst-case" shifts.
  • Density Ratio ($W$): The ratio between source and target distributions is integrated into the learning process, highlighting "blind spots" where logging data is sparse.
  • Base Distribution ($f_0$): To prevent wild over-extrapolation in low-coverage areas, the model defaults toward a predefined conservative base distribution. This acts as a safety net, ensuring robustness.
The Robust Regression framework for reward estimation, incorporating density ratios and a base distribution.

The resulting robust reward model is "plug-and-play," compatible with both Direct Methods and Doubly Robust (DR) frameworks.

Experimental Evaluation

The researchers conducted a massive stress test using 9 UCI benchmark datasets (e.g., Glass, OptDigits, Letter), converted into contextual bandit problems. They simulated:

  • 360 policy shift scenarios
  • 1260 general covariate shift scenarios

These scenarios varied the magnitude of the shift to test the limits of OPE reliability.

Key Results and Insights

The proposed methods demonstrated significant improvements over traditional baselines:

  • Superior Performance: The "DM-PS" variants outperformed baselines in over 90% of policy-shift cases. In the more complex GCS settings, the methods were superior in 72% of scenarios.
  • Stability under Large Shifts: As the discrepancy between logging and target data increased, the performance gap widened. While traditional methods saw error spikes, the robust regression approach remained stable.
  • Theoretical Guarantees: The authors established finite sample upper bounds for bias, providing mathematical assurance that the estimators remain reliable even under significant distribution shifts.

Conclusion and Future Work

By shifting the focus from handling distribution discrepancies at the evaluation stage to the learning stage, this work provides a more resilient framework for OPE. While currently focused on Gaussian reward assumptions and single-step bandits, future work aims to extend these distributionally robust principles to multi-step Reinforcement Learning (RL) and scenarios with extreme context non-overlap.

Summary updated

BibTeX
@article{guo2024distributionally,
  author = {Yihong Guo and Hao Liu and Yisong Yue and Anqi Liu},
  title = {{Distributionally Robust Policy Evaluation under General Covariate Shift in Contextual Bandits}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=R7PReNELww},
}
Figure