Recommender systems
Counterfactual Evaluation, Propensity, and Position Bias
Understand inverse propensity scoring, direct models, doubly robust estimators, support, variance, and position-biased feedback.
By the end you can
- Explain IPS, direct, self-normalized, and doubly robust evaluation
- Identify support, propensity, position, slate, and weight-variance problems
- Design overlap and effective-sample-size diagnostics
- Use counterfactual estimates as evidence for guarded online confirmation
Visual
An off-policy evaluation record
Off-policy evaluation needs five facts about every past decision. The context available before the choice. The action or slate actually displayed. The probability the logging policy gave that choice. The observed reward under a defined window. And the probability the proposed policy would assign to the same action. Two of them are usually missing. They are the last two.
The logs that do carry them carry them because someone paid for them in advance. The data behind the replay method, published in 2011, came from a "random bucket" on the Yahoo! Front Page Today Module, running between 1 and 10 November 2009. Articles were drawn uniformly from the pool. So the logging propensity was fixed by the design, not reconstructed afterwards from serving code. That is the shape of a record that supports counterfactual estimation. It is also a decision that has to be taken before the data exists, not after.
Context
The information available before the historical decision.
Action or slate
The item, position, or policy choice actually displayed.
Logging propensity
Probability assigned by the logging policy to that choice.
Observed reward
Outcome for the chosen action under a defined window.
Target probability
Probability the proposed policy would assign to the same action.
Counterfactual evaluation reweights or models unobserved policy outcomes
Off-policy estimators ask how a target policy might have performed using data generated by another policy. Inverse propensity scoring reweights observed rewards by target-to-logging probability ratios. Direct methods predict rewards; doubly robust methods combine both ideas. The methods require overlap, trustworthy propensities, stable outcome definitions, and controlled variance. They do not recover evidence for actions the logging policy never took.
That last sentence is a theorem, not a caution. Under a support-deficient logger, the bias of the IPS estimator equals the expected reward the target policy places on the actions the logger gave zero probability. That was proved in 2020. The gap between what the estimate says and what the policy would do is exactly the value sitting in the region the logger stayed out of.
Every off-policy estimate inherits the blind spots of the logging policy, so it can only speak about the actions that policy was already willing to take.
Example
Yahoo! ran a uniformly random bucket for ten days to buy an unbiased offline estimate
What logging propensities cost is documented, in impressions. The replay method was validated on a log of the Yahoo! Front Page Today Module gathered between 1 and 10 November 2009. The paper describes the source plainly: “In the random bucket, articles are randomly selected from the article pool to serve users. There are about 40 million events in the offline evaluation data set, and about 20 articles available in the pool at every moment.”
The evaluator is a rejection rule. It walks the log and keeps an event only when the algorithm under test chooses the same arm that was actually served. Otherwise the event is discarded, and the algorithm never sees it. Under uniform logging an event survives with probability exactly 1/K. A pool of K articles therefore costs a factor-K shrinkage of usable data. With roughly 20 articles live at any moment, about one logged impression in twenty reaches the estimator. The other nineteen were served, paid for and thrown away by the evaluation. Some forty million events is what the unbiased number is made of before that shrinkage, not after it.
This is the honest version of the sentence a lesson usually asserts. Propensities are not metadata that a careful engineer remembers to write down. Here they were bought: ten days of deliberately randomised serving, and a large multiple of the impressions the estimate finally rests on.
- Logged policy: a "random bucket" of live traffic in which articles were selected at random from the pool, so the serving distribution was uniform by construction.
- Logging propensity: known in advance rather than reconstructed, because roughly 20 articles were available in the pool at every moment and each was equally likely to be shown.
- Replay rule: a logged event is retained only when the algorithm's choice matches the logged arm, which is what makes the resulting estimate unbiased.
- Price in data: an event survives with probability exactly 1/K, so K articles in the pool shrink the usable log by a factor of K — about one impression in twenty here, out of about 40 million events.
- What it does not buy: the estimate still speaks only for the pool that was served; an article never in the pool has no logged event to be matched against, and no rule can retain one.
Example
Counterfactual evaluation failures
Propensity omission is decided by the logging code and position confusion by the analysis, months apart and usually by different people. One stores the chosen action without its selection probability. The other reads a click as relevance without modelling where on the page it happened.
The slate failure has a price tag. Treat a whole page as a single action and IPS needs m^Ω(l) samples for a slate of length l drawn from m items. A 2017 paper measured that and offered a cheaper route. Its pseudoinverse estimator needs about O(l·m/ε²) samples for error ε, under an additive-reward assumption. The paper states the trade directly: “Inspired by work in combinatorial and linear bandits [7, 31, 11], we propose an estimator that makes only a weak assumption about the evaluated metric, while exponentially reducing the data requirements in comparison with IPS.” They tested it on MSLR-WEB30K, over 31K queries. They tested it again on logs from a popular search engine, whose logging policy randomly chose slates of size l = 5 from at most 8 pre-filtered documents: 77 unique queries and 22K examples. The scale is deliberately small. The exponent is what decides whether the page-level question is answerable at all.
- Propensity omission: The logger stores the chosen action but not its selection probability, and no later analysis can recover it.
- Deterministic logger: Important target actions have zero historical support, and the resulting damage is bias, not variance.
- Weight explosion: Tiny propensities let a few events dominate the estimate, so the number moves with a handful of rows.
- Slate simplification: Item-level probabilities are used for a dependent page-level choice; whole-slate IPS costs m^Ω(l) samples, against roughly O(l·m/ε²) for the pseudoinverse estimator that assumes additive rewards.
- Position confusion: Clicks are attributed to relevance without modeling rank exposure, which has been measured to move the average rank of a clicked document from 2.66 to 4.03.
Position-bias correction needs its own evidence
Randomized swaps, interleaving, examination models, or carefully designed propensities can help separate attention and relevance. A correction is only ever as credible as the exposure model and the logging behind it. Report intervals and show where the estimators disagree, rather than one point estimate. Large variance or poor overlap is itself a result: it says the historical data cannot safely answer the question being asked of it.
The reason to distrust a raw click was established by watching eyes, not by argument. In 2005 Joachims and four colleagues sat subjects in front of a proxy that silently manipulated Google's result list, and eye-tracked them while they searched. Phase I recruited 34 subjects, 29 of whom gave usable gaze data. Phase II recruited 22, of whom 16 were usable: 6 "normal", 5 "swapped", 5 "reversed". In the swapped condition the top two results traded places, so the second abstract was frequently the more relevant one. Subjects went on clicking link one. The gaze data is what makes this a measurement rather than an interpretation: “It is very interesting that users click substantially more often on the first than on the second link, while they view the corresponding abstract with almost equal frequency.” Reversing the whole list moved the average rank of a clicked document from 2.66 in the "normal" condition to 4.03 in the "reversed" condition. Users saw both abstracts. Rank decided which one they clicked. Anything that reads those clicks as a relevance signal is reading position and calling it preference.
The exposure model is the fragile part of any correction: when it is wrong, position bias is not removed, only relabelled as relevance.
Case
Trained on biased clicks, settled by a live test
Counterfactual ranking has a clear starting point. In 2017 Joachims and two co-authors published a way to train a ranker on clicks while correcting for the propensity that a result was examined. They called it Propensity SVM-Rank. One line of the abstract says why that matters outside search: “In contrast to most conventional approaches to de-biasing the data using click models, this allows training of ranking functions even in settings where queries do not repeat.”
Then they ran it live, on the Arxiv Full-Text Search engine. The propensities were not assumed. They were bought by intervention. For 7 days the top-ranked document was swapped to a uniformly random rank between 1 and 21. The examination probabilities that came out of that decayed with rank, down to a smallest value of about 0.12. Training used 21 days of logs, a strikingly modest quantity of signal — 5,437 click events in the 16-day train split, 1,755 in the 5-day validation split. Balanced interleaving against the hand-crafted production ranker gave Propensity SVM-Rank 87 wins, 48 losses and 83 ties (two-tailed binomial sign test, p = 0.001). Against Naive SVM-Rank it gave 95 wins, 60 losses and 102 ties (p = 0.006).
Note what settled the question. The offline correction produced a candidate. A live interleaving experiment produced the verdict. And the correction itself is only as good as the click model supplying the propensities: a smallest examination probability of about 0.12 is an estimate with an experiment behind it. That is exactly why the swap period existed.
Analogy
Reweighting a biased survey
A survey that called some neighborhoods ten times as often as others can still be corrected, as long as the calling probabilities were recorded. Weights rebuild the population that was reachable. The neighborhoods the surveyor never dialed have no weight that reaches them. Off-policy evaluation meets the same edge. Propensity repairs known selection inside the region where the logger actually had choices, and nowhere else.
Reweighting repairs known selection only where the data contains comparable choices.
Steps
Conduct a support-aware counterfactual analysis
Validate the logger before estimating anything from it: action probabilities, candidate sets, randomization and exclusions all have to be reconstructible after the fact. Then measure overlap, comparing target and logging support before estimating any value. Then inspect the weights. Then triangulate estimators — IPS, self-normalized, direct, doubly robust. Then confirm online under a guarded experiment, because no weighting scheme is by itself evidence of deployment value.
The weight-inspection step has a published test rather than a feeling. The failure it looks for was named in 2015, by Swaminathan and Joachims: “We show that this conventional estimator suffers from a propensity overfitting problem when used for learning over complex hypothesis spaces.” The diagnostic follows from the same conditions that make IPS unbiased. The empirical mean of the propensity weights has expected value exactly 1, so its deviation from 1 flags a bad estimate. For the hypothesis selected by IPS-based POEM with positive losses, that mean weight collapsed to 0.274 on Scene, 0.028 on Yeast, 0.000 on TMC and 0.175 on LYRL. The self-normalised Norm-POEM stayed at 0.981, 0.840, 0.941 and 0.945 on the same four. On TMC, POEM's Hamming loss of 17.305 was worse than random guessing. A mean weight of 0.000 against 0.941 on one dataset is what a failing weight distribution looks like when someone bothers to print it.
Steps three to five have an industrial precedent as well. In 2018 Criteo checked offline estimators against ground truth it actually held: “We have access to a proprietary dataset of 39 online A/B tests, representing a total of few hundreds of billions of recommendations.” They set the capping parameter to c = 100 and dropped the uncapped estimators outright. With IS or NIS, they reported, the confidence interval on the uplift would never support a positive or negative decision — it would always be neutral. A few hundred billion recommendations were not enough to make raw IPS decide anything. That is the lesson's "large variance is itself a result", observed at a scale most teams will never reach.
1. Validate the logger
Reconstruct action probabilities, candidates, randomization, and exclusions.
2. Measure overlap
Compare target and logging action support before estimating value.
3. Inspect weights
Report distribution, effective sample size, clipping, and sensitivity.
4. Triangulate estimators
Compare IPS, self-normalized, direct, and doubly robust results.
5. Confirm online
Use guarded experiments before consequential deployment.
Key idea
The support gate
Reject a counterfactual estimate when logging probabilities, action overlap, reward timing, or estimator sensitivity cannot be defended.
The overlap clause is the one people try to negotiate, usually by clipping the offending weights. The 2020 support-deficiency result closes that route. The IPS bias under a support-deficient logger equals the expected reward the target policy places on the zero-probability actions. So the failure is not a heavy tail: “the underlying reason is bias, not excessive variance that could be remedied through clipping or variance regularization”. The experiments forced the condition deliberately, zeroing propensities below a threshold of ε = 0.01 on CIFAR-10 and on a credit-card fraud dataset. Naive IPS degraded as the support divergence grew. It degraded badly once rewards were translated from [0,1] to [-1,0], where the actions the logger never took stop being worth zero and start being worth avoiding.
So the gate is not a style preference about caveats. Clipping controls variance and leaves the bias exactly where it was. A number produced under deficient support is wrong by an amount no diagnostic in the log can measure, because the quantity it is wrong by lives entirely outside the log.
Defend the logging probabilities, the action overlap, the reward timing and the estimator's sensitivity before the number is quoted, or withhold the number instead of caveating it.
Key takeaways
- Counterfactual methods reduce policy bias under assumptions; they do not turn observational logs into randomized truth.
- Logged propensities are bought, not remembered. The Yahoo! Front Page Today Module log behind the replay method came from a random bucket run between 1 and 10 November 2009. Replay keeps an event only when the choices match, so K articles in the pool shrink the usable data by a factor of K.
- No estimator can manufacture support where the historical policy assigned zero probability. The IPS bias there equals the target policy's expected reward on those actions, which is why clipping and variance regularization do not repair it.
- Weights that should average 1 are a checkable test, not a slogan: IPS-based POEM's mean weight fell to 0.000 on TMC while self-normalised Norm-POEM held 0.941 on the same data.
- Clicks encode rank before relevance. With the top two Google results silently swapped, subjects viewed both abstracts with almost equal frequency yet kept clicking link one. Reversing the list moved the average clicked rank from 2.66 to 4.03.
- Guarded online experiments remain the confirmation a consequential deployment needs. Propensity SVM-Rank was settled on Arxiv Full-Text Search by balanced interleaving at 87 wins, 48 losses and 83 ties (p = 0.001), not by the offline correction that produced it.