Diversity-Oriented Fine-Tuning for Uncertainty-Based Hallucination Detection
Proposes diversity-oriented fine-tuning (SFT and DPO) to improve uncertainty-based hallucination detection, boosting AUROC by ~4.5%.
Key Findings
Methodology
This study enhances semantic entropy-based hallucination detection by introducing two fine-tuning strategies: supervised fine-tuning (SFT) with multi-answer data, and direct preference optimization (DPO) that encourages diverse yet semantically consistent responses. Using datasets like TriviaQA, SQuAD, and NQ-Open, and models such as LLaMA-3-8B and Qwen-2.5-7B, experiments compare pre- and post-fine-tuning performance. The core mechanism involves training the models to generate varied answers across multiple samples, increasing semantic entropy and exposing hallucinations. The approach leverages bi-directional entailment for semantic clustering and entropy calculation, providing theoretical guarantees and empirical validation that the models become more sensitive to semantic inconsistencies, thus improving hallucination detection accuracy.
Key Results
- Post-fine-tuning, models show an average AUROC increase of 4.5% across datasets, with the best reaching 0.839 on Qwen. The diversity generation leads to more varied answers, especially in hallucination cases, increasing semantic inconsistency detection. The combined SFT+DPO approach consistently outperforms baseline and single-strategy models, demonstrating the effectiveness of training-stage diversity enhancement.
- Analysis reveals that fine-tuning amplifies semantic divergence among multiple responses, especially when hallucinating, which raises the semantic entropy scores. This results in better separation of hallucination and non-hallucination cases, significantly boosting false negatives detection. The models’ outputs become more discriminative, enabling more reliable automatic hallucination detection.
- The experiments confirm that training for diversity improves the sensitivity of semantic entropy metrics, leading to more accurate hallucination detection. The approach outperforms inference-time diversity baselines, such as temperature sampling and nucleus sampling, confirming the importance of training-stage diversity for robustness.
Significance
This work pioneers the integration of diversity-oriented fine-tuning into hallucination detection, addressing the core challenge of models producing repetitive, low-entropy outputs that hinder detection. By embedding diversity during training, the models become inherently more capable of revealing semantic inconsistencies, thus significantly advancing the reliability of large language models in knowledge-intensive applications. The method bridges the gap between model training and inference, offering a scalable solution that enhances safety and factual correctness in real-world deployments. Its broad impact spans automatic fact verification, content moderation, and AI safety, providing a new paradigm for building trustworthy AI systems.
Technical Contribution
The paper introduces two novel training strategies: multi-answer supervised fine-tuning (SFT) that constructs datasets with semantically equivalent but lexically diverse responses, and direct preference optimization (DPO) that learns to prefer diverse, semantically consistent answers over repetitive ones. These strategies are integrated into a unified pipeline, which systematically increases the model’s output variability. The approach leverages bi-directional entailment for semantic clustering and entropy measurement, providing theoretical guarantees for improved detection sensitivity. Unlike prior methods that rely solely on inference-time diversity, this work embeds diversity into the training process, enabling models to produce inherently more informative and distinguishable responses for hallucination detection.
Novelty
This is the first work to embed diversity-oriented training explicitly aimed at improving semantic entropy-based hallucination detection. Unlike previous approaches that focus on post-hoc filtering or inference-time sampling, this method trains models to generate inherently diverse answers, which enhances the sensitivity of entropy-based metrics. The combination of multi-answer supervised fine-tuning and preference-based optimization represents a significant innovation, providing a new perspective on integrating diversity into model training for safety and reliability.
Limitations
- The approach may introduce semantic fragmentation in open-domain settings, where multiple valid answers can be overly diverse, potentially leading to false positives in hallucination detection.
- Constructing high-quality diverse datasets incurs significant annotation and verification costs, limiting scalability in some scenarios.
- In extremely complex or rare factual cases, the models may still produce low-entropy hallucinations, indicating room for further refinement of diversity control mechanisms.
Future Work
Future research will explore adaptive diversity control mechanisms that balance variability and factual consistency dynamically. Integrating external knowledge bases and multi-modal data could further improve robustness. Additionally, extending the approach to multi-task settings and real-time applications will be key to deploying safer, more reliable large language models in diverse industries.
AI Executive Summary
Large language models (LLMs) have revolutionized natural language processing, yet their tendency to produce hallucinated, factually incorrect outputs remains a critical challenge. Traditional detection methods rely on post-hoc analysis during inference, which often fails when models generate repetitive, low-entropy answers that mask hallucinations. To address this, the present study introduces a novel training paradigm—diversity-oriented fine-tuning—that embeds variability into the model during training itself.
The core idea involves two strategies: supervised fine-tuning (SFT) with multi-answer datasets, and direct preference optimization (DPO) that encourages models to generate diverse yet semantically consistent responses. These methods are designed to increase the semantic entropy of model outputs, making hallucinations more detectable through entropy-based metrics. Extensive experiments on datasets like TriviaQA, SQuAD, and NQ-Open, using models such as LLaMA-3-8B and Qwen-2.5-7B, demonstrate that fine-tuned models outperform baseline models by an average of 4.5% in AUROC, with some reaching over 0.839.
The results highlight that training for diversity not only improves the variability of answers but also significantly enhances the model’s ability to expose semantic inconsistencies indicative of hallucinations. This approach effectively bridges the gap between training and inference, providing a scalable, theoretically grounded method to improve the safety and reliability of large language models in real-world applications.
Looking ahead, integrating external knowledge sources and dynamic diversity regulation could further refine this method. The work opens new avenues for building more trustworthy AI systems, with broad implications for fact verification, content moderation, and AI safety in industry and academia.
Deep Analysis
Background
The evolution of large language models (LLMs) such as GPT, LLaMA, and PaLM has significantly advanced NLP capabilities, enabling tasks like question answering, summarization, and dialogue generation. Despite these achievements, a persistent issue is the generation of hallucinations—plausible but factually incorrect outputs. Existing detection methods include external verification against knowledge bases, uncertainty estimation via token likelihoods, and representation analysis of hidden states. However, these approaches often struggle with models producing repetitive, low-entropy answers, which mask hallucinations and reduce detection sensitivity. Recent research emphasizes the importance of output diversity, but most techniques focus on inference-time sampling strategies like temperature scaling or nucleus sampling, which are limited by their reactive nature. This background underscores the need for training-stage solutions that embed diversity into the model's generative behavior, paving the way for more robust hallucination detection.
Core Problem
The core challenge lies in the tendency of large models to produce high-confidence, repetitive answers across multiple samples, resulting in low semantic entropy and false negatives in hallucination detection. This issue is exacerbated in open-domain settings where multiple valid answers exist, causing semantic entropy metrics to fragment and misclassify correct answers as uncertain. The fundamental bottleneck is the model's training bias towards high-confidence, low-variability outputs, which diminishes the effectiveness of entropy-based detection methods. Overcoming this requires mechanisms that actively promote output diversity during training, enabling the model to generate a broader range of semantically equivalent responses, thereby exposing inconsistencies indicative of hallucinations.
Innovation
This work introduces two key innovations: 1) Multi-answer supervised fine-tuning (SFT), which constructs datasets with multiple semantically equivalent but lexically diverse responses, encouraging the model to produce varied answers; 2) Direct preference optimization (DPO), which trains the model to prefer diverse, semantically consistent answers over repetitive ones through pairwise comparison. These strategies are integrated into a unified training pipeline, systematically increasing output variability. Unlike prior methods that rely solely on inference-time diversity, this approach embeds diversity into the training process, providing theoretical guarantees for improved detection sensitivity. The combination of semantic clustering via bi-directional entailment and entropy measurement forms the core technical mechanism, enabling models to better reveal hallucinations.
Methodology
- �� Construct diverse training datasets by iterative generation and semantic verification, ensuring multiple answers per question.
- �� In SFT, maximize the likelihood of all diverse answers conditioned on the prompt, promoting lexical and structural variation.
- �� In DPO, utilize pairwise preference data where the model learns to favor diverse, semantically aligned responses over repetitive, low-entropy answers.
- �� Combine SFT and DPO: first fine-tune with multi-answer data, then optimize with preference pairs to reinforce diversity.
- �� During training, adjust generation temperature and verify semantic consistency using entailment models.
- �� Evaluate by clustering generated answers with bi-directional entailment, computing semantic entropy, and measuring AUROC for hallucination detection.
Experiments
Experiments involve three datasets—TriviaQA, SQuAD, NQ-Open—and models like LLaMA-3-8B and Qwen-2.5-7B. The training pipeline includes generating multiple diverse answers per question at high temperature (T=0.8) and a single reference answer at low temperature (T=0.05). Fine-tuning employs LoRA for parameter efficiency, with 4-5 epochs, learning rates around 1e-4 for SFT and 2e-6 for DPO. Baselines include unmodified models and models with standard SFT. Evaluation metrics focus on AUROC, comparing detection of hallucinations via semantic entropy scores. Ablation studies analyze the impact of diversity levels, training strategies, and dataset quality, validating the robustness and generalizability of the approach.
Results
Results show that models fine-tuned with diversity strategies outperform baselines across all datasets, with AUROC improvements averaging 4.5%. The combined SFT+DPO approach achieves the highest scores, e.g., 0.839 AUROC on Qwen. Analysis reveals increased semantic divergence among multiple responses, especially in hallucination cases, leading to higher entropy scores and better discrimination. The models exhibit enhanced sensitivity to semantic inconsistencies, reducing false negatives. Comparisons with inference-time diversity methods confirm that training-stage diversity embedding yields superior detection performance, demonstrating the importance of proactive diversity promotion during training.
Applications
This method is directly applicable to AI safety, fact verification, and content moderation systems, where detecting false or hallucinated outputs is critical. It enables deploying more trustworthy LLMs in real-world scenarios like automated fact-checking, dialogue systems, and knowledge-based assistants. The training approach can be integrated into existing pipelines with minimal overhead, provided diverse datasets are available. Long-term, this strategy can facilitate the development of inherently safer models, reducing reliance on external verification and post-hoc filtering, thus broadening AI’s safe deployment in sensitive domains.
Limitations & Outlook
The approach may face challenges in open-domain settings with inherently high answer variability, risking false positives due to semantic fragmentation. Data collection for diverse answer sets is resource-intensive, limiting scalability. Additionally, in rare or complex factual scenarios, models may still produce low-entropy hallucinations, indicating the need for further refinement. Future work should focus on adaptive diversity control, external knowledge integration, and reducing annotation costs to enhance robustness and applicability.
Plain Language Accessible to non-experts
想象你在厨房做饭,平时你用的食材和做法都一样,做出来的菜也差不多。现在你试着用不同的调料或换个做法,菜的味道就会变得丰富多彩,但也可能出现不合口味的情况。这就像模型回答问题一样,如果总是用一样的答案,就很难发现它是不是出错。通过让模型学会用不同的方式回答问题,就像你用不同的调料,答案变得多样了,也更容易找到问题所在。这样一来,模型的回答既丰富又可靠,就像一道色香味俱佳的菜肴,既好吃又有保障。
ELI14 Explained like you're 14
想象你在学校参加一个问答比赛,你总是用一样的答案,比如“我不知道”。如果你学会用不同的方式回答,比如“我不太确定,但我觉得可能是这个”,你的回答就变得多样了。这就像模型在回答问题时,如果每次都给出一样的答案,就很难发现它是不是在搞错。现在,研究人员让模型学会用不同的答案回答同一个问题,就像你用不同的句子表达自己。这样一来,如果答案都差不多,说明模型可能在出错;如果答案不同,但意思一样,就说明它更聪明,也更容易被发现出错的地方。这就像你用不同的方法表达自己,让别人更容易看出你是不是在说谎或搞错了。
Abstract
Existing hallucination detection methods are typically conducted at the inference stage, without making any modifications to the model itself. In this paper, we are interested in exploring fine-tuning strategies that enhance the detectability of hallucinations in the resulting model. Focusing on semantic-entropy-based detection, we observe that many erroneous outputs remain undetected because the model produces nearly identical incorrect answers across multiple runs. To address this, we propose diversity-oriented fine-tuning to encourage more varied generations. We introduce two specific strategies: one based on Supervised Fine-Tuning (SFT) and the other on Direct Preference Optimization (DPO). Extensive experiments are conducted to evaluate our approach and analyze the behavior of the models before and after fine-tuning. We find that after adopting our fine-tuning methods, the models become less likely to produce low semantic entropy responses for hallucinated answers, thereby improving the effectiveness of hallucination detection, eventually yielding results better than or comparable with state of the art methods. The code will be publicly released.