How To · LLM TechniqueIntermediate

How to Reduce LLM Hallucinations in Production

How to reduce LLM hallucinations in production with grounded generation, citations, refusal, and faithfulness evals — not a prompt-only trick for ML teams.

Hybrid retrievalCitation layerFaithfulness judgeGolden set evalsShadow-mode traces16 min · 6 steps · Updated 2026-08-25
The short answer

To reduce LLM hallucinations in production, ground every factual claim in retrieved or tool-returned evidence, require citations, refuse when evidence is missing, and gate releases on faithfulness scores from a golden set — not on a cleverer prompt. Prompt wording still matters for format and tone, but it cannot compensate for empty retrieval, unconstrained tools, or an eval suite that never scores made-up facts.

What you’ll build

  • A refusal policy that answers only from retrieved or tool-returned evidence
  • Span-level citations on every factual claim, with empty-retrieval treated as unknown
  • Faithfulness and groundedness scores on a golden set, gated in CI
  • A weekly hallucination triage queue that fixes corpus, tools, or policy — not only prompts
  • Shadow-mode comparison of the old vs grounded path before cutover

Before you start

  • 01A production chat or agent path with logged prompts, retrieval, and completions
  • 02At least 80 real user questions with source-backed answers for a golden set
  • 03A retrieval index (or a plan to add one) plus a keyword (BM25) index for exact tokens
  • 04An LLM judge endpoint separate from the serving model, with a pinned version
  • 05A way to run the new path in shadow mode against live traffic without user-facing writes

Key takeaways

  • 01

    Most production hallucinations are retrieval misses, stale corpus, or unconstrained generation wearing a fluent sentence — measure those first.

  • 02

    Grounded generation means the model may use only retrieved chunks and tool results; prior-knowledge answers are out of policy for enterprise facts.

  • 03

    Citations must be span-level and checked after generation; a source list under an unsupported answer is worse than no answer.

  • 04

    A golden set of real questions with verified sources, plus a pinned LLM judge, is the only way to know whether a model or prompt change reduced hallucinations.

  • 05

    Shadow mode is required before cutover: faithfulness without usefulness is over-refusal, and users will route around a mute agent.

01

What counts as an LLM hallucination in production

A hallucination is a statement the model presents as fact that is not supported by the evidence you allowed it to use. In a consumer chatbot that is often a wrong date. In production it is a discount that does not exist, a policy clause nobody wrote, a ticket ID that was never opened, or a citation pointing at a document that does not contain the claim. Fluency is not the bug; unsupported confidence is.

Split the category before you try to reduce it. Intrinsic errors contradict the context you already retrieved. Extrinsic errors invent facts outside that context. Citation fabrications look grounded and are not. Empty-retrieval answers are the most common enterprise case: the index missed, the ACL filtered everything, and the model filled the gap from pretraining. Each type has a different fix.

02

Why “stop ChatGPT hallucinating” is not a prompt trick

Teams search for how to reduce LLM hallucinations and get temperature folklore. Lower temperature reduces sampling noise; it does not stop a model from stating a plausible policy when retrieval returned nothing. Longer system prompts do the same: the model is still a next-token predictor with no live view of your wiki unless you give it one.

The production playbook is mechanical. Put the right evidence in context (hybrid retrieval, tools, current schemas). Constrain generation to that evidence. Check the output. Measure on questions you already know the answer to. That is grounded generation. See the RAG how-to at /how-to/build-rag-ai-agent-organization-knowledge for corpus and chunking; this guide covers what you add around generation so the model cannot wander.

03

Grounded generation: retrieval, tools, and refusal

Grounded generation is a contract: the model may use retrieved chunks and tool results, and it may not use parametric memory for enterprise facts. Implement that contract in three places. The prompt states the rule. The application withholds the user-facing reply if retrieval is empty or the faithfulness judge fails. Tool wrappers return structured errors instead of letting the model invent a payload.

