Clicks from a ranked list are biased by display position. Under the examination hypothesis P(click∣item,pos)=P(examined∣pos)×P(relevant∣item), with position propensities [1.0,0.6,0.3] 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 i at position ki is examined with known propensity pki=P(examined∣pos=ki)>0, then a click Ci∈{0,1} has expectation E[Ci∣ki]=pki r, where r=P(relevant∣item). Weighting each click by 1/pki cancels pki in expectation, giving the unbiased estimator r^IPW=1N∑i=1NCipki.

Steps

  1. Set up the examination model: let Ei∈{0,1} indicate whether the user examines position ki, with propensity pki=P(Ei=1∣ki)>0, and let Ri∈{0,1} indicate relevance with probability r=P(Ri=1∣item) independent of position. Under Ci=EiRi, E[Ci∣ki]=pkir.
  2. Prove unbiasedness of IPW (inverse propensity weighting): define r^IPW=1N∑i=1NCipki over N impressions. Taking expectation given positions k1,…,kN yields E[r^IPW]=1N∑i=1NE[Ci∣ki]pki=1N∑i=1Npkirpki=r. Thus IPW is unbiased whenever every propensity pk>0.
  3. Compute the naive CTR (click-through rate) on the example: total impressions N=100+100+200=400 and total clicks =30+18+18=66, so naive CTR =66400=0.165 (16.5%). Because half the impressions were at position 3, naive CTR severely underestimates relevance.
  4. Compute the IPW estimate: divide clicks at each position by that position's propensity before averaging over all 400 impressions: r^IPW=1400(301.0+180.6+180.3)=30+30+60400=120400=0.30. IPW recovers the true 30% relevance.
  5. Explain the variance problem and propensity clipping: since Var⁡(Ci/pki)=r(1−pkir)/pki grows as pki shrinks (and a single click carries weight 1/pki), tiny propensities at deep positions inflate variance when a rare click receives a huge weight. Clipping propensities from below via p~k=max⁡(pk,τ) (equivalently capping weights at 1/τ) trades a small bias for much lower variance.
  6. Explain how propensities are estimated in practice: run controlled randomisation (result swapping) on a small traffic slice (swapping items between position 1 and position k so the same items are seen at both ranks, where the ratio of observed CTRs directly estimates pk/p1), or fit an expectation–maximisation (EM) position-based click model when randomisation is restricted.

Common mistakes

How long your answer should be

About 4 minutes; short expectation proof, worked numbers (0.165 vs 0.30), 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 α=0.05 and power 0.8 (with zα=1.645 and zβ=0.8416), 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?