Hallucination Causes › Worked Example: Exposure Bias Accumulation
Language AI HandbookAll chapters Hallucination Causes › Worked Example: Exposure Bias AccumulationOne section · Sections in this chapter6 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
To make exposure bias concrete, consider a simplified example of how error accumulates across generation steps when a model is asked to produce a factual historical account.
Suppose the model is generating a paragraph about a specific historical event. At step 10, it generates an incorrect date: "1914" instead of the correct "1917." This incorrect date becomes part of the conditioning context for all subsequent tokens. The model now operates as if the event happened in 1914.
The correct year 1917 has high probability when conditioned on the correct prefix (the model has strong associations between the event's name and the year 1917 from training). But conditioned on a prefix that already states 1914, the model's distribution shifts: it may now amplify details that are more consistent with 1914 (other events from that year, the political climate of that period, figures who were prominent then) and suppress details associated with 1917. The hallucination cascades, not because the model lacks knowledge about 1917, but because the erroneous context now points in a different direction.
The formal probability divergence illustrates this. Let be the correct continuation and be the continuation after an error at step . We measure the divergence between the model's behavior in the two cases:
where:
- : the divergence at step between the distribution conditioned on correct context and the distribution conditioned on error context
- : the Kullback-Leibler divergence from distribution to distribution , measuring how much differs from
- : the model's next-token distribution conditioned on the correct prefix up to step
- : the model's next-token distribution conditioned on the error-containing prefix up to step
- and : shorthand for the full prefix sequences and respectively
This divergence grows as the generated prefix diverges further from the true prefix. Since the model is never trained on diverged prefixes during teacher-forced training, is not bounded by the training objective and can grow arbitrarily with sequence length. This is the mathematical reason why hallucination compounds in long-form generation.
The key insight from this worked example is that exposure bias does not require the model to "not know" the correct answer. The model may have reliable knowledge of the correct year in the abstract. The hallucination arises because the error changes the input distribution in a way that activates different, incorrect associations. This is why hallucination is not always fixed by giving the model more facts: sometimes the problem is not missing knowledge but corrupted context.