Hallucination Detection: A Probabilistic Framework Using Embeddings Distance Analysis

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Ricco, Emanuele, Cima, Lorenzo, Di Pietro, Roberto
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929712888020992
author Ricco, Emanuele
Cima, Lorenzo
Di Pietro, Roberto
author_facet Ricco, Emanuele
Cima, Lorenzo
Di Pietro, Roberto
contents Hallucinations are one of the major issues affecting LLMs, hindering their wide adoption in production systems. While current research solutions for detecting hallucinations are mainly based on heuristics, in this paper we introduce a mathematically sound methodology to reason about hallucination, and leverage it to build a tool to detect hallucinations. To the best of our knowledge, we are the first to show that hallucinated content has structural differences with respect to correct content. To prove this result, we resort to the Minkowski distances in the embedding space. Our findings demonstrate statistically significant differences in the embedding distance distributions, that are also scale free -- they qualitatively hold regardless of the distance norm used and the number of keywords, questions, or responses. We leverage these structural differences to develop a tool to detect hallucinated responses, achieving an accuracy of 66\% for a specific configuration of system parameters -- comparable with the best results in the field. In conclusion, the suggested methodology is promising and novel, possibly paving the way for further research in the domain, also along the directions highlighted in our future work.
format Preprint
id arxiv_https___arxiv_org_abs_2502_08663
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Hallucination Detection: A Probabilistic Framework Using Embeddings Distance Analysis
Ricco, Emanuele
Cima, Lorenzo
Di Pietro, Roberto
Computation and Language
Artificial Intelligence
Computers and Society
Hallucinations are one of the major issues affecting LLMs, hindering their wide adoption in production systems. While current research solutions for detecting hallucinations are mainly based on heuristics, in this paper we introduce a mathematically sound methodology to reason about hallucination, and leverage it to build a tool to detect hallucinations. To the best of our knowledge, we are the first to show that hallucinated content has structural differences with respect to correct content. To prove this result, we resort to the Minkowski distances in the embedding space. Our findings demonstrate statistically significant differences in the embedding distance distributions, that are also scale free -- they qualitatively hold regardless of the distance norm used and the number of keywords, questions, or responses. We leverage these structural differences to develop a tool to detect hallucinated responses, achieving an accuracy of 66\% for a specific configuration of system parameters -- comparable with the best results in the field. In conclusion, the suggested methodology is promising and novel, possibly paving the way for further research in the domain, also along the directions highlighted in our future work.
title Hallucination Detection: A Probabilistic Framework Using Embeddings Distance Analysis
topic Computation and Language
Artificial Intelligence
Computers and Society
url https://arxiv.org/abs/2502.08663