Abstract
In this work, we show the pre-trained language models return distinguishable generation probability and uncertainty distribution to unfaithfully hallucinated texts, regardless of their size and structure. By examining 24 models on 6 data sets, we find out that 88-98% of cases return statistically significantly distinguishable generation probability and uncertainty distributions. Using this general phenomenon, we showcase a hallucination-reducing training algorithm. Our algorithm outperforms other baselines by achieving higher faithfulness metrics while maintaining sound general text quality measures.
Introduction
Large Language Models (LLMs) are prone to "hallucinations," categorized into factuality (consistency with world knowledge) and faithfulness (consistency with a provided source text). While previous research suggested internal confidence might correlate with errors, studies were often limited to specific tasks or "black-box" models. This paper investigates whether the ability to distinguish unfaithfulness is a universal trait across architectures (Encoder, Decoder, Enc-Dec) and sizes, how model size affects this "self-awareness," and the impact of fine-tuning on internal signals.
Methodology and Datasets
The researchers conducted a "white-box" analysis of 24 models, including GPT-2, Llama 2, BERT, RoBERTa, T5, and BART. Two primary metrics were analyzed:
- Log Token Probability (LogProb): The average likelihood the model assigns to each token in a sequence.
- Entropy: A measure of the model's predictive uncertainty.
Distinguishability was quantified using the Kolmogorov–Smirnov (KS) statistic for significance and Wasserstein Distance to measure the "gap" between faithful and hallucinated distributions.
The study utilized six human-annotated datasets: BEGIN (TopicalChat, Wizard of Wikipedia, CMU Document Grounded Conversations), FaithDial, XSum Hallucination Data Set, and WikiBio. MediQA-AnS was used for medical summarization training experiments.
Analysis of Internal Signals
A core finding is that the "internal signal" for hallucinations is nearly universal. In 88-98% of tested cases, probability distributions for faithful versus hallucinated text were statistically distinguishable. This suggests that detecting hallucinations is an emergent property of pre-training, regardless of model structure.
Contrary to expectations, increasing model size does not necessarily improve the ability to distinguish hallucinations. For instance, in the T5 model family, the largest versions were significantly worse at distinguishing these groups than their smaller counterparts.
Furthermore, fine-tuning presents a trade-off: as a model is fine-tuned, its LogProb typically becomes a better indicator of faithfulness, while its Entropy becomes less reliable. This highlights the importance of carefully selecting metrics based on the model's training stage.
Hallucination-Reducing Training
Leveraging these insights, the authors introduced a Weighted Training algorithm. Instead of uniform training, a reference model calculates LogProb or Entropy for each sample to weight the loss function. This encourages the model to prioritize certain, faithful samples and down-weight potential hallucinations.
The proposed methods (Ours-LogProb and Ours-Entropy) consistently outperformed standard baselines. On the WOW dataset, "Ours-Entropy" achieved a $Q^2$ F1 score of 0.7742, significantly higher than the 0.6521 of standard training. These gains in faithfulness were achieved without sacrificing text fluency, as evidenced by stable ROUGE-L and BERTScore results.
Limitations
The method currently requires "white-box" access to token-level probabilities, limiting its direct application to API-only models. Additionally, tokenizer differences make cross-family comparisons difficult, and very long reference texts (as seen in XSum) may dilute the internal probability signals, requiring further investigation.
Summary updated