alphaFeedback

WorksComputer Science

Clearing the FoG: Training KG Agents to Retrieve the Evidence Behind Their Answers

AI contributions
Not recorded for this paper
View details

Abstract

Large language models (LLMs) can answer many factual questions correctly, but a correct answer is not necessarily a supported one. For an LLM agent, a knowledge graph (KG) plays two roles: as a source of answers, it supplies facts that the model lacks; as a source of evidence, it supplies the supporting triples that make an answer traceable and auditable. However, existing KG agents treat the KG only as a source of answers: their training data carries answers but not evidence, and their training rewards check the answer but not the retrieved evidence, so agents often answer correctly without retrieving the supporting triples. We propose FoG, a framework that trains KG agents to retrieve the evidence behind their answers. FoG consists of evidence-grounded synthesis, a KG interaction agent, and an evidence-coverage process reward (ECPR): the synthesis recursively hides explicit entities behind verifiable sub-questions, so that every question carries its supporting triples by construction; the agent records the triples returned by the KG; and ECPR credits each supporting triple to the turn that first retrieves it. Experiments on three KGQA benchmarks demonstrate that FoG enables 3B–4B open-source agents to outperform substantially larger baselines in answer accuracy and evidence coverage, with zero-shot cross-KG transfer.

Introduction

Large language models (LLMs) [39, 9, 40, 41, 26] increasingly answer factual questions from parametric knowledge, but remain difficult to trust on questions that require complex factual reasoning [24, 13, 17, 28]. A correct answer is not necessarily a supported one: the model may answer from memory or surface cues while exposing little about why the answer

holds [14, 2, 25], which is problematic in high-stakes settings such as healthcare and law [3], where users need evidence that they can check [32, 1]. Current LLM answers thus lie in a fog: the answer is visible, yet the evidence behind it remains hidden.

Knowledge graphs (KGs) [27] offer a natural way to clear this fog, since they store facts as verifiable triples. Existing KG-augmented methods follow two paradigms (Figure 2). Retrieval-based methods [21, 18, 22] retrieve triples, paths, or sub-graphs and answer from them. Agent-based methods [34, 5, 19, 15] interact with the KG through a multi-turn “think–act–observe” process, and recent work trains them with reinforcement learning (RL) [19, 6] [33] (Sun et al. 2025).

Comparison of KG-augmented reasoning paradigms

Figure 2. Comparison of KG-augmented reasoning paradigms. All three methods return the correct answer, but retrieval-based methods miss key evidence and agent-based methods answer after the first hop, whereas FoG retrieves every supporting triple of the answer.

However, existing KG agents treat the KG only as a source of answers and overlook its role as a source of evidence. An LLM with no KG access can already answer many benchmark questions correctly, and even an RL-trained agent can answer correctly while retrieving only part of the supporting triples. We identify two causes. First, training data carries answers but not evidence: most KGQA datasets annotate answers and at most logical forms [38, 52] (Gu et al. 2021), and recovering the supporting triples afterwards requires enumerating and verifying paths for every question. Second, training rewards check the answer but not the evidence: most rewards score only the final answer or whether the KG returns it [19, 31, 47, 6] (Sun et al. 2025), so a trajectory that reaches the answer through part of the evidence earns as much as one that retrieves all of it. The process rewards that go further depend on an LLM judge or on gold paths recovered for every question [43, 49], both of which are costly. Both causes trace back to one bottleneck: evidence is expensive to recover once a question has been written.

To remove this bottleneck, we propose FoG (Figure 1), a framework that trains KG agents to retrieve the evidence behind their answers. Our key observation is that evidence is hard to recover after a question is written but can be embedded when the question is constructed and then rewarded during training. First, evidence-grounded synthesis recursively hides the explicit entities of a seed question behind verifiable sub-questions, so every question carries its supporting triples. Second, a KG interaction agent answers through multi-turn KG queries and records every triple that the KG returns. Lastly, during RL training, an evidence-coverage process reward (ECPR) gives a dense reward to each turn that first retrieves one of these supporting triples. Our contributions are as follows:

Motivation of FoG

Figure 1. Motivation of FoG. Answer-only training yields correct but unsupported answers, whereas FoG embeds supporting triples at synthesis and rewards their retrieval during RL training.

  • We distinguish two roles of the KG and show that existing training data and rewards serve it only as a source of answers, not of evidence.

  • We propose FoG, which embeds supporting triples into synthetic questions and rewards their retrieval through ECPR, so the dense reward comes from data synthesis with no LLM judge or extra annotation.

  • On three benchmarks, 3B–4B FoG agents outperform larger baselines in accuracy and evidence coverage, and transfer zero-shot across KGs.

Related Work

Knowledge graph augmented reasoning. Unlike prompting strategies [46, 45, 50, 16], KG-augmented methods ground reasoning in verifiable triples and follow two paradigms. Retrieval-based methods [21, 18, 22, 23, 12, 20] condition the LLM on triples, paths, or subgraphs retrieved in a single step. Agent-based methods [34, 5, 19, 15] explore the KG iteratively: ToG and PoG prompt a frozen LLM, whereas recent work trains the agent with RL [19, 31, 6, 44, 33] (Sun et al. 2025). However, these agents use the KG only as a source of answers and can answer correctly without retrieving the supporting triples. In this work, we train agents to use it as a source of evidence.

Synthetic data for KGQA. Synthetic data frees KGQA from human annotation, since questions can be generated from the KG and verified by execution. It provides questions for agent training [47] and for benchmarking and retriever training [53, 4]. However, these pipelines treat it as extra examples to train or evaluate on. In this work, we treat it as a source of supervision: every synthesized question carries the evidence that defines its reward.

Rewards for KG agents. RL lets a KG agent learn its retrieval policy from interaction with the KG. Most work trains from outcome rewards on the final answer with rule-based terms for valid interaction [19, 31, 6, 44, 33, 35] (Sun et al. 2025). Because outcome rewards are sparse, later work adds dense process rewards, obtained from an LLM judge [43] or from gold paths and logical forms [49, 11, 37]. However, both sources are costly: a judge must score every rollout, and gold references must be annotated or recovered for every question. In this work, the process reward comes from data synthesis: every synthesized question already carries its supporting triples, which provide a dense reward at no extra cost.

Method

In this section, we introduce FoG, as shown in Figure 3, including evidence-grounded synthesis, a KG interaction agent, and ECPR.

The FoG pipeline

Figure 3. The FoG pipeline. Evidence-grounded synthesis produces complex questions with gold supporting triples, the KG interaction agent records the triples that it retrieves, and ECPR rewards the retrieval of the gold supporting triples.

Definition 1 (KG question answering). A knowledge graph is G=(E,R,T)\mathcal{G}=(\mathcal{E},\mathcal{R},\mathcal{T}) with entities E\mathcal{E}, relations R\mathcal{R}, and triples T⊆E×R×E\mathcal{T}\subseteq\mathcal{E}\times\mathcal{R}\times\mathcal{E}. A question qq has a logical form ℓq\ell_q and a gold answer yq∗∈SPARQL⁡(ℓq,T)y_q^* \in\operatorname{SPARQL}(\ell_q,\mathcal{T}), where SPARQL⁡(ℓ,S)\operatorname{SPARQL}(\ell,\mathcal{S}) is the result of executing ℓ\ell over a triple set S\mathcal{S}. An agent answers qq through a trajectory τ=((s1,a1),…,(sT,aT))\tau=((s_1,a_1),\ldots,(s_T,a_T)) of states and actions and outputs a prediction y^\hat{y}, where Tt⊆T\mathcal{T}_t\subseteq\mathcal{T} are the triples returned at step tt, T(τ)=⋃tTt\mathcal{T}(\tau)=\bigcup_t\mathcal{T}_t all triples retrieved along τ\tau, and E(τ)\mathcal{E}(\tau) all returned entities.

Definition 2 (Supported answer). A triple set S⊆T\mathcal{S}\subseteq\mathcal{T} supports the answer of qq if yq∗∈SPARQL⁡(ℓq,S)y_q^*\in\operatorname{SPARQL}(\ell_q,\mathcal{S}). The answer of τ\tau is correct if y^\hat{y} matches yq∗y_q^*, reached if yq∗∈E(τ)y_q^*\in\mathcal{E}(\tau), and supported if T(τ)\mathcal{T}(\tau) supports it. Unlike the first two levels, which use the KG as a source of answers, a supported answer uses it as a source of evidence. In FoG, each training question carries gold supporting triples Sq∗\mathcal{S}_q^* that support its answer.

Evidence-Grounded Synthesis

Seed question construction

To obtain complex questions that carry their supporting evidence, we propose evidence-grounded synthesis that includes seed question construction, backward expansion, and quality control. All roles use the teacher Kimi-K2 [39].

Seed question construction. We sample a size-bounded subgraph Gsub\mathcal{G}_{\mathrm{sub}} from Wikidata around a seed entity vseedv_{\mathrm{seed}} of moderate degree. The teacher generates a 1-hop question whose answer is vseedv_{\mathrm{seed}}:

(Q(1),ℓ(1),S(1))∼πgen(vseed,Gsub),(1)\left(Q^{(1)},\ell^{(1)},\mathcal{S}^{(1)}\right)\sim\pi_{\mathrm{gen}}\left(v_{\mathrm{seed}},\mathcal{G}_{\mathrm{sub}}\right), \tag*{(1)}

where πgen\pi_{\mathrm{gen}} is the teacher model, Q(1)Q^{(1)} the seed question, ℓ(1)\ell^{(1)} its logical form, and S(1)\mathcal{S}^{(1)} its supporting triples. The seed is retained only if every triple in S(1)\mathcal{S}^{(1)} exists in Gsub\mathcal{G}_{\mathrm{sub}} and ℓ(1)\ell^{(1)} executes over the global KG with vseedv_{\mathrm{seed}} in its result set.

Backward expansion. Given a verified question Q(n)Q^{(n)} with logical form ℓ(n)\ell^{(n)}, answer y=vseedy=v_{\mathrm{seed}}, and supporting triples S(n)\mathcal{S}^{(n)}, we replace an explicit non-answer entity uu in Q(n)Q^{(n)} with a sub-question Q~\widetilde{Q} whose answer is exactly uu:

Q(n+1)=Q(n)[u⇝Q~],S(n+1)=S(n)∪S~,y∈SPARQL⁡(ℓ(n+1),S(n+1)),(2)\begin{aligned} Q^{(n+1)} &= Q^{(n)}[u \leadsto\widetilde{Q}],\\ \mathcal{S}^{(n+1)} &= \mathcal{S}^{(n)} \cup\widetilde{\mathcal{S}},\\ y &\in\operatorname{SPARQL}(\ell^{(n+1)},\mathcal{S}^{(n+1)}), \tag*{(2)} \end{aligned}

where S~\widetilde{\mathcal{S}} are the supporting triples of Q~\widetilde{Q}, drawn from the incoming neighborhood of uu, and ℓ(n+1)\ell^{(n+1)} is the expanded logical form. Each expansion turns an explicit entity into a hidden intermediate variable, and the accumulated triples still support the answer. Thus N∈{0,1,2}N \in\{0, 1, 2\} expansions yield 1- to 3-hop questions, where N=0N = 0 keeps the seed. Expansion uses a ReAct agent (Yao et al. [51]) that retrieves the neighborhood of uu, selects triples, writes Q~\widetilde{Q}, and verifies it; on failure, it reselects triples or the entity.

Proposition 1. Backward expansion preserves the answer and yields triples that support it.

Proof. We provide experimental results in § 4.4 and proofs in Appendix § 8.§ 1.

Quality control. Each synthesized question must further pass two symbolic checks, which keep the answer specific and every topic entity necessary.

(a) Executability. Let Y(n)=SPARQL⁡(ℓ(n),T)\mathcal{Y}^{(n)} = \operatorname{SPARQL}(\ell^{(n)},\mathcal{T}) be the result set of the candidate question. We retain it only if the target answer is included and the result set is not overly broad, i.e., y∈Y(n)y \in\mathcal{Y}^{(n)} and

