1.  [](/)
2.  [Glossary](/glossary)
3.  Mean Reciprocal Rank (MRR)

[Back to Glossary](/glossary)

# What is Mean Reciprocal Rank (MRR)

## Mean Reciprocal Rank (MRR) - How high the first correct result ranks, averaged over queries

Mean reciprocal rank (MRR) is the average, over a set of queries, of 1 divided by the rank of the first relevant result. A query whose first relevant result is at rank 1 scores 1, rank 2 scores 0.5, rank 3 scores 0.33, and a query with no relevant result in the list scores 0. MRR suits search where one right answer is enough, such as finding a specific clip, product or document.

### How It Works

For each query, find the position of the first relevant result and take its reciprocal. Average those values across all queries. Three queries whose first relevant results sit at ranks 1, 3 and 2 give (1 + 1/3 + 1/2) / 3 = 0.611. With a cutoff K, a first relevant result below rank K counts as 0, which is written MRR@K.

### Technical Details

*   Formula: MRR = (1 / |Q|) × Σ 1 / rank\_q, where rank\_q is the position of the first relevant result for query q
*   Range 0 to 1; higher is better
*   Binary relevance: a result is relevant or it is not, and graded scores are ignored
*   Only the first relevant result counts, so two systems that both put a correct answer at rank 1 score the same even if one of them returns nothing useful after it

### When to Use MRR

*   Known-item search: the user wants one particular video moment, image or file
*   Question answering, where the first good passage is what gets read
*   Reverse image search and duplicate lookup, where the best match should come first
*   Use NDCG or mean average precision instead when the user reads many results or when relevance comes in grades

### Measuring MRR in Mixpeek

Mixpeek retriever evaluations report MRR next to precision, recall, F1, MAP and NDCG. You upload a ground truth dataset of queries and their relevant document IDs, then run \`POST /v1/retrievers/{retriever\_id}/evaluations\` with \`"metrics": \["mrr", "ndcg"\]\`. Running the same dataset against two retrievers shows whether a change such as adding a reranker moved the first correct result up. See [retriever evaluations](https://mixpeek.com/docs/retrieval/evaluations).

### Common Pitfalls

*   Reading MRR as overall ranking quality when it only describes the first relevant result
*   Comparing MRR values computed with different cutoffs
*   Too few queries: with 20 queries, one query moving from rank 1 to rank 2 shifts MRR by 0.025
*   Ground truth that marks only one of several correct results as relevant, which understates the score

[One-click templatesStart from a templateEach template deploys a working search app on your own files.Browse templates](/templates)

[Put it to work: search your own files](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=glossary_onramp&utm_campaign=mvs_onramp)

### Related Terms

[ACID](/glossary/acid)[API](/glossary/api)[Blob Storage](/glossary/blob-storage)[CLIP](/glossary/clip)[Embedding](/glossary/embedding)