Definitionintro
Mean reciprocal rank
Also called MRR.
The mean over queries of 1/r, where r is the rank of the first relevant result.
Reciprocal rank (RR) scores a ranking by the rank of its first relevant document: the value is , and 0 when the ranking holds no relevant document. Mean reciprocal rank (MRR) is the arithmetic mean of RR over the queries. It models a user who wants one good answer and stops at the first one, so it fits known-item search and question answering. It ignores every relevant document after the first.
Definition
Input. A ranking of distinct document ids, with ranks starting at 1, and graded judgments , where a document that is not judged has . A document is relevant when . is the number of relevant documents in the judgments. An optional cutoff limits the ranking to its first ranks.
Value. When , let be the smallest rank whose document is relevant. Then
- Gain: binary, with the threshold .
- Discount: at the rank of the first relevant document. Every later rank has weight 0, whatever it holds.
- Normalization: none is needed. The best value is 1, reached when rank 1 is relevant.
- Cutoff: trec_eval uses the whole run (file m_recip_rank.c). The TREC-8 question answering track took 5 responses per question, so its score was RR at , with the possible values 0, 1/5, 1/4, 1/3, 1/2 and 1 (Voorhees 1999). Say which a reported MRR uses.
- Ties: RR changes when a tie group holds the first relevant document and a nonrelevant one. This area orders by score descending, then by document id ascending. trec_eval orders tied documents by document number in reverse lexical order.
- No relevant documents (): undefined. No ranking can do better than 0, so the value says nothing about the system. Return None and leave the query out of the mean. trec_eval sets no value for a query in its judgments file with no relevant document retrieved, so the query counts as 0 in its mean.
MRR over queries with is the arithmetic mean .
Claim 1. If every query has a relevant document in its ranking, at ranks , then MRR is the reciprocal of the harmonic mean of these ranks.
Proof. The harmonic mean of is . Its reciprocal is , which is MRR.
So MRR is not the reciprocal of the mean rank. For two queries with first relevant ranks 1 and 10, MRR is , while . A single query with a good rank pulls MRR up much more than a bad rank pulls it down.
Claim 2. If , RR equals average precision.
Proof. With one relevant document at rank , AP is , and both are 0 when that document is not retrieved.
When the two are not ordered. Relevant documents at ranks 1 and 10 with give RR 1 and AP . Relevant documents at ranks 2 and 3 give RR and AP , which is larger.
Examples and non-examples
The toy collection
The toy collection of this area has four queries.
| Query | Ranking | First relevant | RR |
|---|---|---|---|
| q1 "sorted array search" | 1, 6, 8, 2, 4 | d1 at rank 1 | 1 |
| q2 "posting list merge" | 8, 5, 1, 4, 2 | d5 at rank 2 | 1/2 |
| q3 "rank documents" | 2, 6, 7, 1, 5 | d7 at rank 3 | 1/3 |
| q4 "quantum circuit" | 1, 2, 3, 4, 5 | none, | None |
MRR . If q4 is kept with the value 0, the mean becomes .
On q1, RR is 1 although only one of the three relevant documents is near the top. Average precision on the same ranking is , and it would fall if d8 and d2 moved down. RR would not change.
Ties on q1
The fixed run gives d1 and d6 the same score 2.0. With this area's rule d1 comes first and . trec_eval puts d6 first and gets . The tie-aware value of McSherry and Najork (2008), the mean over both orders, is .
Non-examples
- . For the three toy queries the mean rank is , which gives , not .
- Reciprocal rank fusion. It also uses , but it is a method to merge several rankings into one, with a constant added to each rank. It does not score a ranking against judgments.
- Expected reciprocal rank. It uses graded judgments and a user who may stop at any relevant document with a probability that grows with the grade. With binary grades and certain stopping at the first relevant document it reduces to RR.
- Success at , which is 1 if the first ranks hold a relevant document and 0 otherwise. It does not separate rank 1 from rank .
Related definitions
- Precision at k counts all relevant documents in the first ranks; RR looks only at the first one.
- Average precision looks at every relevant document and equals RR when .
- Normalized discounted cumulative gain and rank-biased precision also discount by rank, but sum over all ranks.
RR takes few values, and on a single query a move of the first relevant document from rank 1 to rank 2 halves it. A difference in MRR between two systems is therefore noisy on a small query set. To claim that one system is better, use a paired test over the queries, such as the sign test or a permutation test, and give the number of queries.
References
- The TREC-8 Question Answering Track Report, section on evaluation (five ranked responses per question, score is the reciprocal of the rank of the first correct response, 0 if none of the five is correct)
- trec_eval, the TREC evaluation program by Chris Buckley, maintained by NIST, file m_recip_rank.c (1/(i+1) for the first relevant retrieved document at index i, no cutoff, no value set when no relevant document is retrieved)
- Frank McSherry and Marc Najork, Computing information retrieval performance measures efficiently in the presence of tied scores, ECIR 2008, LNCS 4956, pp. 414-421, tie-aware reciprocal rank
- W. Bruce Croft, Donald Metzler and Trevor Strohman, Search Engines, Information Retrieval in Practice, Addison-Wesley, 2010, Chapter 8 (reciprocal rank and mean reciprocal rank)
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 52K6S3 Edit this page History Report an error Markdown