Efficient Hallucination Detection: Adaptive Bayesian Estimation of Semantic Entropy with Guided Semantic Exploration
Organizations: National University of Defense Technology, Changsha, China · Intelligent Game and Decision Lab, Beijing, China · The Chinese University of Hong Kong, Shenzhen, China
Abstract
Large language models (LLMs) have achieved remarkable success in various natural language processing tasks, yet they remain prone to generating factually incorrect outputs known as hallucinations. While recent approaches have shown promise for hallucination detection by repeatedly sampling from LLMs and quantifying the semantic inconsistency among the generated responses, they rely on fixed sampling budgets that fail to adapt to query complexity, resulting in computational inefficiency. We propose an Adaptive Bayesian Estimation framework for Semantic Entropy with Guided Semantic Exploration, which dynamically adjusts sampling requirements based on observed uncertainty. Our approach employs a hierarchical Bayesian framework to model the semantic distribution, enabling dynamic control of sampling iterations through variance-based thresholds that terminate generation once sufficient certainty is achieved. We also develop a perturbation-based importance sampling strategy to systematically explore the semantic space. Extensive experiments on four QA datasets demonstrate that our method achieves superior hallucination detection performance with significant efficiency gains. In low-budget scenarios, our approach requires about 50% fewer samples to achieve comparable detection performance to existing methods, while delivers an average AUROC improvement of 12.6% under the same sampling budget.
Figures & tables
| LLM | Dataset | P(True) | N=2 | N=5 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| SAR | SE | SE | OURS | SAR | SE | SE | OURS | |||
| Llama-2-7B | CoQA | .468 | .591 | .609 | .618 | .695 | .627 | .683 | .688 | .748 |
| TriviaQA | .488 | .708 | .710 | .724 | .835 | .741 | .795 | .827 | .897 | |
| TruthfulQA | .509 | .598 | .621 | .635 | .732 | .632 | .713 | .724 | .795 | |
| SimpleQA | .521 | .721 | .796 | .891 | .895 | .768 | .930 | .956 | .959 | |
| Llama-3.1-8B | CoQA | .568 | .655 | .699 | .648 | .738 | .648 | .756 | .769 | .799 |
| Method | N=2 | N=5 |
|---|---|---|
| Full Model | .855 | .913 |
| Prior Estimation | ||
| w/o adaptive prior ( ) | .812 | .878 |
| Adaptive Sampling | ||
| Fixed sampling w/o Bayesian | .759 | .866 |
| Fixed sampling w/ Bayesian | .798 | .885 |
| Model | CoQA | TriviaQA | TruthfulQA | SimpleQA |
|---|---|---|---|---|
| Llama-2-7B | 27.4% | 37.5% | 58.8% | 98.5% |
| Llama-3.1-8B | 15.9% | 34.7% | 52.2% | 76.2% |
| Mistral-Small-24B | 13.7% | 21.2% | 46.9% | 71.5% |
LLM Hallucination Detection
Large language model hallucination detection identifies unsupported, incorrect, or fabricated claims in model outputs and traces.
See all 206 papers