Inferensys

Glossary

Inverse Propensity Scoring (IPS)

An off-policy estimator that corrects for selection bias in logged bandit data by re-weighting observed rewards by the inverse probability of the action being taken by the logging policy.
Data scientist working on AI bias mitigation on laptop, fairness metrics visible, casual technical session.
OFF-POLICY EVALUATION

What is Inverse Propensity Scoring (IPS)?

Inverse Propensity Scoring (IPS) is a statistical method for unbiased off-policy evaluation that corrects for selection bias in logged data by re-weighting observed outcomes by the inverse probability of the logging policy selecting that action.

Inverse Propensity Scoring (IPS) is an off-policy estimator that corrects for the selection bias inherent in logged bandit feedback. Because historical data only contains rewards for actions a previous logging policy chose, naive averaging produces biased estimates. IPS corrects this by re-weighting each observed reward by the inverse probability of that action being selected under the logging policy, creating an unbiased estimate of a new target policy's expected performance.

The core mechanism relies on importance sampling: if a logging policy chose an action with probability 0.1, that observation receives a weight of 10 to represent the nine unobserved counterfactuals. While unbiased, IPS suffers from high variance when logging and target policies diverge significantly. Practical implementations often use clipped weights or the Doubly Robust Estimator to balance bias-variance trade-offs, making IPS foundational for safely evaluating new personalization models without risky live deployment.

OFF-POLICY ESTIMATION

Key Properties of IPS

Inverse Propensity Scoring (IPS) is a foundational off-policy estimator that corrects for selection bias in logged bandit data. By re-weighting observed rewards by the inverse probability of the action being taken by the logging policy, it provides an unbiased estimate of a target policy's performance without deploying it live.

01

Unbiased Estimation Under Known Propensities

IPS provides a statistically unbiased estimate of a target policy's value when the logging policy's action probabilities are known and non-zero for all actions the target policy might select. This property is critical for safe, offline model validation.

  • Mechanism: Reweights each observed reward by 1 / π_logging(action | context)
  • Requirement: Full knowledge of the logging policy's probability distribution
  • Failure Mode: Bias is introduced if propensities are estimated rather than recorded exactly
Unbiased
Statistical Property
02

Handling the Exploration-Exploitation Trade-off

IPS enables rigorous counterfactual evaluation of policies that exploit aggressively, even when the data was collected under a randomized or exploratory logging policy. This decouples data collection from evaluation.

  • Exploration data can be reused to evaluate a purely exploitative target policy
  • Variance increases as the target policy diverges from the logging policy
  • Practical use: Evaluate a deterministic production policy on data collected during an A/B test
03

The Variance Problem and Clipping

The primary weakness of IPS is high variance, especially when the logging policy assigns a very small probability to an action the target policy favors. The importance weight 1/π can become extremely large, dominating the estimate.

  • Weight clipping: Capping importance weights at a threshold M introduces bias but dramatically reduces variance
  • Self-normalization: Dividing by the sum of weights stabilizes estimates
  • Effective sample size: Often much smaller than the actual dataset due to weight concentration
04

Propensity Overlap Requirement

For IPS to be valid, the logging policy must have common support with the target policy. Every action the target policy might take must have a non-zero probability under the logging policy.

  • Violation: If π_target(a|x) > 0 but π_logging(a|x) = 0, the estimator is undefined
  • Practical implication: Logging policies must maintain some exploration over the full action space
  • Mitigation: Use epsilon-greedy or Thompson Sampling during data collection to ensure full support
05

IPS vs. Direct Method vs. Doubly Robust

IPS is one of three core off-policy estimators, each with distinct bias-variance profiles. Understanding their trade-offs is essential for selecting the right evaluation strategy.

  • Direct Method (DM): Learns a reward model r̂(a,x). Low variance but high bias if the model is misspecified.
  • IPS: Zero bias with known propensities, but high variance.
  • Doubly Robust (DR): Combines IPS and DM. Remains unbiased if either the propensity model or the reward model is correct, offering a practical safety net.
06

Application in Bandit Model Validation

IPS is the standard tool for off-policy evaluation in contextual bandit systems, allowing data scientists to compare new model candidates against a production champion without risking live traffic.

  • Champion-Challenger: Evaluate a challenger policy on historical data collected by the champion
  • Model selection: Rank multiple candidate policies by their IPS-estimated value before shadow deployment
  • Integration: Often paired with bootstrapping to construct confidence intervals around the IPS estimate
OFF-POLICY EVALUATION

Frequently Asked Questions

Clear, technical answers to the most common questions about Inverse Propensity Scoring and its role in unbiased offline evaluation of contextual bandits and personalization systems.

Inverse Propensity Scoring (IPS) is an off-policy estimator that corrects for selection bias in logged bandit data by re-weighting observed rewards by the inverse of the probability that the logging policy selected the observed action. The core mechanism involves dividing the observed reward for a given action by the propensity score—the probability that the historical behavior policy chose that specific action in that specific context. This creates an unbiased estimate of the expected reward for a new target policy. For example, if a logging policy had only a 10% chance of showing a specific product recommendation, but the user clicked, IPS assigns that click a weight of 10 (1/0.10) to account for the under-sampled actions. The standard IPS estimator is: V_IPS = (1/n) * Σ (π_target(a_i|x_i) / π_logging(a_i|x_i)) * r_i, where π_target is the probability of the new policy taking action a_i given context x_i, and r_i is the observed reward. This re-weighting ensures that the evaluation is statistically unbiased, provided the logging policy has full support—meaning it assigned a non-zero probability to every action the target policy might select.

OFF-POLICY EVALUATION COMPARISON

IPS vs. Other Off-Policy Estimators

A technical comparison of Inverse Propensity Scoring against alternative off-policy evaluation methods for estimating policy value from logged bandit data.

FeatureInverse Propensity Scoring (IPS)Direct Method (DM)Doubly Robust (DR)

Core Mechanism

Reweights observed rewards by 1/propensity of logging policy

Learns a regression model to directly predict expected reward per action

Combines IPS reweighting with a direct reward model as a control variate

Unbiasedness

Unbiased if propensity model is correctly specified

Biased unless reward model is perfectly accurate

Unbiased if either propensity model OR reward model is correctly specified

Variance Characteristics

High variance, especially with small propensity scores or large action spaces

Low variance due to smooth function approximation

Lower variance than IPS; reward model absorbs variance of the propensity weights

Requires Propensity Scores

Requires Reward Model

Sensitivity to Model Misspecification

High sensitivity to propensity misspecification; bias scales with error

High sensitivity to reward model misspecification; no correction mechanism

Robust to misspecification of one component; double robustness property

Typical Variance Reduction vs IPS

Baseline (highest variance)

50-90% reduction

40-80% reduction

Computational Complexity

Low; simple weighted average of observed rewards

Medium; requires training and maintaining a reward regression model

High; requires both propensity estimation and reward model training

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.