AI/TLDR

How to Reduce Hallucinations with Better Prompts

Learn the prompt-side tactics that measurably cut made-up answers — grounding, permission to abstain, citation demands — and why prompting alone can't fully fix it.

INTERMEDIATE9 MIN READUPDATED 2026-06-13

In plain English

A hallucination is when a language model states something false with total confidence — a fake citation, a function that doesn't exist, a made-up date. The model isn't lying; it has no concept of truth. It was trained to produce the most plausible next words, and a fluent wrong answer often looks more plausible than an honest "I'm not sure." So it fills the gap.

Reducing Hallucinations — illustration
Reducing Hallucinations — i.ytimg.com

Picture a student in an oral exam who never learned that "I don't know" is allowed. Asked a question outside their notes, they don't pause — they smoothly invent an answer that sounds like the textbook, because confident-and-wrong feels safer to them than silent. That's a base language model. Reducing hallucinations with prompting is changing the instructions so the model knows the rules of the exam: answer only from what's in front of you, and saying "I don't know" scores points instead of losing them.

This article is about the prompt-side tactics — words you add to the prompt — that measurably cut made-up answers. They are cheap, they work on any model, and you can apply them today without touching your architecture. They are also not a complete fix, and we'll be honest about that at the end.

Why it matters

A single confident fabrication can sink an otherwise good product. A support bot that invents a refund window, a research assistant that cites a paper that was never written, a coding helper that calls an API method that doesn't exist — each one erodes trust faster than ten correct answers build it. In legal, medical, and financial tools, a made-up fact isn't an annoyance; it's a liability.

The reason prompting matters first is leverage. Compared with the alternatives, changing the prompt is almost free:

  • No retraining. Fine-tuning a model to hallucinate less is slow, costs real money, and can degrade other skills. A prompt edit ships in seconds.
  • No new infrastructure. Adding retrieval, citations databases, or a verification layer is a project. Adding the sentence "If the answer isn't in the context, say you don't know" is one line.
  • Works everywhere. The same tactics transfer across providers and model sizes. They are part of the basic toolkit of prompt engineering, not a vendor feature.

The honest framing: prompting moves the failure rate from "often" toward "rarely," not to zero. That's still a huge win, and it's the highest-return change you can make before reaching for heavier machinery. Builders who skip it and jump straight to complex pipelines are leaving the easiest gains on the table.

How it works

A hallucination usually happens at one of two moments: the model lacks the fact (it was never in the prompt or the weights), or the model has the fact but guesses anyway because nothing told it that guessing is worse than abstaining. Every prompting tactic targets one of those two moments — either supply the fact, or remove the incentive to guess.

1. Grounding: answer only from the text

The single strongest tactic is to put the relevant source text into the prompt and tell the model to use nothing else. This converts a closed-book exam (answer from memory) into an open-book one (answer from the page). When the model has the real text in front of it, the cheapest path to a plausible answer is to copy from the source rather than invent — so it does.

a grounding prompttext
Answer the question using ONLY the context between the
<context> tags below. Do not use any outside knowledge.
If the context does not contain the answer, reply exactly:
"I don't have that information."

<context>
Refunds on physical items are accepted within 30 days.
Digital goods are non-refundable once downloaded.
</context>

Question: How long do I have to return a digital download?

Two details do the heavy lifting. First, fencing the source in clear delimiters — XML-style tags like <context> or a Markdown block — so the model can tell data from instructions (more in structuring prompts with XML and Markdown). Second, the explicit escape hatch: a sentence telling the model what to do when the answer isn't there. Without it, a grounded model will still strain to produce something.

2. Permission to abstain: make "I don't know" a valid answer

Models default to answering because their training rewards helpful-looking completions. You have to explicitly license refusal. Phrases that work: "If you are not sure, say 'I'm not certain' rather than guessing," or "It is better to admit you don't know than to provide an answer you can't support." You are rewriting the exam rules so that an honest blank beats a confident fabrication.

3. Demand evidence: quotes and citations

Asking the model to quote the exact sentence it relied on, or cite which source supports each claim, does two things. It forces the model to check whether the support actually exists before writing the claim — and if it can't find a quote, the gap becomes visible to you instead of hidden inside fluent prose. A claim with no quote behind it is a red flag you can now catch.

Putting the three together gives a reliable pipeline you can apply to almost any factual task:

The tactics at a glance

Each tactic targets a different failure and carries a small cost. Reach for them in roughly this order — grounding first, since it removes the most failures, then the cheaper guard rails on top.

