Mean Average Precision (MAP) is an information retrieval metric that calculates the mean of the Average Precision (AP) scores across a set of queries, providing a single-figure measure of ranking quality. AP for a single query is computed by taking the average of the precision@k values at each rank where a relevant document is retrieved. MAP aggregates this by averaging the AP scores for all queries in the evaluation set, making it sensitive to the rank order of all relevant items.
Glossary
Mean Average Precision (MAP)

What is Mean Average Precision (MAP)?
Mean Average Precision (MAP) is a core metric for evaluating the overall quality of a ranking system, such as a search engine or a retrieval-augmented generation (RAG) retriever, across multiple queries.
MAP is particularly valuable in Retrieval-Augmented Generation (RAG) evaluation because it rewards systems that rank the most relevant documents higher, directly impacting the quality of the context provided to the language model. It is a standard benchmark in TREC Evaluation and contrasts with simpler metrics like precision@k or recall@k by summarizing performance across the entire recall spectrum. A higher MAP score indicates a more effective retrieval system for the given query set.
Key Characteristics of MAP
Mean Average Precision (MAP) is a core metric for evaluating ranking systems, particularly in information retrieval and RAG. It provides a single, comprehensive score by averaging precision across all relevant documents for multiple queries.
Definition & Core Calculation
Mean Average Precision (MAP) is the mean of the Average Precision (AP) scores across a set of queries. For a single query, AP is calculated as the average of the precision@k values computed at each position where a relevant document is retrieved.
Formula (for a single query): AP = (1 / Total Relevant Documents) * Σ (Precision@k * rel(k)) Where rel(k) is 1 if the document at rank k is relevant, 0 otherwise.
Final MAP: MAP = (1 / Number of Queries) * Σ AP for each query. This single score summarizes the ranking quality across the entire query set.
Handles Multiple Relevant Documents
Unlike simpler metrics like precision@k or recall@k, MAP accounts for the rank order of all relevant documents. It rewards systems that retrieve relevant documents higher in the ranking.
Key Behavior:
- A system gets a higher AP score if it retrieves two relevant documents at ranks 1 and 2 versus ranks 5 and 10.
- It penalizes systems that bury relevant documents deep in the result list.
- This makes MAP highly suitable for tasks where a user examines results sequentially, such as web search or document retrieval for RAG context windows.
Binary Relevance Assumption
The standard formulation of MAP operates on binary relevance judgments: a document is either relevant (1) or not relevant (0) to a query. It does not natively handle graded relevance (e.g., slightly relevant, highly relevant).
Implications for Evaluation:
- This simplifies ground truth creation but can be a limitation for nuanced tasks.
- For scenarios requiring graded relevance, metrics like Normalized Discounted Cumulative Gain (NDCG) are often preferred.
- In RAG evaluation, relevance is often binary based on whether a document chunk contains information necessary to answer the query.
Query Set Sensitivity & Interpretation
MAP is highly sensitive to the composition of the evaluation query set. Its value is most meaningful when averaged over a large, representative set of queries.
Interpretation Guidelines:
- A MAP of 1.0 indicates perfect retrieval across all queries.
- A MAP of 0.0 indicates no relevant documents were retrieved for any query.
- It is a macro-average over queries, treating each query as equally important.
- Comparing MAP scores is only valid when using the same query set and relevance judgments. It is the standard metric for benchmarks like TREC tracks.
Relation to Precision-Recall Curve
The Average Precision (AP) for a single query can be interpreted as an approximation of the area under the precision-recall curve (AUC-PR) for that query. Therefore, MAP represents the mean area under the precision-recall curves across all queries.
Why this matters:
- It summarizes the precision-recall trade-off across all recall levels into one number per query.
- It is more informative than a single precision@k point, which only considers one specific cutoff.
- This property makes MAP a robust summary statistic for ranking performance, especially when the number of relevant documents per query varies.
Use in RAG and Modern Retrieval
In Retrieval-Augmented Generation (RAG) evaluation, MAP is used to assess the quality of the retriever component before generation occurs. It measures how well the system fetches the correct source material.
Practical Application:
- Evaluate different embedding models or retrieval algorithms (e.g., dense vs. sparse vs. hybrid).
- Tune parameters like chunk size or overlap by measuring their impact on retrieval MAP.
- It is often used alongside end-to-end metrics like answer faithfulness or RAGAS scores to provide a complete performance picture.
- Benchmarks like BEIR and MTEB report MAP scores for retrieval tasks.
MAP vs. Other Retrieval Metrics
A feature-by-feature comparison of Mean Average Precision (MAP) against other common metrics for evaluating information retrieval and ranking systems.
| Metric / Feature | Mean Average Precision (MAP) | Precision@k / Recall@k | Mean Reciprocal Rank (MRR) | Normalized Discounted Cumulative Gain (NDCG) |
|---|---|---|---|---|
Core Definition | Mean of Average Precision scores across multiple queries. | Precision/Recall calculated at a fixed cutoff k. | Mean of the reciprocal rank of the first relevant result. | Gain of documents based on graded relevance and position, normalized to ideal. |
Query Set Evaluation | ||||
Accounts for Ranking Order | ||||
Handles Multiple Relevant Docs | ||||
Handles Graded Relevance | ||||
Primary Use Case | Overall ranking quality across many queries. | Performance at a specific result depth (k). | Finding the first relevant result (e.g., question answering). | Ranking with non-binary relevance (e.g., search engines). |
Single-Figure Summary | ||||
Interpretation Range | 0 to 1 | 0 to 1 | 0 to 1 | 0 to 1 |
Sensitivity to Top Results | High (via Average Precision). | Defined by k. | Extreme (only first result). | High (via logarithmic discount). |
Where is MAP Used?
Mean Average Precision (MAP) is a cornerstone metric for evaluating ranking systems where the order of results is critical. It is the standard for quantifying retrieval quality in scenarios with binary relevance judgments.
Recommendation Systems
MAP is used to evaluate ranking in recommendation engines, where the goal is to surface a personalized, ordered list of items (products, videos, articles) that a user is likely to find relevant.
- Personalized Ranking: Assesses if a system correctly ranks items a user will interact with (e.g., purchase, watch) above those they will not.
- Beyond Accuracy: Captures the business impact of ranking; showing the most relevant item first maximizes conversion. A system with higher MAP typically drives more engagement.
- Common Benchmarks: Used with datasets like MovieLens for film recommendations.
Binary Classification & Anomaly Detection
For binary classifiers that output a probability or confidence score (e.g., fraud detection, medical diagnosis), the Average Precision (AP) metric summarizes performance across all thresholds, especially when classes are imbalanced.
- Precision-Recall Focus: AP (and by extension, MAP over multiple trials/classes) is often more informative than AUC-ROC when the positive class (e.g., 'fraudulent transaction') is rare.
- Anomaly Detection: Evaluates systems that rank events by their anomaly score. A high AP means true anomalies are consistently ranked higher than normal events.
- Use Case: Evaluating a model that flags network intrusions, where catching all intrusions (high recall) while minimizing false alarms (high precision) is critical.
Frequently Asked Questions
Mean Average Precision (MAP) is a core metric for evaluating ranking systems, particularly in information retrieval and recommendation engines. These questions address its calculation, interpretation, and role in assessing Retrieval-Augmented Generation (RAG) pipelines.
Mean Average Precision (MAP) is an evaluation metric that calculates the mean of the Average Precision (AP) scores across a set of queries, providing a single-figure measure of quality for a ranking system.
It is the standard metric for tasks where the order of retrieved items matters, such as document search or product recommendations. MAP is calculated by first computing the Average Precision for each individual query, which itself is the average of the Precision@k values calculated at each position where a relevant document is found. The final MAP score is the arithmetic mean of these AP scores across all queries in the evaluation set. A higher MAP indicates a system that consistently ranks relevant items higher in the results list.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Mean Average Precision (MAP) is a core metric for ranking systems. To fully understand its context and application, it's essential to be familiar with these related evaluation concepts.
Precision and Recall
Precision measures the fraction of retrieved documents that are relevant. Recall measures the fraction of all relevant documents that are retrieved. These are the foundational binary metrics from which MAP is derived.
- Precision@k: Precision calculated only on the top k retrieved results.
- Recall@k: Recall calculated only on the top k retrieved results. MAP computes the Average Precision, which is the average of precision values at each rank where a relevant document is found, effectively summarizing the precision-recall trade-off for a single query.
Mean Reciprocal Rank (MRR)
Mean Reciprocal Rank (MRR) is a simpler ranking metric focused on the position of the first relevant item. For a set of queries, it calculates the average of the reciprocal of the rank of the first correct answer.
- Calculation: MRR = (1/Q) * Σ (1 / rank_i), where rank_i is the position of the first relevant document for query i.
- Use Case: Ideal for tasks where the user needs only one correct answer (e.g., question answering, voice assistants). Unlike MAP, MRR does not consider the precision of all relevant items, only the first.
Normalized Discounted Cumulative Gain (NDCG)
Normalized Discounted Cumulative Gain (NDCG) evaluates ranking quality when relevance is graded (e.g., scores of 0, 1, 2, 3) rather than binary. It incorporates the position and relevance grade of each item.
- Discounted Cumulative Gain (DCG): Sums relevance scores, logarithmically discounting scores as rank increases.
- Ideal DCG (IDCG): The DCG of the perfect ranking.
- NDCG@k: DCG@k / IDCG@k, resulting in a score between 0 and 1. While MAP assumes binary relevance, NDCG handles multi-level relevance, making it suitable for web search and recommendation systems.
R-Precision
R-Precision is a precision metric calculated after retrieving exactly R documents, where R is the total number of relevant documents for the query in the entire collection.
- Calculation: If a query has 10 relevant documents (R=10), R-Precision is the precision value after examining the top 10 results.
- Interpretation: It provides a fixed cutoff point tailored to each query's number of relevant documents. It is a component sometimes used in the TREC Evaluation benchmarks. R-Precision offers a single, query-specific precision point, whereas MAP averages precision at every relevant document's rank.
Precision-Recall Curve & AUC
A Precision-Recall (PR) Curve plots precision against recall at various classification thresholds or ranking cutoffs. The Area Under the PR Curve (AUC-PR) summarizes the curve's performance in a single number.
- Relationship to MAP: The Average Precision (AP) for a single query is numerically equivalent to the area under the interpolated precision-recall curve for that query. Therefore, MAP is the mean of the AUC-PR values across all queries.
- Utility: The PR curve and its area are particularly informative for imbalanced datasets where the number of negative (non-relevant) examples vastly outweighs the positives.
Benchmarks: TREC & BEIR
Standardized benchmarks are crucial for rigorous evaluation. TREC (Text REtrieval Conference) provides the seminal methodology for evaluating search systems, often using metrics like MAP and P@10.
The BEIR (Benchmarking IR) Benchmark is a modern, heterogeneous suite for evaluating zero-shot retrieval performance across diverse tasks (e.g., fact-checking, question answering, bio-medical retrieval). It reports metrics like NDCG@10 and Recall@100, with MAP being a common aggregate score for classical retrieval baselines. These benchmarks establish the standardized datasets and protocols required to compute and compare MAP scores meaningfully.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us