Large Language Models (LLMs) have demonstrated remarkable capabilities in many real-world applications. Nonetheless, LLMs are often criticized for their tendency to produce hallucinations, wherein the models fabricate incorrect statements on tasks beyond their knowledge and perception. To alleviate this issue, researchers have explored leveraging the factual knowledge in knowledge graphs (KGs) to ground the LLM's responses in established facts and principles. However, most state-of-the-art LLMs are closed-source, making it challenging to develop a prompting framework that can efficiently and effectively integrate KGs into LLMs with hard prompts only. Generally, existing KG-enhanced LLMs usually suffer from three critical issues, including huge search space, high API costs, and laborious prompt engineering, that impede their widespread application in practice. To this end, we introduce a novel Knowledge Graph based PrompTing framework, namely KnowGPT, to enhance LLMs with domain knowledge. KnowGPT contains a knowledge extraction module to extract the most informative knowledge from KGs, and a context-aware prompt construction module to automatically convert extracted knowledge into effective prompts. Experiments on three benchmarks demonstrate that KnowGPT significantly outperforms all competitors. Notably, KnowGPT achieves a 92.6% accuracy on OpenbookQA leaderboard, comparable to human-level performance.
翻译:大语言模型(LLMs)在许多实际应用中展现出卓越能力。然而,LLMs常因产生幻觉而受到批评——当任务超出其知识范畴时,模型会编造错误陈述。为缓解此问题,研究者尝试利用知识图谱(KGs)中的事实知识,将LLM的响应锚定于既定事实与原理。但当前主流LLMs多为闭源模型,仅通过硬提示构建高效融合知识图谱的提示框架面临巨大挑战。现有基于知识图谱增强的LLMs普遍存在三大关键问题:搜索空间庞大、API调用成本高昂以及提示工程繁琐,这些问题阻碍了其在实际场景中的广泛应用。为此,我们提出一种基于知识图谱的新型提示框架KnowGPT,通过领域知识增强LLMs。KnowGPT包含知识抽取模块(从知识图谱中提取最具信息量的知识)与上下文感知的提示构建模块(将提取的知识自动转化为高效提示)。在三个基准测试上的实验表明,KnowGPT显著优于所有对比方法。值得注意的是,KnowGPT在OpenbookQA排行榜上达到92.6%的准确率,接近人类水平表现。