Mean Average Precision (MAP)

Bibliometrics
Introduced by
TREC / information-retrieval evaluation community; Chris Buckley & Ellen Voorhees (stability analysis)
Year
2000
Type
Binary-relevance ranked-retrieval evaluation pipeline
Family
Information-retrieval evaluation / ranking metrics

What does it do?

Mean Average Precision (MAP) is a widely used single-number summary of ranked-retrieval effectiveness under binary relevance, and it was the headline metric of the TREC ad hoc retrieval tracks.

For a single query, average precision (AP) takes the precision of the result list at each rank where a relevant document appears and averages those values over all relevant documents for the query. It therefore rewards systems that place relevant documents near the top. MAP is the mean of AP across a set of queries. Buckley and Voorhees (2000) analyse the stability of evaluation measures and are commonly cited in discussions of how reliably measures such as AP separate systems. MAP remains a common reporting metric for ranked retrieval, typically alongside graded-relevance measures such as nDCG.

The intuition behind the method

Imagine a search returns a long ranked list and you know which documents are truly relevant. Precision at a fixed cutoff (say, the top 10) tells you what fraction of those ten are relevant, but it ignores order within the cutoff and everything below it. Average precision fixes this. Walk down the ranked list, and every time you hit a relevant document, write down the precision of the list up to that point — that is, how clean the results have been so far. A relevant document found at rank 1 contributes a precision of 1; one found at rank 50 after many irrelevant results contributes a small precision. Average those numbers over all the relevant documents, and you get a single score that is high only when relevant documents are both numerous and ranked near the top. Doing this for one query gives average precision; doing it for many queries and averaging gives MAP, a stable overall picture of how well a system ranks across a whole workload.

History

Average precision grew out of the precision-recall tradition of information-retrieval evaluation and became the central effectiveness measure of the Text REtrieval Conference (TREC), launched by NIST in 1992, where MAP was the headline number for the ad hoc retrieval tracks. The measure therefore predates Chris Buckley and Ellen Voorhees's 2000 SIGIR paper 'Evaluating evaluation measure stability', which is a study of how reliably evaluation measures distinguish systems rather than the origin of MAP. Manning, Raghavan and Schütze's 2008 textbook 'Introduction to Information Retrieval' covers MAP and its relation to the precision-recall curve, and MAP remains a standard reported metric alongside nDCG.

When to use it

Use MAP when you evaluate ranked retrieval under binary relevance and want one score that rewards ranking all relevant documents highly. Typical cases are TREC-style ad hoc retrieval, system comparisons in IR research, and tasks where the full set of relevant documents matters rather than only the top few. It suits settings with a reasonably large, representative query set and known relevant-document sets. Avoid MAP when relevance is graded (use nDCG), when only the top of the list matters and recall is irrelevant (precision at k or reciprocal rank may fit better), or when judgments are sparse, because treating unjudged documents as non-relevant biases both AP and the normalisation by R_q.

Limitations and considerations

  • Assumes binary relevance and cannot express degrees of relevance, unlike nDCG.
  • Assumes the set of relevant documents per query is known and reasonably complete; with incomplete judgments, unjudged documents are usually treated as non-relevant, which biases the score.
  • Each relevant document contributes its precision at its own rank, so a relevant item found deep in the list adds only a small value. This may understate usefulness for tasks where users rarely look that far down.
  • Averaging AP equally across queries means queries with many relevant documents and queries with few carry the same weight, so a few unusual queries can shift the summary unless the query set is well designed and representative of the intended workload.
  • Comparisons between systems typically treat queries as independent samples; this assumption should hold for the query set, otherwise significance tests may be misleading.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Gives a single scalar summary of ranking quality over the whole result list, not only at a fixed cutoff.
  • Recall-aware: every relevant document contributes to the sum, and dividing by R_q means a system that fails to retrieve relevant documents loses score.
  • Buckley and Voorhees's work on measure stability is commonly cited in support of AP's favourable discrimination between systems compared with simpler cutoff-based measures.
  • Long-standing TREC standard, enabling direct comparison with a large body of published retrieval results.

Applications

  • Headline effectiveness metric for TREC ad hoc retrieval and many IR system comparisons.
  • Comparing lexical and neural rankers under binary relevance on shared test collections.
  • Evaluating recall-sensitive search tasks such as legal, patent, and systematic-review retrieval where finding all relevant documents matters.
  • Benchmarks in other fields, such as object detection, that use average-precision-style metrics over ranked candidate lists. These are related to IR MAP but not identical, so their scores should not be compared directly.
  • Tuning retrieval-pipeline parameters by optimizing MAP on a held-out query set.

How it works

How it works

1

