GraphWalker: Agentic Knowledge Graph Question Answering via Synthetic Trajectory Curriculum
Organizations: School of Artificial Intelligence, University of Chinese Academy of Sciences · The Key Laboratory of Cognition and Decision Intelligence for Complex Systems, Institute of Automation, Chinese Academy of Sciences · Department of Electronic Engineering, Tsinghua University
Abstract
Agentic knowledge graph question answering (KGQA) requires an agent to iteratively interact with knowledge graphs (KGs), posing challenges in both training data scarcity and reasoning generalization. Specifically, existing approaches often restrict agent exploration: prompting-based methods lack autonomous navigation training, while current training pipelines usually confine reasoning to predefined trajectories. To this end, this paper proposes GraphWalker, a novel agentic KGQA framework that addresses these challenges through Automated Trajectory Synthesis and Stage-wise Fine-tuning. GraphWalker adopts a two-stage SFT training paradigm: First, the agent is trained on structurally diverse trajectories synthesized from constrained random-walk paths, establishing a broad exploration prior over the KG; Second, the agent is further fine-tuned on a small set of expert trajectories to develop reflection and error recovery capabilities. Extensive experiments demonstrate that our stage-wise SFT paradigm unlocks a higher performance ceiling for a lightweight reinforcement learning (RL) stage, enabling GraphWalker to achieve state-of-the-art performance on CWQ and WebQSP. Additional results on GrailQA and our constructed GraphWalkerBench confirm that GraphWalker enhances generalization to out-of-distribution reasoning paths. The code is publicly available at https://github.com/XuShuwenn/GraphWalker.
Figures & tables
| Type | Method | Global KG | Autonomous Interaction | RL Optimization |
| Prompting | ToG ( Sun et al., 2024 ) | ✓ | ✓ | ✗ |
| GoG ( Xu et al., 2024 ) | ✓ | ✓ | ✗ | |
| Training | RoG ( Luo et al., 2024b ) | ✗ | ✗ | ✗ |
| KBQA-o1 ( Luo et al., 2025 ) | ✓ | ✓ | ✗ | |
| KG-Agent ( Jiang et al., 2025 ) | ✓ | ✓ | ✗ | |
| KG-R1 ( Song et al., 2025 ) | ✗ | ✓ | ✓ |
| Method | Backbone | CWQ | WebQSP | ||
| EM | F1 | EM | F1 | ||
| Vanilla LLMs | |||||
| IO Prompt | Qwen2.5-3B-Instruct | 22.0 | 17.7 | 44.6 | 30.3 |
| IO Prompt | Qwen2.5-7B-Instruct | 25.7 | 20.7 | 50.9 | 33.2 |
| IO Prompt | GPT-4o-mini | 45.5 | 33.6 | 47.1 | 39.3 |
| IO Prompt | DeepSeek-V3.2 | 50.1 | 43.5 | 63.8 | 55.7 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Threshold | Overall | CWQ | WebQSP | GrailQA |
| 0.80 | 25.97% (3960) | 23.30% (3553) | 5.27% (804) | 2.67% (407) |
| 0.85 | 2.57% (392) | 2.13% (325) | 0.56% (85) | 0.09% (13) |
| 0.90 | 0.15% (23) | 0.12% (18) | 0.03% (4) | 0.01% (1) |
| Structure Type | Composition | Conjunction | Total | |||
| 2-hop | 3-hop | 4-hop | 5-hop | 2I | ||
| Count | 1,982 | 4,920 | 1,778 | 576 | 5,599 | 14,855 |
| Ratio (%) | 13.34 | 33.12 | 11.97 | 3.88 | 37.69 | 100.00 |
| Dataset | API Calls | Input Tokens | Output Tokens | Cost |
| GraphSynth | 6.673 | 11,533.56 | 796.53 | $0.0110 |
| GraphRoll | 5.680 | 9,296.93 | 553.87 | $0.0086 |
| Structure Type | Composition | Conjunction | Total | ||||
| 3-hop | 4-hop | 5-hop | 2I | IP | PI | ||
| Count | 347 | 209 | 180 | 344 | 337 | 349 | 1766 |
| Type | Annotated path(s) | Question |
| 2I | (1) Korean War films MASH; (2) Ring Lardner, Jr. writer.film MASH | What film about the Korean War was written by Ring Lardner, Jr.? |
| PI | (1) Czech Republic Central Europe Europe; (2) Continental Celtic languages geographic distribution Europe | What continent that includes the Czech Republic is also the geographic home of the Continental Celtic languages? |
| 4-hop | Classic rock Rock music Rock and Roll Hall of Fame I. M. Pei Pei Cobb Freed & Partners | What architectural firm was a partner of the architect who designed a hall of fame for a parent genre of classic rock? |
| 5-hop | Rotokas Language Papuan languages New Guinea Malay Archipelago Lost Continent Angelo Francesco Lavagnino | Who composed the music for a film about the island group home to the Rotokas language family? |
| Method | CWQ | WebQSP | ||
| EM | F1 | EM | F1 | |
| w/ Reranking Top-20 | 79.6 | 74.2 | 91.5 | 88.6 |
| Ablations | ||||
| w/ Reranking Top-10 | 78.4 | 73.5 | 89.4 | 86.1 |
| w/ Reranking Top-15 | 78.7 | 74.6 | 89.8 | 86.5 |
| w/ Reranking Top-30 | 76.9 | 72.0 | 87.0 | 84.4 |
| Question: Where is the home stadium of the team who won the 1946 World Series championship? |
| Initial Entities: 1946 World Series |
| <think> Since I need to determine the home stadium of the team that won the 1946 World Series, I will start by querying the relations for the entity "1946 World Series". This will help me identify relevant connections to the winning team and its stadium. Gathering these relations is essential for finding the necessary information to answer the question. </think> |
| <kg-query> get_relations("1946 World Series") </kg-query> |
| <information> sports.sports_championship_event.champion, sports.sports_championship_event.result, sports.sports_team.championships, time.event.locations, … </information> |
| <think> The relations obtained for "1946 World Series" include "sports.sports_championship_event.champion," which is crucial for identifying the winning team, and "time.event.locations," which may provide information about the home stadium. By querying the triples with these relations, I can gather detailed information about the champion team and its associated stadium, which is necessary to answer the question accurately. </think> |
| <kg-query> get_triples("1946 World Series", ["sports.sports_championship_event.champion", "sports.sports_championship_event.result", "sports.sports_team.championships", "time.event.locations", …]) </kg-query> |
| Question: Where is the home stadium of the team who won the 1946 World Series championship? |
| Initial Entities: 1946 World Series |
| <think> To find the home stadium of the team that won the 1946 World Series championship, I will start by querying the relations of the entity "1946 World Series". This should provide information about the winning team and potentially its home stadium. After retrieving the relations, I will look for relevant details regarding the championship and the winning team. </think> |
| <kg-query> get_relations("1946 World Series") </kg-query> |
| <information> sports.sports_championship_event.champion, sports.sports_championship_event.result, sports.sports_team.championships, time.event.locations, … </information> |
| <think> The relations retrieved for the "1946 World Series" include information about the champion, result, championships associated with the team, locations, start date, end date, and runner-up. To find the home stadium of the winning team, I will focus on the "champion" relation first, as it should indicate which team won the championship. Once I identify the champion, I can then look for its home stadium. I will proceed to retrieve the triples for the "1946 World Series" using the top relevant relations. </think> |
| <kg-query> get_triples("1946 World Series", ["sports.sports_championship_event.champion", "sports.sports_championship_event.result", "sports.sports_team.championships", "time.event.locations"]) </kg-query> |
| Question: Where is the home stadium of the team who won the 1946 World Series championship? |
| Initial Entities: 1946 World Series |
| <think> To find the home stadium of the team that won the 1946 World Series championship, I will start by querying the relations of the "1946 World Series" entity. This should provide information about the winning team and potentially lead to details about their home stadium. </think> |
| <kg-query> get_relations("1946 World Series") </kg-query> |
| <information> sports.sports_championship_event.champion, sports.sports_championship_event.result, sports.sports_championship_event.runner_up, … </information> |
| <think> The relations returned for the "1946 World Series" include several relevant ones, particularly "champion," which likely indicates the winning team. I will also consider "runner_up" as it may provide context about the teams involved. To gather more detailed information, I will query the triples for the "1946 World Series" using these relations. </think> |
| <kg-query> get_triples("1946 World Series", ["sports.sports_championship_event.champion", "sports.sports_championship_event.runner_up", "sports.sports_championship_event.result"]) </kg-query> |
| Parameter | Value |
| SFT settings | |
| Batch size | 32 |
| Learning Rate | 1e-5 |
| Max Response Length | 4096 |
| Epoch | 2 |
| RL settings | |
Knowledge Graph Question Answering
Knowledge Graph Question Answering answers natural-language questions by finding and reasoning over entities and relations in structured knowledge graphs.
See all 164 papers