RAG evaluation needs separate views of retrieval and generation. Retrieval metrics test whether the right evidence arrived. Generation metrics test whether the answer used that evidence correctly. End-to-end outcomes then show whether the task was solved. Mixing the layers turns every regression into guesswork: a faithful answer over irrelevant documents needs a retrieval fix, while ignored evidence points at generation.

Retrieval and correctness metrics depend on relevance labels, reference evidence, or reference answers. Some generation diagnostics, including faithfulness and response relevancy, can instead compare the query, response, and retrieved context without a reference answer. Retrieval Evaluation Sets covers retrieval labels and builds on the broader Building an Evaluation Set process. A changed score still identifies a symptom, not the responsible component. Component-Level Evaluation provides the ablation method for that diagnosis.

A support bot can retrieve the correct policy and still misread its date constraint. Retrieval passed. Generation failed. More search tuning cannot repair that answer.

Retrieval Metrics

Retrieval metrics evaluate whether the relevant documents reached the generator. The relevance and ranking metrics assume a labeled set in which each query has known relevant documents. Empty-result rate needs no labels, because it only counts queries for which retrieval returns nothing. The full definitions, worked examples, and alerting guidance live in Monitoring — Retrieval Quality Metrics. This table summarizes what each metric answers and when to prefer it.

MetricWhat it answersWhen to prefer
Recall@kWere the relevant documents foundPrimary metric — always tracked
Precision@kHow much noise is in the contextContext window is tight or token cost matters
HitRate@kDid at least one relevant doc appearQuick minimum-bar check. Good for dashboards
MRRIs the best result ranked firstGenerator uses only top-1 or top-2 chunks
MAPAre all relevant docs found and ranked highMultiple relevant documents per query expected
nDCG@kIs the full ranking quality goodGenerator uses all k chunks with position-aware weighting
Empty-result rateHow often retrieval returns nothing — label-free telemetry for possible coverage gapsCorpus is growing or query patterns are shifting

Recall creates a hard ceiling because the generator cannot use evidence it never receives. Empty-result rate needs separate tracking as well. Aggregate recall can hide queries for which the index returns nothing.

Generation Metrics

Generation metrics judge the answer against the query and retrieved context. Many use a separate LLM-as-judge model. Monitoring — LLM-as-Judge Metrics gives the full definitions. These dimensions cover different failure modes:

  • Faithfulness (groundedness) — does every claim in the answer trace back to the provided context? The RAG-specific counterpart to hallucination detection — see Hallucinations for broader coverage.
  • Answer correctness — does the answer actually solve the user’s question? A response can be perfectly faithful yet still wrong if it misses the key constraint or answers a different question. Requires a reference answer.
  • Citation validity — does each citation actually support the claim it is attached to? Stricter than faithfulness: an answer can be grounded overall while a specific citation points to an irrelevant passage.
  • Response completeness — does the answer cover all aspects of the query? “Compare A and B” expects coverage of both. Partial answers score lower.

RAGAS Framework

RAGAS turns these concepts into runnable scores, often through an LLM-as-judge. Each score targets a distinct retrieval or generation failure, though its exact implementation and model requirements depend on the RAGAS version.

MetricLayerWhat it measuresReference needed
FaithfulnessGenerationAre all claims in the response supported by retrieved context? Score = supported_claims / total_claimsNo
Response RelevancyGenerationDoes the response address the user’s question? Reverse-engineers questions from response, measures embedding similarity to original queryNo
Context PrecisionRetrievalAre relevant chunks ranked higher than irrelevant ones? Signal-to-noise in the retrieved setVariant-dependent: reference response, reference contexts, or another declared relevance signal
Context RecallRetrievalDid retrieval capture all evidence needed to answer? Score = reference_claims_in_context / total_reference_claimsAlways

Faithfulness and Response Relevancy can run without a reference answer. Context Recall requires reference evidence. Current RAGAS releases expose several Context Precision variants whose required columns differ: some compare retrieved contexts with a reference response, while others use reference contexts or a non-LLM relevance signal. The exact class names and inputs are versioned API details, so the evaluation record must name the variant rather than reporting an unqualified “Context Precision” score.

Diagnostic Combinations

Individual scores identify symptoms. Combinations are hypotheses, interpreted only after reference quality, captured context, metric configuration, and representative samples have been checked. Scores alone do not establish a component’s root cause.

FaithfulnessContext RecallObservation / hypothesisInvestigation
HighLowAnswer claims are largely supported by retrieved context, but reference coverage is lowMissing evidence, metadata filters, candidate cutoff, and retrieval fit warrant inspection
LowHighUnsupported answer claims despite high reference coverage in the measured contextAssembled model input, generation behavior, and evaluator judgments warrant inspection
LowLowUnsupported answer claims and low reference coverageBoth measurements are validated first; missing evidence and generation are then investigated separately
Context PrecisionContext RecallObservation / hypothesisInvestigation
LowHighRelevant chunks tend to rank below irrelevant chunks while reference coverage is highRanking, metadata filters, and final context selection warrant inspection
HighLowRelevant chunks tend to rank above irrelevant chunks while reference coverage is lowMissing evidence, candidate cutoff, hybrid search, and chunk boundaries warrant inspection

Additional RAGAS Metrics

Two additional diagnostics cover failure modes that the four core rows above do not:

  • Noise Sensitivity — measures incorrect response claims, judged against the reference, that are attributable to retrieved context. A selected mode sets the attribution: relevant mode counts incorrect claims attributable to relevant retrieved chunks, and irrelevant mode counts those attributable to irrelevant chunks, so a reported score names its mode. Catches a gap the original four miss: a claim that the retrieved context supports, and that Faithfulness therefore accepts, can still be incorrect against the reference. Attribution shows which context supports an incorrect claim, not that the chunk caused the error. Requires reference. Lower is better.
  • Context Entities Recall — compares named entities in the reference answer against entities in retrieved context. Useful for entity-heavy domains (legal, medical, financial) where missing a specific name, date, or identifier is a hard failure even when general topic recall is adequate.

Tradeoffs

No scoring method gives high semantic coverage, low cost, and stable calibration at once. The mix depends on available ground truth and the consequence of a false pass.

ApproachCoverageCostLatencyReliability
Human evaluationHighest — catches nuance and edge casesHighest — annotator time per querySlow — days to weeks per batchGold standard but low throughput
LLM-as-judgeHigh — handles open-ended semanticsMedium — API cost per scored responseFast — seconds per judgmentSubject to bias and prompt sensitivity
Deterministic checksLow for open-ended semantics — covers explicitly encoded rules such as exact match, format, business rules, permissions, and argument constraintsLowest — no model callsInstantReproducible, but only as valid as the encoded specification
Reference-free metricsMedium — no ground truth neededMedium — model calls for scoringFastLimited — can flag claims unsupported by or contradicting the supplied context, but cannot establish real-world correctness or completeness, or catch an error the answer copies faithfully from that context
End-to-end user metricsHighest signal — measures real impactLow direct cost — piggybacks on productionDelayed — needs traffic volumeNoisy — confounded by UI and user behavior

Deterministic checks serve as fast release gates, while an LLM judge covers semantic failures. Human labels calibrate both and cover costly edge cases. Production outcomes validate the system, but they are too delayed and confounded to serve as the only evaluation.

Pitfalls

Aggregate Metrics Mask Segment Regressions

A change can improve average Recall@5 by 2% while dropping 15% for one tenant’s query cluster. The average passes and the tenant sees a regression. Query types and document sources do not share one retrieval distribution.

Slicing by the dimensions that can change the retrieval problem, such as tenant, language, query cluster, or document source, exposes such losses. A material segment regression remains a regression even when the global average rises.

LLM-as-Judge Bias in Generation Metrics

LLM judges exhibit positional bias (scoring the first response higher in pairwise comparisons), verbosity bias (rewarding longer answers regardless of correctness), and self-preference bias (scoring outputs from the same model family higher). For RAG specifically, judges are also sensitive to evaluation prompt wording: small changes to the prompt that asks whether an answer is faithful can shift scores across the entire eval set.

Binary judgments often calibrate more reliably than broad numeric scales. Prompt-sensitivity checks, comparison with a small human-labeled set, and agreement tracked over time show whether a judge stays reliable. LLM-as-a-Judge covers the reliability mechanics in more depth.

Questions

References