arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.04933cs.CLcs.AIcs.ITcs.LGcs.NEmath.IT
收藏

《真理的几何:用于大语言模型幻觉检测的逐层语义动力学》

The Geometry of Truth: Layer-wise Semantic Dynamics for Hallucination Detection in Large Language Models

Sirraya Labs(Sirraya实验室)

Amir Hameed Mir

AI总结:

本研究针对大语言模型的幻觉问题,提出基于几何框架的逐层语义动力学(LSD)检测方法,通过层间隐藏语义轨迹分析实现单次前向传播的高效检测,性能优于现有基线且提速显著,为实时幻觉监测提供了可扩展的模型无关方案。

摘要:

大语言模型(LLM)常生成流畅但事实错误的表述,即幻觉现象,在高风险领域会带来严重风险。本文提出逐层语义动力学(LSD),这是一种用于幻觉检测的几何框架,通过分析Transformer层间隐藏状态语义的演化规律实现检测。与依赖多次采样或外部验证源的现有方法不同,LSD完全在模型的表征空间内运行。该方法采用基于间隔的对比学习,将隐藏激活与由事实编码器生成的真值嵌入对齐,揭示出语义轨迹的显著差异:事实性响应能保持稳定的对齐关系,而幻觉响应会随网络深度出现明显的语义漂移。在TruthfulQA数据集和合成事实幻觉数据集上的评估显示,LSD取得了0.92的F1值、0.96的AUROC和0.89的聚类准确率,性能优于SelfCheckGPT和语义熵基线方法,且仅需单次前向传播。这种高效性使其比基于采样的方法提速5-20倍,同时未牺牲精度或可解释性。LSD为实时幻觉监测提供了一种可扩展、模型无关的机制,也为理解大语言模型中事实一致性的几何结构提供了新见解。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