Flashcard: what does 'grounding' mean in the context of RAG, and why is it the whole point?
Grounding constrains the LLM to answer from the retrieved context only, with citations, and to refuse when the context does not cover the question. It is enforced by the system prompt.
Imagine you ask a knowledgeable friend a question and also hand them a stack of documents. There are two ways they might answer. They could read the documents, point at the relevant paragraph, and tell you exactly what it says, refusing if the documents do not cover your question. Or they could glance at the documents, mix what they read with what they already think they know, and confidently make up a few details to round out the answer. The first version is grounded. The second is not. Grounding is the rule that says 'only use what is in the supplied documents, and cite where each fact came from'. Without that rule explicitly written into the prompt, even a smart model with great documents will default to the second behavior. That is the whole reason RAG bothers with system prompt directives.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: define grounding as answer from context with citations and refusal, walk through the three system prompt directives, contrast with ungrounded behavior, and call out faithfulness as the production metric.
Real products, models, and research that use this idea.
- Anthropic's Claude with citations feature emitting per-claim references back to supplied chunks, with refusal when context does not support the answer.
- Perplexity instructing its generator to cite every sentence with a numbered source, with a fallback message when sources are insufficient.
- OpenAI's Responses API file-search returning citations metadata so the application can verify each generated claim against a specific chunk.
- Ragas faithfulness scores being tracked as a per-release SLO inside enterprise RAG products to detect grounding regressions.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you write a system prompt that actually produces grounded answers?
QHow do you measure grounding in production, and what would a regression look like?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming that retrieving relevant chunks is enough to make the answer grounded. Without an explicit grounding directive in the system prompt, the LLM blends retrieved context with parametric memory and produces fluent but ungrounded answers.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.