HomeServicesBlogAboutContact
Start a project

How to evaluate LLM hallucinations in production

Practical ways to measure and reduce hallucinations in LLM features: real-question test sets, groundedness checks, human review and ongoing monitoring.

By Muhammad Adnan Amin3 min read

A shield with a check mark next to a document being inspected with a magnifying glass

Why "it seems fine" is not an evaluation

A hallucination is an answer that sounds confident but is not supported by facts or by the sources you gave the model. Spot-checking a handful of answers before launch feels reassuring, but it tells you very little: the questions you think of are rarely the ones real users ask, and a single good run says nothing about how often the system fails.

Evaluation turns "seems fine" into a number you can track and improve. The goal is not zero hallucinations, which no system can promise, but knowing how often they happen, on which kinds of questions, and whether a change made things better or worse.

Build a test set from real questions

Start with what people actually ask: support tickets, search logs, sales emails, interview notes. Collect a few dozen to begin with and write down, for each, what a correct answer contains and which source it should come from. Include the awkward cases on purpose: questions the documents do not answer, questions with a false assumption in them, and questions that look similar but have different answers.

Keep this set stable so you can compare versions over time, and keep adding to it. Every failure you find in production should become a new test case.

Loop: collect real questions, build a test set, run and score, review samples, fix, and monitor in production, feeding new failures back into the test set
Evaluation is a loop, not a one-off check.

Check groundedness and citations

For systems that answer from your documents, the most useful question is: is every claim in the answer supported by the passages the model was given? You can check this automatically with a second model acting as a judge, comparing each claim against the retrieved text, and flagging anything unsupported.

Automated judges are useful but imperfect, so treat their scores as a signal and calibrate them against human judgement. Requiring answers to cite their sources also helps: a citation you cannot find in the source is an easy, cheap hallucination detector.

  • Score groundedness: is each claim backed by the retrieved text?
  • Score retrieval: did the right passage reach the model in the first place? Many "hallucinations" are really retrieval misses.
  • Score abstention: when the answer is not in the documents, does the system say so?

Add human review of sampled outputs

Numbers need a reality check. Set aside time each week for a person who knows the subject to read a random sample of real answers and mark them correct, partly correct or wrong, with a note on why. A small, regular sample finds problems an automated score misses, and it keeps the test set and the judges honest.

Monitor after launch

Quality drifts. Documents change, users ask new things, and model providers update their models. Log questions, retrieved sources and answers, give users a simple way to flag a bad answer, and track a few numbers over time: the share of answers rated unsupported, the share of questions where the bot abstained, and the share of thumbs-down feedback.

Review the flagged items, add them to your test set, and re-run it whenever you change a prompt, a model or the content. If you would like help designing this for your own product, it is a standard part of our AI and LLM integration work.

Frequently asked questions.

Can hallucinations be eliminated completely?
No. They can be reduced and measured, mainly by grounding answers in trusted sources, making the system say when it does not know, and testing against real questions. Plan for a small residual rate and design the product so mistakes are visible and recoverable.
How many test questions do I need?
Start with a few dozen real questions covering your main use cases and some tricky edge cases, then grow the set as you find failures. A small, well-chosen set you actually run is far better than a large one you never do.
Is using an LLM to judge another LLM reliable?
It is a useful signal when you calibrate it against human review and use clear criteria, but it is not a ground truth. Keep humans in the loop for a sample of outputs.

Have a project in mind?

Tell us what you are building. We reply within one business day with honest next steps.

Start a project