Correct Position Bias When Training a Ranker on Click Logs

Last updated: November 29, 2026

Quick Overview

Your product search ranker is trained on clicks, but items shown at the top get clicked more just because of their position. How would you remove position bias from training and from offline evaluation?

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


Your product search ranker is trained on clicks, but items shown at the top get clicked more just because of their position. How would you remove position bias from training and from offline evaluation?

Amazon search and recommendations learn from implicit feedback that is heavily shaped by what the current system showed. Interviewers check knowledge of counterfactual learning to rank: examination models, propensity estimation, and inverse propensity weighting.

What the Interviewer Expects
  • Explain the examination hypothesis
  • Estimate position propensities with interventions or EM
  • Apply inverse propensity weighting to the loss
  • Discuss variance and clipping
  • Evaluate offline with debiased metrics and validate online
Key Topics to Cover
Position bias
Inverse propensity weighting
Counterfactual learning to rank
Click models
Off-policy evaluation
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you estimate propensities without hurting customers with random shuffles?
  • How does the grid layout on mobile change the position model?
  • How would you handle trust bias, where top results are also trusted more?
  • What is the bias-variance trade-off when clipping weights?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify
  • Layout: list or grid? Propensity depends on screen position, not just rank.
  • Signal: clicks, add-to-cart, or purchases? Purchases have less position bias but are sparser.
  • Can we run small interve...
Approach

Examination hypothesis: a click happens if the item is examined and relevant: P(c=1∣q,d,k)=P(e=1∣k)⏟θk⋅P(r=1∣q,d).P(c=1 \mid q, d, k) = \underbrace{P(e=1 \mid k)}_{\theta_k} \cdot P(r=1 \mid q, d). If we know θk\theta_k, we can ...


Submit Your Answer
Markdown supported