SmartFAQs.ai
Back to Learn
Intermediate

NDCG

NDCG (Normalized Discounted Cumulative Gain) is a ranking metric used in RAG to evaluate the retrieval component's ability to order context by relevance, rewarding the placement of highly relevant documents at the top while logarithmically penalizing relevant items that appear lower in the results. It is essential for minimizing 'lost-in-the-middle' phenomena in LLMs by ensuring the highest-signal data is prioritized.

Definition

NDCG (Normalized Discounted Cumulative Gain) is a ranking metric used in RAG to evaluate the retrieval component's ability to order context by relevance, rewarding the placement of highly relevant documents at the top while logarithmically penalizing relevant items that appear lower in the results. It is essential for minimizing 'lost-in-the-middle' phenomena in LLMs by ensuring the highest-signal data is prioritized.

Disambiguation

Focuses on the position and graded relevance of results, whereas Precision@K only measures if a result is present.

Visual Metaphor

"A luxury restaurant menu where the signature dishes must be on the first page; if the best items are buried on page ten, the menu's effectiveness score drops significantly."

Key Tools
RagasDeepEvalscikit-learnPyTreccarArize Phoenix
Related Connections

Conceptual Overview

NDCG (Normalized Discounted Cumulative Gain) is a ranking metric used in RAG to evaluate the retrieval component's ability to order context by relevance, rewarding the placement of highly relevant documents at the top while logarithmically penalizing relevant items that appear lower in the results. It is essential for minimizing 'lost-in-the-middle' phenomena in LLMs by ensuring the highest-signal data is prioritized.

Disambiguation

Focuses on the position and graded relevance of results, whereas Precision@K only measures if a result is present.

Visual Analog

A luxury restaurant menu where the signature dishes must be on the first page; if the best items are buried on page ten, the menu's effectiveness score drops significantly.

Related Articles