Glossary
Hallucination
A hallucination is when a text-generating AI states something fluent and plausible that is not supported by its input or by fact, such as an invented category.
Swiss-hosted inference. Nothing you send is ever stored. Swiss data residency
Definition
What Hallucination means
Hallucination is the tendency of a generative language model to produce output that reads fluently but is not supported by its input or by the world: an invented citation, a made-up product name, a JSON field that was never requested, or a class label that is not in the list you supplied.
The root cause is structural. An autoregressive model samples one token at a time from an open vocabulary, so nothing in the decoding process forces the output to stay inside a closed answer set. Constrained decoding, JSON mode and retry loops reduce the problem, but they are guards added around a generator, not properties of the model.
Why it matters for classification
When an LLM is used as a classifier, hallucination shows up as:
- a label that is not one of the options ("billing_issue" when you offered "billing")
- malformed output that fails to parse
- a confident-sounding explanation that does not match the chosen label
- verbalised confidence ("I am 90% sure") that is not a probability at all
Each of these needs defensive code, and each adds latency when it triggers a retry.
How Laya avoids it
Laya is a non-autoregressive decision model. It never generates text. Every option you pass is scored at its own option marker, and the answer is the argmax of a softmax over exactly those options. It is therefore impossible for Laya to return a label you did not define, or to return unparseable output: the response is always a typed choice, score or noul answer with probabilities.
That removes one failure mode, not all of them. A decision model can still be wrong, and it can be wrong with high confidence (the English checkpoint scores 0.000 accuracy on Khmer at 0.952 confidence). The fix for that is calibration plus language routing, not more generation guards. See hallucination-free decisions for the full argument.
Related terms
How Hallucination connects to the rest of the vocabulary.
Go deeper
- ExplainerHallucination-free decisions: what a non-generative model rules outCan an AI classifier hallucinate? What a non-generative model like Laya rules out (invented labels, fake fields, unparseable text) and what it can get wrong.
- ComparisonLaya vs GPT and Claude: which should classify your text?Should you use GPT or Claude to classify text? Laya vs LLM classifiers on speed, cost per decision, calibration, label limits, and where the LLM still wins.
Get started
Try it on your own text
Send any text with your own typed questions and get a calibrated probability for every answer. 6k free tokens, no card needed; then $0.0357 per 1M input tokens — 15% below Jev.
Swiss-hosted inference. Nothing you send is ever stored.