Detecting Hallucinations in Large Language Model Generation: A Token Probability Approach

Ernesto Quevedo, Jorge Yero, Rachel Koerner, Pablo Rivas, Tomas Cerny
5/30/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: Rivas-AI/HalluDetect (17 stars, MIT, last commit 2024-06-01).

Abstract

Concerns regarding the propensity of Large Language Models (LLMs) to produce inaccurate outputs, also known as hallucinations, have escalated. Detecting them is vital for ensuring the reliability of applications relying on LLM-generated content. Current methods often demand substantial resources and rely on extensive LLMs or employ supervised learning with multidimensional features or intricate linguistic and semantic analyses difficult to reproduce and largely depend on using the same LLM that hallucinated. This paper introduces a supervised learning approach employing two simple classifiers utilizing only four numerical features derived from tokens and vocabulary probabilities obtained from other LLM evaluators, which are not necessarily the same. The method yields promising results, surpassing state-of-the-art outcomes in multiple tasks across three different benchmarks. Additionally, we provide a comprehensive examination of the strengths and weaknesses of our approach, highlighting the significance of the features utilized and the LLM employed as an evaluator. We have released our code publicly at https://github.com/Baylor-AI/HalluDetect.

View on arXivView PDF

Code Implementations(1)

MIT

Detecting Hallucinations in Large Language Model Generation: A Token Probability Approach. This repository includes the implementation of our method for training and evaluation of a Logistic Regression and MLP using features extracted with LLMs from text to classify it as an hallucination across different tasks.

172Jupyter NotebookMay 27, 20242 years agoMIT

Similar Papers

Cite this paper

@article{quevedo2024detecting,
  title  = {Detecting Hallucinations in Large Language Model Generation: A Token Probability Approach},
  author = {Ernesto Quevedo and Jorge Yero and Rachel Koerner and Pablo Rivas and Tomas Cerny},
  year   = {2024},
  eprint = {2405.19648},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.19648v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.19648.svg)](https://codeofpaper.com/paper/2405.19648)

Discussion