Skip to content
mentoor

Topic 2 of 5 · 4 min read

Faithfulness and context relevance metrics

Goal: Choose faithfulness and context-relevance metrics for a pipeline and spot a judge score that disagrees with the evidence.

Faithfulness asks whether every claim in the answer is supported by the retrieved passages; context relevance asks whether those passages were worth retrieving. Neither needs a gold answer, so you can run both on real traffic where nobody has written the right answer down.

Check yourself · 1 of 3

What does a faithfulness score measure in a RAG pipeline?

Choose one answer

Why it matters

Recall needs gold passage labels, which exist only for your eval set. Production questions have none. Faithfulness and context relevance work from the question, the retrieved text and the answer alone, so they can watch live output. They also catch a failure recall cannot: an answer that contradicts or goes beyond a perfectly good passage.

How the metrics work

Most frameworks, Ragas among them, score these with an LLM judge in steps.

  • Faithfulness: split the answer into separate claims, then ask for each claim whether the retrieved context supports it. The score is supported claims over total claims. An answer of 5 claims with 4 supported scores 0.8.
  • Context relevance (or context precision): for each retrieved chunk, ask whether it is useful for the question. The score is the share of relevant chunks, and some variants weight relevant chunks that rank higher.
  • Answer relevance: does the answer address the question that was asked, whatever its truth?

Together they separate faults. Faithful but irrelevant context means the model honestly summarised the wrong material. Relevant context with low faithfulness means the model added things.

Calibrate the judge

A judge is a model, so it can be wrong in a steady direction. Before trusting a score, hand-label 30 to 50 outputs as supported or not, run the judge on the same items and compare. Read the disagreements one by one. Fix the judge prompt, then check again. Judges also favour longer answers and fluent text, so look for scores that stay high on weak answers.

Before and after

Weak: "Faithfulness averages 0.92, so we do not hallucinate." Fixed: "Faithfulness averages 0.92 by the judge. On 40 hand-labelled answers, the judge agreed with the human on 34. It marked 4 unsupported dates as supported, so date claims get an extra rule-based check."

What goes wrong

  • Treating a judge score as ground truth. It is an estimate until compared with human labels.
  • Judging with the same model that generated the answer. It tends to approve its own style, so use a different model where you can.
  • Faithful to bad context. A faithful answer built on an outdated passage is still wrong. Faithfulness alone says nothing about truth.
  • Averages only. Read the lowest-scoring 10 answers, not just the mean.

Examples

One answer, claim by claim

Context: "Refunds are available within 30 days of delivery. Digital items are not refundable." Answer: "You can get a refund within 30 days, including for digital items, and shipping is free."

Three claims. The 30 days claim is supported. The digital items claim contradicts the context. The free shipping claim is not in the context at all. Faithfulness is 1 of 3, 0.33, even though the answer reads smoothly.

A judge that disagrees with the evidence

Answer Judge score Human label Why
a1 1.0 supported matches passage
a2 1.0 unsupported answer says 14 days, passage says 30
a3 0.5 unsupported one claim added

The judge gave a2 full marks although the number is wrong. Add a check that extracted numbers and dates appear in the context.

Key points

  • Faithfulness checks claims in the answer against the retrieved text, and needs no gold answer.
  • Context relevance checks whether retrieved chunks are useful for the question, which catches noisy retrieval in live traffic.
  • Low faithfulness with relevant context means the generator added or changed claims.
  • Calibrate every LLM judge against 30 to 50 human labels and read the disagreements before trusting its scores.
  • A faithful answer can still be wrong if the retrieved passage is wrong or outdated.

Common mistakes

  • Treating the average judge score as truth without comparing it to human labels.
  • Using the generator model as its own judge and trusting the high scores.
  • Reading faithfulness as correctness, when the answer may be faithful to a wrong or stale passage.
  • Looking at the mean score only and never reading the lowest-scoring answers.

Check yourself · 2 of 3

An answer has 5 claims, and the judge finds 3 supported by the retrieved context. What is the faithfulness score?

Choose one answer

Check yourself · 3 of 3

Your judge gives an average faithfulness of 0.95. What should you do before reporting it as a result?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic