Knowledge-graph retrieval-augmented generation (KG-RAG) couples large language models (LLMs) with structured, verifiable knowledge graphs (KGs) to reduce hallucinations and expose reasoning traces. However, many KG-RAG systems compose multiple LLM modules (e.g planning, reasoning, and responding), inflating inference cost and binding behavior to a specific target KG. To address this, we introduce KG-R1, an agentic KG retrieval-augmented generation (KG-RAG) framework through reinforcement learning (RL). KG-R1 utilizes a single agent that interacts with KGs as its environment, learning to retrieve at each step and incorporating the retrieved information into its reasoning and generation. The process is optimized through end-to-end RL. In controlled experiments across Knowledge-Graph Question Answering (KGQA) benchmarks, our method demonstrates both efficiency and transferability: Using Qwen-2.5-3B, KG-R1 improves answer accuracy with fewer generation tokens than prior multi-module workflow methods that use larger foundation or fine-tuned models. Furthermore, KG-R1 enables plug and play: after training, it maintains strong accuracy on new KGs without modification. These properties make KG-R1 a promising KG-RAG framework for real-world deployment. Our code is publicly available at https://github.com/Jinyeop3110/KG-R1.
翻译:知识图谱检索增强生成(KG-RAG)将大语言模型(LLM)与结构化、可验证的知识图谱(KG)相结合,以减少幻觉并显式化推理路径。然而,许多KG-RAG系统由多个LLM模块(如规划、推理和响应)组合而成,这增加了推理成本,并将系统行为绑定到特定的目标知识图谱上。为解决这一问题,我们提出了KG-R1,一个通过强化学习(RL)实现的智能知识图谱检索增强生成(KG-RAG)框架。KG-R1采用单一智能体,将知识图谱作为其环境进行交互,学习在每一步进行检索,并将检索到的信息融入其推理和生成过程。整个过程通过端到端的强化学习进行优化。在知识图谱问答(KGQA)基准上的受控实验中,我们的方法展现了高效性和可迁移性:使用Qwen-2.5-3B模型,KG-R1以更少的生成token数实现了比先前使用更大规模基础模型或微调模型的多模块工作流方法更高的答案准确率。此外,KG-R1支持即插即用:训练完成后,它无需修改即可在新的知识图谱上保持强大的准确性。这些特性使得KG-R1成为一个适用于实际部署的、前景广阔的KG-RAG框架。我们的代码公开在 https://github.com/Jinyeop3110/KG-R1。