← Concepts

阅读中文版本

RAG Grounding and Citation

RAG grounding retrieves relevant documents and constrains the model to answer from them with citations, so the answer is attributable to a source the user can verify rather than a hallucination.

ai

Definition

RAG grounding is the architecture where a user query retrieves relevant documents from a trusted corpus, the model is prompted to answer only from the retrieved context, and the answer includes citations to the source passages, so that the response is grounded in verifiable sources and a hallucination is detectable as an unsupported claim.

Context and scope

Applied in knowledge assistants, document Q&A, and any LLM application where the answer must be attributable to a source the user can check.

Common misconceptions

  • RAG eliminates hallucination — it reduces it; the model can still hallucinate from the retrieved context or cite a passage that does not support the claim, so citation verification is still needed
  • Retrieval quality is secondary to the model — retrieval quality determines what the model can ground on; a strong model with poor retrieval hallucinates confidently

Anti-patterns

  • Retrieving without a relevance threshold, so the model answers from tangential documents and the grounding is fictional
  • Generating citations without verifying the cited passage supports the claim, so the citation is present but the answer is still a hallucination

Related concepts

Authoritative source

https://research.ibm.com/blog/retrieval-augmented-generation-RAG

What it is

RAG grounding is the architecture where a user query retrieves relevant documents from a trusted corpus, the model is prompted to answer only from the retrieved context, and the answer includes citations to the source passages, so that the response is grounded in verifiable sources and a hallucination is detectable as an unsupported claim. Applied in knowledge assistants, document Q&A, and any LLM application where the answer must be attributable to a source the user can check. The model is a statistical artifact; the engineering challenge is that its failure modes are probabilistic, not deterministic, and its inputs can shift in ways the training data did not cover.

How it works

Evaluation uses held-out data that represents the deployment distribution, not the training distribution — a model that scores well in lab and fails in production has a distribution mismatch. Prompts and context are versioned and tested like code. Output is validated against a schema before use, because the model can return syntactically valid but semantically wrong content. Cost and latency are first-class metrics, not afterthoughts.

When to apply and pitfalls

Apply where the task is fuzzy enough that rules fail but constrained enough that wrong output is detectable. The pitfall is treating the model as authoritative — it is a guess with a confidence, and deploying it without a fallback produces failures that are hard to diagnose. Another is evaluating on the easy cases and shipping, then discovering the long tail of inputs the model handles poorly.