KatInterview

Debiasing Click Logs for Ranking: Propensities, IPS, Offline Eval

Machine LearningModel answer
HardModel answerMachine Learningposition-biaslearning-to-rankinverse-propensity-scoring

Last updated

Design a pipeline that models, estimates and corrects position bias in click-trained feed rankers, then evaluates a new ranker offline using only logged impressions.

Context

You own the ranking model for a personalized content feed. Every impression of a ranked list is logged along with user actions such as clicks, upvotes and dwell time. An audit shows that, after matching on post quality and user intent, a post shown in the first slot is clicked about four times as often as the same kind of post in the fifth slot.

If you train directly on raw clicks, a feedback loop appears. Relevant posts that sit low in the list collect few clicks, the model learns they are unattractive, and it pushes them even lower.

What to cover

Describe a complete approach for modeling, measuring and removing this position bias.

  1. Click model. Write the examination hypothesis that links the click indicator C, the relevance indicator R and the examination indicator E for an item at position k. List the independence assumptions the factorization needs.
  2. Propensity estimation. Give at least two ways to estimate P(E = 1 | position = k), one based on interventions (randomization or swapping) and one based on observational logs (an EM click model or a dual-learning approach). Compare them on user-experience cost, sample efficiency and implementation effort.
  3. Debiased training. Write an inverse-propensity-weighted objective for a generic loss L(y_pred, y_true). Explain why it becomes unstable when propensities at deep positions are tiny, and describe how you would stabilize it (for example clipping or self-normalization).
  4. Offline evaluation. Show how to estimate NDCG or average precision of a candidate ranker from logged feedback alone, without exposing it to users. State when that estimator stops being valid, such as when common support (positivity) fails.

Hints

Hint 1

Start from the product form: a click needs the item to be both looked at and relevant. Ask which variables each factor is allowed to depend on.

Hint 2

To isolate the effect of position, find situations where the same item appears at two different positions. Swaps and randomization create these deliberately; historical rankers create them for free.

Hint 3

The expected value of c / p_k equals relevance, which is where the IPS weight comes from. The cost is that small p_k blows up the variance, so think about trading a little bias for stability and monitor effective sample size.

Hint 4

For offline evaluation, re-rank the logged candidates with the new model, but weight each logged click by the inverse propensity of where it was shown, not where the new model would put it. Then ask what happens to items the logger never displayed.