Generation Evaluation

RAG interview question · Medium difficulty

How do you evaluate the generation stage of a RAG pipeline, separately from retrieval?medium

Status
✓
Type
conceptual
Topic
generation-evaluation
Frequency
common
Tags
rag, generation-evaluation, faithfulness, citation-accuracy, hallucination
Answer

Even with perfect retrieval, generation can still fail. Evaluate answer relevance (does it address the question), faithfulness/groundedness (does it stay supported by the retrieved context), citation accuracy (do citations actually back the claim), completeness, and hallucination rate.

Explanation

Answer relevance checks whether the answer actually addresses what was asked — given "what is the refund timeline," a restated general policy is a worse answer than a specific "7-10 business days" even if both are grounded. Faithfulness/groundedness checks whether the answer stays inside what the retrieved context supports — if the context says refunds take 7 business days and the model says 24 hours, that's unfaithful regardless of how confident it sounds. Citation accuracy is a subtler failure: the answer can be correct while the citation points at the wrong document, which is still a RAG quality issue because it breaks the user's ability to verify the claim. Completeness and hallucination rate round this out — a technically-faithful answer that omits key retrieved information is incomplete, and hallucination rate tracks how often the model asserts something no retrieved chunk supports. The point of separating this from retrieval evaluation is diagnostic: if retrieval scores well but generation scores poorly, the fix is prompting or the generation model, not the retriever.

Follow-upHow would you automatically detect that a citation points to the wrong document?
Follow-upWhy might an answer be complete and faithful but still score poorly on relevance?
Follow-upHow would you compute hallucination rate at scale without manual review of every answer?