Introduction
Large Language Models (LLMs) often hallucinate in question-answering tasks, but grounding them in Knowledge Graphs (KGs) offers a robust solution. This paper introduces Explore-on-Graph (EoG), a framework that leverages reinforcement learning with a novel "path-refined" reward to encourage LLMs to autonomously explore KGs rather than merely mimicking rigid rules. By rewarding both the final answer's correctness and the logical path taken, EoG achieves state-of-the-art performance on multiple benchmarks, outperforming even powerful closed-source models.
The Challenge of Out-of-Distribution Graph Reasoning
While LLMs excel at text generation, they struggle with factual accuracy and complex reasoning. A popular mitigation strategy is to ground the LLM's reasoning in a Knowledge Graph—a structured database of facts (e.g., Google -> subsidiary -> YouTube).
However, current KG-enhanced LLM methods typically rely on either strict, pre-defined rules or imitation learning (fine-tuning the model on a fixed set of reasoning paths). These methods confine the LLM to known patterns. If a question requires a novel, out-of-distribution (OOD) reasoning path absent from the training data, the model fails. To generalize to complex, unseen graph structures, LLMs require the ability to autonomously explore unfamiliar regions of a KG.
The Explore-on-Graph (EoG) Framework
To shift the paradigm from imitation to exploration, the authors propose a two-stage training pipeline:
-
Supervised Fine-Tuning (SFT) for a "Cold Start": The LLM is initially fine-tuned on a dataset of "long Chain-of-Thought" (CoT) reasoning paths generated by a teacher model. This equips the model with the basic syntax and logic required to navigate a KG, preventing it from flailing blindly during the subsequent exploration phase.
-
Reinforcement Learning (RL) with Path-Refined Rewards: The core novelty lies in applying Group Relative Policy Optimization (GRPO) to let the model explore the graph. The RL phase utilizes a two-part reward system:
-
Outcome Reward: The model receives a high reward (based on F1 score) if its final answer matches the ground truth.
- Path-Refined Reward: Because a model might guess the right answer via a nonsensical path, the authors reward the model for generating reasoning steps that contain valid subject-relation-object triplets matching the ground-truth logical path. This makes exploration highly efficient.
Datasets and Evaluation
The model was trained and evaluated on five standard Knowledge Graph Question Answering (KGQA) benchmarks:
- WebQSP & CWQ (ComplexWebQuestions): Fact-based and compositional multi-hop questions (Freebase).
- GrailQA: Designed specifically to test out-of-distribution and zero-shot generalization (Freebase).
- QALD-10-en & 2WikiMultihop: Complex, real-world and multi-hop questions requiring structured evidence (Wikidata).
Note: For datasets lacking explicit ground-truth reasoning paths, the authors built a "Search-and-Verify" pipeline using Breadth-First Search (BFS) and an LLM to reverse-engineer logical paths for training the reward model.
Key Insights
- Exploration Beats Imitation: Allowing the model to explore via RL significantly improves its ability to find OOD reasoning patterns. When encountering missing links, it learns to route around them rather than failing rigidly.
- Path Rewards Prevent "Reward Hacking": Relying solely on outcome rewards leads to inefficient exploration and spurious logic. The path reward forces the model to learn how to think, improving the semantic meaningfulness of the generated CoT.
- SFT is a Necessary Foundation: Ablation studies demonstrate that skipping SFT and proceeding straight to RL results in poor performance. The model needs a structural understanding of KGs before RL can effectively refine its policy.
- Simple Rewards Work Best: Experiments with a complex Graph Edit Distance (GED) reward function showed it actually hurt performance compared to the simpler triplet-matching approach, as GED was too lenient on structural deviations.
Results and Performance
- State-of-the-Art Performance: EoG achieved SOTA across all 5 datasets. Using an 8B parameter base model, EoG hit an 82.6% Hit@1 on CWQ, surpassing the previous best open-source baseline (75.8%).
- Outperforming Closed-Source Giants: Remarkably, the 8B parameter EoG model outperformed massive closed-source models evaluated on the exact same prompts, including Gemini 2.5 Pro (71.9% on CWQ) and GPT-5 (74.1% on CWQ).
- Excels at Complex Reasoning: On highly complex questions (e.g., $\ge 3$-hop reasoning or superlative constraints), EoG outperformed baselines by massive margins.
- Highly Efficient Training: The RL phase is computationally cheap. For the WebQSP dataset, GRPO training converged in just 36 steps (approx. 119 GPU hours on an 8x H100 node).
Limitations and Future Work
Constructing the ground-truth paths for the path reward required using a teacher LLM as a semantic filter, which could theoretically inject biases into the training pipeline. Future research should investigate how to leverage KGs to design even more sophisticated reward strategies, potentially moving beyond simple triplet matching to enable deeper reasoning trajectories.
Summary updated