TacticFailure it fixesCost / tradeoff
Ground in provided source textMissing fact → invented factYou must supply the right text (often via retrieval)
Restrict to the context onlyModel blends memory with sourceCan refuse answerable questions if context is thin
Allow "I don't know"Confident guessing on unknownsSlightly more refusals; tune the threshold
Require quotes / citationsUnsupported or blended claimsLonger, slower answers; needs source to quote
Ask it to flag uncertaintyHidden low-confidence claimsSelf-reported confidence is imperfect
Lower the temperatureRandom low-probability inventionsLess variety; not a fix for missing facts

Common pitfalls

These tactics are easy to apply badly. The failures below are the ones that quietly bring hallucinations back after you thought you'd fixed them.

  • Grounding without the right source. "Answer only from the context" is useless if the context doesn't contain the answer — now the model either refuses everything or ignores your instruction and guesses. Grounding quality is retrieval quality.
  • Forgetting the escape hatch. If you say "answer from the context" but never say what to do when the answer is absent, the model still feels obliged to produce one. Always pair the restriction with explicit permission to abstain.
  • Asking for citations the model can't verify. Tell a model with no sources to "cite your references" and it will happily invent plausible-looking ones — fake DOIs, fake URLs. Citations only help when the model is quoting from text you actually provided.
  • Treating self-reported confidence as truth. "Rate your confidence 0–100" produces a number, but the model is estimating, not measuring. A confident hallucination can come with a high self-rated score. Use it as a hint, not a guarantee.
  • Vague instructions. "Don't make things up" barely moves the needle — it's not actionable. "If the context lacks the answer, reply 'Not found in the provided documents'" is concrete and testable. See common prompting mistakes.

Going deeper

The tactics above are the high-value basics. A few directions worth knowing once they're second nature.

Reasoning before answering. Asking the model to think step by step — chain-of-thought prompting — reduces some hallucinations on multi-step questions, because a fact derived through visible steps is easier to keep consistent than one blurted in a single leap. The flip side: a long chain of reasoning can also manufacture a confident wrong conclusion, so it's not a universal cure.

Cross-checking with multiple samples. Ask the same question several times (with a non-zero temperature) and compare answers. If the model says "30 days" five times, that's a stronger signal than a one-off reply that disagrees with the rest. This is the idea behind self-consistency prompting: agreement across samples is a rough confidence proxy, and an outlier answer is often the hallucination.

Verification passes. A second model call can audit the first: "Here is a question, the provided sources, and a draft answer. For each claim, mark whether it is supported by the sources." This separates generating from checking and catches unsupported claims the first pass slipped in. It costs an extra call, but for high-stakes answers it's cheap insurance.

The honest limit. Prompting reshapes the model's incentives, but it can't give the model knowledge it doesn't have, and it can't make a probabilistic system deterministic. A perfectly prompted model handed perfect context can still misread it. That's why serious systems combine prompting with retrieval (RAG), human review on critical paths, and evaluation that measures the hallucination rate instead of eyeballing a few examples. Treat prompting as the first and cheapest layer of defense — never the only one.

Where to go next: lock in the fundamentals with how to write a good prompt, then make your anti-hallucination wording reusable with prompt templates so every call inherits the same guard rails.

FAQ

How do I stop ChatGPT from making things up?

Give it the source text and instruct it to answer only from that text, then explicitly allow it to say "I don't know" when the answer isn't there. Add a request to quote the sentence it relied on, and lower the temperature for factual tasks. These prompt changes cut most fabrications, though none of them eliminate hallucination entirely.

What is a grounding prompt?

A grounding prompt pastes the relevant source text into the prompt, fences it in clear delimiters (like <context> tags), and tells the model to answer using only that text and nothing from its own memory. It turns a closed-book question into an open-book one, so the model copies real facts instead of inventing plausible ones.

How do I let the model say "I don't know"?

Add an explicit instruction such as: "If the answer is not in the provided context, reply 'I don't have that information' rather than guessing." Models default to producing an answer because their training rewards helpful-looking completions, so you have to give clear permission — and ideally specify the exact phrase to use when abstaining.

Does asking for citations actually reduce hallucinations?

Yes, when the model is citing from text you actually provided — it forces the model to find supporting evidence before making a claim, and missing quotes become visible to you. But if the model has no sources, asking it to cite references just makes it invent plausible-looking fake citations, which is worse.

Can prompting completely eliminate LLM hallucinations?

No. Prompting reshapes the model's incentives and dramatically reduces made-up answers, but it cannot give the model knowledge it lacks or make a probabilistic system deterministic. A well-prompted model with perfect context can still misread it. Combine prompting with retrieval, verification passes, and human review for high-stakes work.

Does lowering temperature reduce hallucinations?

It helps with one specific kind. A high temperature makes the model sample less-likely words, raising the odds of a random fabrication, so setting it near 0 for factual tasks reduces that creative invention. It does nothing about a fact the model never had — for that you need grounding, not a sampling change.

Further reading