用知识图谱约束大模型,减少生物医学问答中的幻觉
Combining LLMs and Knowledge Graphs to Reduce Hallucinations in Question Answering
- 将大模型与知识图谱结合,通过查询校验确保生成查询的准确
- 在50个生物医学问题上测试,GPT-4 Turbo表现最优,llama3:70b经提示工程也有潜力
- 提供网页界面,可直观查看和验证生成的查询路径,适合非专业用户
自然语言处理的进步使数字信息系统的交互更便捷,但在准确性要求高的领域(如生物医学)仍面临挑战。核心问题是幻觉:模型生成与底层数据不符的信息,可能引发严重误判。本文提出一种新方法,结合大语言模型(LLM)与知识图谱(KG),提升问答系统的准确性和可靠性。基于LangChain框架,该方法引入查询检查器,验证大模型生成查询的语法和语义有效性,再用于从知识图谱中提取信息,显著降低幻觉错误。我们在一个包含50个生物医学问题的新基准数据集上评估,测试了GPT-4 Turbo和llama3:70b等模型。结果表明,尽管GPT-4 Turbo在生成准确查询方面表现更优,但经过适当提示工程的开源模型llama3:70b也展现出潜力。为提升可访问性,我们开发了友好的网页界面,支持用户输入自然语言问题,查看并验证生成的和修正后的Cypher查询及路径。该混合方法有效缓解数据缺失和幻觉问题,为问答系统提供可靠且直观的解决方案。源码可在https://git.zib.de/lpusch/cyphergenkg-gui 获取。
原文摘要 · Abstract (English)
Advancements in natural language processing have revolutionized the way we can interact with digital information systems, such as databases, making them more accessible. However, challenges persist, especially when accuracy is critical, as in the biomedical domain. A key issue is the hallucination problem, where models generate information unsupported by the underlying data, potentially leading to dangerous misinformation. This paper presents a novel approach designed to bridge this gap by combining Large Language Models (LLM) and Knowledge Graphs (KG) to improve the accuracy and reliability of question-answering systems, on the example of a biomedical KG. Built on the LangChain framework, our method incorporates a query checker that ensures the syntactical and semantic validity of LLM-generated queries, which are then used to extract information from a Knowledge Graph, substantially reducing errors like hallucinations. We evaluated the overall performance using a new benchmark dataset of 50 biomedical questions, testing several LLMs, including GPT-4 Turbo and llama3:70b. Our results indicate that while GPT-4 Turbo outperforms other models in generating accurate queries, open-source models like llama3:70b show promise with appropriate prompt engineering. To make this approach accessible, a user-friendly web-based interface has been developed, allowing users to input natural language queries, view generated and corrected Cypher queries, and verify the resulting paths for accuracy. Overall, this hybrid approach effectively addresses common issues such as data gaps and hallucinations, offering a reliable and intuitive solution for question answering systems. The source code for generating the results of this paper and for the user-interface can be found in our Git repository: https://git.zib.de/lpusch/cyphergenkg-gui
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。