∣Y(n)∣≤Kans\lvert\mathcal{Y}^{(n)} \rvert\le K_{\mathrm{ans}}

for a maximum answer-set size KansK_{\mathrm{ans}}.

KG Interaction Agent

To make the evidence retrieved for an answer explicit, we develop a KG interaction agent that solves each question through a multi-turn think–act–observe loop with the action space

A={think, kg-query, answer},(3)\mathcal{A} = \{\text{think},\ \text{kg-query},\ \text{answer}\}, \tag*{(3)}

where think performs internal reasoning, kg-query interacts with the KG, and answer emits the final prediction. The kg-query action is instantiated with seven atomic operations that probe the relations of an entity, expand to its

(b) Non-redundancy. Let EqE_q be the topic entities of the question. We extract a shortest supporting path for each e∈Eqe \in E_q and discard the question if a proper subset yields an equally specific answer set:

Fred(Q(n))=¬∃Z⊂Eq:Y(n)⊆YZ(n), ∣YZ(n)∣≤∣Y(n)∣(4)\mathcal{F}_{\mathrm{red}}(Q^{(n)}) = \neg\exists Z \subset E_q : \mathcal{Y}^{(n)} \subseteq\mathcal{Y}^{(n)}_Z,\ \lvert\mathcal{Y}^{(n)}_Z \rvert\le\lvert\mathcal{Y}^{(n)} \rvert \tag*{(4)}

where YZ(n)\mathcal{Y}^{(n)}_Z is the answer set of the query built only from the paths of ZZ (Appendix § 9).

The triples accumulated for a final question qq are its gold supporting triples Sq∗\mathcal{S}^*_{q}, and we report the distribution of query-graph types (Dutt et al. [8]) in Appendix § 10.§ 2. neighboring entities, filter an entity set, and combine entity sets (Appendix § 11). Every trajectory thus records the returned triples T(τ)\mathcal{T}(\tau), the only evidence that FoG rewards and evaluates.

Evidence-Coverage Process Reward

To train the agent to retrieve this evidence, we propose a training scheme with outcome and step-validity rewards, the evidence-coverage process reward, and turn-level policy optimization.

Outcome and step-validity rewards. We define the outcome reward of a trajectory as

Rout(τ)=λf1⋅F1(y^,yq∗)+λret⋅I[yq∗∈E(τ)],(5)R_{\mathrm{out}}(\tau)=\lambda_{\mathrm{f1}}\cdot\mathrm{F1}(\hat{y},y_q^*)+\lambda_{\mathrm{ret}}\cdot\mathbb{I}[y_q^*\in\mathcal{E}(\tau)], \tag*{(5)}

where the first term rewards a correct answer and the second a reached answer. Neither term checks whether the answer is supported: a shortcut trajectory, which outputs and even reaches the gold answer while leaving some of the supporting triples Sq∗S_q^* unretrieved, still earns the full outcome reward.

To stabilize graph interaction, each turn also earns a step-validity reward rtstep=λstepvtr_t^{\mathrm{step}}=\lambda_{\mathrm{step}}v_t, where vt=1v_t=1 if action ata_t follows the required format and executes successfully, and vt=0v_t=0 otherwise. The trajectory-level term is the average

Rstep(τ)=1T∑t=1Trtstep.R_{\mathrm{step}}(\tau)=\frac{1}{T}\sum_{t=1}^{T}r_t^{\mathrm{step}}.

Evidence-coverage process reward. Unlike the terms above, which treat the KG only as a source of answers, the Evidence-Coverage Process Reward (ECPR) scores the trajectory against the gold supporting triples Sq∗S_q^* provided by synthesis. We define the evidence coverage of a trajectory as

Cov⁡(τ,Sq∗)=∣T(τ)∩Sq∗∣∣Sq∗∣,(6)\operatorname{Cov}(\tau,S_q^*)=\frac{|\mathcal{T}(\tau)\cap S_q^*|}{|S_q^*|}, \tag*{(6)}

where T(τ)\mathcal{T}(\tau) are all triples retrieved along τ\tau, so a triple that the agent recalls from memory without retrieving it earns no reward. We call τ\tau evidence-covered if Cov⁡(τ,Sq∗)=1\operatorname{Cov}(\tau,S_q^*)=1, and set Recpr(τ)=λecpr⋅Cov⁡(τ,Sq∗)R_{\mathrm{ecpr}}(\tau)=\lambda_{\mathrm{ecpr}}\cdot\operatorname{Cov}(\tau,S_q^*). For dense credit assignment, first-match attribution assigns each gold triple to the step that first retrieves it:

rtecpr=λecpr⋅∣(Tt∩Sq∗)∖⋃i<tTi∣∣Sq∗∣,(7)r_t^{\mathrm{ecpr}}=\lambda_{\mathrm{ecpr}}\cdot\frac{\left|(\mathcal{T}_t\cap S_q^*)\setminus\bigcup_{i<t}\mathcal{T}_i\right|}{|S_q^*|}, \tag*{(7)}

where ∑trtecpr=Recpr(τ)\sum_t r_t^{\mathrm{ecpr}}=R_{\mathrm{ecpr}}(\tau), so repeated retrieval of the same triple earns no additional reward. The composite reward of a trajectory is R(τ)=Rout(τ)+Rstep(τ)+Recpr(τ)R(\tau)=R_{\mathrm{out}}(\tau)+R_{\mathrm{step}}(\tau)+R_{\mathrm{ecpr}}(\tau). We set λf1=0.7\lambda_{\mathrm{f1}}=0.7, λret=0.3\lambda_{\mathrm{ret}}=0.3, λstep=0.5\lambda_{\mathrm{step}}=0.5, and λecpr=1\lambda_{\mathrm{ecpr}}=1.

Proposition 2. ECPR is maximized only by supported answers and rewards each triple once.

Proof. We provide experimental results in § 4.3 and § 4.6 and proofs in Appendix § 8.§ 2.

Turn-level policy optimization. Following prior RL-trained KG agents (Song et al., [31]; Chen et al., [6]; Sun et al., 2025), the policy πθ\pi_\theta is first initialized by supervised fine-tuning (SFT) on demonstration trajectories that a teacher model produces for the synthesized and training questions, minimizing the negative log-likelihood of the teacher actions. We then optimize it with Group Relative Policy Optimization (GRPO) (Shao et al., [29]) and, following KG-R1 (Lin et al., [19]), compute the advantage per turn. For each question qq, the policy samples NN trajectories {τi}i=1N\{\tau_i\}_{i=1}^{N}, and turn tt of τi\tau_i receives the return

Gi,t=Rout(τi)+ri,tstep+ri,tecpr,(8)G_{i,t}=R_{\mathrm{out}}(\tau_i)+r_{i,t}^{\mathrm{step}}+r_{i,t}^{\mathrm{ecpr}}, \tag*{(8)}

i.e., the shared outcome reward plus the process rewards earned by this turn. The advantage A^i,t=(Gi,t−μq)/(σq+δ)\hat{A}_{i,t}=(G_{i,t}-\mu_q)/(\sigma_q+\delta) is normalized with the mean μq\mu_q and standard deviation σq\sigma_q of the returns over all turns of the NN trajectories. A turn that first retrieves gold evidence therefore receives a higher advantage than the other turns. The policy then maximizes the clipped GRPO objective with these advantages, regularized toward the SFT model (Appendix § 15).

Experiments

This section presents the experimental setup, main results, and analysis. We answer the following research questions (RQs): RQ1: Does FoG outperform other methods in answer accuracy? RQ2: Does each component of FoG work? RQ3: Does evidence-grounded synthesis provide valid evidence and better training data? RQ4: Does the KG interaction agent retrieve the evidence behind its answers? RQ5: How does the design of ECPR affect evidence coverage? RQ6: Does FoG transfer to a KG unseen during training?

Experimental Setup

Datasets. We evaluate on three Wikidata-based KGQA benchmarks, WikiWebQuestions (Xu et al., [48]), QALD10-en (Usbeck et al., [42]), and GT-SQA (Cattaneo et al., [4]), and use WebQSP (Yih et al., [52]) over Freebase for cross-KG transfer. The synthetic questions do not overlap with the test sets (Appendices § 10.§ 4 and § 12).

CategoryMethodsBackboneWikiWebQuestions F1WikiWebQuestions Hit@1QALD10-en F1QALD10-en Hit@1GTSQA F1GTSQA Hit@1
LLM ReasoningIO Prompt ([40])Qwen2.5-7B-Instruct28.2444.4311.0512.309.6210.23
LLM ReasoningIO Prompt ([26])GPT-4o-mini40.3168.1015.3418.7815.3716.46
LLM ReasoningCoT ([46])GPT-4o-mini41.6658.4222.6826.8118.8720.12
LLM ReasoningSelf-Consistency ([45])GPT-4o-mini46.3465.2024.2728.5719.0720.21
LLM ReasoningIO Prompt ([7])DeepSeek-V342.3659.8918.9721.7724.7726.20
LLM ReasoningCoT ([46])DeepSeek-V345.9164.6019.0225.2827.6629.41
LLM ReasoningSelf-Consistency ([45])DeepSeek-V349.7266.7926.2529.9733.5935.82
Retrieval-basedRoG ([21])Qwen2.5-7B-Instruct53.2768.71––41.1042.48
Retrieval-basedSubGraphRAG-100 ([18])Qwen2.5-7B-Instruct56.8472.36––44.2745.93
Retrieval-basedGCR ([22])GPT-4o-mini55.3371.27––32.6137.48
Agent-basedToG ([34])GPT-4o-mini58.5572.7530.6332.1841.0842.36
Agent-basedPoG ([5])GPT-4o-mini57.3271.8930.6834.0737.7739.33
Agent-basedKG-R1 ([19])Qwen3-4B-Instruct64.4973.0144.0745.4146.1447.73
Agent-basedFoG-3BQwen2.5-3B-Instruct66.2875.4345.6348.9248.2549.20
Agent-basedFoG-4BQwen3-4B-Instruct66.4176.9347.8049.0148.6650.52

Table 1. Main results on three KGQA benchmarks. Best results are shown in bold, and second-best results are underlined. Our methods are highlighted in blue.

Baselines. We compare FoG against LLM reasoning (IO Prompt, CoT ([46]), Self-Consistency ([45])), retrieval-based (RoG ([21]), SubGraphRAG ([18]), GCR ([22])), and agent-based (ToG ([34]), PoG ([5]), KG-R1 ([19])) methods. Retrieval-based methods require dataset-specific fine-tuning and are omitted from QALD10-en, whose training split has only 387 examples (Appendix § 14).

Evaluation Metrics. We report Hit@1 and token-level F1 for answer accuracy. For evidence coverage, we report Cov, the fraction of gold supporting triples retrieved along the trajectory, and RetQ, the fraction of questions whose gold answer is returned by a KG query. GTSQA provides gold supporting triples natively, and we construct them for WikiWebQuestions with an LLM verifier that agrees with human annotators on 93.0% of 200 audited paths (Appendices § 13.§ 1, § 13.§ 2, and § 13.§ 3).

Implementation Details. We train FoG on Qwen2.5-3B-Instruct and Qwen3-4B-Instruct with LoRA-based SFT followed by GRPO, sampling N=4N=4 trajectories of at most 10 KG turns per question for 450 steps. All methods are evaluated with a single inference run per question (Appendix § 15).

Main Results (RQ1)

As shown in Table 1, we compare FoG with all baselines in answer accuracy.

Comparison across methods. FoG achieves the best F1 and Hit@1 on all three benchmarks, exceeding the strongest baseline KG-R1 by up to +3.73 F1 and +3.92 Hit@1. As KG-R1 is also RL-trained on the same Qwen3-4B backbone, this indicates that training an agent to retrieve evidence also makes its answers more accurate.

