arXiv:2610.29933cs.CLOct 2026

Manuscript Offprint

arXiv:2610.29933

Graph Topology Meets Energy-Driven Pathfinding: Preserving Contextual Consistency in Retrieval-Augmented Generation

Yufeng Li, Zaijing Li, Fuchen Zhang, Zongzong Wu, Ming Zhao, Fengxiao Tang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Retrieval-augmented generation (RAG) frequently integrates knowledge graphs (KGs) for complex multi-hop question answering. However, their performance is increasingly bottlenecked by the knowledge structuring and reasoning processes. (i) Severe semantic loss: Distilling continuous texts into discrete symbols strips away contextual nuances and narrative coherence. (ii) Pronounced modality mismatch: Fragmented graph structures clash with the continuous texts LLMs are pre-trained on, while rewriting them into natural language introduces generative noise and omits information. To address these limitations, we propose ThreadRAG, a semantic-topology-based RAG framework for context-preserving knowledge structuring and modality-native evidence reasoning. ThreadRAG introduces a Semantic Topology Mapper (STM), which organizes retrieved documents into context-intact Semantic Nodes and constructs a Semantic Topology Graph (STG) through narrative, semantic, and lexical edges. It further incorporates Energy-Driven Pathfinding (EDP), which identifies query-relevant subgraphs via energy diffusion and deterministically linearizes them into coherent textual evidence paths. Experiments on three multi-hop QA benchmarks demonstrate that ThreadRAG consistently outperforms strong baselines. Notably, it achieves a 14.4% EM improvement over text-centric methods on HotpotQA and surpasses the best baseline by 5.8% EM on 2WikiMultihop, while reducing token cost to 23.3% of the strongest baseline.

1 Introduction

Retrieval-augmented generation (RAG) has become a powerful paradigm for enhancing large language models (LLMs) on knowledge-intensive tasks by grounding generation in external evidence (Gao et al., 2023). However, complex multi-hop question answering (QA) remains challenging for existing RAG systems (Lewis et al., 2020; Izacard et al., 2022; Trivedi et al., 2023). Unlike single-hop QA, multi-hop QA requires models to identify scattered evidence across multiple documents, connect them through latent relations, and perform multi-step reasoning (Shao et al., 2023).

Graph-enhanced RAG methods address this challenge by introducing structural priors over retrieved knowledge. Despite their promise, existing graph-RAG paradigms often suffer from a mismatch between how knowledge is structured and how LLMs perform reasoning. As illustrated in Figure 1, this mismatch manifests in two key limitations. First, existing graph construction pipelines can incur substantial semantic loss. Triplet-based knowledge graphs compress continuous text into rigid symbolic tuples, often discarding contextual nuances, while chunk-based graphs split documents into isolated segments, leading to semantic truncation and noisy boundaries. Such fragmentation weakens the continuous contextual pathways required for multihop reasoning. Second, existing graph representations introduce a modality mismatch at inference time. LLMs are primarily optimized to consume coherent natural language sequences, whereas graph-RAG methods typically provide fragmented graph paths or rely on generative verbalization to convert subgraphs into text. These conversions can introduce redundancy, hallucinated transitions, or omission of critical evidence, thereby limiting the effectiveness of structural priors.

To address these limitations, we propose ThreadRAG, a semantic-topology-based RAG framework that preserves textual context during knowledge structuring and converts graph evidence into LLM-native reasoning sequences. ThreadRAG consists of two key components: a Semantic Topology Mapper (STM) for high-fidelity knowledge structuring, and an Energy-Driven Pathfinding module (EDP) for query-aware evidence selection and topological linearization.

∗^{*}Corresponding author.

(a) Text to STG

Preserves semantic context. Aligns modality.

SN1: Mickey's Safari in Letterland is a 1993 educational NES video game, starring Disney's Mickey Mouse.

SN4: Mickey Mouse is a cartoon character co-created in 1928 by Walt Disney and Ub Iwerks.

SN7: The successor title, Walt Disney's Comics and Stories (WDC&S)...

Semantic Topology Path

Semantic Nodes

Mickey's Safari in Letterland is a 1993 educational NES video game.

SN 1

SN 2

SN n

Triple Topological mechanism

SN1

SN3

SN9

SN2

SN4

SN5

SN6

Modality-Aligned Pathfinding

