Hallucination Detection Techniques in Large Language Models: A Comparative Analysis of Post-processing and Non-post-Processing Approaches
摘要
Large Language Models (LLMs) have transformed natural language processing, enabling applications from automated assistants to decision-making systems. However, their propensity to generate hallucinations—factually inaccurate yet plausible outputs—threatens reliability in critical domains like healthcare, finance, and law. This study compares two classes of hallucination detection techniques: post-processing methods, which evaluate text after generation, and non-post-processing methods, which leverage internal model states for real-time detection. Using SelfCheckGPT and MIND as representative techniques, this study evaluates their performance across four LLMs (GPT-J-6B, OPT-7B, LLaMA2-Base-7B, LLaMA2-Chat-7B) on the HELM benchmark, employing evaluation metrics including accuracy, precision, recall, F1-score, AUC, and AUC-PR. Results show that non-post-processing techniques consistently outperform post-processing techniques in accuracy, precision, and efficiency, particularly for subtle, context-dependent errors. These findings offer generalizable insights into the strengths and limitations of detection classes, guiding developers in enhancing the trustworthiness of LLMs for diverse, high-stakes applications.