Comparison across backbones. FoG-3B still exceeds the 4B KG-R1 on all three benchmarks, and FoG-4B surpasses GPT-4o-mini agents by at least +7.58 F1 and 7B retrieval-based methods by at least +4.39 F1. This suggests that how an agent is trained to retrieve matters more than its backbone size.

Ablation Study (RQ2)

As shown in Table 2, we ablate the training stages and reward terms on the two benchmarks with gold supporting triples, under the same backbone, SFT checkpoint, RL data, and rollout budget, so the variants differ only in the reward.

VariantsWikiWebQuestions F1WikiWebQuestions Hit@1WikiWebQuestions RetQWikiWebQuestions CovGTSQA F1GTSQA Hit@1GTSQA RetQGTSQA Cov
SFT only59.95±0.1859.95\pm0.1870.10±0.2470.10\pm0.2479.42±0.3179.42\pm0.3170.63±0.2970.63\pm0.2944.73±0.2244.73\pm0.2246.19±0.2746.19\pm0.2758.47±0.3358.47\pm0.3349.85±0.3049.85\pm0.30
SFT + RL w/o RecprR_{\mathrm{ecpr}}63.87±0.4463.87\pm0.4474.35±0.5374.35\pm0.5383.17±0.4983.17\pm0.4972.91±0.5672.91\pm0.5646.02±0.4946.02\pm0.4946.97±0.5646.97\pm0.5661.02±0.5261.02\pm0.5251.43±0.5851.43\pm0.58
SFT + RL w/o RstepR_{\mathrm{step}}65.02±0.3365.02\pm0.3376.48±0.4076.48\pm0.4085.62±0.3885.62\pm0.3877.25±0.4277.25\pm0.4247.96±0.3947.96\pm0.3948.17±0.4748.17\pm0.4763.18±0.4463.18\pm0.4457.21±0.4657.21\pm0.46
SFT + RL, Recpr→R_{\mathrm{ecpr}}\to LLM-as-judge64.95±0.3964.95\pm0.3975.41±0.5175.41\pm0.5184.03±0.4584.03\pm0.4574.12±0.5074.12\pm0.5046.88±0.4346.88\pm0.4348.25±0.5248.25\pm0.5262.24±0.4862.24\pm0.4853.36±0.5153.36\pm0.51
SFT + RL (full FoG)66.41±0.2766.41\pm0.2776.93±0.3876.93\pm0.3886.35±0.3586.35\pm0.3578.34±0.3778.34\pm0.3748.66±0.3448.66\pm0.3450.52±0.4150.52\pm0.4165.34±0.3965.34\pm0.3958.64±0.4058.64\pm0.40

Table 2. Ablation of training stages and reward terms. The LLM-as-judge variant replaces RecprR_{\mathrm{ecpr}} with a model-based process score. Mean and std. over three seeds.

Impact of RL. Full FoG improves over SFT only by +6.83 and +4.33 Hit@1, but RL without RecprR_{\mathrm{ecpr}} raises Cov by only +2.28 and +1.58. This is because the outcome reward is paid in full once the answer is reached, whatever evidence is retrieved.

Impact of RecprR_{\mathrm{ecpr}}. Removing RecprR_{\mathrm{ecpr}} causes the largest drop among the reward terms, and Cov drops more (5.43 and 7.21) than Hit@1 (2.58 and 3.55). As both variants share the data and the SFT checkpoint, this confirms that the coverage gain comes from the reward itself.

Impact of RstepR_{\mathrm{step}}. Removing RstepR_{\mathrm{step}} lowers Hit@1 by 0.45 and 2.35 but Cov by only 1.09 and 1.43, indicating that step validity keeps the interaction executable but does not drive coverage.

ECPR vs. LLM-as-judge. An LLM-as-judge score of the reasoning process (Wang and Yu [43]) raises Cov by only 1.21 and 1.93 over no process supervision and stays 4.22 and 5.28 below ECPR. This suggests that judging how plausible the reasoning reads is a weaker signal than ECPR.

Evidence-Grounded Synthesis (RQ3)

As shown in Table 3 and Figure 4, we fix a budget of 6,588 SFT questions and vary the data source (Train-Only, Synth-Only, or a mix of both), and apply the same SFT data to three backbone scales.

Effect of model scale

Figure 4. Effect of model scale. F1 and Hit@1 of backbones of different sizes after SFT on the same data.

Data SourceWikiWebQuestionsWikiWebQuestionsQALD10-enQALD10-enGTSQAGTSQA
F1Hit@1F1Hit@1F1Hit@1
Train-Only53.5864.5136.9437.8641.3341.52
Synth-Only57.8468.1739.5240.3643.2144.58
Mixed59.9570.1041.3842.3144.7346.19

Table 3. Impact of synthetic training data.

Validity of embedded evidence. The supporting triples of every retained question reproduce its answer under SPARQL execution, and the redundancy check misses a shortcut in only 1.5% of 200 audited questions. This confirms that the embedded triples are a valid reward target without annotation.

Synthetic vs. original data. Synth-Only outperforms Train-Only by +3.66, +2.50, and +3.06 Hit@1 with no in-domain question, indicating that questions built by backward expansion transfer to human-written benchmarks. Mixed performs best, so the two sources are complementary (Appendix § 10.§ 3).

Performance across model scales. Hit@1 improves steadily from 3B to 7B (+12.89, +7.52, and +7.36), indicating that the synthetic data is not backbone-specific.

Analysis of KG Interaction Agent (RQ4)

As shown in Table 4 and Figure 5, we examine how much evidence agent-based methods retrieve.

MethodsWikiWebQuestionsWikiWebQuestionsWikiWebQuestionsGTSQAGTSQAGTSQA
Hit@1RetQCovHit@1RetQCov
PoG71.8975.6669.8539.3335.7025.38
ToG72.7573.5368.7942.3650.9937.34
KG-R173.0182.2874.5047.7361.4154.05
FoG-4B76.9386.3578.3450.5265.3458.64

Table 4. Answer accuracy and evidence coverage of agent-based methods.

Performance under structural complexity on GTSQA by reasoning hop and isomorphism type

Figure 5. Performance under structural complexity on GTSQA by reasoning hop and isomorphism type.

Answers without evidence. On GTSQA, PoG attains 39.33 Hit@1 but reaches the gold answer on only 35.70% of questions, so at least 9.2% of its correct answers never appear in any KG observation, and the RL-trained KG-R1 still leaves 45.95% of the supporting triples unretrieved. Neither prompting nor outcome rewards thus make an agent use the KG as a source of evidence.

Evidence coverage. FoG attains the highest Cov and RetQ on both benchmarks (+3.84 and +4.59 Cov over KG-R1) together with the highest Hit@1, indicating that evidence coverage does not come at the cost of answer accuracy (Appendix § 16).

Performance under structural complexity. FoG leads KG-R1 on all 10 groups and is the best method on 9. Its margin over KG-R1 grows from +1.4 Hit@1 on (1) to +5.0 on (3) and +6.0 on the more branched (3)(1), questions that depend on more supporting triples. This suggests that the more evidence an answer requires, the more the agent benefits from rewards for retrieving it, although the margin narrows to +2.0 on (4).

Analysis of ECPR (RQ5)

As shown in Table 5 and Figure 6, we compare first-match with trajectory-level attribution, which credits coverage to the final turn, and every-match attribution, which rewards every retrieval.

Training dynamics of FoG

Figure 6. Training dynamics of FoG. Rewards rise while interaction turns and response length decline.

Credit assignmentHit@1CovDup. rate
Trajectory-level46.6954.2911.8%
Every-match47.0152.2129.4%
First-match (ours)50.5258.648.6%

Table 5. Credit-assignment strategies for ECPR on GTSQA. Dup. rate is the fraction of KG queries that re-retrieve an already retrieved gold triple.

Comparison across attribution strategies. First-match achieves the best Hit@1 and Cov. Trajectory-level attribution loses 4.35 Cov, as turns that retrieve evidence earn the same return as the others. Every-match raises the duplicate-retrieval rate from 8.6% to 29.4% and falls below trajectory-level in Cov, as it rewards re-querying known evidence. This indicates that dense credit must pay each triple once, or it rewards redundant retrieval rather than coverage.

Training dynamics. Rewards rise during RL while KG turns and response length decline, indicating that the agent learns a precise retrieval policy that covers more evidence with fewer queries.

Cross-KG Transfer (RQ6)

As shown in Table 6, we evaluate the frozen FoG zero-shot on WebQSP over a Freebase backend.

MethodTrain KGBackboneWebQSP trainWebQSP Hit@1
ToG ([34])NoneGPT-4No82.6
RoG ([21])FreebaseLLaMA2-Chat-7BYes85.7
KG-R1 ([19])FreebaseQwen2.5-3B-InstructYes82.8
FoG SFT-onlyWikidataQwen3-4B-InstructNo71.6
FoG fullWikidataQwen3-4B-InstructNo77.2

Table 6. Zero-shot cross-KG transfer to Freebase (WebQSP). Methods developed on Freebase are reference points, not matched baselines.

Zero-shot transfer. FoG reaches 77.2 Hit@1 on an unseen KG, close to the methods developed on Freebase (82.6–85.7), and RL with ECPR contributes +5.6 Hit@1 over SFT only. This suggests that ECPR teaches the habit of retrieving evidence before answering, not the relations of one schema.

Conclusion

In this work, we present FoG, a framework that trains KG agents to retrieve the evidence behind their answers. By introducing evidence-grounded synthesis, a KG interaction agent, and an evidence-coverage process reward, FoG uses the KG as a source of evidence rather than only as a source of answers. Experiments on three KGQA benchmarks demonstrate consistent improvements in answer accuracy, evidence coverage, and cross-KG transfer.

Limitations

KG completeness and freshness. FoG uses Wikidata triples as verifiable references for evidence-covered supervision, but real-world knowledge graphs may be incomplete, outdated, or noisy. When the required evidence is absent or incorrect in the graph, the agent may still fail despite following the intended evidence path. A natural extension is to equip the agent with a mechanism for detecting insufficient on-graph evidence and invoking external retrieval when needed.

Dependence on teacher models. Like other KG agents distilled from teacher trajectories [6, 33], FoG currently relies on an external teacher LLM (Kimi-K2) for question synthesis and trajectory distillation. Although symbolic checks filter invalid questions and evidence paths, the synthesis process still depends on the generation quality of external teachers. One promising direction is to replace teacher-driven synthesis with self-play, where agents generate, explore, and verify candidate questions through graph execution and symbolic filtering.

Long-horizon graph interaction. FoG caps graph interactions at 10 turns, which is sufficient for the 1–4-hop questions studied in our benchmarks. More open-ended KG reasoning may require longer evidence chains and broader graph exploration. Extending FoG to such settings requires balancing search depth against error accumulation, noisy observations, and sparser rewards.

Ethical Considerations

All experiments use publicly available KGQA datasets derived from Wikidata (CC0), QALD10-en (MIT License), and WikiWebQuestions, GTSQA, and WebQSP (publicly available for research). Backbone models Qwen2.5 and Qwen3 are released under Apache 2.0; GPT-4o-mini, DeepSeek-V3, and the teacher Kimi-K2 are accessed via official APIs under their terms of service. Our use of all existing artifacts is consistent with their intended research purposes. The datasets contain only public encyclopedic facts from structured KG triples, with no private or user-generated data. The only human involvement is the audit of constructed evidence paths (Appendix § 13.§ 3), in which three graduate annotators judged whether a KG path supports its question. The annotators took part voluntarily, the task exposed them to no sensitive content, and no personal data was collected. This work involves no crowdsourcing and no user study. FoG is intended to make the answers of KG agents traceable to retrieved evidence. Since the KG may be outdated or incorrect, this evidence supports human verification rather than replaces it. We foresee no dual-use concerns.

Proofs

