What is position bias in ranking and how do you correct for it?
Written by the mlprep team · Updated
Your training data comes from user clicks on ranked results. What's wrong with training directly on this data, and how do you correct for position bias?
The problem: clicks conflate relevance and position#
When a user clicks item A at position 1 and ignores item B at position 5, two things could explain it:
- A is more relevant than B
- A was shown first and B was never seen
Click-through rate at position 1 is typically 5-10× higher than at position 10 — even for the same item. If you train a model to predict clicks directly, you're teaching it to predict position, not relevance. The model learns that items shown at the top are "good," which reinforces whatever the previous ranker decided.
The feedback loop#
Training on biased clicks → model promotes items that were already ranked high → those items get more clicks → model continues to promote them. Items that were poorly ranked early never recover because they never accumulate clicks. This is how a suboptimal initial ranker perpetuates itself indefinitely.
Inverse Propensity Scoring (IPS)#
Correct for position bias by downweighting clicks from high-visibility positions. The propensity p(k) is the probability of examination at position k — how likely a user is to even look at position k.
Weight each click by the inverse of the propensity of the position it appeared at:
IPS-weighted loss = ∑_i (click_i / p(position_i)) · loss(item_i)
A click at position 1 (high propensity, seen by many users) is worth less than a click at position 8 (low propensity, seen by few). This reweights training signal to estimate what relevance would be if all items were shown equally.
Estimating propensities#
You don't observe propensity directly. Common approaches:
Randomization: periodically shuffle ranking order for a small fraction of traffic. The clicks you observe on randomly-ordered results are unbiased — estimate p(k) from click rates across positions in the randomized traffic. Expensive and hurts short-term UX.
Result interleaving: interleave results from two rankers, observe which gets clicked. Allows comparison without full randomization.
Click models: fit a generative model (e.g., Position-Based Model, Cascade Model) that jointly estimates item relevance and position examination probability from observational click data.
Unbiased Learning to Rank#
A more principled framework: treat clicks as noisy labels of relevance, use IPS or Dual IPS (which reduces variance) to debias the training objective. Models trained this way converge toward true relevance rather than position artifacts.
In practice at FAANG#
Real production systems rarely achieve perfect debiasing. Common pragmatic approaches:
- Mix clicked items with randomly-surfaced items in training data
- Add position as a feature at training time but drop it at inference (the model learns to correct for it)
- Use dwell time, video completion rate, or explicit ratings as less position-biased signals alongside clicks
- Run periodic exploration (epsilon-greedy or Thompson sampling) to refresh propensity estimates
Adding position as a feature#
A widely-used trick: include position as an input feature during training. The model learns "clicks at position 1 are less surprising" and adjusts relevance estimates accordingly. At serving time, set position to a constant (e.g., position 1 for all items). The model now predicts relevance as if all items were shown at position 1 — effectively debiasing without explicit propensity estimation. Cheap, approximate, widely deployed.
Senior/staff considerations#
The key senior point is that logged ranking data is not IID supervision. It is data collected by a previous policy. You observe clicks only for items the old system exposed, so both positives and negatives are biased by ranking, eligibility, UI layout, and user attention.
A good answer should separate:
- Examination bias: the user may not see lower-ranked items.
- Selection bias: the old ranker chose which items were shown at all.
- Presentation bias: thumbnails, snippets, badges, price, and layout change click probability.
- Feedback loops: items ranked high get more exposure, which creates more training signal, which keeps them ranked high.
IPS is principled but high variance when propensities are small. In production, teams often clip IPS weights, use doubly robust estimators, add randomized exploration, and validate with interleaving or A/B tests. The tradeoff is bias versus variance: aggressive debiasing can make training unstable; weak debiasing leaves the model learning the old ranker's preferences.
Interview red flags#
- Treating clicks as relevance labels without discussing exposure.
- Suggesting full randomization without acknowledging user experience and revenue cost.
- Forgetting that unclicked does not mean irrelevant; it may mean unseen.
- Not mentioning exploration traffic or propensity estimation.
The key takeaway unlocks after you reveal an expert answer.
Key Takeaway
Position bias: users click high-position items more regardless of relevance, so clicks conflate relevance and position. Training directly on clicks teaches the model to predict position, not quality — creating self-reinforcing feedback loops. Fix with: Inverse Propensity Scoring (IPS) — weight clicks by 1/p(position); position-as-feature trick — include position in training, zero it out at serving; or randomized exploration to collect unbiased data. IPS is principled, position-as-feature is cheap and widely used.
Follow-up Questions to Test Yourself
Interviewers often pivot here once you cover the core concept.
- What is the position-as-feature trick in detail, and what assumptions does it make about how position affects clicks?
- How would you estimate click propensity without running a full randomization experiment?
- Beyond position, what other types of exposure bias exist in recommendation systems?
How confident do you feel explaining this?
Track your understanding or flag it to revisit before your next loop.
Related Questions
Walk me through two-tower models for retrieval — architecture, tradeoffs, and limits
How does multi-task learning work for ranking — and what are the failure modes?
Compare pointwise, pairwise, and listwise ranking losses
How would you design a recommendation system for Reddit?