Statistically Efficient Off-Policy Policy Gradients

Nathan Kallus, Masatoshi Uehara

Introduction

In many real-world Reinforcement Learning (RL) scenarios—such as healthcare or industrial control—agents cannot explore their environments freely due to safety or cost constraints. Instead, they must learn from "off-policy" data: logs of actions taken by a different, older policy.

The standard tool for optimization in RL is the Policy Gradient (PG). However, estimating these gradients from off-policy data is notoriously difficult, often falling into two traps:

  1. High Variance: Methods like REINFORCE use importance sampling, where errors and variance explode exponentially as the time horizon ($H$) increases. This is known as the "curse of horizon."
  2. Bias: Other methods simplify the problem by ignoring the "state distribution mismatch" (the fact that the data-collection policy visits different states than the target policy), leading to biased gradients and poor convergence.

This paper introduces EOPPG (Efficient Off-Policy Policy Gradient), a new method for estimating policy gradients from off-policy data that achieves the theoretical limit of statistical efficiency. By leveraging the Markov property, EOPPG breaks the curse of horizon, turning an exponential error growth into a manageable polynomial one.

Methods

The authors utilize semiparametric efficiency theory to derive the "Efficient Influence Function" (EIF) for policy gradients, which represents the gold standard for an estimator's variance.

EOPPG acts as a meta-algorithm that plugs estimates of "nuisance functions" into the EIF formula. These nuisances include the Q-function ($q$), the state-action density ratio ($\mu$), and their respective gradients ($d^q$ or $\nabla q$, and $d^\mu$ or $\nabla \mu$).

Comparison of policy gradient estimators.

To ensure stable estimation:

  • Cross-Fitting: The data is split into $K$ folds to avoid overfitting. Nuisance functions are trained on one fold and used to estimate gradients on another.
  • Recursive Nuisance Estimation: The authors derive new Bellman-like equations to estimate the gradients of the Q-function and density ratios, allowing for more stable estimation than simple Monte Carlo methods.

Key Insights and Ideas

The Markov Advantage

The "curse of horizon" (exponential error) is unavoidable if one assumes the environment is non-Markovian (NMDP). However, by explicitly utilizing the Markov Decision Process (MDP) property, the authors prove the error bound can be reduced to a polynomial function of the horizon ($\Theta(H^4/n)$). EOPPG is specifically designed to hit this theoretical lower bound of variance, avoiding the wasted information typical of standard off-policy PG estimators.

3-Way Double Robustness

A significant theoretical contribution of EOPPG is its unique "3-way double robustness" to model errors. While standard doubly robust methods in RL protect against either the Q-function or the density ratio being wrong, this paper identifies a 3-way structure.

Venn diagram illustrating 3-way double robustness.

The estimator remains consistent if any of three specific pairs of the four nuisance models ($\mu, q, d^\mu, d^q$) are correct. This provides multiple "safety nets" against model misspecification, making the algorithm highly resilient in practice.

Key Results

Using a synthetic 1D continuous environment (with continuous states/actions and quadratic rewards) to analytically verify the estimator:

  • Lower MSE: EOPPG consistently demonstrated lower Mean Squared Error (MSE) in gradient estimation compared to REINFORCE and standard off-policy PG, particularly as sample sizes increased.
  • Faster Convergence: When applied to policy optimization, EOPPG reached lower "regret" (the difference between the learned and optimal policy) faster than baseline methods.
  • Polynomial Regret: The authors proved a regret bound of $O(H^2/\sqrt{n})$, confirming that the method scales polynomially with task length—a major improvement over importance-sampling-based methods that scale exponentially ($O(C^H)$).

Limitations and Future Work

While theoretically sound, EOPPG requires estimating four distinct nuisance functions. In complex, high-dimensional environments, training these models accurately could be computationally expensive. Furthermore, practical performance depends heavily on the quality of the regression models used for these nuisances. A key next step for future work is implementing EOPPG within large-scale deep RL frameworks to evaluate its performance on high-dimensional visual inputs or complex robotics tasks.

Summary updated

BibTeX
@inproceedings{kallus2020statistically,
  author = {Nathan Kallus and Masatoshi Uehara},
  title = {{Statistically Efficient Off-Policy Policy Gradients}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=dRbcGaf8GPb},
}
Figure