Throughout the proofs, a logical form ℓ\ell is a conjunctive query: a set of triple patterns over entities and variables with one answer variable, optionally with filters on bound values. For a triple set SS, SPARQL(ℓ,S)(\ell,S) is the set of values of the answer variable over all assignments that map every pattern of ℓ\ell to a triple in SS and satisfy the filters. Such queries are monotone: S⊆S′S \subseteq S' implies SPARQL⁡(ℓ,S)⊆SPARQL⁡(ℓ,S′)\operatorname{SPARQL}(\ell,S) \subseteq\operatorname{SPARQL}(\ell,S'). Following Definition 2, SS supports (ℓ,y)(\ell,y) if y∈SPARQL⁡(ℓ,S)y \in\operatorname{SPARQL}(\ell,S), and a trajectory τ\tau is evidence-covered if Cov⁡(τ,Sq∗)=1\operatorname{Cov}(\tau,S_q^*) = 1, as defined in Equation (6).

Proof of Proposition 1

Proposition 1. Backward expansion preserves the answer and yields triples that support it.

Proof. We show by induction that, for every n≥1n \ge1, the triple set S(n)⊆TS^{(n)} \subseteq T supports (ℓ(n),y)(\ell^{(n)},y).

Base case. A seed is retained only if its supporting triples exist in the KG and instantiate ℓ(1)\ell^{(1)} with the answer variable bound to yy. Hence S(1)S^{(1)} supports (ℓ(1),y)(\ell^{(1)},y) under some assignment μ\mu.

Inductive step. Assume that S(n)S^{(n)} supports (ℓ(n),y)(\ell^{(n)},y) under an assignment μ\mu. An expansion selects an entity uu in ℓ(n)\ell^{(n)} and a verified sub-question with logical form ℓ~\tilde{\ell}, answer variable xx, and triples S~⊆T\tilde{S} \subseteq T that support (ℓ~,u)(\tilde{\ell},u) under an assignment μ~\tilde{\mu} with μ~(x)=u\tilde{\mu}(x)=u. With variables renamed apart, the expanded logical form is

ℓ(n+1)=ℓ(n)[u↦x]∪ℓ~,(9)\ell^{(n+1)} = \ell^{(n)}[u \mapsto x] \cup\tilde{\ell}, \tag*{(9)}

where [u↦x][u \mapsto x] replaces every occurrence of uu with the variable xx. Consider the assignment μ∪μ~\mu\cup\tilde{\mu}. Every pattern of ℓ~\tilde{\ell} is mapped into S~\tilde{S}, and every pattern of ℓ(n)[u↦x]\ell^{(n)}[u \mapsto x] is mapped to the same triple of S(n)S^{(n)} as under μ\mu, since μ~(x)=u\tilde{\mu}(x)=u. The answer variable is still bound to yy, which gives

y∈SPARQL⁡(ℓ(n+1),S(n+1)),(10)y \in\operatorname{SPARQL}(\ell^{(n+1)},S^{(n+1)}), \tag*{(10)}

where S(n+1)=S(n)∪S~S^{(n+1)} = S^{(n)} \cup\tilde{S}, so S(n+1)S^{(n+1)} supports (ℓ(n+1),y)(\ell^{(n+1)},y). Since S(n+1)⊆TS^{(n+1)} \subseteq T, monotonicity also gives y∈SPARQL⁡(ℓ(n+1),T)y \in\operatorname{SPARQL}(\ell^{(n+1)},T), so the answer is preserved over the full KG. Each expansion replaces one entity with a variable, so NN expansions hide NN intermediate entities.

The proof guarantees that the accumulated triples are sufficient for the answer, not that they are the only triples that support it. In the special case where the sub-question has answers other than uu, the result set of ℓ(n+1)\ell^{(n+1)} may grow, but the executability check bounds it by KansK_{\mathrm{ans}}.

In conclusion, every expansion keeps yy in the result set over the full KG, and the accumulated triples alone support the expanded logical form. Therefore, backward expansion preserves the answer and yields triples that support it.

Proof of Proposition 2

Proposition 2. ECPR is maximized only by supported answers and rewards each triple once.

Proof. Let R=Rout+Rstep+RecprR = R_{\mathrm{out}} + R_{\mathrm{step}} + R_{\mathrm{ecpr}} be the composite reward with λecpr>0\lambda_{\mathrm{ecpr}} > 0, and let Sq∗S_q^* be the supporting triples of a question qq, which support (ℓq,yq∗)(\ell_q,y_q^*) by Proposition 1.

Supported maximizers. Since F1≤1F1 \le1, Rstep≤λstepR_{\mathrm{step}} \le\lambda_{\mathrm{step}}, and Cov⁡≤1\operatorname{Cov} \le1, the composite reward is bounded as

R(τ)≤λf1+λret+λstep+λecpr,(11)R(\tau) \le\lambda_{\mathrm{f1}} + \lambda_{\mathrm{ret}} + \lambda_{\mathrm{step}} + \lambda_{\mathrm{ecpr}}, \tag*{(11)}

where equality holds if and only if every term attains its maximum, in particular only if Cov⁡(τ,Sq∗)=1\operatorname{Cov}(\tau,S_q^*)=1. Assume that an evidence-covered trajectory with a correct answer and only valid actions is feasible within the turn limit. The bound is then attained, so every trajectory τ\tau that maximizes RR satisfies Sq∗⊆T(τ)S_q^* \subseteq T(\tau), and monotonicity gives

yq∗∈SPARQL⁡(ℓq,T(τ)),(12)y_q^* \in\operatorname{SPARQL}(\ell_q,T(\tau)), \tag*{(12)}

which means that the answer of τ\tau is supported.

For outcome rewards alone, RoutR_{\mathrm{out}} in Equation (5) depends on τ\tau only through the prediction y^\hat{y} and the returned entities E(τ)\mathcal{E}(\tau). A shortcut trajectory τs\tau_s that predicts and reaches yq∗y_q^* with Cov⁡(τs,Sq∗)<1\operatorname{Cov}(\tau_s,S_q^*) < 1 therefore attains the maximum λf1+λret\lambda_{\mathrm{f1}}+\lambda_{\mathrm{ret}} of RoutR_{\mathrm{out}}. Under the composite reward, it loses at least λecpr(1−Cov⁡(τs,Sq∗))>0\lambda_{\mathrm{ecpr}}(1-\operatorname{Cov}(\tau_s,S_q^*)) > 0 against the bound and is no longer optimal.

One reward per triple. Let Ut=(⋃i≤tTi)∩Sq∗U_t = \left(\bigcup_{i \le t} \mathcal{T}_i\right) \cap S_q^* be the gold triples retrieved up to step tt, with U0=∅U_0 = \varnothing. The step reward of ECPR is then

rtecpr=λecpr∣Ut∣−∣Ut−1∣∣Sq∗∣,(13)r_t^{\mathrm{ecpr}} = \lambda_{\mathrm{ecpr}} \frac{\lvert U_t\rvert-\lvert U_{t-1}\rvert}{\lvert S_q^*\rvert}, \tag*{(13)}

where Ut−1⊆UtU_{t-1} \subseteq U_t, so rtecpr≥0r_t^{\mathrm{ecpr}} \ge0 and the sum over steps telescopes to λecpr∣UT∣/∣Sq∗∣=Recpr(τ)\lambda_{\mathrm{ecpr}}\lvert U_T\rvert/\lvert S_q^*\rvert= R_{\mathrm{ecpr}}(\tau). If step tt returns only triples that were already retrieved, then Ut=Ut−1U_t=U_{t-1} and rtecpr=0r_t^{\mathrm{ecpr}}=0. In contrast, every-match attribution pays λecpr∣Tt∩Sq∗∣/∣Sq∗∣\lambda_{\mathrm{ecpr}}\lvert T_t \cap S_q^*\rvert/\lvert S_q^*\rvert at each step. Repeating a query that returns m≥1m \ge1 gold triples for TT steps thus earns λecprTm/∣Sq∗∣\lambda_{\mathrm{ecpr}}Tm/|S_q^*|, which grows with TT while the coverage stays at m/∣Sq∗∣m/|S_q^*|.

The statement concerns the maximizers of the trajectory-level reward and does not guarantee that policy optimization reaches them. Covering Sq∗S_q^* is sufficient but not necessary for a supported answer, since a question may admit other supporting sets. In the special case where no shortcut trajectory exists for the question, the maximizers of RoutR_{\mathrm{out}} are already evidence-covered, so the two rewards share the same maximizers.

In conclusion, the composite reward attains its maximum only when the retrieved triples support the answer, and first-match attribution never pays a triple twice. Therefore, ECPR is maximized only by supported answers and rewards each triple once.

FoG Algorithm Detail

Redundancy Check. To provide a clear overview of the non-redundancy check in § 3.1, we present its procedure in the form of pseudocode. As shown in Algorithm 1, we first build a support graph from the supporting triples and extract the shortest path from each topic entity to the answer node. We then enumerate proper subsets of topic entities in increasing size and execute one SPARQL query per subset. If any subset yields an answer set no larger than that of the full query, the question admits a shortcut and is discarded.

Complexity Analysis. Given a question with ∣Eq∣|E_q| topic entities and ∣S(n)∣|S^{(n)}| supporting triples, extracting the shortest paths by BFS takes O(∣Eq∣⋅∣S(n)∣)O(|E_q|\cdot|S^{(n)}|) time. The subset enumeration issues at most 2∣Eq∣−22^{|E_q|}-2 SPARQL queries and stops at the first redundant subset. Using only the shortest path per topic entity is an approximation, which we audit on 200 candidate questions against an exhaustive enumeration of all path combinations under the same hop limit. The shortest-path check misses a shortcut in 1.5% of the candidates, while issuing 5.1 rather than 48.6 SPARQL queries per question.

In summary, the redundancy check is dominated by SPARQL execution, and the shortest-path approximation reduces the number of queries by 9.5×9.5\times while missing few shortcuts.

Algorithm 1: Redundancy Check
Input: S(n)S^{(n)}: supporting triples; EqE_q: topic entities; Y(n)Y^{(n)}: full answer set.
Output: Redundancy flag IsRedundant∈{True,False}\mathrm{IsRedundant} \in\{\mathrm{True},\mathrm{False}\}.
Build an undirected graph GG from S(n)S^{(n)}; label topic-entity nodes with their Wikidata IDs, the answer node with ?answer, and intermediates with fresh variables.
for each e∈Eqe \in E_q do
Compute shortest path P(e)P(e) in GG from ee to the answer node.
Derive SPARQL triple pattern ϕ(e)\phi(e) from triples along P(e)P(e).
end
for k=1k=1 to ∣Eq∣−1|E_q|-1 do
for each Z⊆EqZ \subseteq E_q with ∣Z∣=k|Z|=k do
QZ←Q_Z \gets SELECT; ?answer; WHERE; {⋃e∈Zϕ(e)}\{\bigcup_{e\in Z}\phi(e)\}
Execute QZQ_Z on the KG →\to answer set YZ(n)\mathcal{Y}^{(n)}_Z.
if ∣YZ(n)∣≤∣Y(n)∣|\mathcal{Y}^{(n)}_Z| \le|\mathcal{Y}^{(n)}| then
return True
end
end
end
return False

Table 1 (PDF p. 14).

Synthetic Data Construction

Topic Domains

As shown in Figure 7, the synthetic questions used for FoG training span seven named Wikidata domains. Entertainment is the largest (39.7%), reflecting the density of film, television, and music entities in Wikidata, followed by history (12.6%), society (11.4%), geography (9.6%), transportation (6.6%), sports (6.5%), and politics (5.7%); the remaining 7.9% fall into other domains.

Topic-domain distribution of the synthetic questions

Figure 7. Topic-domain distribution of the synthetic questions. The questions are drawn from major Wikidata domains.

Query-Graph Topologies

To construct questions with diverse reasoning structures, we label each synthetic question with the isomorphism type of its query graph. As shown in Table 7, the 6,588 questions that pass all checks span nine chain and tree structures from 1 to 3 hops. All verified seeds enter backward expansion, and the 1-hop questions are seeds retained at depth one. Overall, 35.1%, 40.0%, and 24.9% of the questions have 1, 2, and 3 hops. The most frequent types are the three-branch star (1)(1)(1) (18.38%) and the 3-hop chain (3) (16.48%), and 67.6% of the questions have a multi-branch query graph rather than a single chain.

