Algorithm Search⌘K

Theoremcore

Probability ranking principle

Ranking by decreasing probability of relevance maximizes the expected sum of decreasing rank weights of relevant documents, when the relevance of a document does not depend on the others.

The probability ranking principle says that a retrieval system should rank the documents in decreasing order of their probability of relevance to the query. As a theorem it holds when the relevance of each document does not depend on the other documents shown, when the probabilities are exact, and when the user's utility adds a fixed, decreasing weight for each relevant document by rank. Then the sorted order maximizes the expected utility, by linearity of expectation and an exchange argument. It is the reason why the binary independence model and BM25 rank by an estimate of that probability, and it fails when documents repeat each other, which is the starting point of result diversification.

Statement

Fix a query and a finite set DD of nn documents. A ranking is a bijection π:{1,…,n}→D\pi : \{1, \ldots, n\} \to D, with π(i)\pi(i) the document at rank ii. The relevance of document dd is a random variable Rd∈{0,1}R_d \in \{0, 1\} on a probability space that models what the system knows from its evidence.

Hypotheses.

  1. Relevance of each document is its own. RdR_d depends on dd and the query only. It does not depend on which other documents the ranking shows, on their order, or on what the user has seen before dd. So the same variables RdR_d serve for every ranking.
  2. Calibrated probabilities. The system knows pd=P(Rd=1∣evidence)p_d = P(R_d = 1 \mid \text{evidence}) exactly for each dd.
  3. Rank-linear utility. The utility of a ranking is U(π)=∑i=1nwiRπ(i)U(\pi) = \sum_{i=1}^{n} w_i R_{\pi(i)} with fixed weights w1≥w2≥⋯≥wn≥0w_1 \ge w_2 \ge \cdots \ge w_n \ge 0 that do not depend on the RdR_d.

Theorem. Under hypotheses 1 to 3, every ranking π∗\pi^* with pπ∗(1)≥pπ∗(2)≥⋯≥pπ∗(n)p_{\pi^*(1)} \ge p_{\pi^*(2)} \ge \cdots \ge p_{\pi^*(n)} maximizes E[U(π)]E[U(\pi)] over all rankings π\pi. If the weights are strictly decreasing and the pdp_d are distinct, π∗\pi^* is the only maximizer.

No statistical independence between the variables RdR_d is needed. Hypothesis 3 covers:

  • the number of relevant documents in the top kk, and so precision at kk: wi=1/kw_i = 1/k for i≤ki \le k and wi=0w_i = 0 after;
  • discounted cumulative gain with 0-1 gains: wi=1/log⁡2(i+1)w_i = 1/\log_2(i + 1);
  • the cost model of Robertson and of Manning, Raghavan and Schuetze (Section 11.2.2), for a list of kk documents. Let C0C_0 be the cost of retrieving a non-relevant document and C1C_1 the cost of missing a relevant one. Up to a constant that does not depend on the ranking, the expected cost of the top kk is −(C0+C1)∑i≤kpπ(i)-(C_0 + C_1) \sum_{i \le k} p_{\pi(i)}, which is the case wi=C0+C1w_i = C_0 + C_1 for i≤ki \le k.

In plain words

Suppose that the system knows, for each document, the chance that the user will find it relevant, and that this chance does not change when the user has seen other documents. Suppose also that the user gains a fixed amount from each relevant document, and more for one near the top than for one further down. Then the best list puts the most probable document first, the next most probable second, and so on.

If two neighbors in a list are in the wrong order, swapping them moves the more probable one to the place that is worth more, and the expected gain can only go up. Any list can be sorted by such swaps, so the sorted list is the best one. The rule says nothing about how to find the chances. Models such as BM25 are ways to estimate them.

Proof

Fix a ranking π\pi. By linearity of expectation, which holds for any joint distribution of the RdR_d,

