用强化学习让大模型一步步修正SPARQL查询,提升知识图谱问答准确率。
Learning to Refine: An Agentic RL Approach for Iterative SPARQL Query Construction
- 基于强化学习构建智能体,逐轮修正查询语句。
- 在LC-QuAD 2.0上达49.7%准确率,比基线高17.5个百分点。
- 适合研究知识图谱问答与智能体推理的开发者。
生成复杂、逻辑正确的多跳问题SPARQL查询仍是知识图谱问答的关键瓶颈,因大语言模型(LLMs)的一次性生成方式对结构化数据交互可靠性差。现有方法缺乏根据实时执行反馈动态调试查询的自适应策略。本文提出一种新型代理框架,使LLM通过结果驱动的强化学习(GRPO)训练出稳健的迭代式SPARQL构造策略。一个仅30亿参数的模型,不依赖监督微调,即可学会从执行错误中系统恢复并逐步优化查询直至正确答案。在经过筛选的可执行单答案子集LC-QuAD 2.0上,该智能体在实体链接后达到49.7%的准确率,较最强的迭代零样本基线显著提升17.5个百分点。进一步分析表明,尽管性能由强化学习驱动,但显式的反思推理步骤作为认知支架,显著提升了策略精度。本工作为通过交互教会智能体掌握形式化符号工具提供了通用范式,弥合了概率性大模型与知识图谱之间的鸿沟。
原文摘要 · Abstract (English)
Generating complex, logically-sound SPARQL queries for multi-hop questions remains a critical bottleneck for Knowledge Graph Question Answering, as the brittle nature of one-shot generation by Large Language Models (LLMs) hinders reliable interaction with structured data. Current methods lack the adaptive policies needed to dynamically debug queries based on real-time execution feedback. This paper introduces a novel agentic framework where an LLM learns a resilient policy for the sequential process of iterative SPARQL construction. We show that a compact 3B-parameter model, trained exclusively via outcome-driven Reinforcement Learning (GRPO) without supervised fine-tuning, can learn effective policies for this task, discovering how to systematically recover from execution errors and refine its queries toward a correct answer. On a curated, executable single-answer subset of LC-QuAD 2.0, our agent achieves 49.7\% accuracy post-entity-linking, a significant 17.5 percentage point improvement over the strongest iterative zero-shot baseline. Further analysis reveals that while the agent's capability is driven by RL, its performance is enhanced by an explicit deliberative reasoning step that acts as a cognitive scaffold to improve policy precision. This work presents a generalizable blueprint for teaching agents to master formal, symbolic tools through interaction, bridging the gap between probabilistic LLMs and the structured world of Knowledge Graphs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。