通过分析模型层间语义演变,识别大模型幻觉问题。
The Geometry of Truth: Layer-wise Semantic Dynamics for Hallucination Detection in Large Language Models
- 基于层间隐藏状态的几何动态分析,无需采样或外部验证。
- 在TruthfulQA等数据集上达到F1=0.92,AUROC=0.96,仅需单次前向传播。
- 适合需要实时检测幻觉的高风险应用场景,如医疗、法律。
大语言模型常生成流畅但事实错误的内容(即幻觉),在高风险领域带来严重隐患。本文提出层间语义动态(LSD)框架,通过分析Transformer各层隐藏状态的语义演化来检测幻觉。不同于依赖多次采样或外部验证的方法,LSD在模型内部表示空间中运行。采用基于边距的对比学习,将隐藏激活对齐于由事实编码器生成的真值嵌入,揭示出明显的语义轨迹差异:真实回答保持稳定的对齐,而幻觉则表现出显著的语义漂移。在TruthfulQA和合成事实-幻觉数据集上的评估显示,LSD实现F1分数0.92、AUROC 0.96、聚类准确率0.89,优于SelfCheckGPT和语义熵基线,且仅需一次前向传播。该方法效率提升5-20倍,同时保持精度与可解释性。LSD为实时幻觉监控提供了一种可扩展、模型无关的机制,并揭示了大模型中事实一致性背后的几何特性。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。