Estimating the Hallucination Rate of Generative AI
Andrew Jesson, Nicolas Beltran-Velez, Quentin Chu, Sweta Karlekar, Jannik Kossen, Yarin Gal, John P. Cunningham, David Blei
TL;DR
This paper addresses the problem of quantifying hallucination risk in in-context learning by casting CGMs as approximating the posterior predictive of an unknown Bayesian mechanism. It introduces the posterior hallucination rate (PHR) and a practical predictive-resampling estimator that leverages only log-probabilities from the CGM to approximate the likelihood-based thresholding that defines hallucinations. The authors provide a Doob-theorem–based justification and finite-N approximations, and validate the approach with synthetic regression and natural-language ICL experiments using Llama-2 and Gemma-2 models. Overall, the method offers a principled way to quantify and monitor epistemic/aleatoric uncertainty in ICL, with empirical evidence that PHR tracks the true or model-based hallucination rates across tasks, though calibration and underestimation biases remain practical considerations for complex settings.
Abstract
This paper presents a method for estimating the hallucination rate for in-context learning (ICL) with generative AI. In ICL, a conditional generative model (CGM) is prompted with a dataset and a prediction question and asked to generate a response. One interpretation of ICL assumes that the CGM computes the posterior predictive of an unknown Bayesian model, which implicitly defines a joint distribution over observable datasets and latent mechanisms. This joint distribution factorizes into two components: the model prior over mechanisms and the model likelihood of datasets given a mechanism. With this perspective, we define a hallucination as a generated response to the prediction question with low model likelihood given the mechanism. We develop a new method that takes an ICL problem and estimates the probability that a CGM will generate a hallucination. Our method only requires generating prediction questions and responses from the CGM and evaluating its response log probability. We empirically evaluate our method using large language models for synthetic regression and natural language ICL tasks.
