Table of Contents
Fetching ...

A novel hallucination classification framework

Maksym Zavhorodnii, Dmytro Dehtiarov, Anna Konovalenko

TL;DR

The paper tackles the lack of systematic hallucination classification in LLMs by proposing a taxonomy-guided, embedding-space framework that uses controlled generation and unsupervised clustering. It constructs a pipeline—data preparation with prompt-engineered generation, uniform vector embeddings, and UMAP-based reduction—to analyze centroid distances between ground truth, correct outputs, and hallucinations. Empirical results show clear semantic separation in embedding space, with correct outputs clustering near ground truth and hallucinations occupying distinct regions, enabling lightweight, distance-based classification. This approach lays the groundwork for real-time, scalable hallucination detection and fine-grained typing, with practical impact for reliability and risk-aware deployment of LLMs.

Abstract

This work introduces a novel methodology for the automatic detection of hallucinations generated during large language model (LLM) inference. The proposed approach is based on a systematic taxonomy and controlled reproduction of diverse hallucination types through prompt engineering. A dedicated hallucination dataset is subsequently mapped into a vector space using an embedding model and analyzed with unsupervised learning techniques in a reduced-dimensional representation of hallucinations with veridical responses. Quantitative evaluation of inter-centroid distances reveals a consistent correlation between the severity of informational distortion in hallucinations and their spatial divergence from the cluster of correct outputs. These findings provide theoretical and empirical evidence that even simple classification algorithms can reliably distinguish hallucinations from accurate responses within a single LLM, thereby offering a lightweight yet effective framework for improving model reliability.

A novel hallucination classification framework

TL;DR

The paper tackles the lack of systematic hallucination classification in LLMs by proposing a taxonomy-guided, embedding-space framework that uses controlled generation and unsupervised clustering. It constructs a pipeline—data preparation with prompt-engineered generation, uniform vector embeddings, and UMAP-based reduction—to analyze centroid distances between ground truth, correct outputs, and hallucinations. Empirical results show clear semantic separation in embedding space, with correct outputs clustering near ground truth and hallucinations occupying distinct regions, enabling lightweight, distance-based classification. This approach lays the groundwork for real-time, scalable hallucination detection and fine-grained typing, with practical impact for reliability and risk-aware deployment of LLMs.

Abstract

This work introduces a novel methodology for the automatic detection of hallucinations generated during large language model (LLM) inference. The proposed approach is based on a systematic taxonomy and controlled reproduction of diverse hallucination types through prompt engineering. A dedicated hallucination dataset is subsequently mapped into a vector space using an embedding model and analyzed with unsupervised learning techniques in a reduced-dimensional representation of hallucinations with veridical responses. Quantitative evaluation of inter-centroid distances reveals a consistent correlation between the severity of informational distortion in hallucinations and their spatial divergence from the cluster of correct outputs. These findings provide theoretical and empirical evidence that even simple classification algorithms can reliably distinguish hallucinations from accurate responses within a single LLM, thereby offering a lightweight yet effective framework for improving model reliability.

Paper Structure

This paper contains 11 sections, 3 figures, 4 tables.

Figures (3)

  • Figure 1: Visualization of sentence embeddings for 100 samples grouped into three clusters: (1) ground-truth correct answers, (2) LLM-generated answers predicted as correct, and (3) LLM-generated hallucinated answers. Each cluster represents a distinct category of responses. Red dots at the center of each cluster indicate the computed centroids. The visualization reflects the semantic grouping and separability of different answer types.
  • Figure 2: Visualization of sentence embeddings for 300 samples grouped into three clusters: (1) ground-truth correct answers, (2) LLM-generated answers predicted as correct, and (3) LLM-generated hallucinated answers. Each cluster represents a distinct category of responses. Red dots at the center of each cluster indicate the computed centroids. The visualization reflects the semantic grouping and separability of different answer types.
  • Figure 3: Visualization of sentence embeddings for 500 samples grouped into three clusters: (1) ground-truth correct answers, (2) LLM-generated answers predicted as correct, and (3) LLM-generated hallucinated answers. Each cluster represents a distinct category of responses. Red dots at the center of each cluster indicate the computed centroids. The visualization reflects the semantic grouping and separability of different answer types.