用知识图谱结构化大模型输出,提升幻觉自检准确率
Lie to Me: Knowledge Graphs for Robust Hallucination Self-Detection in LLMs
- 将大模型回复转为实体关系知识图谱,辅助判断幻觉
- 相比现有方法,准确率提升16%,F1值提高20%
- 无需改造模型,适合各类大模型幻觉检测
幻觉——生成看似合理却虚假的陈述——仍是大模型安全部署的主要障碍。基于自检方法的良好表现,本文探索使用结构化知识表示(即知识图谱)来增强幻觉自检能力。提出一种简单而有效的方法:(i) 将大模型输出转换为实体与关系构成的知识图谱;(ii) 利用该图谱评估回应中包含幻觉的可能性。在GPT-4o和Gemini-2.5-Flash两个主流模型上,针对两个幻觉检测数据集进行评估。为支持更可靠的未来基准测试,其中一个数据集经人工校对并增强,作为本研究的副成果发布。相比标准自检方法及当前先进方法SelfCheckGPT,本方法在准确率上最高提升16%,F1-score提升20%。结果表明,即使初始输出存在错误,将原子事实以知识图谱形式结构化后,大模型仍能更有效地分析其真实性。该低成本、模型无关的方法为构建更安全可信的语言模型开辟了新路径。
原文摘要 · Abstract (English)
Hallucinations, the generation of apparently convincing yet false statements, remain a major barrier to the safe deployment of LLMs. Building on the strong performance of self-detection methods, we examine the use of structured knowledge representations, namely knowledge graphs, to improve hallucination self-detection. Specifically, we propose a simple yet powerful approach that enriches hallucination self-detection by (i) converting LLM responses into knowledge graphs of entities and relations, and (ii) using these graphs to estimate the likelihood that a response contains hallucinations. We evaluate the proposed approach using two widely used LLMs, GPT-4o and Gemini-2.5-Flash, across two hallucination detection datasets. To support more reliable future benchmarking, one of these datasets has been manually curated and enhanced and is released as a secondary outcome of this work. Compared to standard self-detection methods and SelfCheckGPT, a state-of-the-art approach, our method achieves up to 16% relative improvement in accuracy and 20% in F1-score. Our results show that LLMs can better analyse atomic facts when they are structured as knowledge graphs, even when initial outputs contain inaccuracies. This low-cost, model-agnostic approach paves the way toward safer and more trustworthy language models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。