HopsIsomorphism TypeQuestionsProportion
1 hop(1)5007.59%
1 hop(1)(1)6009.11%
1 hop(1)(1)(1)1,21118.38%
2 hop(2)5508.35%
2 hop(2)(1)85312.95%
2 hop((1)(1))70010.63%
2 hop(2)(1)(1)5338.09%
3 hop(3)1,08616.48%
3 hop((2)(1))5558.42%
Total-6,588100.00%

Table 7. Topology distribution of the synthetic questions. Query-graph isomorphism types are grouped by hop count, the longest path from a topic entity to the answer.

Synthesis Cost and Retention

As shown in Table 8, we report the candidates retained, the rejection rate, and the teacher calls at each synthesis stage, all of which use the same teacher model, Kimi-K2 Team, [39]. Of 20,000 sampled seed entities, 14,400 yield a verified seed question, 8,784 candidates remain after backward expansion, and 6,588 questions pass all filters, an end-to-end rejection rate of 67.1%. The pipeline uses 115,184 teacher calls, about 17.5 per retained question, and backward expansion accounts for three quarters of them.

StageInputRetainedRejectedTeacher calls
Seed-question generation20,00014,40028.0%20,000
Backward expansion14,4008,78439.0%86,400
Complex-question composition8,7846,58825.0%8,784
End-to-end20,0006,58867.1%115,184

Table 8. Synthesis cost and retention.

Data Leakage Check

To ensure that the synthetic questions do not overlap with the test sets, we encode each question with BGE-M3 and compute the cosine similarity between every test question and its most similar synthetic question. The similarity stays below 0.85

for all test questions. On QALD10-en and WikiWebQuestions, no test question exceeds 0.75, and on GTSQA only 6 questions (0.37%) fall in the 0.80–0.85 range.

KG Interaction Operations

As shown in Table 9, the kg-query action in § 3.2 is instantiated with seven operations in four categories: relation search, neighborhood expansion, constraint filtering, and set combination. The table lists the name, description, input parameters, and output of every operation.

CategoryFunctionDescriptionInput ParametersOutput
Relation searchfind_outgoing_relationsGiven an entity, return all outgoing relations.entity_nameList of outgoing relations
Relation searchfind_incoming_relationsGiven an entity, return all incoming relations.entity_nameList of incoming relations
Neighborhood expansionget_tail_entitiesFollow the relation forward from head to tail.head_entity_name; relation_nameSet of tail entities
Neighborhood expansionget_head_entitiesFollow the relation backward from tail to head.tail_entity_name; relation_nameSet of head entities
Constraint filteringget_entity_by_constraintFilter the provided entity_set and return the entities satisfying the specified constraint.entity_set; relation; operator; valueEntity subset
Set combinationintersectReturn the intersection of the given list of entity sets.entity_set_listIntersection set
Set combinationunionReturn the union of the given list of entity sets.entity_set_listUnion set

Table 9. The seven KG operations of the kg-query action. Each operation is listed with its description, input parameters, and output.

Benchmark Datasets

The benchmarks used for FoG evaluation cover two knowledge graphs, with data sourced as follows:

WikiWebQuestions: Ported from WebQuestions and re-annotated with SPARQL queries over Wikidata Xu et al., [48], consisting of real-world natural language questions.

QALD10-en: Derived from the English subset of the tenth QALD challenge Usbeck et al., [42], the first edition to adopt Wikidata, covering 394 expert-written test questions with multi-hop and qualifier constraints.

GTSQA: Built over Wikidata with 30,144 training and 1,622 test questions Cattaneo et al., [4], each annotated with a gold answer subgraph and a query-graph isomorphism label.

WebQSP: Sourced from Freebase Yih et al., [52] and used only for the zero-shot cross-KG transfer experiment.

Evaluation Details

Evaluation Metrics

We evaluate model performance using four complementary metrics that assess two aspects of KGOQA: answer accuracy (Hit@1 and F1) and evidence coverage (Cov and RetQ).

(i) Hit@1. Hit@1 quantifies whether the predicted answer is correct. For each question, we check whether the normalized prediction matches any gold answer, and then average over all evaluated questions:

Hit@1⁡=1M∑i=1MI[∃y∈Yi∗:norm⁡(y^i)=norm⁡(y)](14)\operatorname{Hit@1} = \frac{1}{M}\sum_{i=1}^{M} \mathbb{I}\left[\exists y \in Y_i^* : \operatorname{norm}(\hat{y}_i) = \operatorname{norm}(y)\right] \tag*{(14)}

where y^i\hat{y}_i and Yi∗Y_i^* denote the prediction and the gold answer set of the ii-th question, norm⁡(⋅)\operatorname{norm}(\cdot) removes superficial differences such as case and punctuation, and MM is the total number of evaluated questions in the benchmark.

(ii) Token-level F1. F1 quantifies the token-level overlap between the predicted and gold answers. For each question, we compute the harmonic mean of token precision and recall, and then average:

F1⁡=1M∑i=1M2⋅∣tokens⁡(y^i)∩tokens⁡(Yi∗)∣∣tokens⁡(y^i)∣+∣tokens⁡(Yi∗)∣(15)\operatorname{F1} = \frac{1}{M}\sum_{i=1}^{M}\frac{2\cdot\lvert\operatorname{tokens}(\hat{y}_i)\cap\operatorname{tokens}(Y_i^*)\rvert}{\lvert\operatorname{tokens}(\hat{y}_i)\rvert+\lvert\operatorname{tokens}(Y_i^*)\rvert} \tag*{(15)}

where tokens⁡(⋅)\operatorname{tokens}(\cdot) normalizes each answer in a list, splits it on whitespace, and takes the union of the resulting tokens over the list.

(iii) Evidence Coverage (Cov). Cov quantifies how much of the gold supporting evidence the agent retrieves along its trajectory. For each question, we compute the fraction of gold supporting triples returned by its KG queries, and then average over all questions:

Cov⁡=1M∑i=1M∣T(τi)∩Si∗∣∣Si∗∣(16)\operatorname{Cov} = \frac{1}{M}\sum_{i=1}^{M}\frac{\lvert\mathcal{T}(\tau_i)\cap S_i^*\rvert}{\lvert S_i^*\rvert} \tag*{(16)}

where T(τi)\mathcal{T}(\tau_i) denotes the set of triples returned by all kg-query actions in the trajectory τi\tau_i, and Si∗S_i^* denotes the gold supporting triples of the ii-th question. This metric reflects whether an answer is backed by the complete evidence path.

(iv) Retrieval Grounding (RetQ). RetQ quantifies whether the gold answer is retrieved from the KG rather than produced from parametric memory. For each question, we check whether any gold answer appears among the entities returned by its KG queries, and then average over all questions:

RetQ⁡=1M∑i=1MI[∃y∈Yi∗, y∈E(τi)](17)\operatorname{RetQ} = \frac{1}{M}\sum_{i=1}^{M}\mathbb{I}\left[\exists y \in Y_i^*,\ y \in\mathcal{E}(\tau_i)\right] \tag*{(17)}

where E(τi)\mathcal{E}(\tau_i) denotes the set of entities returned by all KG queries in the trajectory τi\tau_i.

Gold Supporting Triples

The gold supporting triples used for evaluation are distinct from those produced by synthesis, which serve only as ECPR supervision during training. GTSQA provides gold answer subgraphs natively. For WikiWebQuestions, which has no such annotation, we follow EoG [49] and construct them in two stages. We first enumerate candidate paths from each topic entity to each answer entity by BFS under a maximum-hop constraint. An LLM verifier then judges whether each candidate path supports all constraints of the question, and the union of triples on the accepted paths forms the gold supporting triples.

Human Validation of Constructed Paths

To validate the constructed paths independently of the LLM verifier, we sample 200 candidate paths from WikiWebQuestions, 100 accepted and 100 rejected by the verifier. Three graduate annotators independently judge whether each path supports all constraints of its question, without seeing the verifier decision. The annotators reach Fleiss’ κ=\kappa=

QuestionCandidate pathReason for rejection
Who was the prime minister of Pakistan in 1999?Links candidates only to the office “Prime Minister of Pakistan”.Does not establish that the candidate held the office in 1999.
What town did Justin Bieber grow up in?Justin Bieber →\to Canada; Waterloo →\to Canada.Sharing the same country does not establish childhood residence.

caption: tbl:10: Representative rejected paths. The verifier checks whether a path covers the semantic constraints of the question, not only whether it reaches a plausible answer entity.

0.91, and the human–verifier agreement is 93.0%, with a verifier precision of 0.94 and a recall of 0.92. Table 10 shows two representative rejected paths.

Baseline Details

We compare FoG against nine representative baselines that cover the LLM reasoning, retrieval-based, and agent-based paradigms:

IO Prompt ([26, 40, 7]) is a KG-free baseline where the LLM directly answers the question from its parametric knowledge. This serves as a lower bound for KG-augmented reasoning.

CoT ([46]) elicits step-by-step reasoning before the final answer, still without any access to the KG.

Self-Consistency ([45]) samples multiple CoT chains and aggregates their answers by majority voting.

RoG ([21]) generates relation paths as plans, retrieves reasoning paths along them, and answers from the retrieved paths.

SubGraphRAG ([18]) retrieves a subgraph with a lightweight MLP that scores triples in parallel, and feeds it to an LLM reader.

GCR ([22]) encodes KG paths into a Trie index and constrains LLM decoding with the graph structure.

ToG ([34]) is a training-free agent that performs beam search over entities and relations through multi-turn KG interaction.

PoG ([5]) decomposes the question into sub-objectives and explores paths with memory updating and self-reflection.

KG-R1 ([19]) trains a single KG agent end-to-end with GRPO under outcome and turn-level action-validity rewards.

Adaptation to Wikidata. RoG, SubGraphRAG, and GCR were proposed on Freebase and rely on dataset-specific supervision, so they cannot be transferred to a new KG without retraining. We therefore retrain each of them on the training split

of every Wikidata benchmark. KG-R1 was also proposed on Freebase. We retrain it on Wikidata with the same training data as FoG.

To ensure fairness, all methods, including FoG, are evaluated under identical conditions with a single inference run per question, and no multi-run aggregation is used. The backbone of each method is listed in Table 1.

Hyperparameter Settings

Supervised Fine-Tuning. For SFT, we adopt LLaMA-Factory ([54]) and apply LoRA to all linear layers. The training trajectories are distilled from the same teacher model used in synthesis, Kimi-K2 ([39]), with the prompt in Table 19. Training runs on a single NVIDIA A100 GPU.

Trajectory distillation Prompt
SYSTEM PROMPT
You are a Knowledge Graph QA Assistant. Your task is to explore the knowledge graph only by calling the provided function tools, and answer questions based on the retrieved triplet information.
Core Principles (Strictly Mandatory): 1. Tool-first. You must call at least one tool before giving any answer. Do not answer from memory or guess. If you have not yet received tool results, your next action must be a tool call, not <answer>. 2. No direct answers. You must not use your own internal knowledge; all information must be obtained from the knowledge graph via function calls. 3. Show reasoning. Before each function call, briefly explain its purpose; after the call, summarize the information obtained. 4. Evidence-based. Text inside <answer> . . . </answer> must be only entity name(s) that appeared in the last relevant tool response(s). 5. Step-by-step exploration. Explore relationships first, then retrieve entities, avoiding blind calls.
Available Functions: {tool_call}
Workflow:
Step 1: Understand the Question. Analyze question type (one-hop, multi-hop, intersection, constraint, hybrid). Identify entities from Entity info. Plan initial exploration.
Step 2: Choose Function Strategy.
• Unknown relations: start with find_outgoing_relations or find_incoming_relations.
• Known relation: use get_tail_entities or get_head_entities.
• “Both A and B” / “satisfies both”: get set A, get set B, then intersect([set_A, set_B]).
• “Among X, which has attribute = value”: get set X, then get_entity_by_constraint.
Step 3: Execute Exploration.
1. Start with the given entity: call find_outgoing_relations or find_incoming_relations. Use entity names from Entity info (no QID); use exact relation names from find_*_relations.
2. Based on question, call get_tail_entities or get_head_entities.
3. For “Both A and B” questions: get set for A, get set for B, then call intersect once.
4. For constraint questions: (a) obtain candidate set; (b) call get_entity_by_constraint(entity_set, relation, "=", value) once.
5. If multi-hop needed, repeat for new entities. Use intersect or union when merging.
Step 4: Generate Answer:
• As soon as a tool returns a result that uniquely answers the question, output <answer>. . . </answer> immediately; do not call more tools.
• Put inside <answer>. . . </answer> only entity name(s) that appeared in tool response(s).
• If max steps are reached without a clear answer: <answer>Cannot find the answer from the knowledge graph.</answer>
USER PROMPT
Question: {question}
Entity info: {entity_info}
Please start by calling tools, then use the observations to decide the next step. Answer only after you have tool evidence.

