Aha.
正在载入中英对照阅读…

arXiv:2404.16130 · 中英对照阅读

从局部到全局:一种用于查询聚焦摘要(QFS)的 GraphRAG 方法

From Local to Global: A GraphRAG Approach to Query-Focused Summarization

Darren Edge、Ha Trinh、Newman Cheng、Joshua Bradley、Alex Chao、Apurva Mody、Steven Truitt、Dasha Metropolitansky、Robert Osazuwa Ness、Jonathan Larson

中文速览

面对普通 RAG 只会捞取少量相关片段、难以回答“整批资料讲了什么”这类全局问题,GraphRAG 把重点放在梳理文本之间的联系和主题上。它先让大语言模型从文档中抽取人物、地点、事件及其关系,建成知识图谱,再把图谱按关联主题分组,预先为各组生成摘要;回答时综合这些摘要,先分别作答,再汇总成最终回复。在百万 token 规模的资料集上,实验显示它比传统 RAG 的答案更全面、涉及面更多。这样一来,大语言模型不仅能查资料里的局部事实,也更有机会看懂一大批文档整体呈现的脉络与主题。

摘要

检索增强生成(RAG)通过从外部知识源检索相关信息,使大语言模型(LLM)能够针对私有和/或此前未见过的文档集合回答问题。然而,对于面向整个文本语料库的全局问题,例如“数据集的主要主题是什么?”,RAG 往往无法奏效,因为这本质上属于查询聚焦摘要(QFS)任务,而非显式检索任务。与此同时,先前的 QFS 方法无法扩展到典型 RAG 系统所索引的文本规模。为结合这两类方法各自的优势,我们提出 GraphRAG,这是一种用于私有文本语料库问答的基于图的方法,能够随着用户问题的普遍性和源文本的数量而扩展。我们的方法利用 LLM 分两个阶段构建图索引:首先,从源文档中提取实体知识图谱;随后,预先生成所有紧密相关实体组的社区摘要。给定一个问题后,系统先利用每个社区摘要生成部分回答,再将所有部分回答汇总为面向用户的最终回答。对于针对百万 token 规模数据集的一类全局意义建构问题,我们证明,与传统 RAG 基线相比,GraphRAG 在生成答案的全面性和多样性方面均有显著提升。

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.

术语表

retrieval-augmented generation (RAG)
检索增强生成(RAG)
large language model (LLM)
大语言模型(LLM)
query-focused summarization (QFS)
查询聚焦摘要(QFS)
GraphRAG
GraphRAG
vector RAG
向量 RAG
sensemaking
意义建构
sensemaking query
意义建构查询
text corpus
文本语料库
context window
上下文窗口
text embedding
文本嵌入
vector space
向量空间
knowledge graph
知识图谱
entity
实体
entity knowledge graph
实体知识图谱
graph index
图索引
community
社区
community detection
社区检测
community summary
社区摘要
hierarchical indexing
层级索引
thematic partitioning
主题划分
map-reduce processing
MapReduce 处理
LLM-as-a-judge
LLM 评审
ground-truth answer
标准答案
prompt template
提示模板
self-memory
自记忆
graph-based approach
基于图的方法
global sensemaking
全局意义建构
semantic similarity
语义相似度
factual grounding
事实依据