Hybrid retrieval (dense vectors plus BM25) still matters here because enterprise questions are full of IDs and acronyms. Query-time ACLs belong on the same path: filter before generation so restricted text never enters the context window. When filtering empties the result set, treat it like a miss — do not hint that a forbidden document exists.

04

Citations and faithfulness scoring

Users trust answers that look sourced. If you attach three URLs to an unsupported paragraph you have made hallucination harder to spot. Require claim-to-span maps: each factual sentence points at a chunk ID and a character or sentence range. After generation, a checker confirms the span actually contains the claim. Failures become refusals or trimmed answers, never silent extras.

Faithfulness is the fraction of claims supported by the supplied evidence. Groundedness (sometimes used interchangeably) should be scored by a pinned judge model with a written rubric, plus a human sample. Do not let the serving model grade itself. Track citation precision separately — a correct answer with a fake link is still a production defect.

05

Golden sets, judges, and a CI gate

A golden set is a frozen list of real questions, verified answers, and the documents or tool traces that justify them. Start at 80 items if that is all you can verify; 150–200 is a better production floor. Stratify by task (FAQ, policy, multi-hop, tool use) and by risk (wrong tone vs wrong price). Include known-empty cases so refusal is scored, not only answers.

Wire scores into CI the way you wire unit tests. Retrieval hit rate (gold chunk in top 10), faithfulness, citation precision, and useful-answer rate (not refused when evidence exists) are the four numbers that catch most regressions. Pin judge and serving model versions. A silent provider upgrade is a release you did not approve.

06

Shadow mode and the weekly triage loop

Shadow mode runs the grounded path on live questions without showing it to users. Compare old vs new on faithfulness and useful-answer rate. Over-refusal is the usual side effect of a hard grounding rule; you will see it here before customers do. Keep the grounded path dark until both numbers meet the bar you wrote down in week one.

After cutover, every thumbs-down and judge-fail goes to a queue tagged by root cause: missing doc, stale chunk, ACL miss, tool error, or true generation error. Most tickets are corpus or tool tickets. A four-week implementation typically spends week 1 on the error taxonomy and golden set, week 2 on grounding and citations, week 3 on shadow scoring, and week 4 on handover of evals and runbooks — the client owns those artifacts.

  • Week 1 — taxonomy, golden set, and current-path baseline scores
  • Week 2 — hybrid retrieval or tools, refusal, span citations
  • Week 3 — faithfulness judge, CI gate, shadow mode on live traffic
  • Week 4 — cutover criteria, runbooks, and 30 days on-call after handover

Step-by-step build

  1. 1

    Define hallucination types you will actually score

    Split errors into ungrounded facts, contradictions of retrieved text, fabricated citations, and overconfident answers on empty retrieval. Tag each golden-set item with type and severity so you do not treat a wrong tone as a policy invention.

  2. 2

    Close the evidence gap with hybrid retrieval or tools

    For knowledge questions, index the sources that answer real queries with hybrid (vector + BM25) retrieval and query-time ACLs; for live systems, expose read tools instead of hoping the weights know. If the right span is not in context, the model will invent one.

  3. 3

    Force grounded generation and refusal

    Instruct the serving model to answer only from retrieved chunks and tool payloads, to cite spans, and to say it does not know when top-k is empty or below a similarity/re-rank threshold. Implement refusal in the application, not only in the prompt, so a jailbroken completion cannot skip it.

  4. 4

    Add a post-generation faithfulness check

    Run a second, pinned model (or a rules layer) that scores whether each claim is supported by the supplied evidence. Fail closed on high-severity tasks: strip unsupported sentences or replace the answer with a refusal plus owner.

  5. 5

    Build the golden set and CI gate

    Collect 80–200 real questions with verified answers and source docs, stratified by department and failure type. Score retrieval hit rate (right chunk in top 10), faithfulness, citation precision, and useful-answer rate; fail the build if any drops past an agreed threshold.

  6. 6

    Shadow, triage, and freeze the loop

    Run the grounded path in shadow mode on live traffic for at least a week, sample thumbs-down and judge-fail traces, and send them to a queue that fixes corpus, tools, or policy. Cut over only when faithfulness and useful-answer rate both hold, then re-score weekly.

Common pitfalls

The mistakes that show up in real deployments — each one costs a week if you learn it the hard way.

Treating hallucination as a prompt bug

A stronger system prompt does not fix a missing document, a broken tool, or a model inventing a policy clause. Measure retrieval hit rate and tool-error rate before rewriting instructions.

Citations that are not span-checked

Dumping three source URLs under an invented paragraph trains users to trust the wrong thing. Require each claim to map to a retrieved span; drop or refuse claims that fail the check.

Letting the model speak when retrieval is empty

Empty top-k is the most common production hallucination. Instruct the model to refuse, name the gap, and (if policy allows) escalate — never to fill silence with prior knowledge.

One faithfulness number for the whole product

Support chat, policy Q&A, and multi-hop agents fail in different ways. Stratify the golden set by task type and severity so a fluent FAQ score cannot hide a fabricated discount rule.

Shipping the grounded path without shadow mode

Faithfulness can rise while useful-answer rate falls if the model over-refuses. Run both paths on live questions for a week, score both, then cut over only if both metrics hold.

Frequently asked questions

How do you reduce LLM hallucinations in production?

Ground every factual claim in retrieved chunks or tool results, require span-level citations, refuse when evidence is missing, and fail releases when faithfulness on a golden set drops. Prompt tweaks alone do not stop a model from inventing policy when retrieval is empty. Measure retrieval hit rate first; most “model lies” are missing context.

How do I stop ChatGPT hallucinating on company questions?

Do not send company questions to an ungrounded chat window. Index the documents that contain the answers, retrieve with hybrid search, pass only those chunks, and instruct the model to say it does not know when the index misses. Enforce the same rule in application code. Consumer ChatGPT has no view of your ACLs or current wiki.

What is grounded generation?

Grounded generation is answering only from evidence supplied at request time — retrieved passages, tool payloads, or structured records — rather than from the model’s pretraining memory. Citations and a faithfulness check make the contract testable. It is the default for enterprise facts; parametric knowledge is for language, not for your discount table.

How do you measure faithfulness score?

Faithfulness is the share of generated claims supported by the evidence in context. Score it with a pinned LLM judge on a rubric, plus human spot-checks on a stratified sample. Report it next to retrieval hit rate and useful-answer rate so a mute, over-refusing bot cannot look like a quality win. Recalculate on every prompt, index, or model change.

When should you not try to eliminate every hallucination?

Do not chase zero on open-ended brainstorming, draft copy, or tasks where the user expects invention. Forced grounding there produces empty, unhelpful replies. Apply hard refusal and span citations on facts that can cost money or safety — prices, policies, medical or legal claims, and tool-backed records — and keep a looser path for ideation with a visible “ungrounded” label.

Want this built for your team?

From architecture review to a deployed, evaluated system your engineers own — we ship it with you.

FAQ

Working with us

How soon can this build work start?

Typically within a week or two of a scope being agreed. The first delivery is deliberately a small batch so you can check the output against your expectations before volume ramps.

What do you need from our team?

One process owner who knows the workflow, one engineer with access to the systems involved, and a weekly 45-minute review. No standing committee, and no requirement for an ML specialist on your side.

Who owns the output and the data?

You do. Datasets, labels, weights, evaluation suites and runbooks are yours and are handed over at the end. Your data trains your models only, with zero-retention provider settings by default.

Can you scale volume up quickly if we need it?

Yes, and the quality bar holds because the rubric and gold set are already agreed by that point. Ramping is a staffing question, not a re-scoping one, so it usually takes days rather than a new engagement.

We already have a vendor for this. Why switch?

Often you should not. The cases where teams move to us are when they cannot get a quality number out of their current vendor, or when the work is delivered as an opaque batch with no trace of how disagreements were resolved.

What happens after the engagement ends?

We stay on-call for 30 days at no extra cost, then move to an optional support retainer. Most teams also keep a quarterly evaluation review with us to catch drift early.

Copyright © 2026
ReinforcedX, Inc.
All rights reserved