RAG evaluation: the metrics that show which half failed
RAG evaluation scores retrieval and generation separately, then checks the answer end to end. The metrics, what each one needs, and how to read a result.
- Published
- Reading time
- 13 min read
In short
- RAG evaluation scores retrieval and generation separately, because one end-to-end score cannot say whether the wrong passages were fetched or the right ones were misused.
- Retrieval metrics computed from labeled passage IDs, such as recall at k and nDCG, cost nothing per run. Judge-based metrics such as context recall and faithfulness cost model calls and need calibration against human labels.
- Context recall and correctness need a reference answer, so they run only on the offline test set. Context relevance, faithfulness, and answer relevancy need no reference and can grade sampled production traffic.
- Build the test set from real user queries. In an IBM Research study, 95 percent of questions generated from documents with a single prompt were single-fact lookups, the type that retrieval most often scored highest on.
RAG evaluation measures a retrieval-augmented generation system in two parts: whether retrieval returned the passages that contain the answer, and whether the model wrote a correct answer from them. Grade the two parts separately, then confirm with one end-to-end check of the final answer. A single end-to-end score shows that something is wrong. It does not show whether to fix the index or the prompt.
The sections below define the metrics for each half from their papers and library docs, then cover the test set, reading a result, production traffic, and release gates. LLM evaluation covers the general method, and RAG vs fine-tuning covers whether retrieval is the right design at all.
One end-to-end score hides which half failed
A single score for the final answer cannot separate a retrieval failure from a generation failure, and the two have different fixes. A wrong answer written from the right passages is a prompt or model problem. A wrong answer written from the wrong passages is a search problem, and no prompt change repairs it.
The two failures also hide each other. Joren and colleagues, in a 2024 study from Google, labeled whether the retrieved context was sufficient to answer each question, then split model errors by that label:
- Models gave incorrect answers on some cases where the context was sufficient, so better retrieval alone does not fix a RAG system.
- When the context was insufficient, models tended to give a wrong answer more often than they abstained.
- Models still answered correctly 35 to 62 percent of the time with insufficient context, so a correct answer does not prove that retrieval worked.
A correct answer without the evidence passes today and can fail when the fact changes, and only a retrieval score shows that the evidence never arrived.
The reverse case appears in RAGChecker, a 2024 benchmark of eight RAG systems across ten domains. In its best-performing system, an average of 92.9 percent of answer claims were supported by the retrieved chunks, and 62.0 percent were correct against the reference answer. Faithfulness alone would have reported that system as healthy.
Where each metric attaches to the pipeline
Each metric grades one stage of the pipeline from some combination of four inputs: the query, the retrieved passages, the answer, and a labeled reference. The reference is what a person adds to a test case: which passages are relevant, and what a correct answer says. Metrics that need it run only on a test set. The rest can also grade live traffic.
Three reference-free checks are common to most tools. TruLens calls them the RAG triad: context relevance, groundedness, and answer relevance. The 2023 Ragas paper defines the same three, with groundedness named faithfulness, and ARES (NAACL 2024) scores them with fine-tuned judges.
Retrieval metrics: recall first, then rank
Retrieval metrics answer two questions: whether the passages that contain the answer came back at all, and whether they were ranked above the noise. The classic metrics compare retrieved passage IDs with human relevance labels and need no model. The newer ones replace labels with an LLM judge.
| Metric | What it measures | What it needs |
|---|---|---|
| Recall at k | Share of the labeled relevant passages that appear in the top k | Relevant passage IDs for each query |
| Precision at k | Share of the top k that is relevant | Relevant passage IDs |
| MRR (mean reciprocal rank) | One divided by the rank of the first relevant passage, averaged over queries | At least one relevant ID per query |
| nDCG at k | Graded relevance summed with a discount for lower ranks, divided by the score of the ideal ordering | Graded relevance labels |
| Context recall | Share of the claims in the reference answer that the retrieved passages support | A reference answer and a judge |
| Context precision | Whether relevant passages rank above irrelevant ones, with a judge deciding relevance | A reference answer and a judge |
| Context relevance | Whether the retrieved passages are pertinent to the query | A judge only |
The first four are standard information retrieval measures. NIST's trec_eval tool notes that reciprocal rank suits queries with one relevant document, and that precision at a cutoff averages poorly across queries with different numbers of relevant documents. The BEIR benchmark reports nDCG at 10 throughout, because MRR and mean average precision cannot use graded judgments.
For RAG, track recall at k first. The generator cannot use a passage it never received, so a recall miss caps every later score. Add nDCG or context precision second, because position and noise both matter. Models use the start and end of the window better than the middle, as context engineering explains, and RAGChecker found that generators grew more sensitive to noise as retrieval recall rose.
The judge-based metrics trade labeling for model calls. Ragas computes context recall by splitting the reference answer into claims and checking each against the retrieved context, so it needs a reference answer and no passage labels. Its context precision averages precision at each rank that holds a relevant chunk, with a judge deciding relevance against the reference. A variant, context utilization, judges each chunk against the generated answer instead. It needs no reference, and it is circular: a chunk that led the model to a wrong answer counts as useful. Recall has no reference-free version, because nothing in a live request says what was missed.
Passage labels cost more than the labeling time. Every unlabeled passage counts as irrelevant, which penalizes a new retriever for finding relevant passages nobody judged. BEIR measured this on TREC-COVID: 30.6 percent of the top-10 results from one dense retriever (DPR) had never been judged, and judging them raised its nDCG at 10 from 0.332 to 0.445. Labels tied to chunk IDs also break when the chunking changes, so label documents or sections, and judge the unlabeled top results whenever the retriever changes.
Generation metrics: was the context used correctly
Generation metrics grade the answer three ways: whether its claims are supported by the retrieved context, whether it addresses the question, and whether it matches a reference answer. The first two need no reference. The third is the end-to-end check.
| Metric | Question it answers | How it is computed | Needs a reference |
|---|---|---|---|
| Faithfulness, also called groundedness | Is every claim in the answer supported by the retrieved context? | Split the answer into claims, verify each against the context, and divide supported claims by all claims | No |
| Answer relevancy | Does the answer address the question that was asked? | Ragas generates questions from the answer and compares their embeddings with the original question | No |
| Correctness | Does the answer say what the reference answer says? | Split both into claims and compute precision, recall, and F1 over the matching claims | Yes |
Faithfulness is the metric to run everywhere, because it needs no reference and catches claims the documents do not support. Hallucination detection covers how the check works.
The same metric name can hide different rules. As of November 2026, Ragas counts a claim as supported only if it can be inferred from the context, while DeepEval's faithfulness metric counts a claim as truthful if it does not contradict the context. An answer that adds a detail the context never mentions fails the first rule and passes the second. Pin the library, its version, and the judge model, and do not compare scores across tools.
Answer relevancy does not check facts. Correctness is the only generation metric that can catch an answer that is faithful to a wrong document, which is why the end-to-end check stays in the suite.
How judge-based metrics go wrong, and how to calibrate them
Every metric above that is not an ID comparison is a short chain of model calls: one splits text into claims, another verifies each claim, and code divides the counts. A mistake at either step moves the score. Each of these metrics is an LLM judge, to be checked against human labels before its numbers are trusted.
Published accuracy is uneven across metrics. The Ragas paper tested its three metrics on pairwise comparisons built from 50 Wikipedia pages, with GPT-3.5 as the judge. Agreement with human annotators was 0.95 for faithfulness, 0.78 for answer relevance, and 0.70 for context relevance, which the authors called the hardest to evaluate, especially on longer contexts.
Hard cases are worse than those averages suggest. FaithBench, a 2024 benchmark from Vectara and collaborators, collected summaries on which popular hallucination detectors, GPT-4o as a judge among them, disagreed, and had experts label them. Even the best detectors scored near 50 percent accuracy on that set.
The method adds failure modes of its own. Claim splitting sets the denominator. Ragas exposes atomicity and coverage settings on its factual correctness metric, and a different setting changes how many claims a sentence becomes. Reference-based metrics inherit the reference's gaps, since context recall checks only the claims the reference answer makes.
Calibrate as the LLM as a judge article describes: label 100 to 200 real cases per metric by hand, run the judge on them, and report Cohen's kappa and the judge's recall on failures. ARES builds the correction into the score, using about 150 or more human-annotated examples to adjust its judges' predictions and put a confidence interval on each result. Recalibrate whenever the judge model, its prompt, or the library version changes.
Build the test set from real queries
Start the test set with queries real users sent, and add synthetic ones only to cover gaps. Real queries carry the phrasing and mix of question types the system will meet. Questions generated from the documents are easier, which inflates retrieval scores.
An IBM Research study, published at COLING 2025, measured the skew. Generating question-answer pairs from documents with a single prompt produced single-fact lookups 95 percent of the time. On public datasets, that type most often had the highest recall at 5 and reasoning questions the lowest, with a relative gap of 4.8 to 42 percent depending on the dataset. The best weighting between keyword and vector search also changed with the question type, so a test set of easy lookups can select the wrong retrieval configuration.
Some generators vary the question type. Ragas builds a knowledge graph from the documents to produce single-hop and multi-hop queries. Each generated case still needs a human check. Use synthetic cases for documents nobody has asked about yet, and report their scores separately.
A test case needs enough labels to feed both halves:
{
"query": "can i get a refund on an annual plan after 6 weeks",
"source": "production",
"type": "reasoning",
"relevant": { "policy/refunds#annual": 2, "policy/refunds#window": 1 },
"reference_claims": [
"Annual plans can be refunded within 30 days of purchase.",
"Six weeks is past the window, so no refund applies."
],
"answerable": true
}Grade relevance on two levels if you track nDCG. Write the reference as a short list of claims, since the claim-based metrics split it that way regardless. Include unanswerable queries, because abstaining when the evidence is missing is a behavior to score.
Start with 50 to 100 real queries, enough to see which half fails more. Before the scores gate a release, grow the set to a few hundred. At 200 cases, a 90 percent pass rate carries a 95 percent interval of about plus or minus 4 points. The labels are the cost. A person reads candidate passages and writes reference claims for every case, and reviews them when the documents change.
Read a result by its pattern
Read the scores as a pattern across both halves, because each combination points at a different component.
| Retrieval | Generation | Diagnosis | First fix |
|---|---|---|---|
| Low recall | Faithful, incorrect | The evidence never reached the model | Chunking, hybrid search, query rewriting, a larger k |
| Low recall | Correct | The model answered from training data or partial evidence | Fix retrieval anyway, because the answer breaks when the fact changes |
| High recall, low precision or nDCG | Incorrect, with wrong claims traceable to a chunk | The right passage is buried among distractors | Rerank, lower k, filter by metadata |
| High recall and precision | Low faithfulness | The model adds or alters claims | Restrict the prompt to the context, require quotes, or change the model |
| High recall and precision | Faithful, incorrect | The answer is incomplete, or the indexed source is wrong or stale | Check the reference, then the corpus |
| Any | Low answer relevancy | The answer addresses a different question | Query handling and the prompt |
| No relevant passage exists | A confident answer | The model should have abstained | Add an abstention rule and score it |
Fixes interact. Raising k to repair recall adds distractors, the trade-off context rot explains. Rerun the generation metrics after every retrieval change, and read each pattern per slice, because a failing question type can sit under a healthy average.
Run the same checks on sampled production traffic
Only the reference-free metrics can grade production traffic: context relevance, faithfulness, and answer relevancy. Context recall and correctness need a reference that a live request does not have. Online scores therefore catch unsupported answers well and retrieval misses poorly.
The checks need each request's trace to hold the query, the retrieved passage IDs and text in rank order, the answer, and the versions of the index, prompt, and model. LLM observability covers that trace. Grade a fixed share of requests asynchronously, plus every request a user flagged or retried.
The cost is judge calls. Faithfulness in the Ragas design takes at least two per answer, one to split the claims and one to verify them, so the sampling rate is a budget decision.
Retrieval misses need proxies online: a rising abstention rate, low context relevance, and user flags. Send those traces for labeling, and each confirmed miss becomes a new offline case.
Gate a release on each half, then confirm end to end
Gate in three steps, cheapest first: retrieval metrics on labeled IDs, generation metrics on the answers, then end-to-end correctness. A change that fails an early step never pays for the later ones.
- Retrieval gate. Recall at k and nDCG from labeled IDs are deterministic and use no model calls. Run them on every change to chunking, embeddings, the index, or k.
- Generation gate. Run faithfulness and answer relevancy on the test set, paired against a baseline run on the same cases. This step costs judge calls, so run it before merge.
- End-to-end confirmation. Score correctness against the reference answers and abstention on the unanswerable cases, then have a person read a sample of the answers that changed.
Keep the third step even when both component gates pass, because better recall brings more noise and a faithful answer can rest on a stale source. Block on a drop beyond the error bars, overall or on any slice, as the LLM evaluation article describes.
If only one measurement is affordable at the start, label the relevant passages for 50 real queries and track recall at k. It costs nothing to rerun, and it shows whether the evidence was there, which is the first thing to establish about any wrong answer.
Frequently asked questions
What is RAG evaluation?
RAG evaluation is the process of measuring a retrieval-augmented generation system by scoring its two stages separately. Retrieval metrics check whether the passages that contain the answer were found and ranked well. Generation metrics check whether the answer is supported by those passages, addresses the question, and matches a reference.
What are the Ragas metrics?
Ragas is an open-source library for evaluating RAG systems. As of November 2026, its RAG metrics include context precision, context recall, noise sensitivity, response relevancy, and faithfulness. Context precision and context recall grade retrieval. Faithfulness and response relevancy grade the answer.
What is the difference between context precision and context recall?
Context recall measures how much of the needed information was retrieved: the share of claims in a reference answer that the retrieved passages support. Context precision measures ranking: whether the relevant passages sit above the irrelevant ones. Low recall means the evidence is missing, and low precision means it is buried in noise.
What does the faithfulness metric measure?
The faithfulness metric measures whether an answer's claims are supported by the retrieved context. The answer is split into claims, each claim is checked against the context, and the score is the supported share. It needs no reference answer, and it does not measure whether the answer is true, because the context itself can be wrong.
Can you evaluate a RAG pipeline without ground truth?
Partly. Context relevance, faithfulness, and answer relevancy need only the query, the retrieved passages, and the answer, so they work without labels. They cannot tell whether a needed passage was missed or whether the answer is correct. Those need context recall and correctness, which require a reference answer or labeled passages.
Sources
- 01Ragas: Automated Evaluation of Retrieval Augmented GenerationarXiv:2309.15217
- 02ARES: An Automated Evaluation Framework for Retrieval-Augmented Generation SystemsarXiv:2311.09476
- 03The RAG triadTruLens docs
- 04Context PrecisionRagas docs
- 05Context RecallRagas docs
- 06FaithfulnessDeepEval docs
- 07BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval ModelsarXiv:2104.08663
- 08trec_evalGitHub, NIST
- 09Sufficient Context: A New Lens on Retrieval Augmented Generation SystemsarXiv:2411.06037
- 10RAGChecker: A Fine-grained Framework for Diagnosing Retrieval-Augmented GenerationarXiv:2408.08067
- 11Know Your RAG: Dataset Taxonomy and Generation Strategies for Evaluating RAG SystemsarXiv:2411.19710
- 12FaithBench: A Diverse Hallucination Benchmark for Summarization by Modern LLMsarXiv:2410.13210