Introduction
Retrieval-Augmented Generation (RAG) has become a cornerstone for enhancing Large Language Models (LLMs) with external knowledge. However, traditional RAG systems often treat knowledge bases as flat collections of independent text chunks, failing to capture the complex relational structures inherent in real-world data. We present Graph Retrieval-Augmented Generation (GRAG), a framework that treats documents as networked entities to improve multi-hop reasoning and factual accuracy.
The Structural Blind Spot of Traditional RAG
Standard RAG typically retrieves the "top-k" most similar snippets based on vector similarity. This approach ignores the topological relationships—such as citations, social interactions, or knowledge graph links—between data points. When a query requires synthesizing information across multiple connected documents, naive RAG often retrieves irrelevant or disconnected snippets, leading to hallucinations or incomplete answers.
Methodology: Graph-Aware Retrieval and Generation
GRAG addresses these limitations through a two-stage process: efficient subgraph retrieval and dual-view generation.
1. Divide-and-Conquer Retrieval
To manage the complexity of searching massive networks, GRAG indexes the knowledge base as a collection of K-hop ego-graphs (a central node and its immediate neighbors). The system ranks these ego-graphs by query similarity and applies a soft pruning mechanism using Multilayer Perceptrons (MLPs). This filters out noisy nodes and edges, resulting in a streamlined, query-relevant subgraph in linear time.
2. Dual-View Generation
The retrieved subgraph is presented to the LLM through two complementary representations:
- Text View (Hard Prompts): A hierarchical, indented text description that preserves the narrative flow of connections.
- Graph View (Soft Prompts): Topological embeddings generated by a Graph Neural Network (GNN), aligned with the LLM’s token space, allowing the model to process structural layout alongside text.
Experimental Evaluation
GRAG was evaluated on the WebQSP (multi-hop reasoning) and ExplaGraphs (commonsense reasoning) datasets using Llama-2 backbones.
Key Results
- Performance Leap: On WebQSP, GRAG achieved a Hit@1 of 0.7236, nearly doubling the performance of the base LLM (0.4148). On ExplaGraphs, accuracy reached 92.23%, compared to just 33.94% for the base model.
- Hallucination Reduction: Human evaluation confirmed that GRAG’s outputs were more grounded, referencing valid graph entities 79% of the time, compared to 62-71% for standard retrieval methods.
- Zero-Shot Superiority: Notably, a frozen LLM equipped with GRAG outperformed fine-tuned models, suggesting that providing structured context is often more effective than internalizing knowledge via weight updates.
Conclusion
GRAG demonstrates that incorporating graph topology into the RAG pipeline significantly enhances an LLM's ability to "connect the dots." By combining efficient subgraph retrieval with dual-view representations, GRAG provides a robust framework for complex reasoning tasks, outperforming both standard RAG and fine-tuned models while reducing factual hallucinations.
Summary updated