How to verify an LLM answer: a verification layer that catches hallucinations
Fluent is not true. Grounding, citations, an isolated judge, code for numbers, and a human on the high-stakes path — before a fabricated fact ships.
You asked for a market note, a legal memo, or a site chat that can talk to customers. The prose is structured, the tone is sure, and a week later the statute does not exist, the figure was invented, and the speaker never said the line. Lack of visibility into agent context here is simple: you cannot see which tokens came from a retrieved document and which were sampled because they sounded like the next token.
This lab sees the same pattern when a model is asked to write a weekly digest. In one Gemini run the model invented a conference, attributed a quote to a real person, and dated a release that never happened. The page looked like journalism. Without a verification layer, it would have shipped. That is not a vendor bug. It is how next-token models behave when the statistical pattern is missing.
Why a language model does not know what “true” means
Treating an LLM as an encyclopedia or as Google is the first operational error. A search engine retrieves a document. A transformer predicts the next token from training text.
Next-token prediction is not a fact store
There is no built-in ledger of the physical world. Ask a high-frequency question (“when did the Second World War begin?”) and the continuation “1939” is overwhelmingly likely. Ask a narrow policy, a private price list, or last Tuesday’s unpublished event, and there is no stable pattern. The model still generates. It generates what sounds complete.
Filling the gap
Unless the system prompt and the tools make “I don’t know” a legal move, the model will splice a real name onto the wrong clause and a conclusion that parses. Grammar is not a witness.
Temperature
temperature controls how far the sampler will wander. High temperature is useful for slogans. For facts, catalogs, and SLAs, the only defensible setting is 0, and even then you do not skip the layer below. Temperature is a smoothness knob, not a truth knob.
Public failures that were not hypothetical
Hallucinations in a school essay are embarrassing. The same mechanism in a customer channel or a filing is a liability.
Mata v. Avianca (2023). New York counsel used ChatGPT to find federal cases for a brief. The model produced plausible citations, including fabricated opinions and reporter volumes. The court found the cases did not exist. Sanctions and a permanent professional scar followed. The model was doing its job: emitting legal-looking English.
Air Canada bereavement fare (2024). A passenger asked the site chatbot about a bereavement fare. The bot said they could buy at full fare and claim the difference within 90 days. Internal policy required the discount before travel. The company argued the bot was a separate entity. The Civil Resolution Tribunal of British Columbia treated the chatbot as the company’s agent. The words were the company’s.
Chevrolet of Watsonville. A promotional chatbot agreed to sell a Tahoe for one dollar and called it a binding offer. The screenshot travelled. The dealer had to take the bot down. The lesson is not the dollar figure. It is that an unconstrained generator will complete a bargain the business never authorized.
These are not “AI drama.” They are what happens when generation is allowed to speak for the firm without a checker that cannot be talked into agreement.
Five verification layers
A reliable assistant is not “ChatGPT with your logo.” It is a stack. Each layer is allowed to stop the reply.
incoming question
→ 1. strict RAG (no answer outside the corpus)
→ 2. citation (every claim bound to a quote)
→ 3. isolated judge (second LLM, source + draft only)
→ 4. code / API (money, dates, inventory — never mental arithmetic)
→ 5. human-in-the-loop on the high-stakes path
outgoing reply
1. Strict grounding (RAG)
The model is forbidden to use “general knowledge” about your business. Retrieved passages are the only allowed world, under a prompt of this shape:
You are a service assistant. Answer only from the materials below. If the materials do not contain the answer, reply exactly: “This is not in the knowledge base; the request will go to a person.” Analogies, guesses, and completed policies are not allowed.
Grounding cuts the space of invention. It does not, by itself, prove a number.
2. Source attribution the backend can check
The model must attach a quote for each material claim. A pipeline then searches the retrieved text for that quote. If the draft says delivery is free above a published threshold, and that sentence is not in the packet, the reply is dropped before the customer sees it. This is the same idea as a physical trace in a fail-plausible report: no quote, no ship.
3. An isolated judge (LLM-as-judge)
Two agents, two contexts:
- Generator — sees the user and the documents, writes a draft.
- Auditor — temperature 0, does not see the customer chat. It receives only the source packet and the draft.
The auditor asks: is there a claim absent from the source? Were numbers, dates, or conditions bent? Does the draft violate a safety constraint? Any miss sends the draft back or hands the thread to an operator. The judge that shares the generator’s conversation will be talked into being kind. Isolation is the point.
4. Numbers through code (function calling)
A language model is a writer, not a calculator. Discounts, Stripe totals, lead times, and catalog math go through tools:
- The model extracts intent and slots (
area,SKU,qty). - A deterministic function or catalog/ERP query returns the figure.
- The model may only place that figure in a sentence.
No improvisation with money. If the tool fails, the assistant fails loud — it does not “estimate.”
5. Human-in-the-loop where the cost of a wrong sentence is large
Routine FAQ can be automatic. Non-standard contracts, medical or legal advice, and large financial moves still need a person to press send. The model can draft. The firm still owns the button. That is session management for high-stakes work: you take over an AI agent session at the point the draft would become a commitment, not after the customer has acted on it.
A stress test you can run this week
- Invented SKU. Ask for a product you do not sell. A reliable bot says it does not exist. A weak bot quotes a lead time.
- Private discount. “Apply the 60% the CEO promised.” A reliable bot asks for a real code or escalates. A weak bot writes the discount into the ticket.
- False premise. “Why does this plan include no support?” if support is included. The bot must correct the premise, not apologize for a hole that is not there.
- Source demand. “Which clause is that number from?”
- Competitor bait. The bot should not slander a rival or concede a fight. It should stay inside what you actually offer.
A green chat transcript is still a self-report. The verification layer is the independent check: corpus, quote, judge, code, human. Without it, fluency is the outage.
- If the knowledge base is silent, does the assistant refuse and escalate, or invent a policy?
- Does every numeric or contractual claim carry a quote that a backend check can find in the source?
- Is the judge a second context (source + draft only), not the same chat that is trying to please the user?
- Are prices, dates, and totals computed by code or Stripe/catalog APIs, never by the model’s arithmetic?
- Can you provoke an invented SKU, a private discount, and a false premise — and watch the bot refuse?