SOPE: Spectrum of Off-Policy Estimators

Christina Yuan, Yash Chandak, Stephen Giguere, Philip S. Thomas, Scott Niekum

Evaluating a new AI policy without actually running it—known as Off-Policy Evaluation (OPE)—is a holy grail in high-stakes fields like healthcare and robotics. In these domains, you often have historical data collected from an old policy (the "behavior" policy), and you want to estimate how a new "evaluation" policy would perform before deploying it in the real world.

Traditionally, researchers have been stuck between two extremes: methods that are mathematically accurate but wildly unstable, and methods that are stable but often biased. A paper from researchers at UT Austin and UMass Amherst, titled "SOPE: Spectrum of Off-Policy Estimators," proposes a way to bridge this gap by creating a continuous spectrum of estimators that lets you tune the balance between bias and variance.

The Curse of Horizon in OPE

In reinforcement learning, OPE is notoriously difficult because of the "curse of horizon." When evaluating long sequences of actions, estimators typically fall into one of two categories:

  1. Trajectory-based Importance Sampling (IS / PDIS): This method looks at entire sequences of actions. While it is mathematically unbiased, its variance grows exponentially with the length of the task. If an agent takes 100 steps, the cumulative "weight" assigned to a trajectory can become astronomically large or shrink to zero, making the estimate practically useless.
  2. Stationary Distribution Importance Sampling (SIS): To fix the variance issue, newer methods look at the average frequency of state-action pairs rather than specific, full-length sequences. This marginalization is much more stable, but it requires estimating "density ratios"—a difficult optimization problem. If your model of these ratios is even slightly off, your final evaluation becomes permanently biased.

Until now, these were seen as two distinct, mutually exclusive choices. SOPE addresses the lack of a middle ground.

The SOPE Method: $n$-Step Interpolation

The core innovation of SOPE is the $n$-step interpolation. The authors realized that the Markov property allows us to split a trajectory into two distinct parts, blending the strengths of both IS and SIS.

Comparison of PDIS, SOPE, and SIS

For any reward received at time $t$, the trajectory is split at time $t-n$:

  • The Distant Past (Marginalized): For steps more than $n$ steps ago, SOPE uses distribution ratios (the SIS approach). This "marginalizes" the history, keeping variance low by relying on state-action visitation distributions.
  • The Recent Past (Trajectory): For the $n$ steps immediately preceding the reward, SOPE uses action likelihood ratios (the IS approach). This preserves the specific causal sequence of recent events, reducing reliance on potentially flawed density ratio models.

By varying the parameter $n$, you move along a continuous spectrum:

  • At $n = 0$, you get pure SIS (maximum stability, potential bias).
  • At $n = L$ (the full horizon), you get pure PDIS (zero bias, maximum variance).

The authors also extend this logic to create Doubly Robust (DR-SOPE) versions, which incorporate a model of the environment to further reduce variance, and Weighted (W-SOPE) versions for better numerical consistency.

Key Insights: The "Backup" Analogy

A brilliant conceptual leap in the paper is drawing a parallel between OPE estimators and $n$-step temporal difference (TD) learning.

The spectrum of estimators compared to forward backups

Just as $n$-step returns in standard RL look forward $n$ steps into the future to estimate value (interpolating between a biased one-step backup and an unbiased Monte-Carlo return), SOPE looks $n$ steps into the past to estimate the probability of reaching the current state.

This parameter $n$ acts as a literal knob for the bias-variance trade-off. As $n$ increases, the estimator relies less on potentially flawed density ratio models (reducing bias) but becomes more sensitive to specific action sequences (increasing variance).

Empirical Results and Trade-offs

The researchers evaluated SOPE using the Caltech OPE Benchmarking Suite (COBS) on environments like a synthetic Graph Domain and the classic Mountain Car task.

  • The U-Shaped Curve: In experiments, the Mean Squared Error (MSE) often follows a U-shape when plotted against $n$. This proves that the "best" estimator is frequently somewhere in the middle of the spectrum, outperforming both the standard IS and SIS endpoints.
  • Empirical Trade-off: On the Mountain Car domain, as $n$ increased, the "Bias Squared" estimate dropped significantly while the "Variance" estimate climbed, perfectly validating the theoretical spectrum.
  • Robustness to Data Size: Even as the amount of historical data (batch size) increased, the interpolated estimators consistently maintained an edge over the traditional endpoints in several scenarios.

Limitations and Future Work

The biggest remaining challenge is the automated selection of $n$. Currently, a researcher has to experiment to find the best $n$ for their specific problem. The authors suggest that future work could involve "$\lambda$-trace" methods (similar to TD($\lambda$)) to automatically combine multiple $n$ values or learn the optimal stopping point dynamically.

Additionally, while SOPE mitigates the bias of SIS, it still relies on having some estimate of the density ratio for the distant past. If the initial density ratio model is extremely poor, even a well-tuned $n$ might struggle to produce an accurate evaluation. Nonetheless, SOPE provides a powerful new framework for navigating the fundamental trade-offs in Off-Policy Evaluation.

Summary updated

BibTeX
@inproceedings{yuan2021sope,
  author = {Christina Yuan and Yash Chandak and Stephen Giguere and Philip S. Thomas and Scott Niekum},
  title = {{SOPE: Spectrum of Off-Policy Estimators}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=Mfi0LZmFB5a},
}
Figure