Normalized Discounted Cumulative Gain (NDCG)

Category: AI Search & Retrieval

Definition

Normalized Discounted Cumulative Gain (NDCG) is a ranking evaluation metric used to measure how well a search system orders results according to their relevance.

Unlike Mean Reciprocal Rank (MRR), which focuses primarily on the position of the first relevant result, NDCG evaluates the quality of the entire ranked list.

It gives more importance to highly relevant results appearing near the top while still considering relevant results farther down the list.

Why It Matters

Not every relevant result is equally useful.

For example, imagine a search produces:

  1. Highly relevant
  2. Highly relevant
  3. Somewhat relevant
  4. Irrelevant

This is generally better than:

  1. Somewhat relevant
  2. Irrelevant
  3. Highly relevant
  4. Highly relevant

NDCG captures this difference by considering both relevance level and position.

How It Works

NDCG is based on three main concepts:

Gain — how relevant a result is.

Discount — results lower in the ranking receive less weight.

Normalization — the score is compared with an ideal ranking so results can be evaluated consistently.

A common formulation uses Discounted Cumulative Gain (DCG):

DCG = Σ relevance ÷ log₂(position + 1)

The DCG score is then normalized against the score of the ideal ranking:

NDCG = DCG ÷ Ideal DCG

The resulting score is commonly between 0 and 1, with a higher value indicating a ranking closer to the ideal ordering.

Example

Suppose a search evaluator assigns relevance scores from 0 to 3:

  • 3 = highly relevant
  • 2 = relevant
  • 1 = slightly relevant
  • 0 = irrelevant

A ranking such as:

3 → 3 → 2 → 0

will generally produce a higher NDCG than:

0 → 2 → 3 → 3

because the strongest results appear earlier.

This makes NDCG useful for evaluating whether a ranking system is putting the most valuable information where users are most likely to encounter it.

NDCG vs. MRR

The two metrics answer different questions.

MetricMain Question
MRRHow high is the first relevant result?
NDCGHow good is the overall ranking?

MRR is useful when finding one correct result quickly is the primary objective.

NDCG is more useful when several results can have different degrees of relevance and the ordering of the entire result set matters.

NDCG and Re-Ranking

NDCG is commonly used to evaluate ranking and re-ranking systems.

For example, an AI retrieval pipeline might first generate 100 candidates and then use a sophisticated ranking model to reorder them.

Researchers can compare NDCG before and after re-ranking to determine whether the new ranking better matches human relevance judgments.

This makes NDCG particularly useful for testing improvements to search algorithms.

NDCG and AI Retrieval

AI systems that retrieve multiple passages may benefit from ranking the strongest evidence near the top.

NDCG can help evaluate whether a retrieval system consistently places highly relevant passages ahead of less useful ones.

This matters because downstream systems may use only a subset of retrieved information due to context, latency, or processing constraints.

NDCG and AI Visibility

NDCG is not a direct AI visibility metric, and a website cannot optimize for a specific NDCG score in isolation.

However, it illustrates an important principle behind AI retrieval:

Relevant information needs to be identifiable and well-ranked, not merely present somewhere in a document collection.

For content creators, this reinforces the value of clear topical focus, strong answers, useful supporting detail, and well-structured information.

Related Terms

  • Mean Reciprocal Rank (MRR)
  • Mean Average Precision (MAP)
  • Retrieval Evaluation
  • Retrieval Quality
  • Retrieval Relevance
  • Retrieval Precision
  • Retrieval Recall
  • Re-Ranking
  • Learning to Rank
  • Passage Ranking
  • Document Ranking

In Simple Terms

NDCG measures how well a search system orders a whole list of results.

It rewards systems that put the most relevant results near the top while still considering the quality of results farther down the ranking.

I’m Ben

I’m passionate about helping businesses understand how AI is changing search, discovery, and online visibility. Through the AI Visibility Glossary, I break down emerging AI search and optimization concepts into clear, practical definitions—making complex terminology easier to understand and apply.

My focus is on building a useful reference for marketers, SEO professionals, content creators, and businesses navigating the rapidly evolving world of AI-powered search.

Primary Categories

  1. Fundamentals
  2. GEO & AI SEO
  3. AI Search & Retrieval
  4. Content & Authority
  5. Entities & Citations
  6. Technical AI SEO
  7. Measurement & Analytics
  8. Platforms & Emerging AI

Recent posts