SOPE: Spectrum of Off-Policy Estimators

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

In the world of Reinforcement Learning (RL), evaluating a new policy without actually running it—known as Off-Policy Evaluation (OPE)—is a high-stakes necessity . Whether in healthcare or robotics, we often can't afford to "test in production." However, OPE is plagued by a classic dilemma: do you want an estimate that is perfectly unbiased but wildly noisy, or one that is stable but potentially wrong?

In their paper "SOPE: Spectrum of Off-Policy Estimators," Christina J. Yuan and colleagues introduce a framework that refuses to accept this binary choice. By creating a tunable spectrum between the two dominant OPE paradigms, they allow researchers to find the "Goldilocks" zone of evaluation.

TL;DR

The authors introduce $SOPE_n$, a new family of off-policy evaluation estimators that bridges the gap between high-variance trajectory importance sampling (PDIS) and potentially biased distribution-based importance sampling (SIS). By tuning a single parameter $n$, users can navigate the bias-variance trade-off to achieve a lower mean-squared error than either traditional method alone.

What Problem Does This Paper Address?

OPE typically relies on Importance Sampling (IS) to correct for the fact that our data was collected by a "behavior policy" ($\pi_b$) rather than the "evaluation policy" ($\pi_e$) we care about.

There are two main ways to do this:

  1. Trajectory-based (PDIS): This looks at the entire sequence of actions. It is unbiased but suffers from the "curse of horizon"—as the task gets longer, the variance of the estimate explodes exponentially.
  2. Distribution-based (SIS): This looks at the average probability of being in a certain state-action pair. It has much lower variance for long horizons but requires estimating complex distribution ratios. If your model for these ratios is slightly off, your final evaluation becomes biased.

Until now, researchers usually had to pick one or the other. There was no formal way to combine the unbiased nature of trajectory methods with the stability of distribution methods.

Methods

The core innovation is the $SOPE_n$ estimator. The authors use the Markov property to split a trajectory into two parts.

For any reward $R_t$ at time $t$:

  • They use distribution ratios to account for the probability of reaching a state $n$ steps in the past ($S_{t-n}$).
  • They use action likelihood ratios (traditional IS) for the remaining $n$ steps leading up to the reward.
Illustrating how PDIS, $SOPE_n$, and SIS handle the probability of a reward.

By varying $n$, you move along a spectrum:

  • At $n=0$, you get pure SIS (maximum reliance on distribution models, lowest variance).
  • At $n=L$ (the full horizon), you get pure PDIS (zero reliance on distribution models, zero bias).

The authors also extend this logic to create Weighted ($W-SOPE_n$) and Doubly-Robust ($DR-SOPE_n$) versions, which incorporate learned value functions to further reduce variance.

Datasets

The researchers evaluated their estimators using the Caltech OPE Benchmarking Suite (COBS) on three distinct environments:

  • Graph Domain: A discrete "two-chain" environment designed to test how estimators handle stochastic transitions.
  • Toy Mountain Car: A simplified, tabular version of the classic control problem.
  • Mountain Car: The standard continuous version from OpenAI Gym, requiring function approximators (like neural networks) to estimate distribution ratios.

Key Insights and Ideas

  • The $n$-step Analogy: The authors draw a brilliant parallel to $n$-step returns in standard RL. Just as $n$-step TD methods bridge the gap between Monte Carlo (high variance) and TD(0) (high bias), $SOPE_n$ bridges the gap between trajectory and distribution importance sampling.
  • "Backing Up" Probabilities: In traditional RL, we "back up" rewards from the future to the present. In $SOPE_n$, we are essentially "backing up" the probability of the history.
  • U-Shaped Error Curves: The most important insight is that the optimal value for $n$ is rarely at the endpoints. There is almost always an intermediate $n$ that provides a better Mean Squared Error (MSE) than either PDIS or SIS.
Figure 3: On the left side of the figure, we show an illustration the SOPEn spectrum of estimators. For the purpose of this illustration, consider that only at the last time step there is a non-zero reward RL. The SOPEn spectrum allows for control of how much an estimate depends on distribution ratios vs action likelihood ratios. Notice that SOPE0 results in SIS, SOPEL results in PDIS estimator, and other values of n result in new interpolated estimators. As an analogy, consider the backup-diagram [Sutton and Barto, 2018] for the n-step q-estimate as illustrated on the right-hand side of the solid vertical line. Notice that in the n-step q-estimate, returns are backed up from possible future outcomes, whereas in the n-step interpolation estimators the probabilities are ‘backed-up’ from the possible histories. (In the diagram, bias-variance characterization of PDIS and SIS is based on typical practical observations [Voloshin et al., 2019, Fu et al., 2021], however it is worth noting that SIS is not biased when oracle density ratios are available, and there are also edge cases, particularly for short horizon problems, where SIS can have higher variance than PDIS [Liu et al., 2020, Metelli et al., 2020]).

Key Results

  • Superior Performance: In both the Graph and Mountain Car domains, $SOPE_n$ achieved lower MSE than the baseline endpoints.
  • Empirical Bias-Variance Trade-off: The experiments confirmed the theory: as $n$ increases, the "Bias Squared Estimate" drops while the "Variance Estimate" climbs.
  • Robustness to Mismatch: Even when the behavior and evaluation policies were significantly different (high policy mismatch), the interpolated estimators remained effective at finding a lower-error middle ground.

Limitations and Future Work

  • Selecting $n$: Currently, $n$ is a hyperparameter that must be chosen by the user. The authors acknowledge that automated strategies for selecting $n$ (perhaps similar to $\lambda$-trace methods in RL) are a vital next step.
  • Density Estimation Dependency: While $SOPE_n$ reduces reliance on distribution ratios compared to SIS, it still requires an estimate of $w(s,a)$. If the function approximator used for this estimate is extremely poor, the benefits of the spectrum may be limited.
  • Safety-Critical Deployment: The authors caution that while $SOPE_n$ improves estimation, OPE in high-stakes medical or safety domains should still be paired with high-confidence bounds to ensure safety.

For more details, you can find the full paper and code at the Pearl-UTexas/SOPE GitHub repository.

Summary updated

BibTeX
@inproceedings{yuan2021sope,
  author = {Christina J. 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