HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Models
MemoryRAGKnowledge Graph3.9k+NeurIPS 2024CCF-A俄亥俄州立大学斯坦福大学HippoRAG:受神经生物学启发的大语言模型长期记忆
Abstract
In order to thrive in hostile and ever-changing natural environments, mammalian brains evolved to store large amounts of knowledge about the world and continually integrate new information while avoiding catastrophic forgetting. Despite their impressive accomplishments, large language models (LLMs), even with retrieval-augmented generation (RAG), still struggle to efficiently and effectively integrate a large amount of new experiences after pre-training. In this work, we introduce HippoRAG, a novel retrieval framework inspired by the hippocampal indexing theory of human long-term memory to enable deeper and more efficient knowledge integration over new experiences. HippoRAG synergistically orchestrates LLMs, knowledge graphs, and the Personalized PageRank algorithm to mimic the different roles of neocortex and hippocampus in human memory.
为了在充满威胁且不断变化的自然环境中生存,哺乳动物的大脑进化出了存储大量世界知识、持续整合新信息并避免灾难性遗忘的能力。 尽管大语言模型(LLM)取得了令人瞩目的成就,但即使采用检索增强生成(RAG),它们仍难以在预训练后高效、有效地整合大量新经验。 在这项工作中,我们提出 HippoRAG,这是一种受人类长期记忆海马体索引理论启发的新型检索框架,旨在对新经验进行更深入、更高效的知识整合。 HippoRAG 协同组织 LLM、知识图谱和个性化 PageRank 算法,以模拟新皮层和海马体在人类记忆中的不同作用。
We compare HippoRAG with existing RAG methods on multi-hop question answering (QA) and show that our method outperforms the state-of-the-art methods remarkably, by up to 20%. Single-step retrieval with HippoRAG achieves comparable or better performance than iterative retrieval like IRCoT while being 10-20 times cheaper and 6-13 times faster, and integrating HippoRAG into IRCoT brings further substantial gains. Finally, we show that our method can tackle new types of scenarios that are out of reach of existing methods.
我们在多跳问答(QA)上将 HippoRAG 与现有 RAG 方法进行比较,结果表明,我们的方法显著优于最先进方法,提升最高可达 20%。 HippoRAG 的单步检索取得了与 IRCoT 等迭代检索相当或更好的性能,同时成本降低至其 1/10–1/20,速度提升至 6–13 倍;将 HippoRAG 集成到 IRCoT 中还能带来进一步的显著增益。 最后,我们表明,该方法能够处理现有方法尚无法触及的新型场景。

