← Back to article

Equation 11 · Measuring What a RAG System Retrieves, Not Just What It Answers

What does this equation mean?

DCG@k=∑i=1k2 reli−1log⁡2(i+1),nDCG@k=DCG@kIDCG@k\mathrm{DCG@}k = \sum_{i=1}^{k} \frac{2^{\,\mathrm{rel}_i}-1}{\log_2(i+1)}, \qquad \mathrm{nDCG@}k = \frac{\mathrm{DCG@}k}{\mathrm{IDCG@}k}

Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.

Start with2^rel_i-1
Divide bylog_2(i+1)
This relates toDCG@k
How to read the two sides of this formula. Follow the article passage for the meaning of each quantity.

This equation states an equality: the expressions on both sides have the same value under the article’s assumptions. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.

Read it piece by piece

kk

Symbol k

the DCG of the ideal ordering, so the ratio is bounded near one regardless of how many relevant documents exist for a given query.

Understand this part →

ii

Symbol i

a position index.

Understand this part →

=

=

The expressions on both sides represent the same quantity under the stated assumptions.

Understand this part →

See an illustrated explanation →
fraction

fraction

Divide the expression above the line by the one below it.

Understand this part →

See an illustrated explanation →
addition

addition

Add the term after the plus sign to the term or group before it.

Understand this part →

subtraction

subtraction

Subtract the following term or group from the preceding one. A leading minus marks a negative quantity.

Understand this part →

subscript

subscript

The lower label selects a particular version, component, or indexed member of the quantity. For example, x₀ and xₜ can be values at different positions.

Understand this part →

superscript

superscript

A raised number can be a power. When it is a label or bound, it selects a case or the upper limit of a sum; the formula’s structure distinguishes these uses.

Understand this part →

See an illustrated explanation →
i=1i=1

Starting index or lower bound: i=1

This label says where the repeated addition, multiplication, or accumulation starts. Read its value or condition together with the article’s description of the index.

Understand this part →

kk

Ending index or upper bound: k

This label says where the repeated addition, multiplication, or accumulation stops. It sets the last term or end of the range.

Understand this part →

2 reli−12^{\,\mathrm{rel}_i}-1

Numerator: 2^rel_i-1

The complete quantity above the fraction bar.

Understand this part →

log⁡2(i+1)\log_2(i+1)

Denominator: log_2(i+1)

The complete quantity below the fraction bar; it must be nonzero for this division.

Understand this part →

See an illustrated explanation →
DCG@k\mathrm{DCG@}k

Numerator: DCG@k

The complete quantity above the fraction bar.

Understand this part →

IDCG@k\mathrm{IDCG@}k

Denominator: IDCG@k

The complete quantity below the fraction bar; it must be nonzero for this division.

Understand this part →

How to interpret it

With a fixed numerator, increasing a nonzero denominator reduces the fraction. Read it with the definitions, units, and assumptions supplied by the article.

What the article says around this equation

Normalised discounted cumulative gain generalises this to graded relevance and to the whole list rather than only the first hit: DCG@k=∑i=1k2 reli−1log⁡2(i+1),nDCG@k=DCG@kIDCG@k\mathrm{DCG@}k = \sum_{i=1}^{k} \frac{2^{\,\mathrm{rel}_i}-1}{\log_2(i+1)}, \qquad \mathrm{nDCG@}k = \frac{\mathrm{DCG@}k}{\mathrm{IDCG@}k}. where reli\mathrm{rel}_i is the graded relevance of the result at position i and IDCG@\mathrm{IDCG@}k is the DCG of the ideal ordering, so the ratio is bounded near one regardless of how many relevant documents exist for a given query. The logarithmic discount encodes a specific judgement about attention: a relevant document at position one is worth far more than the same document at position ten, and nDCG is the standard way the information-retrieval literature makes that judgement quantitative. Heterogeneous retrieval benchmarks built to compare…
Read the full surrounding passage
Normalised discounted cumulative gain generalises this to graded relevance and to the whole list rather than only the first hit: DCG@k=∑i=1k2 reli−1log⁡2(i+1),nDCG@k=DCG@kIDCG@k\mathrm{DCG@}k = \sum_{i=1}^{k} \frac{2^{\,\mathrm{rel}_i}-1}{\log_2(i+1)}, \qquad \mathrm{nDCG@}k = \frac{\mathrm{DCG@}k}{\mathrm{IDCG@}k}. where reli\mathrm{rel}_i is the graded relevance of the result at position i and IDCG@\mathrm{IDCG@}k is the DCG of the ideal ordering, so the ratio is bounded near one regardless of how many relevant documents exist for a given query. The logarithmic discount encodes a specific judgement about attention: a relevant document at position one is worth far more than the same document at position ten, and nDCG is the standard way the information-retrieval literature makes that judgement quantitative. Heterogeneous retrieval benchmarks built to compare retrievers across many domains at once — BEIR evaluated ten lexical, sparse, dense, late-interaction and re-ranking systems across eighteen public datasets and found BM25 a robust baseline that dense retrievers frequently underperformed out of domain — rely on exactly these rank-based metrics to make that comparison possible without ever generating an answer [ 2 ] .

Read the equation in its article →

Sources cited in the surrounding passage

These citations give research context. Read each source to check which claims it supports.

Return to Measuring What a RAG System Retrieves, Not Just What It Answers

See this formula across 1 published context →

Browse the mathematical compendium →