Clicks from a ranked list are biased by display position. Under the examination hypothesis , with position propensities for positions 1–3, how do you show that inverse propensity weighting (IPW) gives an unbiased estimate of relevance, and what are the naive click-through rate (CTR) and the IPW estimate for an item shown 100 times at position 1 (30 clicks), 100 times at position 2 (18 clicks), and 200 times at position 3 (18 clicks)?
ML system design, Retrieval and ranking
Level L4 Advanced. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can derive why IPW removes position bias under the examination hypothesis, run the weighting arithmetic, and diagnose IPW's variance issue and propensity estimation.
Key idea
If impression at position is examined with known propensity , then a click has expectation , where . Weighting each click by cancels in expectation, giving the unbiased estimator .
Steps
- Set up the examination model: let indicate whether the user examines position , with propensity , and let indicate relevance with probability independent of position. Under , .
- Prove unbiasedness of IPW (inverse propensity weighting): define over impressions. Taking expectation given positions yields Thus IPW is unbiased whenever every propensity .
- Compute the naive CTR (click-through rate) on the example: total impressions and total clicks , so naive CTR (). Because half the impressions were at position 3, naive CTR severely underestimates relevance.
- Compute the IPW estimate: divide clicks at each position by that position's propensity before averaging over all impressions: IPW recovers the true relevance.
- Explain the variance problem and propensity clipping: since grows as shrinks (and a single click carries weight ), tiny propensities at deep positions inflate variance when a rare click receives a huge weight. Clipping propensities from below via (equivalently capping weights at ) trades a small bias for much lower variance.
- Explain how propensities are estimated in practice: run controlled randomisation (result swapping) on a small traffic slice (swapping items between position 1 and position so the same items are seen at both ranks, where the ratio of observed CTRs directly estimates ), or fit an expectation–maximisation (EM) position-based click model when randomisation is restricted.
Common mistakes
- Dividing the weighted clicks by the number of clicks instead of all impressions when estimating .
- Using unclipped propensities near zero, which lets a handful of noisy clicks at low ranks dominate the training loss.
- Assuming position bias is the only bias; selection bias (unshown items get , violating positivity) and trust bias (users click position 1 even when irrelevant) also affect logged clicks.
How long your answer should be
About 4 minutes; short expectation proof, worked numbers ( vs ), variance clipping and swapping.
Read this
Previous in ML system design: How do you decide how often to retrain a production ML model, and what are degenerate feedback loops and how can you mitigate them?
Next in ML system design: A production model's request error rate is 2%. A canary deployment receives 5% of 1,000 queries per second (QPS). Using a one-sided test at significance level and power (with and ), how many canary requests are needed to detect a rise in error rate to 2.5% against the baseline fleet, and how long does that take? Why does peeking repeatedly at canary metrics inflate false alarms?