Table 19. Prompt for trajectory distillation.

Reinforcement Learning. For RL, we adopt Verl ([30]) and initialize the policy from the SFT checkpoint. Training runs on a single node with 4×4 \times NVIDIA A100 (40 GB) GPUs, using FSDP with parameter and optimizer CPU offloading, and rollouts are executed with vLLM. For each question, the agent samples N=4N=4 trajectories with at most 10 KG interaction turns. KL regularization uses the k3k_3 estimator with coefficient 0.03, anchored to the SFT model. Table 11 and Table 12 summarize the detailed hyperparameter configurations used throughout our experiments, and Table Table 13 lists the coefficients of the composite reward in § 3.3.

ParameterValue
Fine-tuning methodLoRA
LoRA rank / alpha / dropout16 / 32 / 0.05
Max sequence length3,000
Training epochs3
Per-device batch size16
Gradient accumulation steps8
Learning rate5×10−55 \times10^{-5}
LR schedulerCosine, warmup ratio 0.1
Weight decay0.01
Gradient clipping1.0

Table 11. Hyperparameters of supervised fine-tuning.

ParameterValue
Actor learning rate1×10−61 \times10^{-6}
KL loss coefficient0.030.03 (κ3\kappa_3 type)
GRPO rollout NN44
Max interaction turns per question1010
Train batch size3232
PPO mini-batch size1616
Max prompt length4,0964{,}096
Max response length per step8,1928{,}192
Max observation length1,0241{,}024
Rollout temperature0.70.7
Total training steps450450
Hardware4×4 \times NVIDIA A100 (40 GB)

Table 12. Hyperparameters of reinforcement learning.

Reward termCoefficientValue
Answer F1 (RoutR_{\mathrm{out}})λf1\lambda_{\mathrm{f1}}0.70.7
Answer retrieval (RoutR_{\mathrm{out}})λret\lambda_{\mathrm{ret}}0.30.3
Step validity (RstepR_{\mathrm{step}})λstep\lambda_{\mathrm{step}}0.50.5
Evidence coverage (RecprR_{\mathrm{ecpr}})λecpr\lambda_{\mathrm{ecpr}}1.01.0

Table 13. Coefficients of the composite reward. Each coefficient weights one term of the reward in § 3.3.

Advantage Computation. The turn-level advantage in § 3.3 is computed as follows. (i) Return. The return Gi,tG_{i,t} in Equation (8) adds the immediate process rewards of turn tt to the outcome reward of the trajectory. We use neither discounting nor a reward-to-go, so the evidence reward of a turn is credited to that turn only. (ii) Normalization. The mean μq\mu_q and standard deviation σq\sigma_q are computed over all (trajectory, turn) pairs of the NN rollouts of the same question. Trajectories of different lengths need no padding, since each contributes as many returns as it has turns. (iii) Token mask. The advantage of a turn is broadcast to the tokens that the policy generates in that turn, i.e., its reasoning and its tool call or answer. Tool observations are part of the context but are masked out of the policy loss and the KL term. (iv) Objective. The policy maximizes

J(θ)=Eq,{τi}[1N∑i=1N1∣τi∣∑j=1∣τi∣min⁡(ρi,jA^i,t(j),clip⁡(ρi,j,1−ϵ,1+ϵ)A^i,t(j))]−βDKL(πθ∥πref)(18)\mathcal{J}(\theta) = \mathbb{E}_{q,\{\tau_i\}}\left[\frac{1}{N}\sum_{i=1}^{N}\frac{1}{\lvert\tau_i\rvert}\sum_{j=1}^{\lvert\tau_i\rvert}\min\left(\rho_{i,j}\hat{A}_{i,t(j)},\operatorname{clip}(\rho_{i,j},1-\epsilon,1+\epsilon)\hat{A}_{i,t(j)}\right)\right] - \beta D_{\mathrm{KL}}(\pi_\theta\mathbin{\|} \pi_{\mathrm{ref}}) \tag*{(18)}

where jj ranges over the ∣τi∣\lvert\tau_i\rvert policy-generated tokens, t(j)t(j) is the turn of token jj, ρi,j\rho_{i,j} is the probability ratio, and πref\pi_{\mathrm{ref}} is the SFT model. (v) Difference from trajectory-level credit. When the coverage reward is credited only to the final turn, the turns that actually retrieved the evidence receive the same return as the turns that did not, so the update cannot distinguish them. With first-match attribution, two trajectories with the same coverage still produce different per-turn returns, and the advantage concentrates on the queries that first reach gold triples.

Case Study

To better understand how much of the supporting evidence different methods retrieve from the KG, we present a case study on the question: “Which airline flies the Embraer 195 and is based at the airport named after Margaret Kenyatta’s father?” As shown in Table 14, Table 15, and Table 16, this question requires resolving the father, the airport named after him, and the airline that is based there and flies the aircraft. All three methods predict the correct answer, but they differ in how much of the evidence chain they recover.

Question: Which airline flies the Embraer 195 and is based at the airport named after Margaret Kenyatta’s father?
<think>I need to find an airline that satisfies two conditions: 1) flies the Embraer 195, and 2) is based at the airport named after Margaret Kenyatta’s father. Let me start by exploring the relationships around the first given entity to understand what information is stored about Margaret Kenyatta in the knowledge graph.</think>
<kg-query> find_outgoing_relations(entity_name=Margaret Kenyatta) </kg-query>
<information> Outgoing relations for entity Margaret Kenyatta: country of citizenship, father, given name, instance of, mother, occupation, sex or gender......... </information>
<think> The outgoing triple shows that Margaret Kenyatta has a "father" in the knowledge graph. Let me find out who her father is by querying the triple that directly connects Margaret Kenyatta to her father. </think>
<kg-query> get_tail_entities(head_entity_name=Margaret Kenyatta, relation_name=father) </kg-query>
<information> Entities outgoing via relation father from entity Margaret Kenyatta: Jomo Kenyatta.......... </information>
<think> Now I know Jomo Kenyatta is Margaret Kenyatta’s father. Next, I need to find the airport named after Jomo Kenyatta. Let me check what relationships exist for Jomo Kenyatta in the knowledge graph to see if there is an airport named after him. </think>
<kg-query> find_incoming_relations(entity_name=Jomo Kenyatta) </kg-query>
<information> Incoming relations for entity Jomo Kenyatta: father,named after,spouse.......... </information>
<think>I see that some entities have "named after" pointing to Jomo Kenyatta. Let me find out what entities are named after Jomo Kenyatta in the knowledge graph. </think>
<kg-query> get_head_entities(tail_entity_name=Jomo Kenyatta, relation_name=named after) </kg-query>
<information> Entities incoming via relation named after from entity Jomo Kenyatta: Jomo Kenyatta International Airport, Kenyatta International Convention Centre </information>
<think> Great! I found that Jomo Kenyatta International Airport is named after Jomo Kenyatta. Now I need to find which airline is based at Jomo Kenyatta International Airport. Let me check what outgoing relationships exist for Jomo Kenyatta International Airport to see if there is an airline based there. </think>
<kg-query> find_outgoing_relations(entity_name=Jomo Kenyatta International Airport) </kg-query>
<information> Outgoing relations for entity Jomo Kenyatta International Airport: country, instance of, located in the administrative territorial entity, named after......... </information>
<think> I don’t see a direct "airline based at" relationship listed for the airport. Let me check the incoming relationships to see if any airlines have "headquarters location" or similar relationships pointing to this airport. </think>
<kg-query> find_incoming_relations(entity_name=Jomo Kenyatta International Airport). </kg-query>
<information> Incoming relations for entity Jomo Kenyatta International Airport: airline hub </information>
<think> Perfect! I found that some airlines have "airline hub" pointing to Jomo Kenyatta International Airport. Let me find out which airlines have Jomo Kenyatta International Airport as their airline hub. </think>
<kg-query> get_head_entities(tail_entity_name=Jomo Kenyatta International Airport, relation_name=airline hub) </kg-query>
<information> Entities incoming via relation airline hub from entity Jomo Kenyatta International Airport: Kenya Airways </information>
<think> Now I have Kenya Airways as the airline based at Jomo Kenyatta International Airport. Finally, I need to verify that Kenya Airways also flies the Embraer 195. Let me check what aircraft types Kenya Airways operates by looking at its outgoing relationships. </think>
<kg-query> find_outgoing_relations(entity_name=Kenya Airways) </kg-query>
<information> Outgoing relations for entity Kenya Airways: airline alliance, airline hub, country, instance of, item operated .......... </information>
<think> I see that Kenya Airways has "item operated" as an outgoing relationship. Let me find out what items (likely aircraft) Kenya Airways operates. </think>
<kg-query> get_tail_entities(head_entity_name=Kenya Airways, relation_name=item operated) </kg-query>
<information> Entities outgoing via relation item operated from entity Kenya Airways: Boeing 737 Classic,Boeing 737 Next Generation,Boeing 767,Boeing 777,Boeing 787 Dreamliner,Embraer 195 </information>
<think> I now have enough grounded evidence to give the answer. </think>
<answer> ["Kenya Airways"] </answer>

Table 14. Case study of FoG. The trajectory recovers the complete gold evidence before answering.

QuestionWhich airline flies the Embraer 195 and is based at the airport named after Margaret Kenyatta’s father?
Reasoning chains:Turn 1: ‘Margaret Kenyatta -> father -> Jomo Kenyatta‘; ‘Margaret Kenyatta -> country of citizenship -> Kenya‘; ‘Embraer 195 -> subclass of -> E-Jet‘; ‘Margaret Kenyatta -> occupation -> diplomat‘; ‘Margaret Kenyatta -> occupation -> politician‘;
Turn 2: ‘Kenya -> named after -> Mount Kenya‘; ‘diplomat -> named after -> Diplomatstaden‘; ‘E-Jet -> manufacturer -> Embraer‘; ‘politician -> category combines topics -> Category:Dutch politicians‘; ‘Jomo Kenyatta -> country of citizenship -> Kenya‘;
Turn 3: ‘Mount Kenya -> country -> Kenya‘; ‘Embraer -> headquarters location -> São José dos Campos‘; ‘Category:Dutch politicians -> is a list of -> human‘; ‘Kenya -> named after -> Mount Kenya‘; ‘Diplomatstaden -> located in the administrative territorial entity -> Stockholm Municipality‘;
Turn 4: ‘Kenya -> named after -> Mount Kenya‘; ‘Mount Kenya -> country -> Kenya‘; ‘Kenya -> capital -> Nairobi‘; ‘São José dos Campos -> country -> Brazil‘; ‘São José dos Campos -> located in the administrative territorial entity -> São Paulo‘;
<answer>First, the airline that flies the Embraer 195 is Kenya Airways. Second, the airport named after Margaret Kenyatta’s father is Jomo Kenyatta International Airport. The answer is {Kenya Airways}</answer>