E[U(π)]=∑i=1nwi E[Rπ(i)]=∑i=1nwi pπ(i).E[U(\pi)] = \sum_{i=1}^{n} w_i \, E[R_{\pi(i)}] = \sum_{i=1}^{n} w_i \, p_{\pi(i)}.

Hypothesis 1 lets us use the same RdR_d, and so the same pdp_d, for every ranking. Hypothesis 2 makes E[Rd]=pdE[R_d] = p_d the true value.

Call a pair of ranks i<ji < j an inversion of π\pi if pπ(i)<pπ(j)p_{\pi(i)} < p_{\pi(j)}. If π\pi has an inversion, it has one at two adjacent ranks ii and i+1i + 1, since otherwise pπ(1)≥pπ(2)≥⋯≥pπ(n)p_{\pi(1)} \ge p_{\pi(2)} \ge \cdots \ge p_{\pi(n)}. Let π′\pi' be π\pi with the documents at ranks ii and i+1i + 1 swapped. Only two terms of the sum change, so

E[U(π′)]−E[U(π)]=wipπ(i+1)+wi+1pπ(i)−wipπ(i)−wi+1pπ(i+1)=(wi−wi+1)(pπ(i+1)−pπ(i))≥0,E[U(\pi')] - E[U(\pi)] = w_i p_{\pi(i+1)} + w_{i+1} p_{\pi(i)} - w_i p_{\pi(i)} - w_{i+1} p_{\pi(i+1)} = (w_i - w_{i+1})(p_{\pi(i+1)} - p_{\pi(i)}) \ge 0,

because wi≥wi+1w_i \ge w_{i+1} and pπ(i+1)>pπ(i)p_{\pi(i+1)} > p_{\pi(i)}. The swap removes exactly one inversion and creates none. So after at most n(n−1)/2n(n-1)/2 swaps we reach a ranking with no inversion, that is, a sorted ranking, and the expected utility never went down. Two sorted rankings differ only in the order of documents with equal pdp_d, and such documents give the same terms in the sum, so all sorted rankings have the same expected utility. Hence E[U(π∗)]≥E[U(π)]E[U(\pi^*)] \ge E[U(\pi)] for every π\pi.

For uniqueness, let the wiw_i be strictly decreasing and the pdp_d distinct. Then a ranking π≠π∗\pi \ne \pi^* has an adjacent inversion, and the swap above gives a strictly positive change. So π\pi is not a maximizer, and π∗\pi^* is the only one. ■\blacksquare

The same argument is the rearrangement inequality: a sum of products ∑iwipπ(i)\sum_i w_i p_{\pi(i)} is largest when both sequences are sorted in the same order.

Consequences

  • Rank by any increasing function of the probability. The proof uses only the order of the pdp_d. A model may rank by the log-odds log⁡(pd/(1−pd))\log(p_d / (1 - p_d)), or by any strictly increasing function of pdp_d, and get the same ranking. The binary independence model and BM25 rank by such a function, estimated from term statistics.
  • Where to stop needs the true values. With the costs C0C_0 and C1C_1 above, retrieving dd changes the expected cost by C0(1−pd)−C1pdC_0(1 - p_d) - C_1 p_d. A system that may choose how many documents to return should return exactly those with pd>C0/(C0+C1)p_d > C_0/(C_0 + C_1). This rule needs calibrated values, not only their order. It is the Bayes decision rule of a Bayes optimal classifier with these costs.
  • Graded relevance. If the gain of dd is a random value Gd≥0G_d \ge 0 in place of RdR_d, the same proof shows that ranking by decreasing E[Gd]E[G_d] maximizes ∑iwiE[Gπ(i)]\sum_i w_i E[G_{\pi(i)}], so DCG with graded gains is maximized by sorting on the expected gain.
  • Some nonlinear measures under statistical independence. If the RdR_d are independent random variables, the probability that the top kk holds at least one relevant document is 1−∏i≤k(1−pπ(i))1 - \prod_{i \le k} (1 - p_{\pi(i)}). This is largest when the top kk are the kk documents with the largest pdp_d, so the sorted ranking is also optimal for this measure.
  • Measures outside the theorem. Average precision, reciprocal rank and nDCG are not of the form of hypothesis 3: they divide by a random number of relevant documents or depend on products of the RdR_d. The proof above does not cover them.

Tightness

Each hypothesis is needed. The clearest failure is a pair of duplicates.

Dependent relevance. Let AA and BB be two copies of one text, so RA=RBR_A = R_B always, with pA=pB=0.6p_A = p_B = 0.6. Let CC be a different document with pC=0.5p_C = 0.5, independent of RAR_A. The user wants one relevant document and reads two, so the utility is 1 if the top 2 holds a relevant document and 0 if not.

  • The principle puts AA and BB first. The top 2 holds a relevant document exactly when RA=1R_A = 1, with probability 0.6.
  • The ranking A,C,BA, C, B fails only when RA=0R_A = 0 and RC=0R_C = 0, so it succeeds with probability 1−0.4⋅0.5=0.81 - 0.4 \cdot 0.5 = 0.8.

Once the user has read AA, the copy BB adds nothing, so the value of BB depends on the document above it. This breaks hypothesis 1, and the utility is not of the form of hypothesis 3. Chen and Karger (2006) study such measures and rank greedily: each next document is the one most likely to be relevant given that the documents above it are not. Maximal marginal relevance, IA-Select and xQuAD are methods of this kind.

Uncalibrated probabilities. If the system ranks by estimates that are not in the order of the true pdp_d, sorting by the estimates is optimal only for its own beliefs. With true values 0.6 and 0.5 and estimates 0.4 and 0.5, the system puts the second document first and its expected precision at 1 is 0.5 in place of 0.6. Gordon and Lenk (1992) list such failures of the assumptions together with the cases where the principle stays optimal.

Weights that increase. If w2>w1w_2 > w_1, as for a user who skips the first result, the best ranking puts the second most probable document at rank 1. The order of the weights is what decides the order of the documents.

History

Maron and Kuhns proposed in 1960 to rank documents by a probability of relevance computed from weighted index terms. The classic statement of the principle as a rule for retrieval systems, with its justification under explicit assumptions and the discussion of a counterexample of Cooper, is the paper of Robertson (1977). The binary independence model of Robertson and Sparck Jones (1976) and the later Okapi weights are derived from it. Gordon and Lenk (1991, 1992) examined it from the point of view of decision theory. Chen and Karger (2006) and the work on diversification since then study the cases where the relevance of one document depends on the documents above it.

References

  1. Stephen E. Robertson, The probability ranking principle in IR, Journal of Documentation 33(4), 294 to 304, 1977, the statement of the principle, its justification under the stated assumptions, and the discussion of a counterexample due to Cooper, in which the documents cannot be judged one at a time
  2. Christopher D. Manning, Prabhakar Raghavan and Hinrich Schuetze, Introduction to Information Retrieval, Cambridge University Press, 2008, Chapter 11, Section 11.2 (the probability ranking principle, Section 11.2.1 for the 1/0 loss case and Section 11.2.2 for retrieval costs)
  3. Michael D. Gordon and Peter Lenk, When is the probability ranking principle suboptimal?, Journal of the American Society for Information Science 43(1), 1 to 14, 1992, the conditions under which ranking by probability of relevance is optimal for the user, and examples where it is not
  4. M. E. Maron and J. L. Kuhns, On relevance, probabilistic indexing and information retrieval, Journal of the ACM 7(3), 216 to 244, 1960, the ranking of documents by a probability of relevance computed from weighted index terms
  5. Harr Chen and David R. Karger, Less is more, probabilistic models for retrieving fewer relevant documents, Proceedings of SIGIR 2006, 429 to 436, metrics that reward one relevant document in the top k, for which ranking by probability of relevance is not optimal, and a greedy ranking that conditions on the documents above

Where this leads

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/MKV8DT/text.yaml