Reducing AI Hallucinations: A Practical Guide to Grounded Answers
Reducing AI hallucinations comes down to one shift: the assistant should answer from documents you trust, not from its memory. In practice that means retrieving the relevant passages first, instructing the model to use only those passages with citations, and allowing it to decline when the sources are silent. Add a simple test set with known answers and you can actually measure progress. Below, we cover why hallucinations happen and how to organise each safeguard.
Where do AI hallucinations come from?
A large language model doesn't consult a database when it answers. It produces the most plausible continuation of your question, word by word, based on patterns learnt in training. Plausible and true overlap most of the time, which is why these tools feel so capable. When they diverge, you get a hallucination: a well-written, confident answer that is wrong.
The risk rises sharply in a few recognisable situations:
- The knowledge isn't there. Your organisation's procedures, a recently revised HMRC notice or a sector code of practice may never have appeared in the training data.
- The detail is precise. Figures, thresholds, dates, clause numbers and case citations are where models slip, because many near identical values look equally likely.
- There's no way out. Assistants are tuned to be helpful. Unless they're explicitly allowed to say "I can't find that", they tend to produce something.
- The question is ambiguous. The model quietly chooses one interpretation and answers it confidently.
- The reasoning is long. A small early error is carried through and magnified.
Hallucination is a by-product of how generation works, so waiting for the next model release won't make it disappear. Newer models are better, not perfect. The answer lies in the system you build around the model.
What makes an answer grounded?
A grounded answer is written from source material supplied at the moment of the question. The model acts as a careful reader summarising evidence rather than an oracle recalling facts. This is the principle behind retrieval-augmented generation (RAG), which a managed service can handle for you, as explained in RAG as a service.
Grounding changes what failure looks like. An ungrounded assistant that lacks the answer invents one. A grounded assistant that finds nothing relevant can be instructed to say so, and every claim it does make can be traced to a passage a colleague can open and read.
Answering from memory vs answering from sources
| From memory | Grounded in sources | |
|---|---|---|
| Where facts come from | Training data with a cut-off date | Documents retrieved for each question |
| If knowledge is missing | Produces a plausible guess | States that the sources don't cover it |
| Can you check it? | Not easily | Yes, through cited passages |
| Keeping it up to date | Wait for a new model | Replace the document |
| Typical remaining error | Fabricated facts | Misread or partial passages |
Six safeguards that work together
There isn't a single fix. Reliable assistants stack several safeguards, each catching what the previous one let through.
Clean, current sources
Remove superseded policies and duplicate drafts, make sure PDFs contain selectable text rather than scanned images, and put the date and scope at the top of each document. If two versions of the same policy sit side by side, the assistant may quote the wrong one with complete confidence.
Retrieval that finds the right passage
Many apparent hallucinations are really retrieval failures: the right passage existed but never reached the model. Hybrid search, combining exact keywords with a broader semantic expansion of the question, catches both precise references such as "VAT Notice 700" and loosely worded questions. Vector search is one option among several; our explainer on vector databases sets out when it helps.
Strict answer instructions
Tell the model plainly to use only the passages provided, to cite the passage number after each statement, and not to add general knowledge. Specify what to do when passages disagree (report both, with their dates) and when they only partly cover the question (answer that part, flag the gap).
Citations on every claim
Citations keep the model tethered to the text and let a reader verify any statement in seconds. They should point to a specific passage, not merely a document title. An important claim without a citation deserves to be treated with suspicion.
Permission to decline
If the passages don't answer the question, the correct output is "the sources don't cover this", ideally followed by what they do cover. Write this into the instructions and count a correct refusal as a pass in testing. An assistant that must always answer will always invent on some questions.
Human review where it matters
For decisions with legal, financial or safety consequences, build in a step where someone opens the cited source. Grounding makes that check quick; it doesn't make it optional.
Accuracy is also a data protection matter
Under UK GDPR, personal data must be accurate. If an assistant generates statements about identifiable people, hallucinations can become a compliance issue as well as a quality one. The ICO publishes guidance on AI and data protection that is worth reading before deployment.
Testing for hallucinations before launch
A handful of impressive demos proves very little. A modest, repeatable test set tells you far more:
- Collect 30 to 50 genuine questions from colleagues or customers, each with the expected answer and the section that contains it.
- Add 10 to 15 questions your documents can't answer. The only correct result is a clear refusal.
- Check retrieval on its own. Did the expected passage appear among those retrieved? If not, fix the documents or search before touching the prompt.
- Mark each answer for correctness, support by its citations, and correct refusal where out of scope.
- Re-run after every change to documents, chunking, search settings or instructions.
Two figures matter most: the share of answers with a claim unsupported by any cited passage, and the share of out-of-scope questions answered instead of declined. A language model can help with marking at scale, but a person should review a sample, particularly the failures.
Grounded answers without building the plumbing
Doing all of this in-house means a document parser, a chunker, a search index, prompts and an evaluation loop. If what you need is reliable answers from your own documents, Kopik handles the pipeline: you upload PDF, Word, text or Markdown files and Kopik extracts, splits and indexes them for hybrid search. Answers are written from the documents alone, with numbered cited passages, and the assistant says so when the base doesn't contain the answer.
There's also a passages mode that returns the raw excerpts without a written answer, which suits AI agents that prefer to reason over the evidence themselves. Bases can be private or listed in the catalogue of knowledge bases, and are available on the website, through a REST API or via an MCP server that works with Claude, Cursor and ChatGPT. The developer documentation has the details.
Answers grounded in your own documents
Create a knowledge base free of charge, upload your files and get answers that cite their sources.
Checklist before you go live
- Documents are current, de-duplicated and contain real text.
- Retrieval has been tested separately on genuine questions.
- Instructions say "use only these passages" and "cite every claim".
- Declining is explicitly allowed and scored as a pass when correct.
- A test set with known answers and out-of-scope questions runs after every change.
Frequently asked questions
Can you stop AI hallucinations entirely?
No. They stem from how language models generate text, so some risk always remains. Grounding, citations and allowing the assistant to decline reduce the risk considerably and make the remaining errors far easier to catch.
Does RAG prevent hallucinations?
It reduces them substantially but isn't a guarantee. If retrieval misses the relevant passage or the instructions don't forbid outside knowledge, the model can still invent. RAG works best alongside strict instructions, citations, refusal and regular testing.
Why should an AI assistant cite its sources?
Citations keep the model close to the retrieved text and let anyone verify a statement by opening the passage it relies on. Uncited claims stand out and can be challenged.
How do I test an assistant for hallucinations?
Use a set of real questions with known answers plus questions your documents can't answer. Measure unsupported claims in answers and invented answers to out-of-scope questions, and repeat the test after every change.
Are AI hallucinations a UK GDPR issue?
They can be. UK GDPR requires personal data to be accurate, so an assistant that generates false statements about identifiable individuals may raise compliance questions. Check the ICO's guidance on AI and data protection and seek advice for your specific use.
Get the Kopik newsletter
New knowledge bases, RAG guides and product news. One email every week or two, unsubscribe in one click.
By subscribing you agree to receive our newsletter. We never share your address.