55th Annual IEEE/IFIP International Conference on Dependable Systems and Networks Workshops (DSN-W),
Juni 2025 · DOI: 10.1109/DSN-W65791.2025.00076
Large Language Models (LLMs) have revolutionized natural language processing, enabling high-quality content generation. However, they remain prone to hallucinations, instances where generated outputs deviate from factual truth. In this paper, we propose a novel approach that integrates Beam Search Sampling (BSS) with Semantic Consistency Analysis to systematically detect factual hallucinations. Our method leverages BSS to generate multiple candidate answers, capturing the model's confidence distribution across different plausible answers. These answers are then clustered based on semantic similarity, and a Natural Language Inference (NLI) model is applied to assess entailment and contradiction relationships. To quantify hallucinations, we introduce a scoring mechanism that combines token probabilities with semantic similarity metrics. Additionally, for cases where BSS produces a single answer, we incorporate a Chain-of-Verification (CoVe) mechanism to perform self-consistency checks. We evaluate our approach using Llama3.8B on the TruthfulQA dataset, achieving a precision of 0.87 and an AUROC of 0.81 for multi-answer generation. For single-answer verification with CoVe, we report a precision of 0.64 and accuracy of 0.71. Our approach outperforms conventional semantic entrony-based methods
Stichworte: Large Language Models (LLMs), Hallucination Detection, Beam Search Sampling, Semantic Consistency.