Normalized Discounted Cumulative Gain (NDCG) is a ranking quality metric that evaluates a system's ability to place highly relevant documents at the top of a results list. It computes the Discounted Cumulative Gain (DCG) by summing the graded relevance of each document, logarithmically discounted by its rank position to penalize relevant items appearing lower in the list. This raw DCG score is then normalized by dividing it by the Ideal DCG (IDCG)—the DCG of a perfect ranking—yielding a value between 0.0 and 1.0.
Glossary
NDCG (Normalized Discounted Cumulative Gain)

What is NDCG (Normalized Discounted Cumulative Gain)?
NDCG is a standard listwise evaluation metric for information retrieval and re-ranking systems that measures the quality of a ranked list by discounting relevance gains logarithmically by position and normalizing against the ideal ranking.
NDCG is the dominant metric for cross-encoder re-ranking and learning to rank (LTR) systems because it supports multi-level graded relevance judgments (e.g., irrelevant=0, relevant=1, highly relevant=2) rather than binary labels. Unlike Mean Reciprocal Rank (MRR), which only considers the first relevant document, NDCG accounts for the entire ranked list, making it sensitive to both top-heavy precision and overall recall quality. It is the optimization target for algorithms like LambdaMART, which use the gradient of NDCG to train ranking models.
Key Characteristics of NDCG
Normalized Discounted Cumulative Gain (NDCG) is the primary listwise metric for evaluating ranking quality in information retrieval. It measures how well a system orders documents by penalizing relevant items that appear lower in the list, then normalizes against the ideal ranking to produce a score between 0 and 1.
Position-Based Discounting
NDCG applies a logarithmic discount to relevance gains based on rank position. A highly relevant document at position 1 contributes its full gain, while the same document at position 10 contributes only a fraction. The discount function is typically 1 / log2(rank + 1), meaning the drop-off is steepest at the top ranks. This reflects user behavior: searchers rarely scroll beyond the first few results, so top-heavy precision is weighted more heavily than recall at depth.
Graded Relevance Judgments
Unlike binary metrics (relevant/not relevant), NDCG supports multi-level relevance scales. Documents can be labeled with scores like:
- 0: Irrelevant
- 1: Marginally relevant
- 2: Relevant
- 3: Highly relevant
- 4: Perfectly relevant
This granularity allows NDCG to distinguish between a system that places a 'perfect' document at rank 1 versus one that places a merely 'relevant' document there. The cumulative gain is the sum of these graded scores across the ranked list before discounting.
Ideal DCG Normalization
The 'N' in NDCG stands for normalization. After computing the Discounted Cumulative Gain (DCG) of the system's ranked list, NDCG divides it by the Ideal DCG (IDCG) — the DCG of the perfect ranking where all documents are sorted in descending order of relevance. This normalization produces a score between 0.0 and 1.0, making NDCG comparable across queries with different numbers of relevant documents. A score of 1.0 means the system produced the optimal ordering.
Cutoff-Based Evaluation (NDCG@k)
NDCG is typically reported at a specific cutoff depth, written as NDCG@k (e.g., NDCG@10). This evaluates only the top k results, aligning with the reality that users rarely examine results beyond the first page. Common cutoffs include:
- NDCG@1: Measures if the top result is relevant
- NDCG@5: Evaluates the first half of a typical SERP
- NDCG@10: Standard full-page evaluation
Different k values reveal different system behaviors: a system might excel at NDCG@1 but degrade at NDCG@20.
Exponential Gain Variants
Standard NDCG uses linear gain (relevance score = gain). However, many implementations use an exponential gain function: 2^relevance - 1. This dramatically amplifies the difference between relevance levels. For example:
- Relevance 3 → gain of 7
- Relevance 4 → gain of 15
This variant, sometimes called NDCG with exponential gain, strongly penalizes systems that fail to place highly relevant documents at the very top, making it the preferred formulation in modern search evaluation benchmarks like MS MARCO.
Listwise vs. Pointwise Metrics
NDCG is a listwise metric — it evaluates the entire ordering as a single unit rather than individual query-document pairs. This contrasts with:
- Pointwise metrics like precision@k, which treat each position independently
- Pairwise metrics like Mean Reciprocal Rank (MRR), which only consider the first relevant document
NDCG's listwise nature makes it the preferred optimization target for Learning to Rank (LTR) algorithms like LambdaMART, which use NDCG's lambda gradients to directly optimize ranking order during training.
Frequently Asked Questions
Precise answers to the most common technical questions about Normalized Discounted Cumulative Gain, the standard listwise metric for evaluating re-ranking and search quality.
Normalized Discounted Cumulative Gain (NDCG) is a listwise evaluation metric that measures the quality of a ranked list by comparing it against an ideal ordering. It works by first computing the Discounted Cumulative Gain (DCG), which sums the graded relevance scores of documents in a result list, applying a logarithmic discount to penalize relevant documents appearing lower in the ranking. This DCG value is then normalized by dividing it by the Ideal DCG (IDCG)—the DCG of the perfectly ordered list—yielding a score between 0.0 and 1.0. The normalization ensures comparability across queries with varying numbers of relevant documents. NDCG heavily weights top-ranked precision, making it the standard metric for evaluating Cross-Encoder re-ranking and Learning to Rank (LTR) systems where early positions are critical.
NDCG vs. Other Ranking Metrics
How NDCG compares to other standard information retrieval metrics for evaluating ranked lists, highlighting key differences in handling graded relevance, position weighting, and normalization.
| Feature | NDCG | MRR | Precision@K | MAP |
|---|---|---|---|---|
Handles graded relevance | ||||
Position-aware discounting | ||||
Normalized against ideal ranking | ||||
Considers all relevant documents | ||||
Sensitive to top-ranked precision | ||||
Binary relevance only | ||||
Common use case | Re-ranking quality with multi-level labels | First correct answer position | Top-K retrieval precision | Ranked retrieval with binary labels |
Typical range | 0.0 to 1.0 | 0.0 to 1.0 | 0.0 to 1.0 | 0.0 to 1.0 |
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
NDCG is a cornerstone metric for evaluating ranked lists, particularly in multi-stage retrieval pipelines. These related concepts define the scoring mechanisms, training objectives, and architectural patterns that directly optimize for or interact with NDCG.
Listwise Ranking Loss
A family of training objectives that optimize the entire ordering of a document list rather than individual pairs or points. These losses directly maximize list-level metrics like NDCG.
- ListMLE: Minimizes the negative log-likelihood of the ground-truth permutation.
- ListNet: Uses a top-one probability distribution over permutations.
- ApproxNDCG: A smooth, differentiable surrogate for NDCG that enables direct gradient-based optimization.
- Benefit: Avoids the positional bias and local optima of pairwise methods.
Position Bias in Re-Ranking
A systematic error where user click feedback used to train re-rankers is confounded by the propensity of users to click on top-ranked items regardless of relevance. This corrupts NDCG calculations based on implicit feedback.
- Impact: Inflates the perceived relevance of highly-positioned documents.
- Mitigation: Inverse Propensity Scoring (IPS) weights clicks by the inverse of their examination probability.
- Relevance: Uncorrected position bias leads to NDCG scores that measure user behavior rather than true relevance, undermining metric validity.
Score Calibration
The process of adjusting raw model logits so that output scores reflect true empirical relevance probabilities. Well-calibrated scores are essential for NDCG to accurately reflect ranking quality.
- Platt Scaling: Fits a logistic regression on top of raw scores.
- Temperature Scaling: Divides logits by a learned temperature parameter.
- Why It Matters: Overconfident but incorrect predictions at top ranks disproportionately degrade NDCG; calibration ensures the metric penalizes genuine failures rather than scaling artifacts.

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