QCG-RAG Deep Dive: Query-Centric Graph Construction, Multi-Hop Retrieval, and Experimental Results
Background
Retrieval-Augmented Generation (RAG) improves large language models (LLMs) on knowledge-intensive tasks by combining external retrieval with generation. However, traditional RAG relies on flat text retrieval and struggles with inter-document relationships and global questions. Graph-based RAG (GraphRAG) — exemplified by Microsoft's 2024 open-source method — builds entity knowledge graphs with hierarchical community summaries to support multi-hop reasoning and corpus-wide QA, improving answer comprehensiveness and diversity while reducing token cost. QCG-RAG (Query-Centric Graph RAG) goes further: it constructs and retrieves graph-structured knowledge dynamically, centered on each user query.
Key points
- Query-centric paradigm: Instead of a static global graph index, QCG-RAG builds and retrieves query-relevant subgraphs at query time, balancing relevance and efficiency.
- Pipeline: (1) query understanding and expansion; (2) query-driven subgraph construction and retrieval; (3) subgraph-to-context conversion and LLM answer generation with optional post-processing (summarization, re-ranking).
- Entity and relation extraction: Documents are split into chunks; an LLM with domain-specific prompts identifies entities (people, places, organizations) and relations, forming graph nodes and edges. E.g., a Beijing travel document yields entities like "Beijing," "roast duck," "snacks" with corresponding relations.
- Community detection and hierarchical indexing: Algorithms such as Leiden partition the graph into cohesive communities, each summarized as a hierarchical index. Queries route to relevant communities (e.g., a "food" community) without traversing the whole graph, greatly improving efficiency.
- Dynamic incremental updates: New documents insert extracted entities/relations into the existing graph and refresh community structure as needed — important for real-time or fast-changing knowledge sources.
- Query-guided graph traversal: The query maps to seed nodes; traversal follows edges across multiple hops, dynamically choosing directions based on query semantics. Example: for "Which historical events relate to Beijing's cuisine?" the system goes Beijing → food entities → related historical events, forming a complete reasoning chain.
- Query-aware attention: Unlike standard GNNs, the retriever weights nodes and edges by query relevance, prioritizing query-related nodes during propagation.
- Iterative retrieval and pruning: Each hop evaluates candidate relevance against a threshold; confidence-based pruning keeps only high-confidence paths, controlling subgraph size and cost.
- Subgraph to answer: Retrieved nodes/edges are converted into LLM-readable context; QCG-Rerank, for example, builds a chunk graph, iteratively computes transition probabilities until convergence, and selects top-scored chunks — improving relevance and diversity while reducing contradictions.
- Datasets and baselines: Multi-hop QA benchmarks including HotpotQA, MuSiQue, StrategyQA, plus Cultour, IIRC, and SQuAD; baselines include flat vector-similarity RAG and standard GraphRAG.
- Metrics: Retrieval quality (Recall, Precision, F1); generation quality (BLEU, ROUGE, human evaluation); efficiency (retrieval latency, indexing time).
- Findings:
- QCG-RAG retrieves more relevant, comprehensive subgraphs than flat RAG (higher precision and recall).
- Structured subgraph context yields answers with richer detail, better factual accuracy, and fewer contradictions — especially on multi-hop questions like HotpotQA.
- Query-centric dynamic construction avoids expensive global graph indexing, giving faster query responses; the modular design supports incremental updates and parallel retrieval for scalability.
- Dynamic, adaptive graph construction via reinforcement or online learning that adjusts graph structure from query feedback.
- Multimodal knowledge fusion combining text graphs with images and structured data.
- Explainability and trust through visualization and confidence scoring of the retrieval/reasoning path.
- Large-scale deployment using distributed graph computation, index optimization, and approximate algorithms.
Graph Construction Mechanism
Multi-Hop Retrieval Mechanism
Experiments and Results
Summary and Outlook
QCG-RAG upgrades the RAG "retrieve-then-generate" paradigm into "query-guided graph retrieval-then-generate," delivering strong multi-hop reasoning over distributed knowledge. Remaining challenges and future directions: