From Local to Global: A Graph RAG Approach to Query-Focused Summarization

Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody and 4 more

Published
Lab
Microsoft
Citations
2,700

Summary

TL;DR

GraphRAG builds an entity knowledge graph and community summaries so you can answer global questions over a whole private corpus, not just top-k chunks.

Why builders care

Editor's note

Standard RAG fails on 'what are the themes across all of this?' questions.

How to apply it

Editor's note
  1. 1Use graph-based summaries when users ask corpus-wide questions; keep plain RAG for specific lookups.

Key results

From the abstract
  1. 1

    For a class of global sensemaking questions over datasets in the 1 million token range, we show that GraphRAG leads to substantial improvements over a conventional RAG baseline for both the comprehensiveness and diversity of generated answers.

  • The use of retrieval-augmented generation (RAG) to retrieve relevant information from an external knowledge source enables large language models (LLMs) to answer questions over private and/or previously unseen document collections.
  • However, RAG fails on global questions directed at an entire text corpus, such as "What are the main themes in the dataset?", since this is inherently a query-focused summarization (QFS) task, rather than an explicit retrieval task.
  • Prior QFS methods, meanwhile, do not scale to the quantities of text indexed by typical RAG systems.

  • Our approach uses an LLM to build a graph index in two stages: first, to derive an entity knowledge graph from the source documents, then to pregenerate community summaries for all groups of closely related entities.
  • Given a question, each community summary is used to generate a partial response, before all partial responses are again summarized in a final response to the user.

The use of retrieval-augmented generation (RAG) to retrieve relevant information from an external knowledge source enables large language models (LLMs) to answer questions over private and/or previously unseen document collections. However, RAG fails on global questions directed at an entire text corpus, such as "What are the main themes in the dataset?", since this is inherently a query-focused summarization (QFS) task, rather than an explicit retrieval task. Prior QFS methods, meanwhile, do not scale to the quantities of text indexed by typical RAG systems. To combine the strengths of these contrasting methods, we propose GraphRAG, a graph-based approach to question answering over private text corpora that scales with both the generality of user questions and the quantity of source text. Our approach uses an LLM to build a graph index in two stages: first, to derive an entity knowledge graph from the source documents, then to pregenerate community summaries for all groups of closely related entities. Given a question, each community summary is used to generate a partial response, before all partial responses are again summarized in a final response to the user. For a class of global sensemaking questions over datasets in the 1 million token range, we show that GraphRAG leads to substantial improvements over a conventional RAG baseline for both the comprehensiveness and diversity of generated answers.

Everything on this page is written from this abstract. For methods and full results, read the paper PDF.

Ask the paper

Not live yet
Answers will quote the passages of the paper they come from.

Try one of these about “From Local to Global: A Graph RAG Approach to Query-Focused Summarization”: