Code and dense tables are folded away. Open any of them on demand.
Can an AI decision model hallucinate?
A non-generative decision model cannot hallucinate in the usual sense, because hallucination refers to generated text that is false or unfaithful to its source. Laya produces no text: it returns probabilities over options you defined, so it cannot invent a label, a field or a fact. It can still choose the wrong option.
In the research literature, a hallucination is generated content that is nonsensical or unfaithful to the provided source, or that asserts facts not supported by it (Ji et al., 2023; Maynez et al., 2020). Surveys of LLM hallucination (Huang et al., 2023) distinguish factuality errors (stating false things about the world) from faithfulness errors (contradicting or going beyond the input or instructions).
Both definitions are about generated text. A hallucination is something the model produced that should not be there. That framing matters, because it tells you which architectures can hallucinate and which cannot.
How LLM classifiers hallucinate
When a generative model is used as a classifier, the hallucination surface is small but real:
| Failure | Example | Consequence |
|---|---|---|
| Out-of-set label | Asked for billing/technical/sales, returns "account management" | Downstream switch statement falls through |
| Format drift | Returns "Billing." or "The category is billing" | Parser fails or needs fuzzy matching |
| Fabricated rationale | Explains a routing decision by citing a sentence that is not in the email | Misleads reviewers and audit logs |
| Fabricated fields | Fills in an order number or amount that is not in the text | Corrupts extracted data |
| Invented confidence | Says "confidence: 0.95" as generated text | A number with no guaranteed meaning |
Structured-output modes, constrained decoding and validation reduce the first two substantially. The last three persist whenever the model is allowed to generate free-form text alongside its decision.
What a non-generative decision model rules out
Laya reads the state, the question and your options in one encoder pass and returns a probability distribution over those options. There is no decoder and no output text. By construction:
- No out-of-set answers. The
choicefield is always one of your option keys. Ascoreis always a weighted average of your levels. Anoulis always a number in [0, 1]. - No format drift. The response schema is fixed. There is nothing to parse.
- No fabricated text. The model cannot write a rationale, an order number or a quote, so it cannot write a false one.
- No generated confidence. Probabilities come from a softmax over option scores, and
confidenceis computed from them (1 − H(p)/log k for choice and score, max(p, 1 − p) for noul). They are numbers produced by arithmetic, not by sampling words. - Deterministic outputs. The same input to the same checkpoint yields the same distribution, up to floating-point differences between hardware. There is no sampling temperature to set.
This is what the model card means by "nothing to parse and nothing to hallucinate". It eliminates an entire class of production bugs.
What it does not rule out
A non-generative model can still be wrong, and sometimes confidently wrong. The model card documents several ways, and it is worth being explicit:
- Wrong option, high probability. Any classifier makes mistakes. Laya's accuracy varies from 0.950 on AG News to 0.425 on Banking77 in the card's benchmarks.
- Confident failure on unreadable input. The English checkpoint reports 0.952 confidence at 0.000 accuracy on Khmer. It did not invent anything; it picked options from your list, with conviction, on text it could not read. Routing to the multilingual checkpoint is the mitigation.
- Answering the labels instead of the input. The card notes
noul"can follow its option labels instead of the state", returning a confident "no" for clearly positive input (issue #156). This is not hallucination in the generative sense, but it is a failure of faithfulness to the input. - Over-confidence in general. The checkpoints ship with mean ECE of 0.466 (English) and 0.314 (multilingual), improving to 0.081 and 0.106 after temperature refitting.
- Forced choice. A softmax must put its mass somewhere. If none of your options fits, the model still picks one. Add an explicit
otheroption. - Truncation. A state longer than the context is cut from the end. If the decisive sentence is past the cut, the model decides without it.
In other words, a non-generative model converts format and fabrication failures into judgement failures. Judgement failures are the kind you can measure with accuracy, Brier score and expected calibration error, and manage with thresholds.
Designing for faithful decisions
Practices that make the remaining failures visible and rare:
- Always include an escape option (
other,none,unclear) so the model is not forced into a wrong label. - Gate on calibrated confidence and escalate the uncertain tail; see act or escalate.
- Route by language so no checkpoint is asked to read what it cannot.
- Check
noulbehaviour on your data, and use a two-optionchoicewith neutral keys if answers look stuck. - Put the decisive text first in the state, or pre-extract it.
- Log distributions, not just labels. A logged distribution lets you audit near-misses later.
- Replay audits. Because the same input and checkpoint give the same distribution, a logged decision can be reproduced later to confirm what the model saw and said. Record the checkpoint named in
routing.modelalongside the answer. - If you need a rationale, generate it separately for the escalated minority, with an LLM whose output a human reviews, rather than for every decision.
A guardrail request to Laya Studio
Input guardrails are a natural fit: you want a fixed set of flags on every prompt, fast, with no chance that the guard itself produces text an attacker can steer.
Show technical detailsHide technical details· bash sample
The response contains only numbers and your own option keys: noul probabilities for the two flags and an expected level plus distribution for severity. An injected instruction inside prompt can influence those numbers, as any input can influence any classifier, but it cannot make the guard emit text. Three questions read the text three times, billed per input token. See the docs and sign up for a key with 5 free runs.
Frequently asked questions
Is Laya really hallucination-free?
Can a prompt injection manipulate Laya?
Are Laya's outputs deterministic?
What happens if none of my options fits?
Can Laya explain its decisions?
What is an AI hallucination?
Can LLM classifiers hallucinate labels?
Sources
Last updated . Laya Studio is an independent hosted service for the open-source Laya model (Apache-2.0, © Convai Innovations) and is not affiliated with Convai Innovations or TypeSafe.
Next articleLatency budgets for AI agentsHow to set a latency budget for an AI agent: where the time goes in a turn, serial vs parallel steps, tail latency, and where a fast decision model fits.