Evaluation Engineering · 10 min read · NIST AI 600-1 (Confabulation) / OWASP LLM09:2025 / TruLens RAG Triad
RAG Hallucination & Groundedness Eval Metrics
Complete mathematical and engineering guide to diagnosing Retrieval-Augmented Generation failures separately across Retriever Recall/Precision and Generator Faithfulness—eliminating blind prompt tweaking.
1. Decompose RAG Failures Using the RAG Triad
When a RAG system outputs a wrong answer, engineers often tweak the system prompt blindly when the actual bug lives in chunking or vector retrieval. Separate every trace into three orthogonal measurements popularized by TruLens / TruEra: (1) Context Relevance (did the retriever fetch chunks relevant to the user query?); (2) Groundedness / Faithfulness (is every atomic claim in the final answer explicitly supported by the retrieved chunks?); and (3) Answer Relevance (did the grounded answer actually resolve the user’s question?).
2. Deterministic Retrieval Metrics vs. Claim-Level Faithfulness
Evaluate retrieval deterministically whenever you have labeled ground-truth document IDs using Recall@k (fraction of required source chunks present in top-k results), Precision@k, and Mean Reciprocal Rank (MRR) or NDCG@k. For generation faithfulness, decompose the model response into atomic factual claims and compute Faithfulness = (Supported Claims) / (Total Claims) via calibrated small evaluator models (e.g., Patronus Lynx, Galileo Luna) or pinned chain-of-thought judges.
3. Test Abstention & Unanswerable Queries Explicitly
Enterprise hallucination spikes sharpest when users ask questions whose answers do NOT exist in the knowledge base. Dedicate 15%–25% of every golden RAG evaluation set to "negative / unanswerable" queries and contradictory/outdated chunk pairs. Measure Abstention Precision—confirming the model cleanly refuses or escalates rather than fabricating citations from parametric pretraining memory.
4. Measure Citation Integrity Deterministically
Before invoking any LLM judge, run fast zero-cost deterministic assertions in CI: verify every cited document ID exists in the retrieved chunk list, verify quoted numeric figures (dollar amounts, dates, dosage numbers, clause IDs) appear verbatim in the source context, and fail builds on any fabricated URL or dead citation reference.
Production Reference Implementation Pattern
Copy-ready structure aligned with NIST AI 600-1 (Confabulation), OWASP LLM09:2025, TruLens RAG Triad.
{
"pipeline": "enterprise-policy-rag-v4",
"retrieval_metrics": {
"recall_at_5_min": 0.90,
"mrr_min": 0.78,
"tenant_acl_leak_max": 0.00
},
"generation_metrics": {
"claim_faithfulness_min": 0.95,
"citation_id_validity_min": 1.00,
"unanswerable_abstention_recall_min": 0.92,
"numeric_entity_exact_match_min": 0.98
},
"calibration": {
"human_sme_cohens_kappa_min": 0.75,
"judge_model_pinned": "dedicated-faithfulness-v2"
}
}
Operationalize This Guide Before Production Launch
Verify all 12 pre-launch security gates interactively in our OWASP LLM Top 10 / MITRE ATLAS Checklist, calculate statutory costs with the EU AI Act & NIST Compliance Estimator, or download the full editable templates in the Enterprise AI Governance & Red-Team Audit Kit.
Mapped Tooling, Standards & Next Engineering Guides
RAG Hallucination & Groundedness Eval Metrics — Technical FAQ
Why does high Context Relevance not guarantee zero hallucinations?
Even when the retriever returns the exact right paragraph, an LLM can still extrapolate beyond the text, conflate two entities across chunks, or override retrieved facts with stale pretraining weights—which is why Claim Faithfulness must be scored independently from Context Relevance.
Should RAG faithfulness be evaluated with an LLM judge or deterministic rules?
Combine both: use deterministic regex/AST checks for numeric figures, entity IDs, JSON schemas, and valid citation IDs first, then run calibrated claim-level faithfulness evaluators (such as DeepEval, TruLens, Galileo Luna, or Patronus Lynx) for semantic entailment.
How many unanswerable negative test cases belong in a RAG evaluation set?
Allocating 15% to 25% of your evaluation suite to unanswerable, out-of-scope, or stale-document queries reliably exposes over-eager fabrication without skewing overall recall metrics.