Mickey's Safari in Letterland is a 1993 educational Nintendo Entertainment System video game starring Disney's Mickey Mouse, ... The successor title, Walt Disney's Comics and Stories (WDC&S), described by Barrier as a true comic book, began publication with the Oct 1940 issue and had the Gottfr-edson ...

(b) Text to Triplet KG

1993

release year:

Gottfreds

on serials

Mickey's Safari in

Letterland

starring

WDC&S

described

Mickey Mouse

associated with

Disney

Dependencies

missing due to

context loss

Fragmented triples lose semantic.

<Mickey's Safari, starring, Mickey Mouse>,

<Mickey Mouse, associated with, Disney>, ...

Graph paths mislead LLM reasoning.

Mickey's Safari → (starring) → Mickey Mouse (featured) → Gottfredson serials

Text rewriting omits information.

Mickey Mouse is associated with Disney.

WDC&S features Gottfredson.

(c) Text to Chunk KG

Mickey's Safari... starring Disney's Mickey Mouse

Semantic truncation

The successor title, Walt Disney's Comics...

Chunks cause semantic truncation.

The succes-sor title, Walt Disney's Co-mics and Stories (WDC&S), ...

Chunk k

Chunk 2

Chunk 1

Figure 1: Comparison of graph-RAG paradigms. Left: Our proposed ThreadRAG (a) structures raw texts into a Semantic Topology Graph (STG) and extracts Semantic Topology Paths (ST-Paths), preserving semantic context and aligning modality for LLM deduction. Right: Existing paradigms, Triplet KG (b) and Chunk KG (c), fragment texts into discrete components, introducing severe semantic loss and modality mismatch.

A Semantic Topology Mapper for high-fidelity knowledge structuring. To mitigate semantic loss introduced by conventional graph construction, STM structures retrieved documents into an LLM-oriented Semantic Topology Graph (STG). Instead of extracting symbolic triplets or relying on isolated chunks, STM organizes retrieved documents into self-contained Semantic Nodes that preserve local textual context. It then connects these nodes through complementary topological relations, including narrative, semantic, and lexical edges. Narrative edges preserve the original textual order, while semantic and lexical edges capture cross-node associations beyond surface adjacency. This design allows STG to retain the semantic continuity of raw text while exposing the relational structure needed for evidence navigation. These relations transform fragmented retrieved evidence into a navigable topology without discarding the natural context required for multi-hop reasoning.

An Energy-Driven Pathfinding module for modality-native knowledge representation. To bridge the modality mismatch between discrete graph structures and sequence-based LLM reasoning, EDP converts query-relevant topology into continuous textual evidence paths. Given a query, EDP first identifies relevant Semantic Nodes as reasoning anchors, and then performs energy-driven propagation and dynamic pruning over the STG to obtain a compact, query-specific evidence subgraph. Instead of directly prompting the LLM with discrete graph paths or using free-form generation to verbalize the subgraph, EDP deterministically linearizes the selected nodes according to their topological and narrative structure. This process preserves the structural priors of the graph while presenting evidence in a form naturally compatible with LLM pretraining. The resulting Semantic Topology Paths provide continuous, context-preserving, and sequence-native evidence, enabling more coherent and reliable multi-hop reasoning.

We conduct comprehensive evaluations across three multi-hop QA benchmarks. ThreadRAG consistently surpasses the best mainstream graph-enhanced paradigms across all three datasets (e.g., achieving a 3.4% EM improvement over KnowTrace on HotpotQA). In graph representation evaluations, replacing traditional global graphs with our STG yields a 12.6% EM improvement. Furthermore, our sequence-native STG-Paths strictly dominate all prevailing knowledge representation modalities, peaking at 0.588 EM on 2WikiMulti-hop. These results indicate that high-fidelity knowledge structuring and topological linearization significantly boost LLM deduction accuracy. Our contributions are as follows:

• We propose a Semantic Topology Mapper that reduces semantic loss by organizing retrieved text into a context-preserving Semantic Topology Graph.

• We introduce an Energy-Driven Pathfinding module that selects query-relevant evidence and linearizes discrete graph structures into sequence-native prompts for LLM reasoning.

• We present ThreadRAG, a unified graph-enhanced RAG framework that consistently improves multi-hop QA performance over strong baselines across three benchmarks.