Skip to content
Hands-on4 min readPublished 2026-11-29Reviewed 2027-11-29

A 20-question eval cannot see a 10-point gap: the three RAG metrics do not share a denominator ​

Three rows on the eval sheet: context recall 90%, faithfulness 85%, answer correctness 80%. After a prompt change they read 92%, 88%, 83%. The team says "everything improved" and ships. Two weeks later complaints rise, and on review those three numbers on a 20-question sample move by an order of magnitude more than the improvement did.

The mistake is not choosing the wrong metrics. It is that the three metrics do not count the same thing: one counts questions, another counts claims. At the same sample size their statistical resolution differs by two to three times.

What each denominator actually is ​

The RAGAS documentation is explicit about two of them:

  • Faithfulness = claims in the answer supported by the retrieved context ÷ total claims in the answer. Split the answer into claims, then judge each against the context. The official example scores 1/2 = 0.5.
  • Context recall = claims in the reference supported by the retrieved context ÷ total claims in the reference. The docs note it "always requires a reference to compare against", and the LLM version uses reference as a proxy for reference_contexts.
  • Answer correctness = correct answers ÷ questions.

There is the difference: the faithfulness denominator is set by how long the model's output is, the recall denominator by how long the gold answer is, and correctness just counts questions. On the same 20 questions, if each answer yields 4 claims, faithfulness has an effective sample of 80, not 20. Recall likewise. Correctness stays at 20.

How wide is the error on question-level metrics ​

Wilson intervals at 95%, sample size counted in questions:

Questions nObserved correctness95% intervalWidth
1210/12 = 83.3%[55.2%, 95.3%]40.1 points
2016/20 = 80.0%[58.4%, 91.9%]33.5 points
5040/50 = 80.0%[67.0%, 88.8%]21.8 points
10080/100 = 80.0%[71.1%, 86.7%]15.5 points
200160/200 = 80.0%[73.9%, 85.0%]11.0 points
400320/400 = 80.0%[75.8%, 83.6%]7.8 points

On a 20-question set, an observed 80% could be anything from 58% to 92%. "Improved from 80% to 83%" is statistically indistinguishable from no change — you cannot even establish the direction.

How many questions to separate 10 points: a two-proportion test at two-sided α=0.05 with power 0.8 needs about 197 questions per group for 80% versus 90%, and about 291 for 70% versus 80%. That is far beyond most teams' eval sets, which is exactly why "the new prompt feels better but I cannot say how".

Metrics with a bigger denominator double the resolution ​

On the same 20 questions, if each answer yields 4 claims, faithfulness has 80 observations: at an observed 80% the half-width is 8.7%, against 16.8% for the 20-question level — roughly twice the resolution. At 8 claims per answer it is 6.2%; 50 questions × 4 claims = 200 observations gives a 5.5% half-width, close to the precision of a 200-question question-level metric.

So the trio should not be held to one sample-size standard: correctness can only show trend; recall and faithfulness can show small differences. To decide whether a change helped, either push the question count past a hundred, or switch to a metric with a bigger denominator — not compare three-digit percentages on a small sample.

python
import math

def wilson(k, n, z=1.959964):
    p = k / n
    den = 1 + z * z / n
    center = (p + z * z / (2 * n)) / den
    half = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / den
    return center - half, center + half

# 16 of 20 questions correct
print(wilson(16, 20))   # (0.584, 0.919)

The faithfulness denominator drifts with answer length ​

The second trap: the same facts score lower when the answer is verbose. Grow the answer from 3 claims to 6 and the transitional and summary sentences enter the denominator too; one unsupported claim among them pulls faithfulness down. So "faithfulness improved" may only mean the model got shorter, and "faithfulness dropped" may only mean it got more detailed.

Two engineering fixes: when comparing two prompts, fix the output length or normalise by claim count; when reporting faithfulness, publish the mean claim count so readers know the denominator. The docs also offer replacing the second step with a classifier like HHEM-2.1-Open (T5-based, runs on CPU, default batch 10), which cuts judging cost — but the denominator definition does not change.

Recall has three variants: prefer ids ​

Context recall comes in three flavours with the same denominator but different noise:

  • LLM-based: uses reference as the stand-in, splits the gold answer into claims and checks each. Expensive and noisy.
  • Non-LLM: retrieved reference contexts ÷ total reference contexts, by string comparison.
  • ID-based: retrieved reference ids ÷ total reference ids; the official example scores 0.25.

If your chunks have stable ids (say, paragraph fingerprints), use the ID version: zero model calls, reproducible, immune to wording changes. It answers "did the right paragraph come back", which is what recall is for. The LLM version answers "was the information covered", which is a different question — do not report them as one.

Three rules to work by ​

  1. Every ratio ships with an interval. Any question-level proportion gets a Wilson interval; "a 3-point improvement" in a 20-question report is not a finding.
  2. Size the sample per metric: correctness needs a hundred-plus before comparison; recall and faithfulness can lean on claim-level denominators and show direction at 20–50 questions.
  3. Align denominators before comparing. When two prompts' outputs differ twofold in length, faithfulness scores are not comparable — check the mean claim count first.

Scope and limits: Wilson intervals at 95% two-sided; sample-size figures use the normal approximation for two proportions (two-sided α=0.05, power 0.8) and are design guidance, not an exact power calculation. The claim multiplier m (4 / 8) is a design parameter; the true m for your corpus was not measured here — count the mean claims per answer on 20 samples before using the table.

OpenAIChat · Full-stack engineering for LLM-powered conversations and apps