Book a free call

How to Reduce LLM Hallucinations: What Actually Works

LLM hallucinations fall when answers are grounded in your own documents, checked against rules, and reviewed by people. Here is the method that works in production.

Hertiv engineering teamReviewed by a senior engineer
5 min read
How to Reduce LLM Hallucinations: What Actually Works
On this page

Short answer

You reduce LLM hallucinations by grounding answers in your own documents through retrieval, giving the model clear instructions to say when it does not know, and checking its output against rules, citations and human review before it reaches users. No single fix works alone: grounding cuts the rate, checks catch what remains, and an evaluation set proves whether the change actually helped.

What is an LLM hallucination?

An LLM hallucination is a confident answer that is wrong: a made-up fact, a fake citation, a wrong number or a detail that sounds plausible but has no basis in your data. The model is not lying. It is predicting likely words, and when it lacks the facts it fills the gap with something that reads well.

Hallucinations matter most where the answer is used to decide something: a support reply, a medical summary, a legal draft or a financial figure. In those cases a wrong answer is worse than no answer, because it looks authoritative and the reader has no reason to doubt it.

The rest of this article covers why hallucinations happen, what actually reduces them, and how to prove the reduction with a fixed set of test cases.

Why do LLMs hallucinate?

LLMs hallucinate because they generate text from patterns, not from a database of facts. When the facts are missing, unclear or outside what the model was trained on, it still produces an answer. The table below shows the common causes and what helps each one.

Cause What happens What helps
No source in context Model invents facts to fill the gap Retrieval from your documents
Stale training data Old prices, rules and names Live sources, not memory
Ambiguous prompt Model guesses what you meant Clear instructions and examples
Long answers Errors multiply as text grows Short, structured output
Confident tone Wrong answers look certain Ask for sources and uncertainty

The first row is the most important. A model asked to answer from nothing will invent. A model given the right documents and told to use only them has far less room to invent.

How does grounding with retrieval help?

Grounding with retrieval, often called RAG, means the system fetches the relevant documents first and gives them to the model with the question. The model then answers from those documents instead of from memory. This is the single most effective change most teams can make.

The quality of grounding depends on the documents, not the model. If the source material is outdated, duplicated or full of contradictions, the model will surface all of it. Cleaning the knowledge base, removing old versions and writing clear source articles is part of the work, and it usually takes longer than the retrieval setup itself.

Two habits make grounding work better. First, tell the model to say it does not know when the documents do not contain the answer. Second, ask it to cite the source for each claim, so a reviewer can check the answer in seconds. For teams building this, RAG development covers the retrieval and citation design.

What checks catch hallucinations before users see them?

Checks catch what grounding misses. No single check is enough, so production systems layer several of them, each cheap to run and each catching a different kind of error.

  • Citation checks. Every factual claim must point to a source passage. A claim with no source is flagged, not shown.
  • Validation rules. Numbers, dates, prices and names are checked against structured data, such as a product catalogue or a price list.
  • A second model as judge. A separate check compares the answer with the retrieved documents and scores whether each claim is supported.
  • Confidence thresholds. Low-confidence answers go to a human queue instead of to the user.
  • Human review. For sensitive topics, such as billing or medical information, a person approves the answer before it is sent.

The goal is not zero errors. It is to make sure errors are caught before they reach a customer, and that the team learns from each one. Every flagged answer should feed back into the evaluation set.

How do you test for hallucinations?

You test for hallucinations with a fixed set of real questions and known good answers, run before and after every change. Without that set, quality debates are anecdotal and nobody can tell whether a fix actually helped.

  1. Collect real questions. Take 50 to 100 questions users actually asked, covering the topics the system must handle.
  2. Write the correct answers. Have a person who knows the subject write or approve the right answer for each one.
  3. Run the system and count errors. Mark each answer right, wrong or partly wrong, and note the type of error.
  4. Fix the biggest error type first. If most errors come from missing documents, fix the retrieval, not the prompt.
  5. Re-run the same set. Use the same questions every time so the results are comparable.

Keep the set growing: every hallucination a user reports becomes a new test case. The guide to how to test AI models covers the same method for model testing in general.

Example (hypothetical): a support bot cuts wrong answers

Example (hypothetical): a support team runs a bot that answers 500 questions a week. Before grounding, reviewers find 60 wrong answers, which is 60 divided by 500, or 12% of all answers.

The team adds retrieval from the help centre and tells the bot to cite its source and say it does not know when the answer is missing. The next week, reviewers find 18 wrong answers out of 500, which is 3.6%. That is 42 fewer wrong answers, and the bot now says it does not know in 25 cases instead of guessing.

The numbers are invented to show the arithmetic, not a real result. The point is that the improvement is measured on the same questions, so the team knows the change worked, and the remaining errors are now visible enough to fix one type at a time.

What are the common mistakes?

The most common mistakes in reducing hallucinations are trusting the model, skipping the evaluation set, and treating retrieval as a solved problem when the source documents are stale.

  • Trusting confident answers. A fluent answer is not a correct answer, and confidence is not evidence.
  • No evaluation set. Without fixed test cases, nobody can tell whether quality is improving or drifting.
  • Stale sources. Retrieval over outdated documents produces outdated answers, politely and with citations.
  • No fallback. A system that must always answer will invent one. Let it say it does not know.
  • Measuring usage, not accuracy. High usage of a wrong system is a failure, not a success.
  • Long, free-form answers. Short, structured output with citations is easier to check than a long essay.

If the product handles regulated or high-stakes content, the same discipline applies to the whole system. LLM development teams usually start with the evaluation set, because it is the only way to know whether the system is safe to ship.

Key takeaways

  • Grounding in your own documents is the most effective single change
  • Ask the model to say it does not know, and to cite its sources
  • Layer checks: citations, validation rules, a second model and human review
  • Measure on a fixed evaluation set, or you cannot prove improvement
  • A wrong answer is worse than no answer when it looks authoritative

Frequently asked questions

Can fine-tuning stop hallucinations?

Fine-tuning can reduce hallucinations for a narrow task, because the model learns the facts and formats of your domain. It does not remove the problem: a fine-tuned model can still invent details, and it can also learn outdated facts. Grounding in live documents usually helps more, and the two can be combined once grounding works.

Does a bigger model hallucinate less?

Usually, but not reliably. Larger models give better answers on average, yet they still invent facts when the information is missing, and their confident tone makes the errors harder to spot. A smaller model grounded in good documents often beats a larger model answering from memory alone.

What is RAG and why does it help?

RAG, or retrieval-augmented generation, fetches relevant documents before the model answers, so the model works from your sources instead of its memory. It helps because most hallucinations come from missing facts, and retrieval supplies the facts. The quality depends on the documents: clean, current sources are essential.

Should the model ever say it does not know?

Yes, and it should be encouraged to. A refusal is useful information: it tells the team a document is missing or a question is out of scope. A system that always answers will invent one when it should have stopped. Track refusal rates alongside error rates to keep the balance right.

How many test cases do I need?

Start with 50 to 100 real questions with known good answers, covering the topics the system must handle. That is enough to see the error rate and the main error types. Add every hallucination users report, so the set grows with real failures rather than imagined ones.

Can hallucinations ever be removed completely?

No, not with current models. The goal is to reduce them to a level where checks catch what remains and the cost of an error is contained. Grounding, validation, human review and a fixed evaluation set together bring the risk down to a level most products can manage.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building an LLM product that must stay accurate? Talk to Hertiv.

A senior engineer replies within one business day. Or see our LLM Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call