Sources of Hallucination by Large Language Models on Inference Tasks

Nick McKenna, Tianyi Li, Liang Cheng, Mohammad Javad Hosseini, Mark Johnson, Mark Steedman

Abstract

Large Language Models (LLMs) are claimed to be capable of Natural Language Inference (NLI), necessary for applied tasks like question answering and summarization, yet this capability is under-explored. We present a series of behavioral studies on several LLM families (LLaMA, GPT-3.5, and PaLM) which probe their behavior using controlled experiments. We establish two factors which predict much of their performance, and propose that these are major sources of hallucination in generative LLM. First, the most influential factor is memorization of the training data. We show that models falsely label NLI test samples as entailing when the hypothesis is attested in the training text, regardless of the premise. We further show that named entity IDs are used as "indices" to access the memorized data. Second, we show that LLMs exploit a further corpus-based heuristic using the relative frequencies of words. We show that LLMs score significantly worse on NLI test samples which do not conform to these factors than those which do; we also discuss a tension between the two factors, and a performance trade-off.

Introduction

Natural Language Inference (NLI)—the ability to determine if a "premise" statement logically entails a "hypothesis"—is a cornerstone of language understanding. While modern Large Language Models (LLMs) like GPT-3.5 and LLaMA appear proficient at these tasks, their underlying reasoning processes remain opaque. This research investigates whether LLMs are truly reasoning or if they are relying on statistical shortcuts learned during pretraining.

The study identifies two specific pretraining biases—attestation (familiarity with a statement) and relative frequency (word rarity)—that act as primary sources of hallucination. By focusing on directional entailments (where A implies B, but B does not imply A), the authors create a stress test to distinguish genuine understanding from simple pattern matching.

Methodology

The researchers conducted behavioral studies across three major model families: LLaMA-65B, GPT-3.5 (text-davinci-003), and PaLM-540B. To isolate specific biases, they developed several dataset transformations and controlled experiments:

  • The Random Premise Task ($I_{RandPrem}$): The original premise is replaced with a random, unrelated sentence while keeping the hypothesis intact. If a model still predicts "Entailment," it suggests the model is relying on its memory of the hypothesis being "true" in its training data rather than logical inference.
  • Argument Masking: Specific entities (e.g., "George Bush") are replaced with generic placeholders (e.g., "Location X") or random low-frequency entities. This tests whether models use named entities as "indices" to look up memorized sentences.
  • Frequency Analysis: Using Google N-grams as a proxy for training data, the researchers analyzed whether the relative frequency of words in the premise versus the hypothesis influenced the model's decision.

These methods were applied to the Levy/Holt dataset (predicate-argument entailment) and RTE-1 (Recognizing Textual Entailment) to validate findings across both targeted and diverse linguistic scenarios.

Key Insights

Entities as Memory Indices

LLMs do not merely memorize facts in the abstract; they use named entities as keys to access stored information. When the researchers replaced specific entities like "YouTube" with generic placeholders, the models' ability to "recall" the entailment dropped significantly. This suggests that much of what appears to be reasoning is actually a successful database lookup triggered by specific names.

The "Rarity" Shortcut

Models exhibit a strong Relative Frequency Bias. They are significantly more likely to predict entailment if the premise contains a rare word and the hypothesis contains a common one (e.g., "sprint" → "run"). This statistical artifact of natural language is often over-relied upon by models, leading to errors when the logical relationship does not follow this frequency pattern.

Pretraining as the Root Cause

Because these biases appear in base models (LLaMA) and persist in instruction-tuned models (GPT-3.5), the authors conclude they are inherent to the "predict the next token" objective. The model learns the distribution of human text so effectively that it mistakes high probability or commonality for logical truth.

Results and Performance Collapse

The impact of these biases on model reliability is profound:

  • The Attestation Gap: Models were 1.9x to 2.2x more likely to wrongly predict "Entailment" if they had previously seen the hypothesis in their training data, even when the premise provided no logical support.
  • Adversarial Failure: When tested on samples where these biases pointed to the wrong answer, performance plummeted. For GPT-3.5 on the Levy/Holt set, the normalized AUC (Area Under the Curve) dropped from 85.0 on consistent samples to a mere 10.8 on adversarial ones.
  • Persistence in GPT-4: Supplementary testing revealed that even GPT-4 exhibits these same hallucination patterns, suggesting that scaling model size does not inherently solve these fundamental logic biases.

Conclusion

The study demonstrates that LLM performance on inference tasks is heavily subsidized by memorization and frequency heuristics. While masking entities can reduce attestation bias, it does not mitigate frequency-based shortcuts. These findings suggest that future LLM evaluations must include adversarial controls to ensure that models are not merely "superficially performant" while lacking robust, generalizable reasoning capabilities.

Summary updated

Abstract

Large Language Models (LLMs) are claimed to be capable of Natural Language Inference (NLI), necessary for applied tasks like question answering and summarization, yet this capability is under-explored. We present a series of behavioral studies on several LLM families (LLaMA, GPT-3.5, and PaLM) which probe their behavior using controlled experiments. We establish two factors which predict much of their performance, and propose that these are major sources of hallucination in generative LLM. First, the most influential factor is memorization of the training data. We show that models falsely label NLI test samples as entailing when the hypothesis is attested in the training text, regardless of the premise. We further show that named entity IDs are used as "indices" to access the memorized data. Second, we show that LLMs exploit a further corpus-based heuristic using the relative frequencies of words. We show that LLMs score significantly worse on NLI test samples which do not conform to these factors than those which do; we also discuss a tension between the two factors, and a performance trade-off.
BibTeX
@inproceedings{mckenna2023sources,
  author = {Nick McKenna and Tianyi Li and Liang Cheng and Mohammad Javad Hosseini and Mark Johnson and Mark Steedman},
  title = {{Sources of Hallucination by Large Language Models on Inference Tasks}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=rJhk7Fpnvh},
}
Figure