arXiv:2502.13416cs.CL2025-02被引 6

用时序逻辑自动检测大模型生成内容中的事实矛盾问题。

Detecting LLM Fact-conflicting Hallucinations Enhanced by Temporal-logic-based Reasoning

  • 基于时序逻辑构建知识库,自动生成带真实答案的测试用例。
  • 在9个领域测试中发现模型事实错误率24.7%~59.8%,时序相关错误16.7%~39.2%。
  • 通过语义对比验证推理过程,适合评估模型可靠性与安全性。

大型语言模型(LLMs)面临幻觉问题——输出看似合理但实际错误。其中危害较大的是事实矛盾幻觉(FCH),即生成内容与已知事实冲突。现有挑战包括:1)构建和维护大规模基准数据集困难且耗资源;2)生成复杂、高效且模型未训练过的测试用例,尤其涉及复杂时序特征时尤为关键;3)验证模型推理过程难以实现,尤其当涉及复杂逻辑关系时需透明决策机制。本文提出Drowzee,一种端到端的元测试框架,利用时序逻辑识别LLMs中的事实矛盾幻觉。Drowzee通过爬取维基百科等来源构建全面的事实知识库,并使用自动化时序逻辑推理将其转换为大量可扩展的测试用例及真实答案。使用模板化提示对LLM进行测试,要求其生成答案与推理步骤。为验证推理,提出两种语义感知的判别器,比较模型输出与真实答案的语义结构。在九个不同知识领域的九个LLM上实验显示,Drowzee有效识别出非时序相关幻觉率24.7%~59.8%,时序相关幻觉率16.7%~39.2%。

原文摘要 · Abstract (English)

Large language models (LLMs) face the challenge of hallucinations -- outputs that seem coherent but are actually incorrect. A particularly damaging type is fact-conflicting hallucination (FCH), where generated content contradicts established facts. Addressing FCH presents three main challenges: 1) Automatically constructing and maintaining large-scale benchmark datasets is difficult and resource-intensive; 2) Generating complex and efficient test cases that the LLM has not been trained on -- especially those involving intricate temporal features -- is challenging, yet crucial for eliciting hallucinations; and 3) Validating the reasoning behind LLM outputs is inherently difficult, particularly with complex logical relationships, as it requires transparency in the model's decision-making process. This paper presents Drowzee, an innovative end-to-end metamorphic testing framework that utilizes temporal logic to identify fact-conflicting hallucinations (FCH) in large language models (LLMs). Drowzee builds a comprehensive factual knowledge base by crawling sources like Wikipedia and uses automated temporal-logic reasoning to convert this knowledge into a large, extensible set of test cases with ground truth answers. LLMs are tested using these cases through template-based prompts, which require them to generate both answers and reasoning steps. To validate the reasoning, we propose two semantic-aware oracles that compare the semantic structure of LLM outputs to the ground truths. Across nine LLMs in nine different knowledge domains, experimental results show that Drowzee effectively identifies rates of non-temporal-related hallucinations ranging from 24.7% to 59.8%, and rates of temporal-related hallucinations ranging from 16.7% to 39.2%.

幻觉检测时序逻辑大模型评估推理验证

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。