Saved in:
Bibliographic Details
Main Author: Mir, Amir Hameed
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2510.04933
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912631664672768
author Mir, Amir Hameed
author_facet Mir, Amir Hameed
contents Large Language Models (LLMs) often produce fluent yet factually incorrect statements-a phenomenon known as hallucination-posing serious risks in high-stakes domains. We present Layer-wise Semantic Dynamics (LSD), a geometric framework for hallucination detection that analyzes the evolution of hidden-state semantics across transformer layers. Unlike prior methods that rely on multiple sampling passes or external verification sources, LSD operates intrinsically within the model's representational space. Using margin-based contrastive learning, LSD aligns hidden activations with ground-truth embeddings derived from a factual encoder, revealing a distinct separation in semantic trajectories: factual responses preserve stable alignment, while hallucinations exhibit pronounced semantic drift across depth. Evaluated on the TruthfulQA and synthetic factual-hallucination datasets, LSD achieves an F1-score of 0.92, AUROC of 0.96, and clustering accuracy of 0.89, outperforming SelfCheckGPT and Semantic Entropy baselines while requiring only a single forward pass. This efficiency yields a 5-20x speedup over sampling-based methods without sacrificing precision or interpretability. LSD offers a scalable, model-agnostic mechanism for real-time hallucination monitoring and provides new insights into the geometry of factual consistency within large language models.
format Preprint
id arxiv_https___arxiv_org_abs_2510_04933
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle The Geometry of Truth: Layer-wise Semantic Dynamics for Hallucination Detection in Large Language Models
Mir, Amir Hameed
Computation and Language
Artificial Intelligence
Information Theory
Machine Learning
Neural and Evolutionary Computing
68T50, 68T07, 62H30
I.2.7; I.2.6; F.2.2; H.3.3
Large Language Models (LLMs) often produce fluent yet factually incorrect statements-a phenomenon known as hallucination-posing serious risks in high-stakes domains. We present Layer-wise Semantic Dynamics (LSD), a geometric framework for hallucination detection that analyzes the evolution of hidden-state semantics across transformer layers. Unlike prior methods that rely on multiple sampling passes or external verification sources, LSD operates intrinsically within the model's representational space. Using margin-based contrastive learning, LSD aligns hidden activations with ground-truth embeddings derived from a factual encoder, revealing a distinct separation in semantic trajectories: factual responses preserve stable alignment, while hallucinations exhibit pronounced semantic drift across depth. Evaluated on the TruthfulQA and synthetic factual-hallucination datasets, LSD achieves an F1-score of 0.92, AUROC of 0.96, and clustering accuracy of 0.89, outperforming SelfCheckGPT and Semantic Entropy baselines while requiring only a single forward pass. This efficiency yields a 5-20x speedup over sampling-based methods without sacrificing precision or interpretability. LSD offers a scalable, model-agnostic mechanism for real-time hallucination monitoring and provides new insights into the geometry of factual consistency within large language models.
title The Geometry of Truth: Layer-wise Semantic Dynamics for Hallucination Detection in Large Language Models
topic Computation and Language
Artificial Intelligence
Information Theory
Machine Learning
Neural and Evolutionary Computing
68T50, 68T07, 62H30
I.2.7; I.2.6; F.2.2; H.3.3
url https://arxiv.org/abs/2510.04933