Introducing Graph RAG: A New Approach to Addressing Global Query Challenges in Large Language Models

Traditional Retrieval-Augmented Generation (RAG) systems often struggle when it comes to handling global queries that require summarizing entire datasets. To address this limitation, a team from Microsoft Research and associated departments has developed a novel method called Graph RAG. This approach combines the strengths of graph-based indexing and query-focused summarization to enhance the ability of large language models (LLMs) to process extensive text corpora and answer complex, global questions.

How Does Graph RAG Work?

1. Text Chunking: The process begins by breaking down source documents into smaller text chunks, carefully balancing chunk size to optimize both precision and efficiency.
2. Entity and Relationship Extraction: Using LLMs, the system identifies and extracts entities (nodes) and their relationships (edges) from each text chunk. This step can be further refined through few-shot learning, tailored to specific domains.
3. Summarization of Element Instances: The extracted elements are then summarized into meaningful descriptions, laying the groundwork for global querying and graph construction.
4. Community Detection: The graph structure is divided into closely related communities using algorithms like Leiden. These communities represent key themes or groups within the documents.
5. Community Summaries: Each community is summarized, providing insights into the global structure and semantics of the dataset. These summaries are essential for answering both specific and broad queries.
6. Global Query Answering: When a global query is posed, the system generates initial answers using the community summaries, which are then refined and integrated into a comprehensive global response.

Real-World Application and Results

This innovative approach was tested on datasets containing approximately 1 million tokens, including podcast transcripts and news articles. The evaluation focused on the comprehensiveness, diversity, and empowerment of the generated summaries. The results were impressive—Graph RAG significantly outperformed traditional RAG methods in delivering more comprehensive and diverse answers, all while reducing token consumption.

Graph RAG represents a major advancement in how we use LLMs to handle complex, large-scale text analysis. It not only improves the accuracy of global query responses but also offers a scalable solution for processing vast amounts of data.

Project GraphRAG: Publications – Microsoft Research
www.microsoft.com

Scroll to Top