BroadRouter
Get started

Hallucination

Updated

A hallucination is output from a language model that sounds plausible but is false, made up or not supported by the input it was given, such as an invented citation, a wrong number or a fabricated API. It comes from the model predicting likely text rather than checking facts.

Also called: AI hallucination, LLM hallucination, confabulation

A hallucination reads exactly like a correct answer. That is what makes it costly.

How it works

A language model writes the most plausible next tokens given its training and the prompt. Nothing in that loop checks a fact against the world. When the model lacks the answer, a plausible-looking one is still available.

Kalai and colleagues, in a 2025 paper, argue that hallucinations persist because “training and evaluation procedures reward guessing over acknowledging uncertainty.” Most benchmarks give credit for a right guess and nothing for abstaining, so models are tuned to be good test-takers. They also trace the errors to a statistical source: if a model cannot reliably tell true statements from false ones, pretraining will produce false ones.

Common forms in API work:

  • invented citations, URLs or quotes
  • wrong figures in a summary of a correct document
  • API methods or parameters that do not exist
  • answers to questions the provided context does not cover

Why it matters

The cost is downstream: a support bot that invents a refund policy, a report with a wrong total, code that calls a missing function. The fixes are cheap compared with that:

  • Ground the answer. Put the source text in the prompt or retrieve it with RAG. Lewis and colleagues found retrieval-augmented generation more “factual” than a parametric-only baseline. See grounding.
  • Allow “I don’t know”. Anthropic lists explicit permission to admit uncertainty as a basic step.
  • Ask for quotes, then verify. Have the model cite a supporting quote for each claim and drop claims without one.
  • Measure. Build an eval with questions that have no answer in the context, and track how often the model invents one. Logprobs can flag low-confidence answers where the API returns them.
  • Check in code. Totals, dates and IDs can be verified without a model.

Lowering temperature helps with drift in long text, not with confident errors.

On BroadNet Inference

BroadNet’s docs do not publish hallucination rates for their models and do not list guardrails or fact-checking features, so these controls live in your application. A large context helps grounding: DeepSeek V4.1 Flash and GLM 5.3 accept 1,048,576 tokens per request, enough to include full source documents. For Arabic retrieval pipelines, see Arabic RAG; for checking extracted fields against the image, see the invoice guide.

Questions

Why do LLMs hallucinate?

They are trained to produce likely text, and Kalai and colleagues argue that training and benchmarks reward a confident guess over admitting uncertainty. A guess can score points; "I don't know" scores none.

Can hallucinations be eliminated?

No method removes them completely. Grounding in documents, allowing "I don't know", citations and checks in code reduce them. Anthropic's guide says the techniques reduce hallucinations but do not eliminate them.

Does a lower temperature stop hallucinations?

It reduces random word choices but not confident errors. A model can give the same wrong answer every time at temperature 0.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity