On Early Detection of Hallucinations in Factual Question Answering

Ben Snyder, Marius Moisescu, Muhammad Bilal Zafar
12/19/2023
cs.CLcs.AI

No official code found. Best implementation: amazon-science/llm-hallucinations-factual-qa (15 stars, Apache-2.0, last commit 2025-02-08). 1 more below.

Abstract

While large language models (LLMs) have taken great strides towards helping humans with a plethora of tasks, hallucinations remain a major impediment towards gaining user trust. The fluency and coherence of model generations even when hallucinating makes detection a difficult task. In this work, we explore if the artifacts associated with the model generations can provide hints that the generation will contain hallucinations. Specifically, we probe LLMs at 1) the inputs via Integrated Gradients based token attribution, 2) the outputs via the Softmax probabilities, and 3) the internal state via self-attention and fully-connected layer activations for signs of hallucinations on open-ended question answering tasks. Our results show that the distributions of these artifacts tend to differ between hallucinated and non-hallucinated generations. Building on this insight, we train binary classifiers that use these artifacts as input features to classify model generations into hallucinations and non-hallucinations. These hallucination classifiers achieve up to $0.80$ AUROC. We also show that tokens preceding a hallucination can already predict the subsequent hallucination even before it occurs.

View on arXivView PDF

Code Implementations(2)

Apache-2.0
155Shell, PythonMay 17, 20241 years agoApache-2.0

A reimplementation of paper "On Early Detection of Hallucinations in Factual Question Answering"

00Shell, PythonApr 14, 20251 years ago

Similar Papers

Cite this paper

@article{snyder2023early,
  title  = {On Early Detection of Hallucinations in Factual Question Answering},
  author = {Ben Snyder and Marius Moisescu and Muhammad Bilal Zafar},
  year   = {2023},
  eprint = {2312.14183},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.14183v3}
}

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/2312.14183.svg)](https://codeofpaper.com/paper/2312.14183)

Discussion