Large language models (LLMs) have demonstrated strong capabilities in question answering, yet they still frequently suffer from hallucinations on knowledge-intensive tasks. Knowledge graphs (KGs) provide LLMs with structured, interpretable, and updatable factual grounding, making them a promising external knowledge source for reliable reasoning. However, existing LLM-guided graph reasoning methods typically rely on hop-wise greedy or beam-style pruning during evidence retrieval. Such local decision processes are inherently myopic: evidence that appears weak near the source may become crucial only after deeper graph context is explored, causing answer-critical branches to be discarded prematurely and making the reasoning chain difficult to recover. To address this limitation, we propose Foresight-over-Graph (FoG), a foresight-aware evidence retrieval framework for knowledge base question answering (KBQA). FoG iteratively constructs a question-relevant evidence subgraph and uses far-to-near feedback to guide path exploration, and maintains a compact memory subgraph to support continued exploration. Extensive experiments on widely used KBQA benchmarks demonstrate that FoG achieves state-of-the-art performance, with a particularly large improvement of 16.58% in Hit on CWQ, while also reducing LLM calls and token usage. Our code is available at https://github.com/yhong7/FoG .
Figures & tables
Figure 1 : Limitations of short-sighted hop-by-hop KG traversal and the intuition behind FoG.
Figure 2 : The overview of our proposed FoG.
Type
Method
LLM
WebQSP
CWQ
Hit
Hit@1
F1
Hit
Hit@1
F1
Non-LLM
NSM
-
-
74.30
-
-
48.80
-
SQALER
-
-
76.10
-
-
-
-
KGT5
-
-
56.10
-
-
36.50
-
UniKGQA
-
-
77.20
72.20
-
51.20
49.40
LLM-only
Zero-shot
GPT-4o
58.24
58.24
42.57
35.82
35.82
31.49
Table 1 : Overall results on WebQSP and CWQ. The † and ‡ symbols denote graph retrieval-based methods and LLM-guided graph agents method, respectively. The ⋆ indicates the best-performing baseline. The best and second-best results are highlighted in bold and underlined , respectively.
WebQSP
CWQ
Method
Hit
Hit@1
Hit@5
F1
Hit
Hit@1
Hit@5
F1
FoG w/o FSE
90.42 ↓1.21
88.78 ↓0.88
90.19 ↓1.38
77.41 ↓3.87
85.22 ↓1.81
73.95 ↓6.26
82.70 ↓2.10
62.98 ↓8.36
FoG w/o FFP
89.27 ↓2.36
86.92 ↓2.74
88.74 ↓2.83
73.85 ↓7.43
78.61 ↓8.42
68.43 ↓11.78
76.02 ↓8.78
57.34 ↓14.00
FoG w/o MSM
90.19 ↓1.44
88.89 ↓0.77
90.04 ↓1.53
77.19 ↓4.09
79.73 ↓7.30
67.12 ↓13.09
75.84 ↓8.96
56.15 ↓15.19
FoG
91.63
89.66
91.57
81.28
87.03
80.21
84.80
71.34
Table 2 : Ablation results on WebQSP and CWQ. FSE, FFP, and MSM denote Foresight Subgraph Expansion, Foresight Feedback Propagation, and Memory Subgraph Manager, respectively.
Figure 5
Method
WebQSP
CWQ
Hit
Hit@1
F1
Hit
Hit@1
F1
FoG w/ GNN
89.92
88.13
78.75
84.06
76.79
67.27
FoG w/ FFP
91.63
89.66
81.28
87.03
80.21
71.34
Table 3 : Comparison between standard GNN propagation and FFP.
Dataset
Method
Call
Input
Output
Total
WebQSP
ToG
15.9
6031.2
987.7
7018.9
PoG
9.0
5234.8
282.9
5517.7
FoG
2.3
1837.3
248.9
2086.2
CWQ
ToG
22.6
8182.9
1486.4
9669.4
PoG
13.3
7803.0
353.2
8156.2
FoG
2.8
3461.7
295.4
4585.1
Table 4 : Efficiency comparison on WebQSP and CWQ: average LLM calls and token usage per question.
Figure 5 : Effect of τp on knowledge retrieval capacity (CWQ and WebQSP).
Figure 6 : Error distribution of existing graph-guided reasoning failures.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 7 : The prompt template of question decomposition prompt.
Figure 8 : The prompt template of memory subgraph management.
Figure 9 : Case study 1: failure modes of existing methods.
Figure 10 : Case study 2: workflow of our method FoG.
Knowledge graph question answering (KGQA) requires navigating from topic entities to an answer several relations away. Recent methods prompt a frontier LLM to explore the graph through a retrieval tool, but their reliance on frontier-scale inference makes them costly to deploy. We present Search-on-Graph-R1 (\sogrone{}), which internalizes this navigation into a compact 8B model through supervised fine-tuning (SFT) followed by reinforcement learning (RL). Our central idea is to scaffold a frontier teacher with each question's gold SPARQL query, so the teacher traverses a known answer-bearing path with a live \texttt{Search} tool rather than having to discover the path itself. Since every call executes against a live Freebase server, the resulting trajectories are grounded in the knowledge graph by construction. On WebQSP, CWQ, and GrailQA, \sogrone{} at 8B surpasses every frozen frontier-LLM system in our comparison and posts the strongest results on CWQ of any system we compare against. It does so using no auxiliary module at inference and no LLM judge during training. Isolating each training stage shows that SFT and RL contribute complementary gains, our approach transfers across model families, and RL learns to reach answers in fewer \texttt{Search} calls than its SFT initialization.
Jia Ao Sun, Hao Yu, Fengran Mo +4
Université de Montréal · Mila – Québec AI Institute · McGill University +2
Large language models (LLMs) have shown remarkable capabilities in natural language processing. However, in knowledge graph question answering tasks (KGQA), there remains the issue of answering questions that require multi-hop reasoning. Existing methods rely on entity vector matching, but the purpose of the question is abstract and difficult to match with specific entities. As a result, it is difficult to establish reasoning paths to the purpose, which leads to information loss and redundancy. To address this issue, inspired by human reverse thinking, we propose Ontology-Guided Reverse Thinking (ORT), a novel framework that constructs reasoning paths from purposes back to conditions. ORT operates in three key phases: (1) using LLM to extract purpose labels and condition labels, (2) constructing label reasoning paths based on the KG ontology, and (3) using the label reasoning paths to guide knowledge retrieval. Experiments on the WebQSP and CWQ datasets show that ORT achieves state-of-the-art performance and significantly enhances the capability of LLMs for KGQA.
Runxuan Liu, Bei Luo, Jiaqi Li +5
Harbin Institute of Technology, Harbin, China · Beijing University of Posts and Telecommunications, Beijing, China · Joint Laboratory of HIT and iFLYTEK, Beijing, China +2
Knowledge Graphs (KGs) are widely used to mitigate the limitations of Large Language Models (LLMs), such as outdated knowledge and hallucinations. Existing LLM-KG integration frameworks typically rely on predefined operators to retrieve factual knowledge from KGs and inject it into prompts for answer generation. This paradigm faces two critical bottlenecks: 1) Inflexibility: The predefined operators are limited in scope and thus lack sufficient compositional expressiveness to fully capture the complex semantics required by KG questions. 2) Unscalability: Direct injection of factual knowledge into prompts limits scalability in handling large-scale factual knowledge. To address these two bottlenecks, we propose Code-on-Graph (CoG), a programmatic reasoning framework for LLM-KG integration. Specifically, given the factual knowledge retrieved at each reasoning step, CoG first identifies the corresponding KG schemas and represents these schemas as Python classes, which serve as abstract interfaces to the retrieved facts. It then generates executable code grounded in these classes, with the retrieved facts instantiated as objects of the corresponding classes during execution. This design enables flexible code-based reasoning while avoiding the direct injection of large-scale factual knowledge into prompts. Experiments on WebQSP, CWQ, and GrailQA demonstrate that CoG outperforms prior state-of-the-art models by up to 10.5%.
Weiwei Ding, Zixuan Li, Long Bai +7
1Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences · 2Shandong University · 3Shandong University-Weihai Research Institute of Industrial Technology