The building block is precision at rank k: the fraction of the top k retrieved documents that are relevant, computed under binary relevance judgments where each document is either relevant (1) or not (0). As you scan down a ranked list, precision at k rises when a relevant document is added and falls when an irrelevant one is. This per-rank precision captures how 'clean' the list is at each depth and is the quantity that average precision samples at the ranks where relevant documents actually occur.

Formula
P@k = \frac{1}{k}\sum_{i=1}^{k} rel_i,\qquad rel_i \in \{0, 1\}
2

Average precision for a query is obtained by taking the precision at each rank where a relevant document is retrieved, summing those precision values, and dividing by the total number of relevant documents R_q for that query. Only relevant retrievals contribute (the indicator rel_k gates the sum), so a relevant document ranked high contributes a large precision and one ranked low contributes a small one, while relevant documents never retrieved contribute zero through the division by R_q. AP thus rewards ranking all relevant documents as high as possible and is the single-query effectiveness score, ranging from 0 to 1.

Formula
\mathrm{AP}(q) = \frac{1}{R_q}\sum_{k=1}^{n} P@k \cdot rel_k
3

Average precision is closely related to the precision-recall curve. The AP formula above uses precision measured only at the ranks of relevant documents, not interpolated precision. The interpolated curve is a separate construction: the interpolated precision at a given recall level is the maximum precision observed at that recall or any higher recall, which removes the sawtooth dips and gives a monotonically non-increasing curve. AP can be read as approximating the area under the precision-recall curve, but this link is approximate, because AP is computed from the non-interpolated points and interpolated-curve variants can give somewhat different values. Standard IR texts describe this interpolation.

Formula
P_{\mathrm{interp}}(r) = \max_{r' \ge r} P(r'),\quad r \in [0, 1]
4

MAP aggregates single-query average precision into one number by taking the arithmetic mean of AP over all queries in the evaluation set. Each query contributes equally regardless of how many relevant documents it has, so MAP summarizes a system's typical ranking quality across a representative workload. This is the value reported in TREC ad hoc evaluations and in most academic comparisons of retrieval systems.

Formula
\mathrm{MAP} = \frac{1}{|Q|}\sum_{q \in Q} \mathrm{AP}(q)
5

Finally, the reliability of the comparison itself can be assessed. Buckley and Voorhees model a measure's error rate as the probability that, for two systems, the measure declares the wrong winner relative to their true difference. This framing lets you ask how often a given measure would reverse a conclusion under a different sample of queries. Practically, report MAP together with the number of queries and a significance test, so that observed differences are not mistaken for sampling noise. For specific quantitative results and query-count guidance, consult the original paper.

Formula
\mathrm{error\ rate}(M) = \Pr\bigl[\,\widehat{\mathrm{sign}}(M_A - M_B) \ne \mathrm{sign}(M_A - M_B)\,\bigr]

Common pitfalls

  • Confusing precision at k or mean reciprocal rank with MAP; they answer different questions and are not interchangeable.
  • Reporting differences in MAP from a small query set without a significance test, ignoring the measure's sampling variability.
  • Treating all unjudged documents as non-relevant in a sparsely judged collection, which deflates MAP for systems that surface novel relevant items.
  • Reporting MAP for tasks with graded relevance, where collapsing grades to binary discards exactly the information the evaluation should reward.

Frequently asked questions

How is average precision different from precision at k?

Precision at k is the fraction of relevant documents in the top k and ignores both their order within the cutoff and any relevant documents below it. Average precision instead samples precision at every rank where a relevant document appears and averages over all relevant documents, so it is recall-aware and rewards ranking all relevant items highly. MAP is the mean of average precision across queries, giving a fuller picture of ranking quality than precision at a single cutoff.

How many queries do I need for a reliable MAP comparison?

There is no single universal number. Buckley and Voorhees (2000) study how the reliability of measure comparisons depends on factors such as the number of queries; consult the original paper for specific figures. With few queries, differences in MAP can reflect sampling noise, so report the query count and a paired significance test (such as a paired t-test or randomization test) when comparing systems.

When should I prefer nDCG over MAP?

Prefer nDCG when relevance is graded — when a highly relevant document should count more than a marginally relevant one — and when top-of-list quality at a cutoff is the priority, as in web search. Prefer MAP when relevance is binary and you care about ranking the entire set of relevant documents highly, as in recall-sensitive tasks. Many papers report both to characterize a system from both the binary, full-list view and the graded, top-heavy view.

Related methods

Sources

  1. Buckley, C., & Voorhees, E. M. (2000). Evaluating evaluation measure stability. In Proceedings of the 23rd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR '00), 33-40.

    Open DOI reference
  2. Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to Information Retrieval. Cambridge University Press.

    ISBN: 9780521865715