# What Is Grounding?

> What grounding is, how it cuts hallucinations, how a grounding check works and where it still fails, explained simply for your AI interview.

**In short:** Grounding means tying an AI model's answer to real source text you supply, such as a policy or search results, so each claim can be checked. It cuts down hallucinations. It does not remove them.

AI and LLM interview question Q220, Guardrails and AI safety. Beginner, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-grounding

## Say it in 30 seconds

Grounding means connecting the model's answer to real source text, like a policy document or search results, so every claim can be checked against that source. It cuts down hallucinations, where the model writes something that is not factual. It does not remove them. A grounded answer can still misread the source or use an old one. So I ground answers, make the model cite its sources, and run a check that holds any claim with no match.

## Say it in 2 minutes

A language model answers from what it learnt in training, and that can be old, incomplete or wrong. Ask it about your bank's fee schedule and it may give a fee that sounded right once. That is a hallucination: content the model generates that is not factual, with no source behind it. Grounding deals with that. You give the model the actual document for the question, and the answer should come from it.

A practical grounding setup has three parts, and I would name all three. First, retrieval: the app fetches the right text. RAG, short for retrieval-augmented generation, is the common pattern for this. Second, citation: the model quotes the exact lines it used, so a person can check them. Third, a check after the answer: code or a service compares the claims with the source. AWS's contextual grounding check scores each model response against the source, and you set the threshold that counts as grounded.

Be honest about the limit. Anthropic's guide says these techniques significantly reduce hallucinations, and that they don't eliminate them entirely. A grounded answer can still quote a real line that is out of date, or misread it. So I test answers with real questions, and I keep the source for every reply, so a reviewer can check it.

## What is grounding, in plain words?

Grounding means the answer is tied to a source you can point at. The model answers from text you hand it.

Think of a bank teller who reads the policy card before quoting a fee. The card is the source, and the customer can see it too. The AI case is a support bot that reads the current fee schedule before it answers a question about early withdrawals.

- **Grounding:** Tying an answer to source text that you can check.
- **Hallucination:** Content the model generates that is not factual, and often has no source behind it.
- **Source:** The document, web page or database row the answer must come from.
- **Retrieval:** Fetching the right source text for a question, before the model answers.
- **Citation:** A pointer to the exact passage that supports a claim.

## How does grounding work, step by step?

Three steps: fetch the source, make the model use it and show its working, then check each claim against the source before anyone sees the reply.

*Diagram, How a grounded answer is made: The customer's question and the bank's own fee schedule both go to the model. Checks compare each claim with the source. Replies that match go out, and the rest are held back.*
1. The customer's question goes to the model.
2. The fee schedule goes in too, so the model has the source.
3. The draft reply goes on to the checks.
4. Every claim matches the source, so the reply goes out.
5. A claim with no match is held back for a person.

1. **Fetch the source:** The app finds the current fee schedule for this question and passes it in. RAG, short for retrieval-augmented generation, is the common pattern for this: it fetches the text, then the model answers from it.
2. **Make it quote:** Ask the model to cite a source for each claim, and to quote the source word for word first. Anthropic recommends quotes first for long documents, and says this grounds its responses in the actual text.
3. **Check the claims:** Code or a grounding service compares the claims with the source. AWS's check gives each model response a score, and you can block any response below your threshold.

- **Without grounding: Answers from memory.** The model writes a fee from what it learnt. It sounds sure, and nothing backs it.
- **With grounding: Answers from the source.** The reply quotes the fee line, and any claim with no match is held back.

## What does grounding look like at a real bank?

A mid-size bank runs a support assistant for its fixed deposits. A customer types: "What's the fee for an early withdrawal?" The app fetches the 2026 fee schedule first. It says 0.5% of the amount withdrawn, for the first 12 months only. Without grounding, the model may repeat an older fee it saw in training, such as "1% of the balance", and sound sure about it. With grounding, the reply has to quote the schedule line. The check finds "1% of the balance" nowhere in the source, so that reply is held back for an agent. The numbers are made up.

Real checks use a model or a scoring service. The rule is the same as this simplified version: no match in the source, no answer. This demo matches exact words, so it would also hold a correct paraphrase, which is why real checks score meaning.

```python
# A simplified grounding check for a bank's fee assistant. The numbers are made up.
SOURCE = "Early withdrawal fee on fixed deposits: 0.5% of the amount withdrawn. The fee applies in the first 12 months only."

def check(claims):
    for claim in claims:
        if claim in SOURCE:
            print("GROUNDED:", claim)
        else:
            print("NOT IN SOURCE, HOLD:", claim)

check([
    "0.5% of the amount withdrawn",
    "The fee applies in the first 12 months only.",
    "1% of the balance",
])
```

