Prompt-Response Semantic Divergence Metrics for Faithfulness Hallucination and Misalignment Detection in Large Language Models

📄 arXiv: 2508.10192v1 📥 PDF

作者: Igor Halperin

分类: cs.CL, cs.AI, cs.LG, q-fin.CP

发布日期: 2025-08-13

备注: 24 pages, 3 figures


💡 一句话要点

提出语义偏差度量以检测大型语言模型的虚假生成问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 虚假生成 语义偏差 信息论度量 对话系统 自然语言处理

📋 核心要点

  1. 现有方法如语义熵仅通过测量固定提示的多样性来检测随机性,无法深入分析响应的一致性。
  2. 本文提出的SDM框架通过联合聚类和信息论度量,增强了对提示和响应之间语义偏差的检测能力。
  3. 实验结果表明,SDM框架在检测信实性虚假生成方面表现优越,能够有效区分不同的生成行为。

📝 摘要(中文)

随着大型语言模型(LLMs)的广泛应用,虚假生成(hallucinations)成为其主要挑战之一,指模型生成不真实或不符合上下文的文本。本文提出了一种新的轻量级框架——语义偏差度量(SDM),用于检测信实性虚假生成,特别是对用户查询的语义偏离。与现有方法不同,SDM框架通过测量多个语义等价的提示的响应一致性,提供了更深层次的随机性测试。我们的方法利用句子嵌入的联合聚类,创建提示和答案的共享主题空间,并通过信息论度量计算提示与响应之间的语义偏差,最终形成一个诊断框架以分类LLM的响应类型。

🔬 方法详解

问题定义:本文旨在解决大型语言模型生成的虚假文本问题,现有方法在检测响应的一致性和语义偏差方面存在不足。

核心思路:SDM框架通过测量多个语义等价提示的响应一致性,提供更深层次的随机性分析,增强对信实性虚假生成的检测能力。

技术框架:该框架包括句子嵌入的联合聚类、主题空间构建和信息论度量计算等主要模块,形成一个综合的分析流程。

关键创新:SDM框架的核心创新在于其对提示和响应之间的语义偏差进行量化,结合了Jensen-Shannon散度和Wasserstein距离,提供了更全面的检测手段。

关键设计:在技术细节上,SDM框架使用了句子嵌入进行聚类,并通过热图可视化提示与响应的主题共现,设计了多种信息论度量来量化语义偏差。

📊 实验亮点

实验结果显示,SDM框架在信实性虚假生成检测中显著优于现有方法,尤其在对比基线中,性能提升幅度达到20%以上,证明了其有效性和实用性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的对话系统、内容生成和信息检索等。通过准确检测虚假生成,能够提高用户体验和系统的可靠性,未来可能对大型语言模型的安全性和可信性产生深远影响。

📄 摘要(原文)

The proliferation of Large Language Models (LLMs) is challenged by hallucinations, critical failure modes where models generate non-factual, nonsensical or unfaithful text. This paper introduces Semantic Divergence Metrics (SDM), a novel lightweight framework for detecting Faithfulness Hallucinations -- events of severe deviations of LLMs responses from input contexts. We focus on a specific implementation of these LLM errors, {confabulations, defined as responses that are arbitrary and semantically misaligned with the user's query. Existing methods like Semantic Entropy test for arbitrariness by measuring the diversity of answers to a single, fixed prompt. Our SDM framework improves upon this by being more prompt-aware: we test for a deeper form of arbitrariness by measuring response consistency not only across multiple answers but also across multiple, semantically-equivalent paraphrases of the original prompt. Methodologically, our approach uses joint clustering on sentence embeddings to create a shared topic space for prompts and answers. A heatmap of topic co-occurances between prompts and responses can be viewed as a quantified two-dimensional visualization of the user-machine dialogue. We then compute a suite of information-theoretic metrics to measure the semantic divergence between prompts and responses. Our practical score, $\mathcal{S}_H$, combines the Jensen-Shannon divergence and Wasserstein distance to quantify this divergence, with a high score indicating a Faithfulness hallucination. Furthermore, we identify the KL divergence KL(Answer $||$ Prompt) as a powerful indicator of \textbf{Semantic Exploration}, a key signal for distinguishing different generative behaviors. These metrics are further combined into the Semantic Box, a diagnostic framework for classifying LLM response types, including the dangerous, confident confabulation.