Table of Contents
Fetching ...

Hallucination is a Consequence of Space-Optimality: A Rate-Distortion Theorem for Membership Testing

Anxin Guo, Jingwei Li

TL;DR

This work reframes LLM hallucination as a sparse membership-testing problem and derives a rate-distortion theorem that ties the memory per fact to the KL divergence between key and non-key score distributions under prescribed error constraints. It shows that, under finite memory, the optimal strategy often embraces high-confidence hallucinations (a Hallucination Channel) rather than abstaining or forgetting, and it formalizes a two-sided filter frontier that any threshold-based decision rule cannot surpass. The theory yields non-asymptotic memory lower bounds, achievability, and first-order corrections, and it recovers classical filter-space lower bounds as special cases, while providing empirical validation on synthetic data that corroborates the predicted hallucination behavior. Practically, the results illuminate why hallucinations persist under limited capacity and highlight how external memory (e.g., RAG) and training emphasis on non-facts can mitigate such errors, with implications for evaluating and designing factualityConstraints in language models.

Abstract

Large language models often hallucinate with high confidence on "random facts" that lack inferable patterns. We formalize the memorization of such facts as a membership testing problem, unifying the discrete error metrics of Bloom filters with the continuous log-loss of LLMs. By analyzing this problem in the regime where facts are sparse in the universe of plausible claims, we establish a rate-distortion theorem: the optimal memory efficiency is characterized by the minimum KL divergence between score distributions on facts and non-facts. This theoretical framework provides a distinctive explanation for hallucination: even with optimal training, perfect data, and a simplified "closed world" setting, the information-theoretically optimal strategy under limited capacity is not to abstain or forget, but to assign high confidence to some non-facts, resulting in hallucination. We validate this theory empirically on synthetic data, showing that hallucinations persist as a natural consequence of lossy compression.

Hallucination is a Consequence of Space-Optimality: A Rate-Distortion Theorem for Membership Testing

TL;DR

This work reframes LLM hallucination as a sparse membership-testing problem and derives a rate-distortion theorem that ties the memory per fact to the KL divergence between key and non-key score distributions under prescribed error constraints. It shows that, under finite memory, the optimal strategy often embraces high-confidence hallucinations (a Hallucination Channel) rather than abstaining or forgetting, and it formalizes a two-sided filter frontier that any threshold-based decision rule cannot surpass. The theory yields non-asymptotic memory lower bounds, achievability, and first-order corrections, and it recovers classical filter-space lower bounds as special cases, while providing empirical validation on synthetic data that corroborates the predicted hallucination behavior. Practically, the results illuminate why hallucinations persist under limited capacity and highlight how external memory (e.g., RAG) and training emphasis on non-facts can mitigate such errors, with implications for evaluating and designing factualityConstraints in language models.

Abstract

Large language models often hallucinate with high confidence on "random facts" that lack inferable patterns. We formalize the memorization of such facts as a membership testing problem, unifying the discrete error metrics of Bloom filters with the continuous log-loss of LLMs. By analyzing this problem in the regime where facts are sparse in the universe of plausible claims, we establish a rate-distortion theorem: the optimal memory efficiency is characterized by the minimum KL divergence between score distributions on facts and non-facts. This theoretical framework provides a distinctive explanation for hallucination: even with optimal training, perfect data, and a simplified "closed world" setting, the information-theoretically optimal strategy under limited capacity is not to abstain or forget, but to assign high confidence to some non-facts, resulting in hallucination. We validate this theory empirically on synthetic data, showing that hallucinations persist as a natural consequence of lossy compression.
Paper Structure (54 sections, 24 theorems, 137 equations, 4 figures, 1 table)

This paper contains 54 sections, 24 theorems, 137 equations, 4 figures, 1 table.

Key Result

Theorem 1.1

Let $\mathrm{KL}(P\|Q)$ denote the base-2 Kullback-Leibler divergence between distributions $P$ and $Q$. To store $n$ keys in the sparse regime and reach a certain error level under generic error metrics, it is necessary and sufficient for a membership tester to store where $\mu_K$ and $\mu_N$ are the distributions of scores $\hat{x}_i$ conditioned on $i\in \mathcal{K}$ and $i\notin \mathcal{K}$,

Figures (4)

  • Figure 1: Output distributions on facts vs. non-facts ($y$-axis is in log-scale) across different choice of $\lambda_F$ for the model with 15145 parameters (1 per fact). The blue stems indicate the predicted memory-optimal atoms for non-facts under the same empirical loss values.
  • Figure 2: Effect of different weight $\lambda_F$ on fact. Each color represents a different model size. The amount of information per key decreases with $\lambda_F$ for each model size.
  • Figure 3: Output distributions with 15145 facts and 8767 parameters.
  • Figure 4: Output distributions with 15145 facts and 33085 parameters.

Theorems & Definitions (45)

  • Theorem 1.1: Informal, Theorems \ref{['thm:rate-distortion-main-1']}, \ref{['thm:rate-distortion-main-2']}
  • Definition 2.1: Membership tester
  • Remark 2.2: Permutation-invariance
  • Definition 2.3: Query output and error constraints
  • Theorem 3.1
  • Theorem 3.2
  • Theorem 3.3
  • Lemma 3.4
  • proof
  • Lemma 3.5
  • ...and 35 more