What is nDCG (Normalised Discounted Cumulative Gain)?

nDCG (Normalised Discounted Cumulative Gain) is a ranking evaluation metric summing each result's relevance grade with a weight that falls by position, then dividing by the ideal ranking's sum to normalise between 0 and 1.

Unlike Mean Reciprocal Rank, which looks only at the first relevant result, nDCG weighs the whole list and relevance grades, rewarding highly relevant results near the top. It works with graded labels such as highly relevant, partly relevant and irrelevant.

Topic
Evaluation and quality
Also known as
NDCG, nDCG@10
Origin
Järvelin and Kekäläinen, 2002

How nDCG (Normalised Discounted Cumulative Gain) works

  1. Candidates for each query get graded relevance scores.
  2. Each ranked result's score is divided by the logarithm of its position plus one and summed for the top k; this is DCG.
  3. The same sum under the ideal ordering, IDCG, is computed.
  4. DCG divided by IDCG gives nDCG, averaged over queries; nDCG@10 counts only the top 10.

In more detail

Linear versus exponential gain

Two DCG forms are common: with linear gain each document's relevance grade is divided by the base-2 logarithm of its rank plus one; with exponential gain, 2 raised to the relevance grade minus 1 is divided by the same logarithm. Exponential gain penalises pushing top-grade documents down much more sharply; because libraries and teams may use either form, results are compared only after confirming they use the same formula.

When IDCG is zero because no relevant documents exist

If a query has no relevant documents in the corpus, IDCG@k equals zero and DCG/IDCG is undefined. Evaluation frameworks should define a consistent convention, either assigning nDCG = 0, setting 1.0 when an empty list is correctly returned or excluding zero-relevant queries from the macro average.

Incomplete judgements and pooling bias

Because nDCG@10 only inspects the top 10 returned items while IDCG@10 sorts the best 10 judgments from the entire candidate pool, the metric assumes complete or at least sufficiently deep, relevance pooling. In large enterprise corpora where only top results from baseline systems are judged, unjudged relevant documents can bias comparisons against new retrieval models.

Commonly confused terms

TermHow it differs
MAP (mean average precision)Mean Average Precision (MAP) averages precision at every relevant hit across binary relevance labels, while nDCG naturally accommodates multi-level graded relevance (0, 1, 2, 3) and explicitly discounts lower positions logarithmically.
Recall@k and hit rateRecall@k measures what fraction of all relevant documents appear in the top k regardless of their order within those k slots, whereas nDCG@k penalises pushing highly relevant documents down from rank 1 to rank k.

Why nDCG (Normalised Discounted Cumulative Gain) matters for on-premises AI

The paper proposing cumulated gain measures shows that judging results by relevance grade and position reflects that users reach lower results less often. A widely used benchmark gathering 18 datasets for zero-shot evaluation of retrieval models shows reranking and late-interaction models perform best on average but at high compute cost, while classic keyword search remains a robust baseline. Example calculation: three results with grades 3, 2 and 0 arriving in reverse order (0, 2, 3) drop nDCG to about 0.65.

ON-PREMISES EXAMPLE

A job listings platform labels candidate search results as highly relevant, partly relevant or irrelevant, measures them with nDCG@10 and launches a new ranking model only if that metric improves.

Common questions

How does nDCG differ from MRR?

MRR looks only at the first relevant result's rank. nDCG weighs all results by relevance grade and position.

How are relevance labels prepared for nDCG?

Experts give graded scores per query and candidate. Define the scale and guidelines up front and measure annotator agreement.

Sources

In the glossary: Glossary, M to Q

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.