Inferensys

Glossary

Doubly Robust Estimator

An off-policy evaluation method combining inverse propensity scoring with a direct reward model to provide unbiased estimates even if one of the two models is misspecified.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
OFF-POLICY EVALUATION

What is Doubly Robust Estimator?

A statistical method for off-policy evaluation that combines inverse propensity scoring with a direct reward model to produce unbiased policy value estimates, even when one of the two underlying models is misspecified.

A Doubly Robust Estimator is an off-policy evaluation method that combines inverse propensity scoring (IPS) with a direct method (DM) reward model. It provides an unbiased estimate of a target policy's value using historical data collected under a different logging policy. The estimator remains consistent if either the propensity score model or the outcome regression model is correctly specified, offering a critical safety net for model validation.

The estimator works by using the direct method as a baseline and applying inverse propensity weighting to the residual error between observed and predicted rewards. This construction corrects for the direct method's bias while reducing the high variance typically associated with pure IPS. In contextual bandit and dynamic retail hyper-personalization systems, doubly robust estimation enables safe, offline evaluation of new recommendation strategies before risking live traffic.

OFF-POLICY EVALUATION

Key Properties of Doubly Robust Estimators

The doubly robust (DR) estimator combines direct method (DM) and inverse propensity scoring (IPS) to provide unbiased policy evaluation when at least one of the two underlying models is correctly specified.

01

The Doubly Robust Property

The defining characteristic of the DR estimator is its double robustness: it yields an unbiased estimate of a new policy's value if either the propensity score model or the reward outcome model is correctly specified. It does not require both to be correct.

  • Safety net: If the logging policy propensities are accurate, IPS corrects for any bias in the reward model.
  • Variance reduction: If the reward model is accurate, it provides a low-variance baseline, and the IPS term corrects the residual bias.
  • Misspecification tolerance: Only fails when both models are simultaneously wrong, which is a strictly weaker condition than either IPS or DM alone.
02

Mathematical Formulation

The DR estimator for a target policy π_e, given logged data D collected under behavior policy π_b, is:

V̂_DR = (1/n) Σ [ r̂(x_i, a_i) + (I(a_i = π_e(x_i)) / π_b(a_i | x_i)) · (r_i - r̂(x_i, a_i)) ]

  • r̂(x, a): The predicted reward from the direct outcome model.
  • π_b(a|x): The propensity of the logging policy.
  • Correction term: The IPS weight is applied only to the residual (r - r̂), not the full reward, which dramatically reduces variance compared to pure IPS.
03

Variance Characteristics

DR estimators achieve lower variance than pure IPS by using the direct model as a control variate. The variance depends on the accuracy of the reward model.

  • Perfect reward model: If r̂(x, a) = E[r|x, a], the correction term has zero mean, and variance reduces to that of the DM estimator.
  • Imperfect reward model: Variance scales with the residual errors, but is still weighted by inverse propensities, so extreme propensity weights can still inflate variance.
  • Clipping propensities: In practice, propensities are often clipped to a minimum threshold (e.g., 0.01) to prevent variance explosion from near-zero probabilities.
04

Comparison to IPS and DM

DR sits at the intersection of two families of off-policy estimators, inheriting strengths from both:

  • Inverse Propensity Scoring (IPS): Unbiased but high-variance, especially when behavior and target policies diverge significantly.
  • Direct Method (DM): Low-variance but biased if the reward model is misspecified.
  • Doubly Robust: Unbiased if either component is correct, with variance typically between DM and IPS.
  • Switch-DR: An extension that dynamically chooses between DR and DM based on estimated variance to further optimize the bias-variance trade-off.
05

Practical Implementation Considerations

Deploying DR estimation in production bandit or recommendation systems requires careful engineering:

  • Propensity logging: Every decision must log the probability of the chosen action under the logging policy. This is non-negotiable.
  • Reward model training: The outcome model r̂(x, a) should be trained on a held-out dataset to avoid overfitting bias.
  • Cross-fitting: Use K-fold cross-fitting where the reward model for each fold is trained on data not used for evaluation, eliminating bias from overfitting.
  • Continuous monitoring: Track the effective sample size and variance of DR estimates to detect when the behavior policy has drifted too far from the target policy.
06

Applications in Bandit and RL Systems

DR estimators are the workhorse of safe, offline policy evaluation in production:

  • Contextual bandits: Evaluating a new exploration strategy before exposing real users to potentially suboptimal actions.
  • Recommender systems: Comparing candidate ranking models using historical click logs without an A/B test.
  • Dynamic pricing: Estimating revenue under a new pricing policy using data from the current pricing strategy.
  • Clinical trials: Adapting treatment assignment policies while maintaining unbiased estimates of treatment effects.
DOUBLY ROBUST ESTIMATION

Frequently Asked Questions

Clarifying the mechanics, advantages, and limitations of the doubly robust estimator for off-policy evaluation in contextual bandits and reinforcement learning.

A doubly robust estimator is an off-policy evaluation method that combines a direct method (DM) reward model with an inverse propensity scoring (IPS) correction term. It works by taking the direct method's predicted reward for a context-action pair and adding a correction term: the IPS-weighted difference between the observed reward and the predicted reward. Mathematically, for a target policy (\pi_e) and logging policy (\pi_b), the estimator is:

[V_{DR} = \frac{1}{N} \sum_{i=1}^{N} \left[ \hat{r}(x_i, a_i) + \frac{\pi_e(a_i|x_i)}{\pi_b(a_i|x_i)} (r_i - \hat{r}(x_i, a_i)) \right]]

This structure provides a safety net: if the direct model (\hat{r}) is correctly specified, the correction term converges to zero, yielding an unbiased estimate. If the propensity model is correctly specified, the IPS re-weighting cancels the bias from the direct model.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.