Understanding Why Language Models Hallucinate: Testing Reasoning Against Priors

Yangfan Hu, Xuhan Tong, Haoyue Bai, Xi Ding, Shashank Muralidhar Bharadwaj +3 more
7/1/2026
cs.CL

No confident code implementation found for this paper.

Abstract

Large language models often produce hallucinated answers that violate prompt-level constraints. A key diagnostic question is whether these failures reflect missing knowledge, or whether the model has the relevant information but follows the wrong inference path.

Show full abstract

We study this phenomenon as inference misalignment: a mismatch between the answer supported by the prompt and the answer favored by statistically salient latent associations. We formalize this view with a latent key-task model, in which pretraining-frequency imbalance can cause a shortcut path to dominate the constraint-sensitive path and induce positive inference loss. The framework predicts two failure modes: task-retrieval bias in entity disambiguation and key-selection bias in action choice. We introduce TrapQA, a controlled diagnostic testbed with two components. ScientistQA tests disambiguation among similar scientists with supplementary factual probes, while Real-Life Constrained QA tests everyday constraint following under salient shortcuts. Our results show that hallucination can arise from biased latent inference rather than absent knowledge alone.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hu2026understanding,
  title  = {Understanding Why Language Models Hallucinate: Testing Reasoning Against Priors},
  author = {Yangfan Hu and Xuhan Tong and Haoyue Bai and Xi Ding and Shashank Muralidhar Bharadwaj and Siyang Cao and Robert Nowak and Jiawei Zhang},
  year   = {2026},
  eprint = {2607.00447},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.00447v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.00447.svg)](https://codeofpaper.com/paper/2607.00447)

Discussion