Building effective knowledge graphs (KGs) for Retrieval-Augmented Generation (RAG) is pivotal for advancing question answering (QA) systems. However, its effectiveness is hindered by a fundamental disconnect: the knowledge graph (KG) construction process is decoupled from its downstream application, yielding suboptimal graph structures. To bridge this gap, we introduce AutoGraph-R1, the first framework to directly optimize KG construction for task performance using Reinforcement Learning (RL). AutoGraph-R1 trains an LLM constructor by framing graph generation as a policy learning problem, where the reward is derived from the graph's functional utility in a RAG pipeline. We design two novel, task-aware reward functions, one for graphs as knowledge carriers and another as knowledge indices. Across multiple QA benchmarks, AutoGraph-R1 consistently enables graph RAG methods to achieve significant performance gains over using task-agnostic baseline graphs. Our work shows it is possible to close the loop between construction and application, shifting the paradigm from building intrinsically ``good'' graphs to building demonstrably ``useful'' ones.
翻译:为检索增强生成(RAG)构建有效的知识图谱(KG)对于推进问答(QA)系统至关重要。然而,其有效性受到一个根本性脱节的阻碍:知识图谱(KG)的构建过程与其下游应用相分离,导致生成的图谱结构并非最优。为弥合这一差距,我们提出了AutoGraph-R1,这是首个利用强化学习(RL)直接针对任务性能优化知识图谱构建的框架。AutoGraph-R1通过将图谱生成构建为一个策略学习问题来训练一个大语言模型(LLM)构建器,其奖励来源于图谱在RAG流程中作为功能组件的效用。我们设计了两种新颖的、任务感知的奖励函数:一种针对图谱作为知识载体的角色,另一种则针对其作为知识索引的角色。在多个QA基准测试中,与使用任务无关的基线图谱相比,AutoGraph-R1持续助力基于图谱的RAG方法取得显著的性能提升。我们的工作表明,构建过程与应用环节之间的闭环是可能实现的,从而将范式从构建本质上“好”的图谱,转向构建可证明“有用”的图谱。