Skip to content

AI basics7 min read

AI hallucinations: why models make things up and how to keep answers grounded

A language model can invent a clause, a price or a source with complete confidence. Here is why it happens and the practical engineering that keeps business answers tied to facts.

Ryze Labs engineering team

Key takeaways

  • Language models predict likely text rather than look up facts, so without access to the right source they will often produce a fluent answer that is wrong.
  • Hallucinations are reduced by design, not by a better prompt alone: retrieval from your documents, citations, clear refusal rules, real tools for numbers and human review for high-stakes output.
  • The only reliable way to know how often a system is wrong is to test it against a fixed set of real questions and keep monitoring it after launch.

A language model can state a return policy you never had, quote a contract clause that does not exist or cite a source that was never written, and it will sound exactly as confident as when it is right. These errors are called hallucinations. For a company putting AI in front of customers or staff, they are a common reason projects fail review, and they can be managed with engineering rather than hope.

What a hallucination actually is

A hallucination is an output that is fluent and plausible but not supported by facts or by the source material the model was given. It is not a bug in the usual sense, and it is not the model lying. It is a side effect of how these systems generate text.

It helps to separate two cases. In the first, the model has no access to the right information and fills the gap. In the second, it has the right document but misreads it, mixes two passages or adds a detail that is not there. The defences for each are different.

Why models make things up

A language model is trained to predict the next piece of text that is most likely to follow, based on patterns in a very large body of writing. It does not consult a database of verified facts. When the patterns point clearly to the right answer, the result is usually correct; when they do not, the model still produces the most likely-sounding continuation.

  • Missing knowledge. Your price list, internal procedures and recent changes were never in the training data.
  • Knowledge cutoff. Training data stops at a point in time, so anything newer is unknown to the model.
  • Pressure to answer. Models are tuned to be helpful, and by default they tend to give an answer rather than say “I don’t know”.
  • Vague questions. An ambiguous request invites the model to choose one interpretation and run with it.
  • Numbers and exact details. Dates, amounts, article numbers and calculations are where plausible-but-wrong output is most common.

Where it hurts in a business

Type of errorBusiness exampleMain defence
Invented factA chatbot promises a 60-day return window you do not offerAnswer only from retrieved policy text
Wrong numberA draft quote multiplies a unit price incorrectlyDo calculations in code, not in the model
Fake sourceA summary cites a contract section that does not existCitations checked against real passages
MisreadingTwo clauses from different contracts are merged into oneSmaller, clearly labelled passages and review
Out of scopeA support bot gives tax or legal adviceExplicit scope and refusal rules

Grounding answers in your own sources

The most effective single measure is to stop asking the model to remember and start giving it the material. With retrieval-augmented generation, the system first searches your documents and data, then asks the model to answer only from what was found. Our guide to RAG for business explains the mechanics.

Grounding also applies to structured data. If a customer asks about the status of an order, the answer should come from a live lookup in Shopify or your ERP, not from text. If a quote needs a total, a small piece of ordinary code should do the arithmetic. The model’s job is to understand the question and phrase the answer, not to be the source of truth.

Citations and automatic checks

When every statement in an answer links to a specific passage, two things improve. Users can verify the answer in seconds, and the system itself can check whether the cited passage really exists and supports the claim. Answers that cite nothing, or cite passages that were not retrieved, can be flagged or blocked before anyone sees them.

  • Require structured output, for example an answer plus a list of source ids, and validate it in code.
  • Reject answers whose citations do not match retrieved passages.
  • For extracted values such as invoice totals or dates, check them against rules: does the total equal the sum of the lines?
  • Keep the model’s settings conservative for factual tasks; creativity is a feature in marketing copy and a risk in a policy answer.

Teaching the system to say no

A well-designed assistant has a clear scope and an explicit instruction to say when the sources do not contain an answer. That reply should be useful, not a dead end: point to the right contact, offer a handover to a person or suggest where to look. A business chatbot that says “I can’t find that in our policies, here is who can help” is far more trustworthy than one that always answers.

Example

Illustrative example: a refusal that works

A fictional online shop selling garden furniture runs a support assistant on its product and returns documentation. A customer asks whether a table can stay outside in winter. The care guide covers this, so the assistant answers and links to it. The customer then asks whether the shop will pay for a damaged patio. No document covers this, so the assistant says it cannot answer that question and opens a ticket for the customer service team, with the conversation attached.

For high-stakes output, such as a contract summary, a credit decision or a message to an authority, refusal rules are not enough. A person should review before anything leaves the building. Our article on human-in-the-loop AI covers how to design those review steps without slowing everything down.

Measuring how often it is wrong

You cannot manage what you do not measure, and general benchmark results say little about your documents and your questions. Build an evaluation set: real questions from your users, the correct answers and the sources they should come from, including questions that should be refused.

  • Run the set before launch and after every change to the model, prompts, search settings or documents.
  • Score each answer for correctness, faithfulness to sources and appropriate refusal.
  • In production, log questions, retrieved passages and answers, and review a sample every week.
  • Give users a simple way to flag a wrong answer, and feed those cases back into the evaluation set.

This is also what separates a demo from a system that survives in production, a theme we explore in moving AI from pilot to production.

Next steps: a grounding checklist

  1. List what the system must never get wrong: prices, deadlines, legal terms, medical or safety information.
  2. For each of those, define the source of truth: a document, a database or a person.
  3. Make sure the system answers from those sources and shows where each answer came from.
  4. Write down what the system should refuse to answer and where it sends the user instead.
  5. Build an evaluation set of real questions and agree who reviews the results and how often.

Hallucinations do not disappear entirely, but with these measures they become rare, visible and correctable. If you want a system designed this way from the start, our custom AI solutions are built around grounding, citations and evaluation.

General information, not legal, tax or investment advice.

FAQ

Questions people ask

Language models generate the most likely next words based on patterns in their training data rather than looking up verified facts. When the right information is missing, outdated or unclear, they still produce a fluent answer, which can be wrong. They are also tuned to be helpful, which makes them more inclined to answer than to admit uncertainty.

No current technique removes them entirely. Grounding answers in your documents, requiring citations, adding refusal rules and testing regularly can make errors much less frequent and much easier to spot. For decisions with real consequences, a human review step remains the safest design.

Newer models often handle facts and instructions better, but none of them knows your internal information unless you provide it. The system design around the model, especially retrieval and verification, usually matters more than the choice between strong models. Test any model on your own questions rather than relying on general rankings.

Look for a citation and open the source to confirm it says what the answer claims. In a business system, this check should be partly automated: citations validated against retrieved text, numbers recalculated in code and uncovered questions refused. Regular testing on a fixed set of questions shows how often errors still slip through.

How we can help

Services related to this article

  • AI Chatbots

    Website, WhatsApp and internal assistants that answer from your own knowledge.

Read next

Want to apply this to your company?

Tell us which process slows you down. We reply within one business day with questions or a first idea of how we'd approach it.