Table 15. Case study of ToG. The trajectory reaches the correct answer while covering only the first part of the gold evidence.

QuestionWhich airline flies the Embraer 195 and is based at the airport named after Margaret Kenyatta’s father?
Reasoning chains:Turn 1: Embraer 195 -> item operated -> Kenya Airways;
<answer>Kenya Airways operates the Embraer 195 and is based at Jomo Kenyatta International Airport, which is named after Margaret Kenyatta’s father. The answer is {Kenya Airways}</answer>

Table 16. Case study of PoG. The trajectory reaches the correct answer through a shortcut retrieval and misses the bridge evidence.

FoG recovers the complete gold evidence. It issues nine KG turns and grounds each hop in the triples returned by the previous one, so every link of the chain can be read from the trajectory.

In contrast, ToG performs four rounds of beam search but recovers only one relevant triple, missing the links for airport naming and airline hub, so its answer relies mainly on parametric knowledge. PoG answers after a single retrieval step, leaving an evidence chain that cannot be audited from the trajectory. This case highlights the strength of FoG in reaching the answer through evidence that is fully retrieved from the KG.

Prompts Used in FoG

Seed Question Generation Prompt

As shown in Table 17, this prompt is designed for generating seed questions from a sampled subgraph. It guides the teacher to return a question, its logical form, and its supporting triples, which corresponds to TgenT_{\mathrm{gen}} in Equation (1).

Seed Question Generation Prompt
SYSTEM PROMPT
You are a question synthesis expert. You are deeply familiar with the structure of the Wikidata knowledge graph and specialize in constructing questions based on given triple information.
Core Concept Definitions
Three Entity Roles in this task:
• Constraint Entity (Con@). The starting point of the question; an entity the user already knows that must be explicitly mentioned. It anchors the context of the question.
• Intermediate Entity (Mid@). The intermediate node in the reasoning chain, obtained through the first reasoning step from the constraint entity. It connects two reasoning steps and must be inferred by the user, never stated explicitly.
• Answer Entity (Ans@). The endpoint of the reasoning chain and the final answer requested by the user.
Triple Selection Principles
• Subset selection. Select a subset of triples from the given set as the evidence basis. Prefer strong constraints that lead to clear, unambiguous answers.
• Avoid redundancy. If a triple already infers B from A, do not select another path that also infers B (no shortcuts allowed).
• Necessity. Every selected triple must contribute to the reasoning chain; no irrelevant triples are permitted.
Question Design Principles
• Information sources. All information must come exclusively from the selected triples. No external knowledge may be used; the question must be verifiable via a SPARQL query on Wikidata.
• Reasoning forms. The question may adopt single-hop reasoning, multi-hop reasoning, intersection queries, union queries, counting, or reverse reasoning.
• Answer requirements. The answer must be derived entirely from selected triples and directly verifiable via a SPARQL query.
• Path guidelines. A Path is an explanation of the reasoning process, expressed as a reasoning chain describing how the answer is derived.
SPARQL Query Requirements
• The generated SPARQL must be syntactically correct and executable on the Wikidata Query Service (WDQS).
• Query results must accurately correspond to the answer of the question.
• For multi-hop questions, the SPARQL must clearly reflect intermediate variables in the reasoning process.
Entity Usage Rules in Questions
✓ Only constraint entities (question premises) may be explicitly mentioned.
✓ The question must ask for the answer entity (final target).
× The specific name of any intermediate entity must never appear explicitly in the question.
× Intermediate entities must only be implicitly implied through relational wording.
× Avoid redundancy: if the answer can be uniquely determined with fewer triples or entities, the question is redundant and must be revised.
USER PROMPT
Relevant Triple Information:
#{Relevant triple information}

Table 17. Prompt for seed question generation.

Backward Expansion Prompt

As shown in Table 18, this prompt is used by the backward-expansion agent. The agent is instructed to select an anchor entity, retrieve its neighborhood, generate a sub-question whose answer is the anchor, and verify the result, retrying on failure.

Complex Question Generation Prompt
SYSTEM PROMPT
You are an expert agent specializing in Knowledge Graph Question Answering (KGQA) data synthesis. Select an Anchor Node from a given set of entities and generate a high-quality sub-question that can uniquely identify/locate this anchor entity within the Knowledge Graph.
Standard Operating Procedure:
Step 1 Select an entity as the Anchor Node and call retrieve_entity_neighborhood to fetch its neighboring triples.
Step 2 Call select_triples_and_generate_subquestion to choose relevant triples and generate the sub-question.
Step 3 Call verify_subquestion to validate the accuracy and check for redundancy of the generated question.
Step 4 If validation passes, return the final result in <answer>{. . . }</answer> format. If it fails, return to Step 2 and retry.
Strict Constraints:
Prohibited:
× No shortcuts. Do not skip any steps or generate the final answer directly.
× No tool-less answers. Never return <answer> without having successfully executed the required tool calls.
× No preconceptions. Do not assume or hallucinate knowledge before receiving tool outputs.
× Redundancy rule. If verify_subquestion flags the question as “redundant,” it means the anchor entity can be uniquely identified using fewer triples or fewer entities in the question. You must retry Step 2.
Required:
✓ Sequential execution. Strictly follow the 1 → 2 → 3 → 4 workflow.
✓ Careful observation. Analyze the output of each tool before proceeding to the next step.
✓ Final approval. Only output the final result after verify_subquestion returns a success status.
USER PROMPT
Output Format:
The final answer must be returned as a JSON object wrapped within <answer></answer> tags:
JSON Format
If a question cannot be generated, return: <answer>do not generate question</answer>
Input Entity Information:
Please select one entity from the list below to serve as the Anchor Node (the answer entity) and generate a sub-question for it:
{entity_info}

Table 18. Prompt for backward expansion.

Trajectory Distillation Prompt

As shown in Table 19, this prompt is used to distill the teacher trajectories for SFT. The teacher is instructed to explore the KG only through the provided tools, explain each call, and answer with entities that appear in the tool responses.

Agent Prompt

As shown in Table 20, this prompt is used by the FoG agent in both training and evaluation. It guides the agent to analyze the question, call the KG operations, and answer from the returned triples.

FoG Training and Evaluation Prompt
SYSTEM PROMPT
You are a knowledge graph question answering assistant. You answer user questions by interacting with a knowledge graph. When a user provides a question and its associated entities, you call tools to query the knowledge graph accordingly. No matter how complex the question is, you will not give up until you believe an answer can be found based on the available information.<br><br>• Comprehensive analysis. Combine external triple information obtained through tools to perform analysis and provide a complete answer.<br>• Working principles. Clearly analyze the problem, select appropriate tools, invoke them to obtain information, and ensure the problem is solved efficiently.
USER PROMPT
<tools> tools definition </tools><br><br>The assistant operates in one or more cycles of (thinking → tool call → tool response), followed by a final (thinking → answer) step. All intermediate processes are enclosed within their respective tags. Multiple thinking steps, tool calls, and responses may appear in sequence.<br><br>Example Response:<br><think> thinking process here </think><br><kg-query>{"name": "tool name", "arguments": {"param": value, ...}}</kg-query><br><information> tool_response here </information><br><br><think> thinking process here </think><br><kg-query> {"name": "another tool name", "arguments": {...}} </kg-query><br><information> tool_response here </information><br>... (more thinking, tool calls, and responses) ...<br><think> thinking process here </think><br><answer> answer here </answer><br><br>User Input:<br>Question: {question}<br>Entity info {entity_name}

Table 20. Prompt of the FoG agent in training and evaluation.

