[论文解读] KnowGPT: Knowledge Graph based Prompting for Large Language Models
KnowGPT 是一种黑箱知识注入框架,通过仅使用 API 访问,利用知识图谱(KGs)增强大型语言模型(LLMs),如 ChatGPT 和 GPT-4。它使用深度强化学习从 KG 中提取相关推理路径,并采用多臂赌博机(MAB)自动构建最优提示,相较于 ChatGPT 实现了平均 23.7% 的性能提升,在 OpenbookQA 上达到 91.6% 的准确率,接近人类水平表现。
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.
研究动机与目标
- 为解决黑箱 LLM(如 ChatGPT 和 GPT-4)无法微调且无法访问内部参数的局限性。
- 通过从知识图谱(KGs)注入领域特定知识,提升问答中的事实准确性,且不修改 LLM 的权重。
- 克服在输入长度受限条件下,从 KG 中选择相关三元组并构建有效提示的挑战。
- 开发一种框架,利用强化学习与博弈算法,根据每个问题动态选择最优提示模板与路径提取策略。
- 在开放域与领域特定问答任务中,实现与人类水平基准相当的性能。
提出的方法
- 训练一个深度强化学习(RL)智能体,通过从问题实体导航到答案实体,从知识图谱(KGs)中提取信息丰富且简洁的推理路径。
- 设计自定义奖励函数,以最大化路径可达性、上下文相关性与简洁性,引导 RL 策略学习有效的路径选择。
- 采用多臂赌博机(MAB)框架,为每个输入问题动态选择最优的路径提取策略与提示模板组合。
- MAB 平衡探索与利用,以优化提示构建,适应问题的特定特征,且无需模型微调。
- 该框架仅通过 LLM API 部署,兼容闭源模型如 GPT-4 和 ChatGPT。
- 在三个基准数据集上进行评估:CSQA、OpenbookQA 和 MedQA,使用 ConceptNet 和 USMLE 作为知识图谱源。

实验结果
研究问题
- RQ1无模型权重访问的黑箱知识注入框架能否有效提升 LLM 在问答任务中的性能?
- RQ2在严格输入长度限制下,如何高效地从大规模知识图谱中提取相关知识?
- RQ3在整合 KG 中的事实知识时,何种提示构建策略能最大化 LLM 表现?
- RQ4动态自适应提示生成方法是否能在复杂推理任务中超越静态提示模板?
- RQ5此类框架在多大程度上能缩小 LLM 与人类水平表现之间的事实准确性差距?
主要发现
- KnowGPT 在三个基准数据集上相较 ChatGPT 实现了 23.7% 的平均性能提升,显著增强了事实准确性。
- 在 OpenbookQA 排行榜上,KnowGPT 达到 91.6% 的准确率,与人类水平表现相当。
- 相较于 GPT-4,该框架性能提升 2.9%,表明其在顶尖模型面前依然有效。
- 基于 MAB 的提示构建策略优于静态模板,完整 KnowGPT 系统在 CSQA 上达到 82.7% 准确率,在 MedQA 上达到 92.4%。
- 消融实验确认,RL 路径提取与 MAB 提示选择两个组件均至关重要,各自对最终性能有显著贡献。
- 案例研究显示,提示格式对 LLM 输出有关键影响,KnowGPT 的自动格式选择始终优于固定模板(如三元组或图描述)。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。