Query-Specific GNN: A Comprehensive Graph Representation Learning Method for Retrieval Augmented Generation

Yuchen Yan, Zhihua Liu, Hao Wang, Weiming Li, Xiaoshuai Hao · OpenReview

Abstract

Retrieval-augmented generation (RAG) enhances Large Language Models (LLMs) by integrating external knowledge. However, multi-hop questions—which require synthesizing information from multiple sources—pose significant challenges, often leading to noise sensitivity and incomplete semantic understanding. We present QSGNN, a novel graph representation learning framework. By utilizing a Multi-information Level Knowledge Graph (Multi-L KG) and a Query-Specific Graph Neural Network (QSGNN) with query-guided message passing, our method effectively filters irrelevant noise and captures multi-granular information. Experimental results show up to a 33.8% improvement in retrieval recall for complex 4-hop questions.

Introduction

Standard RAG systems typically rely on "flat" vector-based retrieval, which struggles with multi-hop queries requiring connections across disparate documents. Existing Knowledge Graph (KG) approaches often fail to capture broader context (chunks) or become overwhelmed by "distractor" nodes as the search depth increases. QSGNN addresses these issues by structuring knowledge hierarchically and using the user query as a dynamic filter during graph traversal.

Methodology: Multi-L KG and QSGNN

The proposed framework consists of two primary components designed to improve the comprehensiveness and precision of retrieval.

The QSGNN framework: Indexing into a Multi-L KG, Pre-training with synthetic data, Fine-tuning, and Retrieval.

Multi-information Level Knowledge Graph (Multi-L KG)

To capture information at various granularities, we construct a hierarchical graph:

  • Entity Level: Captures fine-grained relationships between specific entities.
  • Chunk Level: Models local context and logical flow between sentences.
  • Document Level: Represents global thematic relationships across entire documents.

Query-Specific Graph Neural Network (QSGNN)

The core of our retrieval engine is a GNN that employs Query-Guided Attention. Unlike traditional GNNs that aggregate neighbor information uniformly, QSGNN performs intra-level and inter-level message passing where the influence of each neighbor is weighted by its relevance to the specific user query. This mechanism effectively "prunes" irrelevant paths in real-time, mitigating the noise problem inherent in multi-hop search.

Robust Pre-training

To enhance representation learning, we utilize synthetic data generation. By creating 1-hop and 2-hop questions directly from graph triples, the model learns to navigate the Multi-L KG structure effectively before encountering complex human-written queries.

Experimental Results

We evaluated QSGNN against state-of-the-art baselines, including HippoRAG and RAPTOR, on three major benchmarks: MuSiQue, 2WikiMultiHopQA, and HotpotQA.

Recall@5 comparison across 2-hop, 3-hop, and 4-hop questions, showing QSGNN's superior performance in high-hop scenarios.

Performance in High-Hop Scenarios

The advantage of QSGNN becomes increasingly apparent as question complexity grows. On the MuSiQue dataset, QSGNN achieved a 33.8% improvement in Recall@5 for 4-hop questions compared to the next best GNN-based method. This demonstrates the framework's resilience to the exponential noise typically encountered in deep graph traversals.

Efficiency and Scalability

Despite its multi-layered architecture, QSGNN remains computationally efficient. By utilizing optimized message passing instead of heuristic pathfinding, it offers faster retrieval times than traditional graph search methods like HippoRAG2.

Conclusion

QSGNN represents a significant step forward for multi-hop RAG. By treating the user query as a "compass" for graph navigation and modeling knowledge at multiple levels of granularity, the system overcomes the noise and context limitations of previous methods. Future work will explore integrating Chain-of-Thought reasoning to further refine the query-guided search process.

Code available at: https://github.com/Jerry2398/QSGNN

Summary updated

BibTeX
@inproceedings{yan2026query,
  author = {Yuchen Yan and Zhihua Liu and Hao Wang and Weiming Li and Xiaoshuai Hao},
  title = {{Query-Specific GNN: A Comprehensive Graph Representation Learning Method for Retrieval Augmented Generation}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2026},
  doi = {10.1145/3805712.3809693},
}
Figure