1. Introduction
Millions of years of evolution have led mammalian brains to develop the crucial ability to store large amounts of world knowledge and continuously integrate new experiences without losing previous ones. This exceptional long-term memory system eventually allows us humans to keep vast stores of continuously updating knowledge that forms the basis of our reasoning and decision making.
数百万年的进化使哺乳动物的大脑发展出一种关键能力:存储大量世界知识,并在不丢失既有经验的情况下持续整合新经验。 这种卓越的长期记忆系统最终使人类能够保有不断更新的庞大知识储备,并以此作为推理和决策的基础。
Despite the progress of large language models (LLMs) in recent years, such a continuously updating long-term memory is still conspicuously absent from current AI systems. Due in part to its ease of use and the limitations of other techniques such as model editing, retrieval-augmented generation (RAG) has become the de facto solution for long-term memory in LLMs, allowing users to present new knowledge to a static model.
尽管大语言模型(LLM)近年来取得了进展,但当前 AI 系统仍明显缺少这种持续更新的长期记忆。 部分由于易于使用,以及模型编辑等其他技术存在局限,检索增强生成(RAG)已经成为 LLM 长期记忆的事实标准,使用户能够向静态模型提供新知识。
However, current RAG methods are still unable to help LLMs perform tasks that require integrating new knowledge across passage boundaries since each new passage is encoded in isolation. Many important real-world tasks, such as scientific literature review, legal case briefing, and medical diagnosis, require knowledge integration across passages or documents. Although less complex, standard multi-hop question answering (QA) also requires integrating information between passages in a retrieval corpus. In order to solve such tasks, current RAG systems resort to using multiple retrieval and LLM generation steps iteratively to join disparate passages. Nevertheless, even perfectly executed multi-step RAG is still oftentimes insufficient to accomplish many scenarios of knowledge integration, as we illustrate in what we call path-finding multi-hop questions in Figure 1.
然而,由于每个新段落都被孤立编码,当前 RAG 方法仍无法帮助 LLM 完成需要跨段落边界整合新知识的任务。 许多重要的现实任务,例如科学文献综述、法律案件简报和医学诊断,都需要跨段落或文档进行知识整合。 标准多跳问答(QA)虽然复杂度较低,但同样需要整合检索语料库中不同段落的信息。 为解决这类任务,当前 RAG 系统只能迭代执行多次检索和 LLM 生成步骤,以连接彼此分散的段落。 尽管如此,即使多步 RAG 得到完美执行,它往往仍不足以完成许多知识整合场景;我们在 图1 中通过所谓的路径发现多跳问题说明了这一点。
In contrast, our brains are capable of solving challenging knowledge integration tasks like these with relative ease. The hippocampal memory indexing theory, a well-established theory of human long-term memory, offers one plausible explanation for this remarkable ability. Teyler and DiScenna propose that our powerful context-based, continually updating memory relies on interactions between the neocortex, which processes and stores actual memory representations, and the C-shaped hippocampus, which holds the hippocampal index, a set of interconnected indices which point to memory units on the neocortex and stores associations between them.
相比之下,人脑能够相对轻松地解决这类具有挑战性的知识整合任务。 海马体记忆索引理论是一个成熟的人类长期记忆理论,它为这种非凡能力提供了一种合理解释。 Teyler 和 DiScenna 提出,我们强大的、基于上下文且持续更新的记忆依赖新皮层与 C 形海马体之间的交互:新皮层处理并存储实际记忆表征,而海马体保存海马体索引,即一组相互连接、指向新皮层记忆单元并存储其间关联的索引。
In this work, we propose HippoRAG, a RAG framework that serves as a long-term memory for LLMs by mimicking this model of human memory. Our novel design first models the neocortex's ability to process perceptual input by using an LLM to transform a corpus into a schemaless knowledge graph (KG) as our artificial hippocampal index. Given a new query, HippoRAG identifies the key concepts in the query and runs the Personalized PageRank (PPR) algorithm on the KG, using the query concepts as the seeds, to integrate information across passages for retrieval. PPR enables HippoRAG to explore KG paths and identify relevant subgraphs, essentially performing multi-hop reasoning in a single retrieval step.
在这项工作中,我们提出 HippoRAG,这是一个通过模拟上述人类记忆模型而充当 LLM 长期记忆的 RAG 框架。 我们的新设计首先模拟新皮层处理感知输入的能力:使用 LLM 将语料库转换为无模式知识图谱(KG),作为人工海马体索引。 给定一个新查询,HippoRAG 识别其中的关键概念,并以这些查询概念为种子在知识图谱上运行个性化 PageRank(PPR)算法,从而跨段落整合信息以供检索。 PPR 使 HippoRAG 能够探索知识图谱路径并识别相关子图,本质上是在单次检索步骤中执行多跳推理。
This capacity for single-step multi-hop retrieval yields strong performance improvements of around 3 and 20 points over current RAG methods on two popular multi-hop QA benchmarks, MuSiQue and 2WikiMultiHopQA. Additionally, HippoRAG's online retrieval process is 10 to 30 times cheaper and 6 to 13 times faster than current iterative retrieval methods like IRCoT, while still achieving comparable performance. Furthermore, our approach can be combined with IRCoT to provide complementary gains of up to 4% and 20% on the same datasets and even obtain improvements on HotpotQA, a less challenging multi-hop QA dataset. Finally, we provide a case study illustrating the limitations of current methods as well as our method's potential on the previously discussed path-finding multi-hop QA setting.
这种单步多跳检索能力使 HippoRAG 在 MuSiQue 和 2WikiMultiHopQA 两个常用多跳问答基准上,相比当前 RAG 方法分别取得约 3 分和 20 分的显著性能提升。 此外,HippoRAG 的在线检索过程比 IRCoT 等当前迭代检索方法便宜 10–30 倍、快 6–13 倍,同时仍能取得相当的性能。 进一步地,我们的方法可以与 IRCoT 结合,在相同数据集上分别带来最高 4% 和 20% 的互补增益,甚至能在挑战性较低的多跳问答数据集 HotpotQA 上取得提升。 最后,我们通过案例研究说明当前方法的局限,以及我们的方法在前述路径发现多跳问答场景中的潜力。
2. HippoRAG
In this section, we first give a brief overview of the hippocampal memory indexing theory, followed by how HippoRAG's indexing and retrieval design was inspired by this theory, and finally offer a more detailed account of our methodology.
本节首先简要概述海马体记忆索引理论,随后介绍该理论如何启发 HippoRAG 的索引与检索设计,最后更详细地说明我们的方法。
2.1 The Hippocampal Memory Indexing Theory
The hippocampal memory indexing theory is a well-established theory that provides a functional description of the components and circuitry involved in human long-term memory. In this theory, Teyler and DiScenna propose that human long-term memory is composed of three components that work together to accomplish two main objectives: pattern separation, which ensures that the representations of distinct perceptual experiences are unique, and pattern completion, which enables the retrieval of complete memories from partial stimuli.
海马体记忆索引理论是一个成熟理论,它从功能角度描述了人类长期记忆所涉及的组成部分和神经回路。 在该理论中,Teyler 和 DiScenna 提出,人类长期记忆由三个协同工作的组成部分构成,用以实现两个主要目标:模式分离,确保不同感知经历具有独特表征;以及模式补全,使系统能够从部分刺激中检索完整记忆。
The theory suggests that pattern separation is primarily accomplished in the memory encoding process, which starts with the neocortex receiving and processing perceptual stimuli into more easily manipulatable, likely higher-level, features, which are then routed through the parahippocampal regions (PHR) to be indexed by the hippocampus. When they reach the hippocampus, salient signals are included in the hippocampal index and associated with each other.
该理论认为,模式分离主要在记忆编码过程中完成:首先由新皮层接收感知刺激并将其处理成更易操作、很可能层次更高的特征,再经由海马旁区(PHR)传递给海马体建立索引。 当这些特征到达海马体时,显著信号会被纳入海马体索引并彼此关联。
After the memory encoding process is completed, pattern completion drives the memory retrieval process whenever the hippocampus receives partial perceptual signals from the PHR pipeline. The hippocampus then leverages its context-dependent memory system, thought to be implemented through a densely connected network of neurons in the CA3 sub-region, to identify complete and relevant memories within the hippocampal index and route them back through the PHR for simulation in the neocortex. Thus, this complex process allows for new information to be integrated by changing only the hippocampal index instead of updating neocortical representations.
记忆编码完成后,每当海马体从 PHR 流水线接收到部分感知信号,模式补全便会驱动记忆检索过程。 随后,海马体利用其依赖上下文的记忆系统——该系统被认为由 CA3 子区中密集连接的神经元网络实现——在海马体索引中识别完整且相关的记忆,并将其经由 PHR 送回新皮层进行模拟。 因此,这一复杂过程只需改变海马体索引,而无须更新新皮层表征,就能整合新信息。
2.2 Overview
Our proposed approach, HippoRAG, is closely inspired by the process described above. As shown in Figure 2, each component of our method corresponds to one of the three components of human long-term memory. A detailed example of the HippoRAG process can be found in the appendix.
我们提出的 HippoRAG 方法紧密借鉴了上述过程。 如 图2 所示,我们方法中的每个组件分别对应人类长期记忆的三个组成部分之一。 附录给出了 HippoRAG 过程的详细示例。
Offline Indexing. Our offline indexing phase, analogous to memory encoding, starts by leveraging a strong instruction-tuned LLM, our artificial neocortex, to extract knowledge graph (KG) triples. The KG is schemaless and this process is known as open information extraction (OpenIE). This process extracts salient signals from passages in a retrieval corpus as discrete noun phrases rather than dense vector representations, allowing for more fine-grained pattern separation. It is therefore natural to define our artificial hippocampal index as this open KG, which is built on the whole retrieval corpus passage-by-passage. Finally, to connect both components as is done by the parahippocampal regions, we use off-the-shelf dense encoders fine-tuned for retrieval (retrieval encoders). These retrieval encoders provide additional edges between similar but not identical noun phrases within this KG to aid in downstream pattern completion.
离线索引。 与记忆编码类似,我们的离线索引阶段首先利用一个强大的指令微调 LLM 作为人工新皮层,抽取知识图谱(KG)三元组。 该知识图谱没有固定模式,这一过程称为开放信息抽取(OpenIE)。 该过程将检索语料库段落中的显著信号抽取为离散名词短语,而非稠密向量表征,从而实现更细粒度的模式分离。 因此,很自然地,我们把这个基于整个检索语料库逐段构建的开放知识图谱定义为人工海马体索引。 最后,为了像海马旁区那样连接这两个组件,我们使用经过检索微调的现成稠密编码器,即检索编码器。 这些检索编码器在知识图谱中为相似但不完全相同的名词短语添加额外边,以帮助后续模式补全。
Online Retrieval. These same three components are then leveraged to perform online retrieval by mirroring the human brain's memory retrieval process. Just as the hippocampus receives input processed through the neocortex and PHR, our LLM-based neocortex extracts a set of salient named entities from a query which we call query named entities. These named entities are then linked to nodes in our KG based on the similarity determined by retrieval encoders; we refer to these selected nodes as query nodes. Once the query nodes are chosen, they become the partial cues from which our synthetic hippocampus performs pattern completion.
在线检索。 随后,同样的三个组件通过模拟人脑的记忆检索过程来执行在线检索。 正如海马体接收经新皮层和 PHR 处理的输入一样,我们基于 LLM 的新皮层从查询中抽取一组显著命名实体,并称之为查询命名实体。 随后,根据检索编码器确定的相似度,将这些命名实体链接到知识图谱中的节点;我们将选中的节点称为查询节点。 查询节点一经选定,就会成为人工海马体执行模式补全所依据的部分线索。
In the hippocampus, neural pathways between elements of the hippocampal index enable relevant neighborhoods to become activated and recalled upstream. To imitate this efficient graph search process, we leverage the Personalized PageRank (PPR) algorithm, a version of PageRank that distributes probability across a graph only through a set of user-defined source nodes. This constraint allows us to bias the PPR output only towards the set of query nodes, just as the hippocampus extracts associated signals from specific partial cues. Finally, as is done when the hippocampal signal is sent upstream, we aggregate the output PPR node probability over the previously indexed passages and use that to rank them for retrieval.
在海马体中,海马体索引各元素之间的神经通路会激活相关邻域,并使其被上游回忆。 为模拟这一高效图搜索过程,我们采用个性化 PageRank(PPR)算法;它是 PageRank 的一个变体,只通过一组用户定义的源节点在图中分配概率。 这一约束使 PPR 输出仅偏向查询节点集合,就像海马体从特定部分线索中提取关联信号一样。 最后,正如海马体信号被发送到上游时所做的那样,我们在此前索引的段落上聚合 PPR 输出节点概率,并据此对段落排序以供检索。
2.3 Detailed Methodology
Offline Indexing. Our indexing process involves processing a set of passages
离线索引。 我们使用指令微调 LLM
We find that this two-step prompt configuration leads to an appropriate balance between generality and bias towards named entities. Finally, we use
我们发现,这种两步提示配置在通用性与偏向命名实体之间实现了适当平衡。 最后,当
Online Retrieval. During the retrieval process, we prompt
在线检索。 在检索过程中,我们使用单样本提示来提示
They are represented as the Stanford logo and the Alzheimer's purple ribbon symbol in Figure 2.
在 图2 中,它们分别由 Stanford 标志和 Alzheimer's 紫色丝带符号表示。

After the query nodes
找到查询节点
Node Specificity. We introduce node specificity as a neurobiologically plausible way to further improve retrieval. It is well known that global signals for word importance, like inverse document frequency (IDF), can improve information retrieval. However, in order for our brain to leverage IDF for retrieval, the number of total "passages" encoded would need to be aggregated with all node activations before memory retrieval is complete. While simple for normal computers, this process would require activating connections between an aggregator neuron and all nodes in the hippocampal index every time retrieval occurs, likely introducing prohibitive computational overhead.
节点特异性。 我们引入节点特异性,作为一种在神经生物学上合理的进一步改进检索的方法。 众所周知,逆文档频率(IDF)等表示词语重要性的全局信号可以改进信息检索。 然而,要让人脑利用 IDF 进行检索,就需要在记忆检索完成之前,将编码“段落”的总数与所有节点激活进行聚合。 这一过程对于普通计算机很简单,但在人脑中,每次检索都需要激活聚合神经元与海马体索引全部节点之间的连接,可能会引入难以承受的计算开销。
Given these constraints, we propose node specificity as an alternative IDF signal which requires only local signals and is thus more neurobiologically plausible. We define the node specificity of node
鉴于这些约束,我们提出节点特异性作为一种只需局部信号、因而在神经生物学上更合理的替代 IDF 信号。 我们将节点
3. Experimental Setup
3.1 Datasets
We evaluate our method's retrieval capabilities primarily on two challenging multi-hop QA benchmarks, MuSiQue (answerable) and 2WikiMultiHopQA. For completeness, we also include the HotpotQA dataset even though it has been found to be a much weaker test for multi-hop reasoning due to many spurious signals, as we also show in the appendix. To limit the experimental cost, we extract 1,000 questions from each validation set as done in previous work. In order to create a more realistic retrieval setting, we follow IRCoT and collect all candidate passages (including supporting and distractor passages) from our selected questions and form a retrieval corpus for each dataset. The details of these datasets are shown in Table 1.
我们主要在两个具有挑战性的多跳问答基准 MuSiQue(可回答子集)和 2WikiMultiHopQA 上评估该方法的检索能力。 为保证完整性,我们还纳入 HotpotQA 数据集,尽管研究发现其中存在许多伪信号,使其成为明显更弱的多跳推理测试;附录也说明了这一点。 为限制实验成本,我们沿用此前工作,从每个验证集中抽取 1,000 个问题。 为了创建更真实的检索设置,我们遵循 IRCoT,收集所选问题的全部候选段落(包括支持段落和干扰段落),并为每个数据集构建一个检索语料库。 这些数据集的详细信息见 表1。
| MuSiQue | 2Wiki | HotpotQA | |
|---|---|---|---|
| # of Passages (P) | 11,656 | 6,119 | 9,221 |
| # of Unique Nodes (N) | 91,729 | 42,694 | 82,157 |
| # of Unique Edges (E) | 21,714 | 7,867 | 17,523 |
| # of Unique Triples | 107,448 | 50,671 | 98,709 |
| # of Contriever Synonym Edges (E′) | 145,990 | 146,020 | 159,112 |
| # of ColBERTv2 Synonym Edges (E′) | 191,636 | 82,526 | 171,856 |
3.2 Baselines
We compare against several strong and widely used retrieval methods: BM25, Contriever, GTR and ColBERTv2. Additionally, we compare against two recent LLM-augmented baselines: Propositionizer, which rewrites passages into propositions, and RAPTOR, which constructs summary nodes to ease retrieval from long documents. In addition to the single-step retrieval methods above, we also include the multi-step retrieval method IRCoT as a baseline.
我们与若干强大且广泛使用的检索方法进行比较:BM25、Contriever、GTR 和 ColBERTv2。 此外,我们还与两个近期的 LLM 增强基线比较:将段落重写为命题的 Propositionizer,以及构建摘要节点以简化长文档检索的 RAPTOR。 除上述单步检索方法外,我们还将多步检索方法 IRCoT 作为基线。
3.3 Metrics
We report retrieval and QA performance on the datasets above using recall@2 and recall@5 (R@2 and R@5 below) for retrieval and exact match (EM) and F1 scores for QA performance.
我们在上述数据集上报告检索和问答性能:检索使用 recall@2 和 recall@5(下文记为 R@2 和 R@5),问答性能使用精确匹配(EM)和 F1 分数。
3.4 Implementation Details
By default, we use `GPT-3.5-turbo-1106` with temperature of 0 as our LLM
默认情况下,我们使用温度为 0 的 `GPT-3.5-turbo-1106` 作为 LLM
4. Results
We present our retrieval and QA experimental results below. Given that our method indirectly affects QA performance, we report QA results on our best-performing retrieval backbone ColBERTv2. However, we report retrieval results for several strong single-step and multi-step retrieval techniques.
下面给出我们的检索与问答实验结果。 由于该方法间接影响问答性能,我们使用表现最佳的检索骨干 ColBERTv2 报告问答结果。 不过,对于检索结果,我们报告了多种强大的单步和多步检索技术。
| Method | MuSiQue | 2Wiki | HotpotQA | Average | ||||
|---|---|---|---|---|---|---|---|---|
| R@2 | R@5 | R@2 | R@5 | R@2 | R@5 | R@2 | R@5 | |
| BM25 | 32.3 | 41.2 | 51.8 | 61.9 | 55.4 | 72.2 | 46.5 | 58.4 |
| Contriever | 34.8 | 46.6 | 46.6 | 57.5 | 57.2 | 75.5 | 46.2 | 59.9 |
| GTR | 37.4 | 49.1 | 60.2 | 67.9 | 59.4 | 73.3 | 52.3 | 63.4 |
| ColBERTv2 | 37.9 | 49.2 | 59.2 | 68.2 | 64.7 | 79.3 | 53.9 | 65.6 |
| RAPTOR | 35.7 | 45.3 | 46.3 | 53.8 | 58.1 | 71.2 | 46.7 | 56.8 |
| RAPTOR (ColBERTv2) | 36.9 | 46.5 | 57.3 | 64.7 | 63.1 | 75.6 | 52.4 | 62.3 |
| Proposition | 37.6 | 49.3 | 56.4 | 63.1 | 58.7 | 71.1 | 50.9 | 61.2 |
| Proposition (ColBERTv2) | 37.8 | 50.1 | 55.9 | 64.9 | 63.9 | 78.1 | 52.5 | 64.4 |
| HippoRAG (Contriever) | 41.0 | 52.1 | 71.5 | 89.5 | 59.0 | 76.2 | 57.2 | 72.6 |
| HippoRAG (ColBERTv2) | 40.9 | 51.9 | 70.7 | 89.1 | 60.5 | 77.7 | 57.4 | 72.9 |
| Method | MuSiQue | 2Wiki | HotpotQA | Average | ||||
|---|---|---|---|---|---|---|---|---|
| R@2 | R@5 | R@2 | R@5 | R@2 | R@5 | R@2 | R@5 | |
| IRCoT + BM25 (Default) | 34.2 | 44.7 | 61.2 | 75.6 | 65.6 | 79.0 | 53.7 | 66.4 |
| IRCoT + Contriever | 39.1 | 52.2 | 51.6 | 63.8 | 65.9 | 81.6 | 52.2 | 65.9 |
| IRCoT + ColBERTv2 | 41.7 | 53.7 | 64.1 | 74.4 | 67.9 | 82.0 | 57.9 | 70.0 |
| IRCoT + HippoRAG (Contriever) | 43.9 | 56.6 | 75.3 | 93.4 | 65.8 | 82.3 | 61.7 | 77.4 |
| IRCoT + HippoRAG (ColBERTv2) | 45.3 | 57.6 | 75.8 | 93.9 | 67.0 | 83.0 | 62.7 | 78.2 |
Single-Step Retrieval Results. As seen in Table 2, HippoRAG outperforms all other methods, including recent LLM-augmented baselines such as Propositionizer and RAPTOR, on our main datasets, MuSiQue and 2WikiMultiHopQA, while achieving competitive performance on HotpotQA. We notice an impressive improvement of 11 and 20% for R@2 and R@5 on 2WikiMultiHopQA and around 3% on MuSiQue. This difference can be partially explained by 2WikiMultiHopQA's entity-centric design, which is particularly well-suited for HippoRAG. Our lower performance on HotpotQA is mainly due to its lower knowledge integration requirements, as explained in the appendix, as well as a due to a concept-context tradeoff which we alleviate with an ensembling technique described in the appendix.
单步检索结果。 如 表2 所示,HippoRAG 在主要数据集 MuSiQue 和 2WikiMultiHopQA 上优于所有其他方法,包括 Propositionizer 和 RAPTOR 等近期 LLM 增强基线,同时在 HotpotQA 上取得有竞争力的性能。 在 2WikiMultiHopQA 上,R@2 和 R@5 分别取得了令人印象深刻的 11% 和 20% 提升,在 MuSiQue 上则提升约 3%。 这种差异可以部分归因于 2WikiMultiHopQA 以实体为中心的设计,该设计尤其适合 HippoRAG。 我们在 HotpotQA 上表现较低,主要是因为它对知识整合的要求更低;附录对此作了解释,此外还存在概念—上下文权衡,我们通过附录所述的集成技术缓解了这一问题。
Multi-Step Retrieval Results. For multi-step or iterative retrieval, our experiments in Table 3 demonstrate that IRCoT and HippoRAG are complementary. Using HippoRAG as the retriever for IRCoT continues to bring R@5 improvements of around 4% for MuSiQue, 18% for 2WikiMultiHopQA and an additional 1% on HotpotQA.
多步检索结果。 对于多步或迭代检索,表3 中的实验表明,IRCoT 与 HippoRAG 具有互补性。 使用 HippoRAG 作为 IRCoT 的检索器,仍可使 MuSiQue、2WikiMultiHopQA 和 HotpotQA 上的 R@5 分别提高约 4%、18% 和额外 1%。
| MuSiQue | 2Wiki | HotpotQA | Average | |||||
|---|---|---|---|---|---|---|---|---|
| Retriever | EM | F1 | EM | F1 | EM | F1 | EM | F1 |
| None | 12.5 | 24.1 | 31.0 | 39.6 | 30.4 | 42.8 | 24.6 | 35.5 |
| ColBERTv2 | 15.5 | 26.4 | 33.4 | 43.3 | 43.4 | 57.7 | 30.8 | 42.5 |
| HippoRAG (ColBERTv2) | 19.2 | 29.8 | 46.6 | 59.5 | 41.8 | 55.0 | 35.9 | 48.1 |
| IRCoT (ColBERTv2) | 19.1 | 30.5 | 35.4 | 45.1 | 45.5 | 58.4 | 33.3 | 44.7 |
| IRCoT + HippoRAG (ColBERTv2) | 21.9 | 33.3 | 47.7 | 62.7 | 45.7 | 59.2 | 38.4 | 51.7 |
Question Answering Results. We report QA results for HippoRAG, the strongest retrieval baselines, ColBERTv2 and IRCoT, as well as IRCoT using HippoRAG as a retriever in Table 4. As expected, improved retrieval performance in both single and multi-step settings leads to strong overall improvements of up to 3%, 17% and 1% F1 scores on MuSiQue, 2WikiMultiHopQA and HotpotQA respectively using the same QA reader. Notably, single-step HippoRAG is on par or outperforms IRCoT while being 10-30 times cheaper and 6-13 times faster during online retrieval.
问答结果。 表4 报告了 HippoRAG、最强检索基线 ColBERTv2 和 IRCoT,以及以 HippoRAG 为检索器的 IRCoT 的问答结果。 正如预期,在使用同一问答阅读器时,单步和多步设置中检索性能的提升,使 MuSiQue、2WikiMultiHopQA 和 HotpotQA 的 F1 分数分别取得最高 3%、17% 和 1% 的显著整体提升。 值得注意的是,单步 HippoRAG 与 IRCoT 持平或优于 IRCoT,同时在线检索成本降低至其 1/10–1/30,速度提升至 6–13 倍。
5. Discussions
5.1 What Makes HippoRAG Work?
| Component | Variant | MuSiQue | 2Wiki | HotpotQA | Average | ||||
|---|---|---|---|---|---|---|---|---|---|
| R@2 | R@5 | R@2 | R@5 | R@2 | R@5 | R@2 | R@5 | ||
| HippoRAG | 40.9 | 51.9 | 70.7 | 89.1 | 60.5 | 77.7 | 57.4 | 72.9 | |
| OpenIE Alternatives | REBEL | 31.7 | 39.6 | 63.1 | 76.5 | 43.9 | 59.2 | 46.2 | 58.4 |
| Llama-3.1-8B-Instruct | 40.8 | 51.9 | 62.5 | 77.5 | 59.9 | 75.1 | 54.4 | 67.8 | |
| Llama-3.1-70B-Instruct | 41.8 | 53.7 | 68.8 | 85.3 | 60.8 | 78.6 | 57.1 | 72.5 | |
| PPR Alternatives | Rq Nodes Only | 37.1 | 41.0 | 59.1 | 61.4 | 55.9 | 66.2 | 50.7 | 56.2 |
| Rq Nodes & Neighbors | 25.4 | 38.5 | 53.4 | 74.7 | 47.8 | 64.5 | 42.2 | 59.2 | |
| Ablations | w/o Node Specificity | 37.6 | 50.2 | 70.1 | 88.8 | 56.3 | 73.7 | 54.7 | 70.9 |
| w/o Synonymy Edges | 40.2 | 50.2 | 69.2 | 85.6 | 59.1 | 75.7 | 56.2 | 70.5 | |
OpenIE Alternatives. To determine if using a closed model like GPT-3.5 is essential to retain our performance improvements, we replace it with an end-to-end OpenIE model REBEL as well as the 8B and 70B instruction-tuned versions of Llama-3.1, a class of strong open-weight LLMs. As shown in Table 5 row 2, building our KG using REBEL results in large performance drops, underscoring the importance of LLM flexibility. Specifically, GPT-3.5 produces twice as many triples as REBEL, indicating its bias against producing triples with general concepts and leaving many useful associations behind.
OpenIE 替代方案。 为确定使用 GPT-3.5 等闭源模型是否是保持性能提升的必要条件,我们将其替换为端到端 OpenIE 模型 REBEL,以及强大开放权重 LLM Llama-3.1 的 8B 和 70B 指令微调版本。 如 表5 第 2 行所示,使用 REBEL 构建知识图谱会导致性能大幅下降,凸显了 LLM 灵活性的重要性。 具体而言,GPT-3.5 产生的三元组数量是 REBEL 的两倍,这表明 REBEL 倾向于避免生成包含一般概念的三元组,因而遗漏许多有用关联。
In terms of open-weight LLMs, Table 5 (rows 3-4) shows that the performance of Llama-3.1-8B is competitive with GPT-3.5 in all datasets except for 2Wiki, where performance drops substantially. Nevertheless, the stronger 70B counterpart outperforms GPT-3.5 in two out of three datasets and is still competitive in 2Wiki. The strong performance of Llama-3.1-70B and the comparable performance of even the 8B model is encouraging since it offers a cheaper alternative for indexing over large corpora. The graph statistics for these OpenIE alternatives can be found in the appendix.
对于开放权重 LLM,表5(第 3–4 行)表明,除性能显著下降的 2Wiki 外,Llama-3.1-8B 在所有数据集上的表现均可与 GPT-3.5 竞争。 尽管如此,更强的 70B 模型在三个数据集中的两个上优于 GPT-3.5,并且在 2Wiki 上仍具有竞争力。 Llama-3.1-70B 的强劲表现,以及 8B 模型也能取得相当表现,令人鼓舞,因为这为大规模语料库索引提供了更便宜的替代方案。 这些 OpenIE 替代方案的图统计见附录。
To understand the relationship between OpenIE and retrieval performance more deeply, we extract 239 gold triples from 20 examples from the MuSiQue training set. We then perform a small-scale intrinsic evaluation using the CaRB framework for OpenIE. We find that both Llama-3.1-Instruct models underperform GPT-3.5 slightly on this intrinsic evaluation but all LLMs vastly outperform REBEL. More details about this evaluation experiments can be found in the appendix.
为更深入地理解 OpenIE 与检索性能的关系,我们从 MuSiQue 训练集的 20 个样本中抽取了 239 个标准三元组。 随后,我们使用 OpenIE 的 CaRB 框架进行小规模内在评估。 我们发现,两个 Llama-3.1-Instruct 模型在该内在评估中均略逊于 GPT-3.5,但所有 LLM 都远远优于 REBEL。 该评估实验的更多细节见附录。
PPR Alternatives. As shown in Table 5 (rows 5-6), to examine how much of our results are due to the strength of PPR, we replace the PPR output with the query node probability
PPR 替代方案。 如 表5(第 5–6 行)所示,为检验结果在多大程度上源自 PPR 的能力,我们用查询节点概率
Ablations. As seen in Table 5 (rows 7-8), node specificity obtains considerable improvements on MuSiQue and HotpotQA and yields almost no change in 2WikiMultiHopQA. This is likely because 2WikiMultiHopQA relies on named entities with little differences in terms of term weighting. In contrast, synonymy edges have the largest effect on 2WikiMultiHopQA, suggesting that noisy entity standardization is useful when most relevant concepts are named entities, and improvements to synonymy detection could lead to stronger performance in other datasets.
消融实验。 如 表5(第 7–8 行)所示,节点特异性在 MuSiQue 和 HotpotQA 上带来显著提升,而在 2WikiMultiHopQA 上几乎没有变化。 这可能是因为 2WikiMultiHopQA 依赖命名实体,而这些实体在词项权重方面差异很小。 相比之下,同义关系边对 2WikiMultiHopQA 的影响最大,这表明当大多数相关概念都是命名实体时,带噪声的实体标准化很有用;改进同义关系检测可能在其他数据集上带来更强性能。
5.2 HippoRAG's Advantage: Single-Step Multi-Hop Retrieval
A major advantage of HippoRAG over conventional RAG methods in multi-hop QA is its ability to perform multi-hop retrieval in a single step. We demonstrate this by measuring the percentage of queries where all the supporting passages are retrieved successfully, a feat that can only be accomplished through successful multi-hop reasoning. Table 6 below shows that the gap between our method and ColBERTv2, using the top-5 passages, increases even more from 3% to 6% on MuSiQue and from 20% to 38% on 2WikiMultiHopQA, suggesting that large improvements come from obtaining all supporting documents rather than achieving partially retrieval on more questions.
HippoRAG 相比传统 RAG 方法在多跳问答中的一项主要优势,是它能够在单个步骤中执行多跳检索。 我们通过测量成功检索到全部支持段落的问题比例来证明这一点,而这只有成功执行多跳推理才能实现。 下面的 表6 表明,使用前 5 个段落时,我们的方法与 ColBERTv2 的差距在 MuSiQue 上从 3% 进一步扩大到 6%,在 2WikiMultiHopQA 上从 20% 扩大到 38%;这说明巨大提升来自获取全部支持文档,而非在更多问题上只完成部分检索。
| Method | MuSiQue | 2Wiki | HotpotQA | Average | ||||
|---|---|---|---|---|---|---|---|---|
| AR@2 | AR@5 | AR@2 | AR@5 | AR@2 | AR@5 | AR@2 | AR@5 | |
| ColBERTv2 | 6.8 | 16.1 | 25.1 | 37.1 | 33.3 | 59.0 | 21.7 | 37.4 |
| HippoRAG | 10.2 | 22.4 | 45.4 | 75.7 | 33.8 | 57.9 | 29.8 | 52.0 |
We further illustrate HippoRAG's unique single-step multi-hop retrieval ability through the first example in Table 7. In this example, even though Alhandra was not mentioned in Vila de Xira's passage, HippoRAG can directly leverage Vila de Xira's connection to Alhandra as his place of birth to determine its importance, something that standard RAG methods would be unable to do directly. Additionally, even though IRCoT can also solve this multi-hop retrieval problem, it is 10-30 times more expensive and 6-13 times slower than ours in terms of online retrieval, arguably the most important factor when it comes to serving end users.
我们通过 表7 中的第一个示例,进一步说明 HippoRAG 独特的单步多跳检索能力。 在该示例中,尽管 Vila de Xira 的段落没有提到 Alhandra,HippoRAG 仍能直接利用 Vila de Xira 与 Alhandra 出生地之间的联系来判断该段落的重要性,而标准 RAG 方法无法直接做到这一点。 此外,尽管 IRCoT 也能解决这个多跳检索问题,但其在线检索成本是我们方法的 10–30 倍,速度慢 6–13 倍;在服务终端用户时,这可以说是最重要的因素。
| Type | Question | HippoRAG | ColBERTv2 | IRCoT |
|---|---|---|---|---|
| Path- Following | In which district was Alhandra born? | 1. Alhandra 2. Vila de Xira 3. Portugal | 1. Alhandra 2. Dimuthu Abayakoon 3. Ja'ar | 1. Alhandra 2. Vila de Xira 3. Póvoa de Santa Iria |
| Path- Finding | Which Stanford professor works on the neuroscience of Alzheimer's? | 1. Thomas Südhof 2. Karl Deisseroth 3. Robert Sapolsky | 1. Brian Knutson 2. Eric Knudsen 3. Lisa Giocomo | 1. Brian Knutson 2. Eric Knudsen 3. Lisa Giocomo |
5.3 HippoRAG's Potential: Path-Finding Multi-Hop Retrieval
The second example in Table 7, also present in Figure 1, shows a type of questions that is trivial for informed humans but out of reach for current retrievers without further training. This type of questions, which we call path-finding multi-hop questions, requires identifying one path between a set of entities when many paths exist to explore instead of following a specific path, as in standard multi-hop questions. Path-finding questions require knowledge integration when search entities like Stanford and Alzheimer's do not happen to appear together in a passage, a condition which is often satisfied for new information.
表7 中的第二个示例也出现在 图1 中,它展示了一类对掌握相关信息的人而言很简单、但当前检索器在不进一步训练时无法处理的问题。 我们将这类问题称为路径发现多跳问题:当存在多条可探索路径时,它要求在一组实体之间识别出一条路径,而不是像标准多跳问题那样跟随某条特定路径。 当 Stanford 和 Alzheimer's 等搜索实体没有恰好共同出现在同一段落中时,路径发现问题就需要知识整合;对于新信息,这一条件经常成立。
More specifically, a simple iterative process can retrieve the appropriate passages for the first question by following the one path set by Alhandra's one place of birth, as seen by IRCoT's perfect performance. However, an iterative process would struggle to answer the second question given the many possible paths to explore—either through professors at Stanford University or professors working on the neuroscience of Alzheimer's. It is only by associating disparate information about Thomas Südhof that someone who knows about this professor would be able to answer this question easily.
更具体地说,简单的迭代过程可以沿着 Alhandra 唯一出生地所确定的一条路径,为第一个问题检索适当段落;IRCoT 的完美表现证明了这一点。 然而,第二个问题存在许多可能的探索路径——可以从 Stanford University 的教授出发,也可以从研究 Alzheimer's 神经科学的教授出发——因此迭代过程将难以作答。 只有将关于 Thomas Südhof 的分散信息关联起来,了解这位教授的人才能轻松回答该问题。
As seen in Table 7, both ColBERTv2 and IRCoT fail to extract the necessary passages since they cannot access these associations. On the other hand, HippoRAG leverages its web of associations in its hippocampal index and graph search algorithm to determine that Professor Thomas is relevant to this query and retrieves his passages appropriately. More examples of these path-finding multi-hop questions can be found in our case study in the appendix.
如 表7 所示,ColBERTv2 和 IRCoT 都无法抽取必要段落,因为它们不能访问这些关联。 而 HippoRAG 利用海马体索引中的关联网络和图搜索算法,判断 Thomas 教授与该查询相关,并正确检索其段落。 附录案例研究给出了更多路径发现多跳问题示例。
6. Related Work
6.1 LLM Long-Term Memory
Parametric Long-Term Memory. It is well-accepted, even among skeptical researchers, that the parameters of modern LLMs encode a remarkable amount of world knowledge, which can be leveraged by an LLM in flexible and robust ways. Nevertheless, our ability to update this vast knowledge store, an essential part of any long-term memory system, is still surprisingly limited. Although many techniques to update LLMs exist, such as standard fine-tuning, model editing and even external parametric memory modules inspired by human memory, no methodology has yet to emerge as a robust solution for continual learning in LLMs.
参数化长期记忆。 即使在持怀疑态度的研究者中,人们也普遍接受现代 LLM 的参数编码了大量世界知识,并且 LLM 能够以灵活且稳健的方式利用这些知识。 然而,更新这一庞大知识库的能力是任何长期记忆系统的必要组成部分,却仍然出人意料地有限。 虽然存在标准微调、模型编辑,乃至受人类记忆启发的外部参数化记忆模块等多种更新 LLM 的技术,但尚无方法成为 LLM 持续学习的稳健解决方案。
RAG as Long-Term Memory. On the other hand, using RAG methods as a long-term memory system offers a simple way to update knowledge over time. More sophisticated RAG methods, which perform multiple steps of retrieval and generation from an LLM, are even able to integrate information across new or updated knowledge elements, another crucial aspect of long-term memory systems. As discussed above, however, this type of online information integration is unable to solve the more complex knowledge integration tasks that we illustrate with our path-finding multi-hop QA examples.
RAG 作为长期记忆。 另一方面,将 RAG 方法用作长期记忆系统,为随时间更新知识提供了一种简单方式。 更复杂的 RAG 方法会执行多轮检索和 LLM 生成,甚至能够跨新增或更新的知识元素整合信息,这是长期记忆系统的另一项关键能力。 然而,如上所述,这类在线信息整合无法解决我们通过路径发现多跳问答示例所展示的更复杂知识整合任务。
Some other methods, such as RAPTOR, MemWalker and GraphRAG, integrate information during the offline indexing phase similarly to HippoRAG and might be able to handle these more complex tasks. However, these methods integrate information by summarizing knowledge elements, which means that the summarization process must be repeated any time new data is added. In contrast, HippoRAG can continuously integrate new knowledge by simply adding edges to its KG.
RAPTOR、MemWalker 和 GraphRAG 等其他方法与 HippoRAG 类似,会在离线索引阶段整合信息,因此可能能够处理这些更复杂的任务。 不过,这些方法通过总结知识元素来整合信息,这意味着每当加入新数据时都必须重复总结过程。 相比之下,HippoRAG 只需向知识图谱添加边,就能持续整合新知识。
Long Context as Long-Term Memory. Context lengths for both open and closed source LLMs have increased dramatically in the past year. This scaling trend seems to indicate that future LLMs could perform long-term memory storage within massive context windows. However, the viability of this future remains largely uncertain given the many engineering hurdles involved and the apparent limitations of long-context LLMs, even within current context lengths.
长上下文作为长期记忆。 过去一年中,开放和闭源 LLM 的上下文长度都大幅增长。 这种扩展趋势似乎表明,未来的 LLM 可以在巨大的上下文窗口中完成长期记忆存储。 然而,考虑到其中涉及的诸多工程障碍,以及长上下文 LLM 即使在当前上下文长度内也表现出的明显局限,这一前景能否实现仍有很大不确定性。
6.2 Multi-Hop QA & Graphs
Many previous works have also tackled multi-hop QA using graph structures. These efforts can be broadly divided in two major categories: 1) graph-augmented reading comprehension, where a graph is extracted from retrieved documents and used to improve a model's reasoning process and 2) graph-augmented retrieval, where models find relevant documents by traversing a graph structure.
许多以往工作也使用图结构处理多跳问答。 这些工作大体可分为两类:1)图增强阅读理解,即从检索文档中抽取图,并用它改进模型的推理过程;2)图增强检索,即模型通过遍历图结构寻找相关文档。
Graph-Augmented Reading Comprehension. Earlier works in this category are mainly supervised methods which mix signal from a hyperlink or co-occurrence graph with a language model through a graph neural network (GNN). More recent works use LLMs and introduce knowledge graph triples directly into the LLM prompt. Although these works share HippoRAG's use of graphs for multi-hop QA, their generation-based improvements are fully complementary to HippoRAG's, which are solely based on improved retrieval.
图增强阅读理解。 这一类别的早期工作主要是监督方法,它们通过图神经网络(GNN)将超链接图或共现图的信号与语言模型融合。 近期工作则使用 LLM,并将知识图谱三元组直接加入 LLM 提示。 虽然这些工作和 HippoRAG 一样使用图处理多跳问答,但其基于生成的改进与 HippoRAG 完全互补,因为 HippoRAG 的改进仅来自检索。
Graph-Augmented Retrieval. In this second category, previous work trains a re-ranking module which can traverse a graph made using Wikipedia hyperlinks. HippoRAG, in contrast, builds a KG from scratch using LLMs and performs multi-hop retrieval without any supervision, making it much more adaptable.
图增强检索。 在第二类方法中,以往工作训练了一个能够遍历由 Wikipedia 超链接构成之图的重排序模块。 相比之下,HippoRAG 使用 LLM 从头构建知识图谱,并在没有任何监督的情况下执行多跳检索,因此适应性更强。
6.3 LLMs & KGs
Combining the strengths of language models and knowledge graphs has been an active research direction for many years, both for augmenting LLMs with a KG in different ways or augmenting KGs by either distilling knowledge from an LLM's parametric knowledge or using them to parse text directly. In an exceptionally comprehensive survey, Pan et al. present a roadmap for this research direction and highlight the importance of work which synergizes these two important technologies. Like these works, HippoRAG shows the potential for synergy between these two technologies, combining the knowledge graph construction abilities of LLMs with the retrieval advantages of structured knowledge for more effective RAG.
多年来,结合语言模型与知识图谱的优势一直是活跃的研究方向,其中既包括以不同方式用知识图谱增强 LLM,也包括通过从 LLM 参数化知识中蒸馏知识或直接使用 LLM 解析文本来增强知识图谱。 在一篇格外全面的综述中,Pan 等人为这一研究方向提出了路线图,并强调了使这两项重要技术产生协同作用之工作的重要性。 与这些工作一样,HippoRAG 展示了两项技术协同的潜力:它将 LLM 构建知识图谱的能力与结构化知识的检索优势相结合,从而实现更有效的 RAG。
7. Conclusions & Limitations
Our proposed neurobiologically principled methodology, although simple, already shows promise for overcoming the inherent limitations of standard RAG systems while retaining their advantages over parametric memory. HippoRAG's knowledge integration capabilities, demonstrated by its strong results on path-following multi-hop QA and promise on path-finding multi-hop QA, as well as its dramatic efficiency improvements and continuously updating nature, makes it a powerful middle-ground framework between standard RAG methods and parametric memory and offers a compelling solution for long-term memory in LLMs.
我们提出的方法虽然简单,但建立在神经生物学原理之上,已经展现出克服标准 RAG 系统固有局限、同时保留其相对于参数化记忆之优势的潜力。 HippoRAG 在路径跟随多跳问答上的强劲结果和在路径发现多跳问答上的潜力证明了其知识整合能力;再加上显著的效率提升和持续更新特性,它成为标准 RAG 方法与参数化记忆之间强有力的折中框架,并为 LLM 长期记忆提供了令人信服的解决方案。
Nevertheless, several limitations can be addressed in future work to enable HippoRAG to achieve this goal better. First, we note that all components of HippoRAG are currently used off-the-shelf without any extra training. There is therefore much room to improve our method's practical viability by performing specific component fine-tuning. This is evident in the error analysis discussed in the appendix, which shows most errors made by our system are due to NER and OpenIE and thus could benefit from direct fine-tuning.
不过,未来工作仍可解决若干局限,使 HippoRAG 更好地实现这一目标。 首先,我们注意到 HippoRAG 的所有组件目前都直接使用现成版本,没有进行任何额外训练。 因此,通过对特定组件进行微调,我们的方法在实际可用性方面还有很大的提升空间。 附录中的误差分析清楚地说明了这一点:系统的大多数错误来自 NER 和 OpenIE,因此可能受益于直接微调。
Given that the rest of the errors are graph search errors, also in the appendix, we note that several avenues for improvements over simple PPR exist, such as allowing relations to guide graph traversal directly. Additionally, as shown in the appendix, more work must be done to improve the consistency of OpenIE in longer compared to shorter documents. Finally, and perhaps most importantly, HippoRAG's scalability still calls for further validation. Although we show that Llama-3.1 could obtain similar performance to closed-source models and thus reduce costs considerably, we are yet to empirically prove the efficiency and efficacy of our synthetic hippocampal index as its size grows way beyond current benchmarks.
鉴于其余错误是图搜索错误,我们注意到,相比简单 PPR 还有多种改进途径,例如让关系直接引导图遍历。 此外,如附录所示,与短文档相比,OpenIE 在长文档中的一致性仍需进一步改善。 最后,也许最重要的是,HippoRAG 的可扩展性仍需进一步验证。 虽然我们表明 Llama-3.1 可以取得与闭源模型相近的性能,从而显著降低成本,但当合成海马体索引的规模远超当前基准时,我们尚未通过实验证明其效率和有效性。