Output:

```text
GROUNDED: 0.5% of the amount withdrawn
GROUNDED: The fee applies in the first 12 months only.
NOT IN SOURCE, HOLD: 1% of the balance
```

## Does grounding stop hallucinations completely?

No. A grounded answer is only as good as its source and the reading of it. The source can be old or wrong, the model can misread a line, and a true quote can still answer the wrong question. AWS's check is strict in one setting: in its classic tier, any information not stated in the source lowers the grounding score, even reasonable inferences.

> "In generative AI, grounding is the ability to connect model output to verifiable sources of information." (Google Cloud)
>
> "Remember, although these techniques significantly reduce hallucinations, they don't eliminate them entirely." (Anthropic)

> **Tip:** Asked how you would prove an answer is grounded? Point to the exact line it came from, then say that a check flags any claim without one.

### How would you ground an answer about an insurance claim?

A claims assistant at an insurer tells a customer whether a repair is covered. Grounding means it quotes the policy clause behind every yes or no. A clause from a different product, or one that changed last year, would make the answer grounded in the wrong text.

> **Tip:** Say that grounding ties the answer to the source, so the source must be the right and current policy. Then say you would log the clause each answer used.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: the answer is tied to a source you can check.
- [ ] How it differs from a hallucination, and what it cuts down.
- [ ] The three parts: fetch the source, make it cite, check the claims.
- [ ] A realistic case, such as a bank's fee answer.
- [ ] Honest limits: a grounded answer can still be wrong or out of date.
- [ ] Testing with real questions and keeping the source for each reply.

**Common traps**

- Trap: "Grounding means the model never makes mistakes." Better: It cuts down wrong answers. It does not stop them, so test and check the claims.
- Trap: "Just add the documents to the prompt and we are done." Better: Passing text in is only the first step. Citations and a claim check matter too.
- Trap: "Grounding and RAG are the same thing." Better: RAG is one way to fetch sources. Grounding is the goal, and citations and checks serve it too.

## Can you spot the grounded reply?

**Spot the grounded reply:** Your fixed-deposit bot may answer only from the 2026 fee schedule. Which reply is grounded in that schedule?

A. Early withdrawals usually carry a fee, so ask your branch for details.
B. The fee is 1% of the balance, the rate we used to charge.
C. The schedule says 0.5% of the amount withdrawn, and only in the first 12 months.
D. Fees are waived for premium customers, so this customer pays nothing.

**Answer:** C. Only the third option points at a line in the schedule. The first is too vague to check, the second comes from memory, and the last claims a premium waiver that the schedule does not mention.

**Quick check:** A grounded bot still gave a wrong fee, because retrieval fetched last year's schedule. Which fix works?

A. A bigger model
B. Keep the source current, and check its date before the model answers
C. A longer system prompt
D. A lower temperature

**Answer:** B. The model did what it should, with an old source. Grounding is only as current as the document it fetches. Model size, prompt length and temperature don't change which document is fetched.

## Can you answer these from memory?

**Flash cards**

- **What is grounding?** Tying a model's answer to source text you can check.
- **Grounding vs hallucination?** Grounding ties answers to sources. A hallucination is content the model generates that is not factual.
- **The three parts?** Fetch the source, make the model cite it, check each claim against it.
- **Does it remove hallucinations?** No. It reduces them. Sources can still be old, wrong or misread.
- **What is a citation here?** A pointer to the exact passage that supports a claim.
- **What does a grounding check do?** Compares each claim with the source and holds any claim with no match.

## Likely follow-up questions

- Q023 What is a hallucination, and why does it happen? https://designervenkat.online/interview/ai/what-is-an-ai-hallucination
- Q219 How do you detect hallucinations? https://designervenkat.online/interview/ai/how-do-you-detect-hallucinations
- Q111 What is RAG, and why use it? https://designervenkat.online/interview/ai/what-is-rag
- Q134 How do you reduce hallucinations in RAG? https://designervenkat.online/interview/ai/how-to-reduce-hallucinations-in-rag
- Q135 How do you add citations? https://designervenkat.online/interview/ai/how-do-you-add-citations
- Q204 What are guardrails? https://designervenkat.online/interview/ai/what-are-guardrails

## Learn it in depth

- [Grounded generation](https://designervenkat.online/learn/ai-engineering/generation)
- [Retrieval-augmented generation](https://designervenkat.online/learn/ai-engineering/rags)
