Inferensys

Glossary

Mean Average Precision (MAP)

An information retrieval metric that computes the mean of average precision scores across multiple queries, evaluating the overall ranking quality of a legal document retrieval system.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
INFORMATION RETRIEVAL METRIC

What is Mean Average Precision (MAP)?

Mean Average Precision (MAP) is a rank-aware metric that evaluates the quality of a retrieval system by computing the mean of the Average Precision (AP) scores across a set of distinct legal queries.

Mean Average Precision (MAP) provides a single-figure measure of a retrieval system's overall ranking quality by averaging the Average Precision (AP) for each query in an evaluation set. AP itself summarizes the precision-recall curve by calculating the precision at the position of each relevant document, rewarding systems that place relevant legal documents higher in the returned list. This metric is crucial for evaluating legal embedding models where the order of retrieved case law or statutes directly impacts research efficiency.

Unlike rank-unaware metrics, MAP penalizes systems that bury relevant documents deep in the results, making it a standard benchmark for dense passage retrieval and hybrid search pipelines. It is computed by taking the mean of the AP scores across all queries, ensuring that a system is judged on its consistent performance rather than a single lucky result. For legal AI engineers, MAP validates that a vector database index reliably surfaces the most authoritative precedents first.

METRIC FUNDAMENTALS

Key Characteristics of MAP

Mean Average Precision (MAP) provides a single-figure measure of quality across ranked retrieval results by evaluating both the precision and the position of relevant documents.

01

Ranking-Sensitive Evaluation

MAP evaluates the order of retrieved documents, not just the total number of relevant items found. It computes precision at each position where a relevant document appears, heavily penalizing systems that bury critical legal precedents at the bottom of a result list. This makes it ideal for legal search where the top-ranked cases carry the most weight in argument construction.

02

Binary Relevance Foundation

MAP operates on binary relevance judgments—a document is either relevant or non-relevant to the query. In legal retrieval, this maps cleanly to whether a case or statute directly addresses the legal question at hand. The metric averages precision values computed only at recall points where a relevant document is found, ignoring non-relevant positions entirely.

03

Query-Level Aggregation

The metric first computes Average Precision (AP) for each individual query, then takes the arithmetic mean across all queries in the evaluation set. This ensures that performance on rare, difficult legal queries is weighted equally with common ones, preventing a system optimized for frequent queries from masking poor performance on edge cases.

04

MAP@K Truncation

MAP is often computed at a cutoff K (e.g., MAP@10, MAP@100), evaluating only the top-K retrieved documents. In legal research workflows, this reflects real user behavior—attorneys rarely review beyond the first few pages of results. MAP@10 measures whether the most critical authorities appear in the initial screen of results.

05

Interpolation vs. Exact Computation

Two variants exist: interpolated AP uses fixed recall levels (0.0, 0.1, ..., 1.0) for smoothing, while exact AP computes precision at every relevant document's rank. Modern legal retrieval benchmarks favor exact computation for its finer granularity, capturing subtle differences in ranking quality that interpolated methods may obscure.

06

Limitations in Graded Relevance

MAP cannot distinguish between partially relevant and highly relevant documents—a case that tangentially mentions a principle scores identically to one directly on point. For legal retrieval requiring nuanced relevance grades (e.g., binding vs. persuasive authority), consider NDCG as a complementary metric that captures graded relevance judgments.

METRIC COMPARISON

MAP vs. Other Retrieval Metrics

Comparative analysis of Mean Average Precision against other common information retrieval evaluation metrics for legal document ranking systems.

FeatureMAPNDCGRecall@K

Primary Focus

Ranking quality across all relevant documents

Graded relevance with position discounting

Coverage of relevant documents in top K

Handles Graded Relevance

Position Sensitivity

Full ranking sensitivity

Logarithmic position discount

Position-agnostic within K

Binary Relevance Sufficient

Multi-Query Aggregation

Arithmetic mean of per-query AP

Arithmetic mean across queries

Arithmetic mean across queries

Typical Legal Use Case

Evaluating case law retrieval systems

Assessing relevance-graded document rankings

Measuring discovery completeness

Interpretation Complexity

Moderate

Moderate to High

Low

MEAN AVERAGE PRECISION

Frequently Asked Questions

Clear, technical answers to the most common questions about Mean Average Precision (MAP) and its role in evaluating legal document retrieval systems.

Mean Average Precision (MAP) is an information retrieval metric that computes the mean of the Average Precision (AP) scores across a set of multiple queries, providing a single-figure measure of overall ranking quality. To calculate MAP, you first compute the Average Precision for each individual query by averaging the precision values obtained at each position where a relevant document is retrieved. The formula for Average Precision is AP = (1 / R) * Σ(P(k) * rel(k)), where R is the total number of relevant documents, P(k) is the precision at cutoff k, and rel(k) is an indicator function that equals 1 if the item at rank k is relevant. MAP is then simply the arithmetic mean of all AP scores across the query set: MAP = (1 / Q) * Σ(AP_q). This metric penalizes systems that fail to rank relevant documents highly, making it particularly valuable for evaluating legal document retrieval systems where missing a key precedent at rank 50 is a critical failure.

Prasad Kumkar

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.