References

  1. [1]Garima Agrawal, Tharindu Kumarage, Zeyad Alghamdi, and Huan Liu. 2024. Mindful-rag: A study of points of failure in retrieval augmented generation. In 2nd International Conference on Foundation and Large Language Models, FLLM 2024, Dubai, United Arab Emirates, November 26-29, 2024, pages 607–611. IEEE.arxiv.org/abs/2407.12216
  2. [2]Aisha Alansari and Hamzah Luqman. 2026. Large language models hallucination: A comprehensive survey. Comput. Sci. Rev., 61:100970.arxiv.org/abs/2510.06265
  3. [3]Laura Cabello, Carmen Martin-Turrero, Uchenna Akujuobi, Anders Søg aard, and Carlos Bobed. 2024. MEG: medical knowledge-augmented large language models for question answering. CoRR, abs/2411.03883.arxiv.org/abs/2411.03883
  4. [4]Alberto Cattaneo, Carlo Luschi, and Daniel Justus. 2026. Ground-truth subgraphs for better training and evaluation of knowledge graph augmented llms. Trans. Mach. Learn. Res., 2026.arxiv.org/abs/2511.04473
  5. [5]Liyi Chen, Panrong Tong, Zhongming Jin, Ying Sun, Jieping Ye, and Hui Xiong. 2024. Plan-on-graph: Self-correcting adaptive planning of large language model on knowledge graphs. In Advances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024.arxiv.org/abs/2410.23875
  6. [6]Zhuo Chen, Fei Wang, Zixuan Li, Zhao Zhang, Weiwei Ding, Chuangang Yang, YongJun Xu, Xiaolong Jin, and Jiafeng Guo. 2025. Knowcoder-a1: Incentivizing agentic reasoning capability with outcome supervision for KBQA. CoRR, abs/2510.25101.arxiv.org/abs/2510.25101
  7. [7]DeepSeek-AI. 2024. Deepseek-v3 technical report. CoRR, abs/2412.19437.arxiv.org/abs/2412.19437
  8. [8]Ritam Dutt, Sopan Khosla, Vinayshekhar Bannihatti Kumar, and Rashmi Gangadharaiah. 2023. Grailqa++: A challenging zero-shot benchmark for knowledge base question answering. In Proceedings of the 13th International Joint Conference on Natural Language Processing and the 3rd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics, IJCNLP 2023 - Volume 1: Long Papers, Nusa Dua, Bali, November 1 - 4, 2023, pages 897–909. Association for Computational Linguistics.
  9. [9]GLM. 2025. GLM-4.5: agentic, reasoning, and coding (ARC) foundation models. CoRR, abs/2508.06471.arxiv.org/abs/2508.06471
  10. [11]Haoyu Han, Kai Guo, Harry Shomer, Yu Wang, Yucheng Chu, Hang Li, Li Ma, and Jiliang Tang. 2026. Reasoning by exploration: A unified approach to retrieval and generation over graphs. In Proceedings of the ACM Web Conference 2026, WWW 2026, Dubai, United Arab Emirates, originally scheduled for April 13-17, 2026, rescheduled for June 29 - July 3, 2026, pages 2408–2418. ACM.arxiv.org/abs/2510.07484
  11. [12]Xiaoxin He, Yijun Tian, Yifei Sun, Nitesh V. Chawla, Thomas Laurent, Yann LeCun, Xavier Bresson, and Bryan Hooi. 2024. G-retriever: Retrieval-augmented generation for textual graph understanding and question answering. In Advances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024.arxiv.org/abs/2402.07630
  12. [13]Peng Hu, Changjiang Gao, Ruiqi Gao, Jiajun Chen, and Shujian Huang. 2024. Large language models are limited in out-of-context knowledge reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2024, Miami, Florida, USA, November 12-16, 2024, volume EMNLP 2024 of Findings of ACL, pages 3144–3155. Association for Computational Linguistics.arxiv.org/abs/2406.07393
  13. [14]Lei Huang, Weijiang Yu, Weitao Ma, Weihong Zhong, Zhangyin Feng, Haotian Wang, Qianglong Chen, Weihua Peng, Xiaocheng Feng, Bing Qin, and Ting Liu. 2025. A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions. ACM Trans. Inf. Syst., 43(2):42:1–42:55.DOI
  14. [15]Jinhao Jiang, Kun Zhou, Xin Zhao, Yang Song, Chen Zhu, Hengshu Zhu, and Ji-Rong Wen. 2025. Kg-agent: An efficient autonomous agent framework for complex reasoning over knowledge graph. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2025, Vienna, Austria, July 27 - August 1, 2025, pages 9505–9523. Association for Computational Linguistics.arxiv.org/abs/2402.11163
  15. [16]Bowen Jin, Chulin Xie, Jiawei Zhang, Kashob Kumar Roy, Yu Zhang, Zheng Li, Ruirui Li, Xianfeng Tang, Suhang Wang, Yu Meng, and Jiawei Han. 2024. Graph chain-of-thought: Augmenting large language models by reasoning on graphs. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, volume ACL 2024 of Findings of ACL, pages 163–184. Association for Computational Linguistics.arxiv.org/abs/2404.07103
  16. [17]Maël Jullien, Marco Valentino, and André Freitas. 2025. The knowledge-reasoning dissociation: Fundamental limitations of llms in clinical natural language inference. CoRR, abs/2508.10777.arxiv.org/abs/2508.10777
  17. [18]Mufei Li, Siqi Miao, and Pan Li. 2025. Simple is effective: The roles of graphs and large language models in knowledge-graph-based retrieval-augmented generation. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net.arxiv.org/abs/2410.20724
  18. [19]Junhong Lin, Shicheng Liu, Jinyeop Song, Song Wang, Julian Shun, and Yada Zhu. 2025. Efficient and transferable agentic knowledge graph rag via reinforcement learning. arXiv preprint arXiv:2509.26383.arxiv.org/abs/2509.26383
  19. [20]Yu Liu, Xixun Lin, Yanmin Shang, Yangxi Li, Shi Wang, and Yanan Cao. 2026. Pathmind: A retrieve-prioritize-reason framework for knowledge graph reasoning with large language models. In Fortieth AAAI Conference on Artificial Intelligence, Thirty-Eighth Conference on Innovative Applications of Artificial Intelligence, Sixteenth Symposium on Educational Advances in Artificial Intelligence, AAAI 2026, Singapore, January 20-27, 2026, pages 15386–15393. AAAI Press.
  20. [21]Linhao Luo, Yuan-Fang Li, Gholamreza Haffari, and Shirui Pan. 2024. Reasoning on graphs: Faithful and interpretable large language model reasoning. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.arxiv.org/abs/2310.01061
  21. [22]Linhao Luo, Zicheng Zhao, Gholamreza Haffari, Yuan-Fang Li, Chen Gong, and Shirui Pan. 2025. Graph-constrained reasoning: Faithful reasoning on knowledge graphs with large language models. In Forty-second International Conference on Machine Learning, ICML 2025, Vancouver, BC, Canada, July 13-19, 2025, volume 267 of Proceedings of Machine Learning Research. PMLR / OpenReview.net.arxiv.org/abs/2410.13080
  22. [23]Costas Mavromatis and George Karypis. 2025. GNN-RAG: graph neural retrieval for efficient large language model reasoning on knowledge graphs. In Findings of the Association for Computational Linguistics, ACL 2025, Vienna, Austria, July 27 - August 1, 2025, volume ACL 2025 of Findings of ACL, pages 16682–16699. Association for Computational Linguistics.
  23. [24]Iman Mirzadeh, Keivan Alizadeh, Hooman Shahrokhi, Oncel Tuzel, Samy Bengio, and Mehrdad Farajtabar. 2025. Gsm-symbolic: Understanding the limitations of mathematical reasoning in large language models. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net.arxiv.org/abs/2410.05229
  24. [25]Thi Nguyen, Linhao Luo, Fatemeh Shiri, Dinh Phung, Yuan-Fang Li, Thuy-Trang Vu, and Gholamreza Haffari. 2024. Direct evaluation of chain-of-thought in multi-hop reasoning with knowledge graphs. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, volume ACL 2024 of Findings of ACL, pages 2862–2883. Association for Computational Linguistics.
  25. [26]OpenAI. 2023. GPT-4 technical report. CoRR, abs/2303.08774.arxiv.org/abs/2303.08774
  26. [27]Shirui Pan, Linhao Luo, Yufei Wang, Chen Chen, Jiapu Wang, and Xindong Wu. 2024. Unifying large language models and knowledge graphs: A roadmap. IEEE Trans. Knowl. Data Eng., 36(7):3580–3599.DOI
  27. [28]Fabio Petroni, Aleksandra Piktus, Angela Fan, Patrick Lewis, Majid Yazdani, Nicola De Cao, James Thorne, Yacine Jernite, Vladimir Karpukhin, Jean Maillard, Vassilis Plachouras, Tim Rocktäschel, and Sebastian Riedel. 2021. KILT: a benchmark for knowledge intensive language tasks. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, pages 2523–2544. Association for Computational Linguistics.arxiv.org/abs/2009.02252
  28. [29]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. 2024. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. CoRR, abs/2402.03300.arxiv.org/abs/2402.03300
  29. [30]Guangming Sheng, Chi Zhang, Zilingfeng Ye, Xibin Wu, Wang Zhang, Ru Zhang, Yanghua Peng, Haibin Lin, and Chuan Wu. 2025. Hybridflow: A flexible and efficient RLHF framework. In Proceedings of the Twentieth European Conference on Computer Systems, EuroSys 2025, Rotterdam, The Netherlands, 30 March 2025 - 3 April 2025, pages 1279–1297. ACM.DOI
  30. [31]Yanlin Song, Ben Liu, Víctor Gutiérrez-Basulto, Zhiwei Hu, Qianqian Xie, Min Peng, Sophia Ananiadou, and Jeff Z. Pan. 2026. Plan then retrieve: Reinforcement learning-guided complex reasoning over knowledge graphs. In Proceedings of the ACM Web Conference 2026, WWW 2026, Dubai, United Arab Emirates, originally scheduled for April 13-17, 2026, rescheduled for June 29 - July 3, 2026, pages 3666–3676. ACM.arxiv.org/abs/2510.20691
  31. [32]Yuan Sui, Yufei He, Nian Liu, Xiaoxin He, Kun Wang, and Bryan Hooi. 2025. Fidelis: Faithful reasoning in large language models for knowledge graph question answering. In Findings of the Association for Computational Linguistics, ACL 2025, Vienna, Austria, July 27 - August 1, 2025, volume ACL 2025 of Findings of ACL, pages 8315–8330. Association for Computational Linguistics.
  32. [33]Jia Ao Sun, Hao Yu, Fengran Mo, Zhan Su, Yuchen Hui, Bang Liu, and Jian-Yun Nie. 2026a. Search-on-graph-rl: Training large language models to search knowledge graphs with reinforcement learning. CoRR, abs/2607.18481.
  33. [34]Jiashuo Sun, Chengjin Xu, Lumingyuan Tang, Saizhuo Wang, Chen Lin, Yeyun Gong, Lionel M. Ni, Heung-Yeung Shum, and Jian Guo. 2024. Think-on-graph: Deep and responsible reasoning of large language model on knowledge graph. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.arxiv.org/abs/2307.07697
  34. [35]Tianda Sun and Dimitar Kazakov. 2026. Peak-then-collapse and the four interface channels of knowledge-graph tool use. CoRR, abs/2605.26037.arxiv.org/abs/2605.26037
  35. [37]Xin Sun, Jianan Xie, Zhongqi Chen, Qiang Liu, Shu Wu, Bowen Song, Weiqiang Wang, Zilei Wang, and Liang Wang. 2026b. GAPdl: goal-action policy distillation for agentic reinforcement learning in knowledge base question answering. CoRR, abs/2605.29584.arxiv.org/abs/2605.29584
  36. [38]Alon Talmor and Jonathan Berant. 2018. The web as a knowledge-base for answering complex questions. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 641–651. Association for Computational Linguistics.arxiv.org/abs/1803.06643
  37. [39]Kimi Team. 2025a. Kimi K2: open agentic intelligence. CoRR, abs/2507.20534.
  38. [40]Qwen Team. 2025b. Qwen3 technical report. CoRR, abs/2505.09388.
  39. [41]Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurélien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. 2023. Llama: Open and efficient foundation language models. CoRR, abs/2302.13971.arxiv.org/abs/2302.13971
  40. [42]Ricardo Usbeck, Xi Yan, Aleksandr Perevalov, Longquan Jiang, Julius Schulz, Angelie Kraft, Cedric Möller, Junbo Huang, Jan Reineke, Axel Cyrille Ngonga Ngomo, Muhammad Saleem, and Andreas Both. 2024. QALD-10 - the 10th challenge on question answering over linked data: Shifting from dbpedia to wikidata as a KG for KGQA. Semantic Web, 15(6):2193–2207.
  41. [43]Shuai Wang and Yinan Yu. 2026a. Kg-hopper: Empowering compact open llms with knowledge graph reasoning via reinforcement learning. CoRR, abs/2603.21440.arxiv.org/abs/2603.21440
  42. [44]Shuai Wang and Yinan Yu. 2026b. Kg-reasoner: A reinforced model for end-to-end multi-hop knowledge graph reasoning. CoRR, abs/2604.12487.arxiv.org/abs/2604.12487
  43. [45]Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.arxiv.org/abs/2203.11171
  44. [46]Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le, and Denny Zhou. 2022. Chain-of-thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.arxiv.org/abs/2201.11903
  45. [47]Shuwen Xu, Yao Xu, Jiaxiang Liu, Chenhao Yuan, Wenshuo Peng, Jun Zhao, and Kang Liu. 2026. Graphwalker: Agentic knowledge graph question answering via synthetic trajectory curriculum. CoRR, abs/2603.28533.arxiv.org/abs/2603.28533
  46. [48]Silei Xu, Shicheng Liu, Theo Culhane, Elizaveta Pertseva, Meng-Hsi Wu, Sina J. Semnani, and Monica S. Lam. 2023. Fine-tuned llms know more, hallucinate less with few-shot sequence-to-sequence semantic parsing over wikidata. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, pages 5778–5791. Association for Computational Linguistics.
  47. [49]Shiqi Yan, Yubo Chen, Ruiqi Zhou, Zhengxi Yao, Shuai Chen, Tianyi Zhang, Shijie Zhang, Wei Qiang Zhang, Yongfeng Huang, Haixin Duan, and Yunqi Zhang. 2026. Explore-on-graph: Incentivizing autonomous exploration of large language models on knowledge graphs with path-refined reward modeling. In The Fourteenth International Conference on Learning Representations, ICLR 2026, Rio de Janeiro, Brazil, April 23-27, 2026. proceedings.iclr.cc.arxiv.org/abs/2602.21728
  48. [50]Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Tom Griffiths, Yuan Cao, and Karthik Narasimhan. 2023a. Tree of thoughts: Deliberate problem solving with large language models. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.arxiv.org/abs/2305.10601
  49. [51]Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R. Narasimhan, and Yuan Cao. 2023b. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.arxiv.org/abs/2210.03629
  50. [52]Wen-tau Yih, Matthew Richardson, Christopher Meek, Ming-Wei Chang, and Jina Suh. 2016. The value of semantic parse labeling for knowledge base question answering. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 2: Short Papers. The Association for Computer Linguistics.DOI
  51. [53]Liangliang Zhang, Zhuorui Jiang, Hongliang Chi, Haoyang Chen, Mohammed Elkoumy, Fali Wang, Qiong Wu, Zhengyi Zhou, Shirui Pan, Suhang Wang, and Yao Ma. 2025. Diagnosing and addressing pitfalls in KG-RAG datasets: Toward more reliable benchmarking. In Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2025, NeurIPS 2025, San Diego, CA, USA, December 2-7, 2025 / Mexico City, Mexico, November 30 - December 5, 2025.arxiv.org/abs/2505.23495
  52. [54]Yaowei Zheng, Richong Zhang, Junhao Zhang, Yanh an Ye, and Zheyan Luo. 2024. Lamafactory: Unified efficient fine-tuning of 100+ language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations), ACL 2024, Bangkok, Thailand, August 11-16, 2024, pages 400–410. Association for Computational Linguistics.

Paper details

vlnc:W_crger9c8
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents