Topic 4 of 5 · 3 min read
Prompting and grounding to cut hallucinations
Goal: Rewrite a risky request so the answer is grounded in supplied sources and allowed to say it does not know.
You cannot switch hallucinations off, but you can make them rarer by giving the model the facts, letting it say "I don't know" and asking it to show its evidence. Grounding means tying the answer to a source that you supply or the tool looks up.
Check yourself · 1 of 3
Which line best lowers the chance of a guessed answer from a pasted document?
Why it matters
A model that has the facts in front of it copies and rearranges them. A model that must recall them from memory fills gaps with guesses. Your prompt decides which situation you are in. Anthropic's guide on reducing hallucinations lists several of the steps below.
How to do it
- Attach the source. Paste the text or upload the file and say: "Use only this document." Do not ask for facts the document does not hold.
- Allow "I don't know". Write: "If the document does not say, answer 'not stated'. Do not guess." This removes the pressure to produce something.
- Ask for quotes first. "Pull the exact sentences that answer the question, then write your answer using only those sentences." If a claim has no quote, it is a flag.
- Turn on search when the facts are recent or exact. Tools such as ChatGPT, Gemini, Claude and Copilot can look things up. Ask them to show links, then check the links.
- Ask for less. "List the three main points" is safer than "give all the details". Fewer requested specifics means fewer places to invent.
- Ask for confidence and gaps. "Say which parts you are unsure about." This is not reliable on its own, but it often surfaces weak spots worth checking.
- Do not demand a number or a source you did not supply. Prompts such as "cite at least five studies" push the model to make some up.
Before and after
Before: "Tell me about the refund rules for our airline and cite the policy."
The model has no policy in front of it. It will write one.
After: "Here is our refund policy (pasted below). Answer the customer's question using only this text. Quote the sentence you rely on. If the policy does not cover the case, reply 'not covered' and stop."
Now every claim can be matched to a sentence, and an empty answer is allowed.
What goes wrong
- Adding "do not hallucinate" and nothing else. It helps little, because the model does not know when it is guessing.
- Pasting a long document and trusting the answer. The model can still misread it, so check the quotes.
- Asking for more detail when the source is thin. The model fills the space.
- Believing grounding is a guarantee. It lowers the risk. It does not remove it.
Examples
Ungrounded to grounded
Before: "What are the symptoms of this rare condition?"
After: "Here is the hospital leaflet. List the symptoms it names, one per line, with the sentence you took each from. Do not add symptoms that are not in the leaflet."
The permission line
Add this line to a factual prompt: "If you are not sure, or the text does not say, write 'not sure' for that item instead of guessing." Then look for those words in the reply. A reply with no 'not sure' on a hard question deserves extra checking.
Key points
- Grounding means tying the answer to text you supplied or a search result, not to the model memory.
- Give the model explicit permission to say "not stated" or "I do not know".
- Asking for the supporting quote first makes each claim easy to check.
- Asking for less detail or fewer specifics means fewer places to invent.
- Demanding a fixed number of sources or facts pushes the model to make some up.
Common mistakes
- Relying on "do not hallucinate" as the only instruction.
- Asking for a minimum number of sources or statistics.
- Trusting a grounded answer without checking its quotes.
- Asking for rich detail from a thin source.
Check yourself · 2 of 3
Why ask a model to pull the exact supporting quotes before it writes its answer?
Check yourself · 3 of 3
A prompt says: "Give me at least five studies that prove this." What is the main risk?
Practice items, not counted towards your mastery.
Start here
- Why language models hallucinate (OpenAI) (opens in a new tab)ArticleFree
OpenAI explains in plain language why models guess instead of saying they do not know.
- Why Language Models Hallucinate (Kalai et al., 2025) (opens in a new tab)PaperFree
The research paper behind the claim that common scoring rewards guessing over abstaining.
- Reduce hallucinations (Claude docs) (opens in a new tab)DocsFree
Anthropic lists practical steps such as allowing "I don't know" and asking for quotes.