paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Drowzee: Metamorphic Testing for Fact-Conflicting Hallucination Detection in Large Language Models

Drowzee:面向大语言模型事实冲突幻觉检测的蜕变测试
OOPSLA 8(OOPSLA2)2024匹配度 3/10 · 论文将逻辑编程与蜕变测试用于检测大模型的事实冲突幻觉,属于PL技术辅助LLM测试,但研究目标本身是LLM幻觉检测,而非用户关注的“对ML/Agentic程序做静态分析”或“用LLM改进静态分析/形式化验证”。它也未涉及浮点程序分析或贝叶斯程序分析。引用 32 inbox
Ningke Li, Yuekang Li, Yi Liu, Ling Shi, Kailong Wang, Haoyu Wang
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:提出逻辑编程辅助的蜕变测试框架 Drowzee,自动生成测试用例并检测大模型的事实冲突幻觉。

大语言模型常产生与事实相悖的连贯输出,即事实冲突幻觉(FCH)。现有基准依赖人工静态数据集,难以覆盖不断演化的事实,且对复杂逻辑推理的验证困难。本文提出逻辑编程辅助的蜕变测试技术 Drowzee:爬取 Wikipedia 等来源构建可扩展事实知识库,利用逻辑推理规则变换和增广知识,自动生成带真值答案的测试用例,并通过模板化提示要求模型给出推理答案;随后用两个语义感知 oracle 比较模型答案与真值的语义结构,验证推理。在 9 个领域、6 个 LLM 上检测到 24.7% 至 59.8% 的幻觉率,发现模型在时序概念、分布外知识和逻辑推理上表现薄弱;小规模模型编辑(少于 1000 条知识)可缓解部分幻觉。

问题
自动构建和更新 FCH 基准数据集困难,且验证 LLM 输出背后的推理(尤其复杂逻辑关系)也困难。
方法
提出逻辑编程辅助的蜕变测试,从 Wikipedia 等构建事实知识库,用逻辑规则变换生成带真值答案的测试用例,并通过模板提示与两个语义感知 oracle 验证模型推理。
评估
在 9 个领域、6 个 LLM 上测试,幻觉率为 24.7%–59.8%,并探索模型编辑对 FCH 的小规模缓解效果。
原文摘要(Abstract)

Large language models (LLMs) have revolutionized language processing, but face critical challenges with security, privacy, and generating hallucinations — coherent but factually inaccurate outputs. A major issue is fact-conflicting hallucination (FCH), where LLMs produce content contradicting ground truth facts. Addressing FCH is difficult due to two key challenges: 1) Automatically constructing and updating benchmark datasets is hard, as existing methods rely on manually curated static benchmarks that cannot cover the broad, evolving spectrum of FCH cases. 2) Validating the reasoning behind LLM outputs is inherently difficult, especially for complex logical relations. To tackle these challenges, we introduce a novel logic-programming-aided metamorphic testing technique for FCH detection. We develop an extensive and extensible framework that constructs a comprehensive factual knowledge base by crawling sources like Wikipedia, seamlessly integrated into D rowzee . Using logical reasoning rules, we transform and augment this knowledge into a large set of test cases with ground truth answers. We test LLMs on these cases through template-based prompts, requiring them to provide reasoned answers. To validate their reasoning, we propose two semantic-aware oracles that assess the similarity between the semantic structures of the LLM answers and ground truth. Our approach automatically generates useful test cases and identifies hallucinations across six LLMs within nine domains, with hallucination rates ranging from 24.7% to 59.8%. Key findings include LLMs struggling with temporal concepts, out-of-distribution knowledge, and lack of logical reasoning capabilities. The results show that logic-based test cases generated by D rowzee effectively trigger and detect hallucinations. To further mitigate the identified FCHs, we explored model editing techniques, which proved effective on a small scale (with edits to fewer than 1000 knowledge pieces). Our findings emphasize the need for continued community efforts to detect and mitigate model hallucinations.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@article{LiL0SW024,
  title = {Drowzee: Metamorphic Testing for Fact-Conflicting Hallucination Detection in Large Language Models},
  author = {Ningke Li and Yuekang Li and Yi Liu and Ling Shi and Kailong Wang and Haoyu Wang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689776}
}