Research
PathMind: A Retrieve-Prioritize-Reason Framework for Knowledge Graph Reasoning with Large Language Models
PathMind: A Retrieve-Prioritize-Reason Framework for Knowledge Graph Reasoning with Large Language Models Overview Research area: Knowledge graph reasoning (KGR) with large language models, combining
- arXiv
- 2511.14256
- Published
- 2025-11-18
- Authors
- Yu Liu, Xixun Lin, Yanmin Shang, Yangxi Li, Shi Wang, Yanan Cao
AI summary
PathMind: A Retrieve-Prioritize-Reason Framework for Knowledge Graph Reasoning with Large Language ModelsOverview
Research area: Knowledge graph reasoning (KGR) with large language models, combining graph retrieval, graph neural networks, and preference-based LLM fine-tuning.
Technical level: Intermediate. Readers will benefit from familiarity with knowledge graphs, graph neural networks, retrieval-augmented generation, supervised fine-tuning, and Direct Preference Optimization (DPO).
Scope: The paper proposes PathMind, a three-stage "Retrieve-Prioritize-Reason" framework that selects important reasoning paths from knowledge graphs to guide an LLM, and evaluates it on the WebQSP and CWQ benchmarks against traditional and LLM-based KGR baselines.
What This Paper Is About
Knowledge graph reasoning means inferring new facts or answering multi-hop questions by following chains of relationships through a structured knowledge graph. Existing LLM-based approaches either retrieve paths indiscriminately — flooding the model with irrelevant or misleading evidence — or let an LLM endlessly explore the graph, which is computationally expensive. PathMind's goal is to pick out the small set of genuinely important reasoning paths and use them to steer an LLM toward accurate, interpretable answers without repeated LLM calls.
Key Contributions
- A new framework (PathMind) that guides LLMs with important reasoning paths to improve both faithfulness and interpretability of knowledge graph reasoning.
- A path prioritization mechanism built on a semantic-aware path priority function that simultaneously models the accumulative cost up to a current node and an estimated future cost to reach the target answer, inspired by the A* path-planning algorithm.
- A dual-phase training strategy for the reasoning module, consisting of task-specific instruction tuning (supervised fine-tuning) followed by path-wise preference alignment with DPO, which avoids the overhead of multiple LLM calls.
- Extensive empirical validation on WebQSP and CWQ showing competitive performance against strong baselines, particularly on complex reasoning tasks and with fewer input tokens.
Main Findings
-
Overall benchmark results: PathMind achieves 0.895 Hits@1 and 0.728 F1 on WebQSP, and 0.707 Hits@1 and 0.614 F1 on CWQ. The paper reports 0.8% Hits@1 improvement over the second-best method, EPERM, on WebQSP, and 5.1% Hits@1 and 3.9% F1 improvement over GNN-RAG on CWQ (GNN-RAG scores 0.673 Hits@1 and 0.591 F1).
-
Complex questions benefit most: The gains are larger on CWQ, which the paper describes as the more challenging multi-hop dataset, than on WebQSP.
-
Retrieval-based methods beat embedding-based methods: Among traditional baselines, SR+NSM (which uses path retrieval) outperforms embedding-based approaches, which the authors cite as evidence for the value of reasoning paths.
-
LLMs alone fall short: Llama-3.1-8B (0.555 Hits@1 on WebQSP, 0.281 on CWQ) and GPT-4o (0.618 on WebQSP, 0.382 on CWQ) leave a significant gap compared to the best fine-tuned models.
-
GCR trades coverage for precision: GCR reaches a high Hits@1 (0.883 on WebQSP, 0.686 on CWQ) but a relatively low F1 (0.654 on WebQSP, 0.532 on CWQ), which the authors attribute to the model focusing on the most probable single answer.
-
Every module matters (ablation): Removing path prioritization drops WebQSP to 0.840 Hits@1 / 0.662 F1 and CWQ to 0.643 / 0.561; removing DPO alignment gives 0.871 / 0.695 and 0.672 / 0.586; removing training entirely gives 0.668 / 0.480 and 0.413 / 0.274.
-
Important paths beat alternative selection strategies: Random paths score only 0.356 Hits@1 / 0.104 F1 on WebQSP and 0.268 / 0.079 on CWQ; shortest paths (from GNN-RAG) score 0.854 / 0.681 and 0.662 / 0.578; important paths score 0.895 / 0.728 and 0.707 / 0.614.
-
Both cost terms are needed: Using only the accumulative cost yields 0.878 Hits@1 / 0.714 F1 on WebQSP and 0.683 / 0.602 on CWQ; using only the future cost yields 0.831 / 0.672 and 0.635 / 0.576; combining both ("Full Costs") yields the best numbers.
-
Node selection has a sweet spot: Performance improves as the number of selected nodes K increases, but F1 on both datasets declines once K exceeds 3, so the authors set K = 3.
-
Cross-LLM generalizability: With Llama2-7B, PathMind scores 0.864 Hits@1 / 0.687 F1 on WebQSP and 0.652 / 0.573 on CWQ; with Qwen2-7B, 0.872 / 0.693 and 0.665 / 0.580; with Llama3.1-8B, 0.895 / 0.728 and 0.707 / 0.614.
-
Efficiency on WebQSP: PathMind runs in 2.23 seconds with 1 LLM call and 216 input tokens, compared with ToG at 16.14 seconds, 11.6 calls, and 7,069 tokens; PoG at 16.80 seconds, 9.0 calls, and 5,518 tokens; GCR at 3.60 seconds, 2 calls, and 231 tokens; GNN-RAG at 1.52 seconds, 1 call, and 414 tokens; and RoG at 2.60 seconds, 2 calls, and 521 tokens.
-
Scalability: PathMind consistently surpasses RoG across different numbers of reasoning hops and different numbers of answers on CWQ. WebQSP is dominated by simple questions (65.5% one-hop, 34.5% two-hop, 0% three-hop or more), whereas CWQ contains more multi-hop questions.
-
Qualitative behavior: In case studies on CWQ, PathMind extracts a correct two-hop path for a Fredbird/St. Louis Cardinals/Busch Stadium question, succeeds despite noisy paths containing multiple facts about "the child of Walt Disney," and fails in one case because the necessary path (Dennis Daugaard → gov. pos. held → South Dakota) was missing from the retrieved evidence.
Methodology in Plain English
PathMind works in three stages.
Stage 1 — Subgraph retrieval. For each topic entity in the question, the system collects its k-hop neighborhood from the knowledge graph (the implementation samples 3-hop neighborhoods), takes the union across topic entities, keeps all edges connecting those nodes, and thereby builds a query subgraph. A graph neural network with message passing then learns vector representations for the entities and relations in that subgraph. The query itself is encoded with a pre-trained BERT model.
Stage 2 — Path prioritization. Borrowing the idea behind A* search, the system scores each candidate entity by adding two quantities: the accumulative cost from the query to that entity (built by summing query-conditioned representations of the triples along all paths reaching it) and an estimated future cost to the target (produced by a feed-forward network that compares the current representation with the query representation — if the two are similar, the remaining distance is judged to be near zero). These two terms are summed, passed through a multi-layer perceptron, and squashed by a sigmoid into a priority score between 0 and 1. The model is trained with a binary-style loss that pushes scores high for entities in the answer set and low for all other entities in the subgraph. At each iteration, the top-K entities are selected, and the process repeats for T iterations (T = 2 for WebQSP, T = 4 for CWQ, K = 3).
Stage 3 — Knowledge reasoning. The selected paths are verbalized into text prompts. An LLM (Llama3.1-8B in the main experiments) is first fine-tuned with supervised instruction tuning on query–answer pairs, then further aligned with Direct Preference Optimization, where the prioritized paths serve as the preferred examples and paths sampled from the remaining subgraph candidates serve as the less preferred examples. Training uses 3 epochs, batch size 2, learning rate 2e-5, warm-up ratio 3e-2, DPO learning rate 5e-6, β = 0.1, a maximum input length of 2048 tokens, and two NVIDIA A800 GPUs, implemented in PyTorch. Evaluation uses Hits@1 and F1 on WebQSP and CWQ.
Why This Matters
Impact on research. The paper targets a specific weakness in retrieval-augmented KGR — treating every retrieved path as equally useful — and shows that a learned, semantics-aware priority score over paths yields better accuracy than shortest-path or random selection. It also demonstrates that a single-call retrieval-augmented pipeline can rival iterative, multi-call agent frameworks on accuracy while using far fewer tokens, which reframes the efficiency-versus-accuracy trade-off in this literature.
Real-world applications (the paper names knowledge graph reasoning as supporting these areas):
- Recommendation systems that rely on structured entity relationships.
- Question answering over knowledge bases, especially multi-hop questions.
- Biomedical inference from structured knowledge.
- Any setting where an assistant must answer a multi-hop question without paying for many sequential LLM calls.
Industry relevance. Table 5 is the practically salient result: 216 input tokens and a single LLM call per query versus 7,069 tokens and 11.6 calls for ToG. For deployed systems, token count and call count translate directly into latency and cost, so a method that improves Hits@1 while reducing token usage is attractive for production knowledge assistants.
Future Directions
-
Improving path recall. The authors' own failure case shows the model cannot recover when an important path is absent from the retrieved subgraph, so better subgraph coverage or retrieval expansion is a natural next step.
-
Scaling to larger and more complex graphs. The paper reports scalability analysis over reasoning hops and answer counts on CWQ, but the truncated content does not report results for graphs beyond the benchmark datasets, leaving behavior on much larger real-world KGs as an open question.
-
Generalizing to more backbones and settings. Transferability was tested on Llama2-7B, Qwen2-7B, and Llama3.1-8B; whether the framework holds for other model families or sizes is untested here.
-
Understanding the limits of the priority function. The paper does not include an explicit future work section, but the ablation showing that only 0.840 (WebQSP) and 0.643 (CWQ) Hits@1 remain without prioritization suggests further work on the cost function and on mitigating noise in retained paths.
Target Audience
Researchers and practitioners working on knowledge graph reasoning, retrieval-augmented generation, or graph-augmented LLM systems. It is also relevant to engineers building cost-sensitive question-answering pipelines over structured data, and to readers interested in preference optimization (DPO) applied to structured evidence rather than free-form text. Readers without background in knowledge graphs or GNNs will find the methodology sections dense, though the high-level Retrieve-Prioritize-Reason structure is approachable.
Authors’ abstract
Knowledge graph reasoning (KGR) is the task of inferring new knowledge by performing logical deductions on knowledge graphs. Recently, large language models (LLMs) have demonstrated remarkable performance in complex reasoning tasks. Despite promising success, current LLM-based KGR methods still face two critical limitations. First, existing methods often extract reasoning paths indiscriminately, without assessing their different importance, which may introduce irrelevant noise that misleads LLMs. Second, while many methods leverage LLMs to dynamically explore potential reasoning paths, they require high retrieval demands and frequent LLM calls. To address these limitations, we propose PathMind, a novel framework designed to enhance faithful and interpretable reasoning by selectively guiding LLMs with important reasoning paths. Specifically, PathMind follows a "Retrieve-Prioritize-Reason" paradigm. First, it retrieves a query subgraph from KG through the retrieval module. Next, it introduces a path prioritization mechanism that identifies important reasoning paths using a semantic-aware path priority function, which simultaneously considers the accumulative cost and the estimated future cost for reaching the target. Finally, PathMind generates accurate and logically consistent responses via a dual-phase training strategy, including task-specific instruction tuning and path-wise preference alignment. Extensive experiments on benchmark datasets demonstrate that PathMind consistently outperforms competitive baselines, particularly on complex reasoning tasks with fewer input tokens, by identifying essential reasoning paths.