Estimate a policy from logged actions only where identification permits
Derive inverse propensity and doubly robust estimators with explicit support, observation, and nuisance-model assumptions.
On this page
The question for today
What you’ll understand
- Compute IPS and doubly robust contributions for a tiny log.
- State positivity, consistency, and conditional identification assumptions.
- Explain why clipping and reward modeling do not create missing support.
Historical serving logs reveal the reward of the action that was taken, not the rewards of all actions that could have been taken. Evaluating another policy therefore requires more than rerunning its scores on the same requests. The logging policy must have offered the target policy’s actions with known or estimable probabilities, and the observed reward must represent the relevant action outcome. Inverse propensity and doubly robust estimators use those probabilities and reward predictions to reweight evidence. Their names describe statistical constructions, not permission to infer outcomes for actions the data never supported.
Identification comes before the estimator
Let a context X describe information available before choosing an action A, and let R(a) be the reward that would follow action a. Consistency links the observed reward to the chosen action’s potential reward. A randomized logging policy can make action choice independent of potential rewards conditional on the logged information. Observational logs need a conditional no-unmeasured-confounding assumption instead; unlogged factors that influence both action choice and reward can invalidate the same formulas.
Positivity requires the logger to choose every action the target policy may choose in each relevant context. A deterministic logger lacks that support for alternative actions unless further modeling assumptions are introduced, and a reward model’s extrapolation is not nonparametric identification. Also specify the context distribution, reward horizon, missingness, and interference conditions. A one-step contextual-bandit estimator does not automatically evaluate a policy whose actions change future contexts and long-term trajectories.
A reward model supplies a baseline, not new observations
Doubly robust evaluation starts with the reward model’s target-policy prediction and corrects it using the observed action’s weighted residual. When the propensity model is correct, the residual correction removes reward-model bias in expectation under the identification conditions. When the reward model is correct, residuals have conditional mean zero, supporting robustness to some propensity misspecification. With estimated nuisance models, consistency and uncertainty need the relevant fitting, convergence, and sample-splitting conditions; the slogan alone is not a finite-sample guarantee.
Known logged randomization probabilities are especially valuable because they document the action mechanism rather than reconstructing it later from an outcome-contaminated dataset. Preserve probabilities at decision time, including eligibility and action-set restrictions. If the logger adapts over time, its conditional probability may depend on prior history as well as current context. Use that actual conditional probability and an appropriate adaptive-analysis method rather than replacing it with an overall action frequency.
Diagnose weight concentration and outcome quality
Small logging probabilities create large weights and high variance. Inspect support by context and action, tail weights, reward completeness, and the contribution of individual records. Weight clipping or self-normalization can improve stability but generally changes finite-sample bias properties; report the exact estimator and sensitivity to those choices. A precise-looking number can be dominated by very few rare exploratory actions, so sample size alone is not a reliable information measure.
Keep policy selection separate from final evaluation. Choosing the best policy among many on the same noisy log creates selection optimism, even if each fixed policy estimator is valid. Use held-out evaluation or a method that accounts for the search. Finally, an offline estimate concerns the specified logged-context population and reward definition; a live experiment is still needed when deployment changes exposure, interference, latency, or the distribution of future user behavior.
Work it through
IPS and doubly robust values on four logged decisions
All four records have the same context. The logger independently chooses A or B with probability 0.5 each; observed actions are (A,B,A,B) and rewards (1,0,0,1). The target always chooses A. Use a reward model fixed independently of these records with m(A)=0.4 and m(B)=0.6.
Target-to-logger weights are (2,0,2,0). IPS reward contributions are (2,0,0,0), averaging to 2/4=0.5. B rewards cannot directly stand in for the missing A rewards on those records.
The target-policy model baseline is 0.4 on each row. Weighted residual corrections are (2(1−0.4),0,2(0−0.4),0)=(1.2,0,−0.8,0). DR row contributions are therefore (1.6,0.4,−0.4,0.4).
Their sum is 2 and mean 0.5. A negative individual contribution is possible even with rewards in [0,1]; the estimator is not a per-row probability. Agreement in this tiny realization does not establish small uncertainty or rescue a violated identification assumption.
Both estimators equal 0.5 for this log. Their interpretation still depends on logged probabilities, supported actions, consistent outcomes, and the specified context population.
The living notebook
Explore the model
Interactive lab · probability
Zero logging support cannot generate an action observation
Reset, set Success probability p to 0 and Trials n to 10. Predict count zero with probability 1 before Step. Reset, set p to 0.5 and n to 10; predict mean count 5 and probability of zero observations 1/1024 before Step. Playback highlights exact binomial masses rather than drawing a log. This only illustrates action-observation support, not policy-value estimation.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forPositive support differs from guaranteed observations in a finite sample; zero support cannot be repaired by reweighting.
Pause & reason
Check your understanding
Your turn
Try it yourself
For one logged A action with reward 1, logging probability μ(A)=0.25, and an always-A target, calculate the IPS contribution. With fixed m(A)=0.6, calculate its DR contribution.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The weight is π/μ=1/0.25, and DR adds a weighted residual to the target model baseline.
Compare with the solution
IPS contribution is 4×1=4 reward units. DR contribution is 0.6+4(1−0.6)=2.2. These are individual estimator contributions, not probabilities constrained to [0,1]. A full policy estimate averages over the declared sample and needs uncertainty analysis; clipping these values would change the estimator and its bias properties.
Keep the idea
Take it with you
- Identification requires supported actions and a defensible observation mechanism.
- DR combines target predictions with weighted residual corrections.
- Estimated nuisances, concentrated weights, and policy selection require additional care.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.