An answer should be tied to retrieved permitted passages, with a visible refusal when evidence is missing or conflicting.
Grounded answers: require passage support and a no-answer path
Bound the answer to evidence
Pass only the user question and selected permitted passages into the answer step. Ask for claims tied to passage IDs, then verify those IDs were present in the context. A model can still write unsupported claims, so evidence IDs are an audit aid, not automatic proof. Answer evaluation] must inspect claim support separately from retrieval success.
Define an abstention rule
No passage, stale policy or conflicting versions should trigger a no-answer or escalation path. Do not fill gaps with general model memory when the product promises a handbook answer. A question can be answerable in the world yet absent from this authorized corpus. The system should say that the available material does not establish the answer.
Handle conflict explicitly
Two active policies may disagree across product regions. Preserve region, effective date and revision metadata in context; ask for missing scope if needed. Do not pick the first high-ranked text and suppress the conflict. Corpus lifecycle] should prevent retired rules from masquerading as current ones.
Test short unsupported claims
Create a question whose top chunk mentions the topic but not the requested fee, and ensure the answer abstains instead of inventing a number. Add one question requiring two sections; both passage IDs should be represented. Inspect whether the final text makes a stronger claim than the cited passages support.
Implementation
def validate_answer_evidence(answer, retrieved_chunk_ids):
cited = set(answer["evidence_ids"])
available = set(retrieved_chunk_ids)
if not cited and answer["status"] == "answered":
raise ValueError("answered without evidence")
if not cited.issubset(available):
raise ValueError("answer cites unavailable passage")
if answer["status"] not in ("answered", "no-answer", "needs-scope"):
raise ValueError("unknown answer state")
return TruePerformance and operating cost
Checking E cited IDs against K retrieved IDs is O(E+K) time and O(K) memory. Generation usually dominates latency and token cost; abstention saves unsupported downstream decisions.
Common Mistakes
- Do not treat a cited passage ID as proof that every claim is supported.
- Do not answer from general memory when the corpus lacks evidence.
- Do not hide conflicting active policies.
Read next
- RAG evaluation: separate retrieval recall from answer support
- Retrieval design: compare lexical, semantic and reranked candidates
- Retrieved text as untrusted data: keep instructions and tools separate
- Project: answer support-policy questions with permission-aware evidence
