Techniqueresearch
Unbiased learning to rank
Also called counterfactual learning to rank, propensity-weighted LTR.
Learns a ranker from biased click logs by weighting each click by the inverse of its estimated examination propensity.
Unbiased learning to rank trains a ranker from click logs as if it had relevance labels. Clicks are biased: a user can only click a result that they examine, and they examine the top positions much more often, which is position bias. If the probability that the user examined result is known and positive, dividing each click by it gives an estimate of a relevance-based metric whose expected value is the true metric. This is inverse probability weighting applied to the examination event. The position-bias and click-model pages describe how users examine and click; this page uses one of those models, assumes its propensities, and shows how to turn the clicks into an unbiased training objective, with a proof and the two ways it fails. The learning-to-rank page covers training from editorial labels.
In plain words
People click mostly on the first few results, even when a lower result is better, because they never look at the lower ones. If we train a ranker on raw clicks, it learns to copy the old ranking. The fix is to count a click on a result that people rarely look at as worth more. If only one person in three ever looks at position three, a click there counts three times. On average, this gives the same answer as if every person had looked at every result. For this to work, we must know how often each position is looked at, and every relevant result must have some chance of being seen.
When it applies
The technique applies when:
- the training data are logs of rankings shown to users and the clicks on them;
- a click on happens only if the user examined , and then depends on the relevance of and not on its position: for binary relevance , the examination model of Joachims, Swaminathan and Schnabel (2017), Section 5.1, Equation (5), which is the position-based click model with binary relevance;
- the propensity is known, or estimated, and positive for every relevant document;
- the metric is a sum over relevant documents of a function of their rank, such as the sum of ranks of Equation (2) of that paper, DCG, or precision at .
The method does not apply to clicks that depend on the other results, as in the cascade model, without a matching propensity model.
The template
For a new ranker and one logged query with clicks , the propensity-weighted estimate of is
Summed over the logged queries, it is the empirical risk of Equation (4) of the paper.
UNBIASED-LTR(log, Q, τ, learner)- 1
examples ← empty - 2
for each logged query x with shown ranking y and clicks c: - 3
for each document d with c_d = 1: - 4
q ← Q(examined | rank of d in y) - 5
add (x, d, weight 1 / max(τ, q)) to examples - 6
S ← learner minimizing Σ weight · bound(rank_S(d)) over examples - 7
return S
Line L4 reads the propensity of the logged position, for example as in Section 7.1, Equation (7). Line L5 is the inverse weight; gives the unbiased estimator, and the clipped one of Section 7.2. Line L6 needs a loss that bounds the rank and can be minimized: Propensity SVM-Rank, in Section 6, uses the hinge bound of the Ranking SVM and solves , one pair for each clicked document and each other document of its query.
Unbiasedness. Fix a query, its relevance , the logged ranking and a new ranking . Assume the examination model and for every with . Then , where the expectation is over the examination events.
Proof. Write ; a document with is never clicked under the model, so it adds nothing, and the division is defined for every document that can appear. By linearity of expectation and for ,
The proof uses nothing about except that it does not depend on the clicks of this log entry, so the same holds for any metric of the form . Summing over queries keeps the expectation, so the empirical risk is unbiased for the mean of over the logged queries, and the clicks of different queries are independent, so its average converges to that mean by the law of large numbers.
Wrong propensities. If the estimator uses in place of the true , the same computation gives . Each relevant document is weighted by , so documents at positions where the propensity is overestimated count too little, and the learner prefers rankings that move them down. The bias does not shrink with more data.
Zero propensities. If for a relevant , for example a document that was never shown, always, and no weight can recover it: . The estimator is unbiased only for the metric over documents that can be examined. This is the condition for relevant documents in Section 4 of the paper.
Classic examples
Take one query with three documents shown in the order A, B, C, with relevance and propensities , that is with . A new ranker orders them C, A, B, so . Under the model, A is always clicked and C is clicked with probability .
| estimator | value if only A is clicked | value if A and C are clicked | mean | variance |
|---|---|---|---|---|
| clicks without weights | 2 | 3 | 2.3333 | 0.2222 |
| IPS with the true | 2 | 5 | 3.0000 | 2.0000 |
| IPS with in place of 1 | 2 | 3.7321 | 2.5774 | 0.6667 |
| IPS clipped at | 2 | 4 | 2.6667 | 0.8889 |
The unweighted clicks underestimate the cost of putting C first, because C is rarely examined at rank 3 of the log. IPS with the true propensities is exactly unbiased and has the largest variance. The wrong and the clipping trade bias for variance. If C had never been shown (), every estimator would give 2, and the bias of would remain for any amount of data.
Further examples of the technique:
- Propensity SVM-Rank. Joachims, Swaminathan and Schnabel (2017), Section 6: the Ranking SVM with each clicked document's slack terms weighted by .
- Propensity-weighted LambdaMART. Weight the lambdas of each clicked document by its inverse propensity in LambdaMART, which gives an unbiased estimate of a DCG-like objective under the same model.
- Counterfactual evaluation. The same estimator, with no training, compares rankers offline from logs, as in off-policy evaluation of a contextual bandit, where the propensity is that of the logged action.
Variations
- Propensity estimation by intervention. Section 5.3 of the paper swaps the result at rank 1 with the result at rank for a random fraction of queries; the ratio of click rates at the two positions estimates , since relevance is the same on average.
- Propensities from the logs. Later methods fit the propensities and the relevance together with a click model, from logs where the same document appeared at different positions, without new interventions.
- Clipping and normalization. caps the weights at , and self-normalized estimators divide by the sum of the weights. Both reduce variance and add bias.
- Trust bias and noise. If users also click irrelevant documents with a probability that depends on the position, a single inverse weight is no longer enough; affine corrections with two parameters per position handle that model.
- Online alternatives. Interleaved evaluation and online learning to rank collect new clicks under randomized rankings instead of correcting old logs.
Pitfalls
- Unchecked examination model. The proof needs clicks that depend only on examination and relevance. Under a cascade-like user, the probability of examining rank 3 depends on what is at ranks 1 and 2, and a fixed is wrong.
- Variance. Weights up to make a few clicks at low positions dominate the objective. Clip, or gather more data, and report the effective sample size.
- Propensities from the same model. Estimating from logs of the ranker being corrected, without intervention or a click model, confounds position with relevance.
- Documents that were never shown. Their propensity is 0, and nothing in the clicks tells their relevance. Truncated result lists, pagination and filters create such documents.
- Non-clicks as negatives. IPS weights the clicks. Treating every unclicked document as irrelevant with full weight brings the position bias back.
Exercises
- In the example, show that IPS with in place of has the mean , the same as clipping at , and explain why.
- Prove that the IPS estimator of DCG, with the gain , is unbiased under the same assumptions.
- Under the examination model with click noise, , compute and show that it is an affine function of with a positive slope when , so it still ranks rankers in the right order if the extra term does not depend on .
References
- Thorsten Joachims, Adith Swaminathan and Tobias Schnabel, Unbiased learning-to-rank with biased feedback, Proceedings of the 10th ACM International Conference on Web Search and Data Mining (WSDM 2017), pp. 781-789; Equation (2) (the sum of the ranks of relevant documents), Section 4 and Equation (4) (the propensity-weighted empirical risk), Section 5.1 and Equation (5) (the examination model), Section 5.3 (estimating propensities by swap interventions), Section 6 (Propensity SVM-Rank), Section 7.1 and Equation (7) (propensities (1/rank) to the power eta), Section 7.2 (clipping)
- Thorsten Joachims, Optimizing search engines using clickthrough data, Proceedings of the 8th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2002, pp. 133-142 (pairwise preferences read from clicks, the biased starting point that the propensity method replaces)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag TP8SM4 Edit this page History Report an error Markdown