按年被提到
20202023 · 11 次2026
大模型与语言模型›检索增强与知识库·arXiv:2005.11401 · cs.CL

Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks

面向知识密集型 NLP 任务的检索增强生成
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, Douwe Kiela · 2020

RAG:把检索到的文档与生成模型结合

开始阅读 ↗PDFalphaXiv 讨论
被推荐 · 15 人首次 2021-03-14 · 最近 2024-10-16
15不同的人
12活跃月份
15讨论串
4,473被引(OpenAlex)

论文提出检索增强生成(RAG):以预训练的 seq2seq 模型作为参数化记忆,以维基百科的稠密向量索引作为非参数化记忆,并通过预训练的神经检索器访问。作者比较了两种形式,一种在整个生成序列中使用同一批检索段落,另一种每个 token 可用不同段落;在三个开放域问答任务上刷新最好成绩,在语言生成任务上也比纯参数化 seq2seq 基线更具体、多样、符合事实。

HN 为什么提它

评论者把它当作「RAG」这个名称的原始出处来引用,在讨论长上下文的替代方案和生成式搜索时用它说明「检索加生成」的模式。

奠基之作难度 3 / 5约 45 分钟经得起时间
读之前最好知道
1seq2seq 与预训练语言模型(如 BART)
2稠密检索(dense retrieval)
3向量索引与最近邻搜索
4开放域问答

学习路径

读这篇之前,按顺序读书架上的 7 篇 · 参考文献来自 OpenAlex,顺序和要点由 Claude Code 排出

先补 Transformer、BERT、T5 这条预训练与序列到序列的主线,再看外部记忆、向量检索索引和 REALM 的检索增强预训练,就能读懂 RAG 把检索器和生成器接在一起的做法。

  1. 1
    Attention Is All You Need注意力就是你所需要的一切 · 2017

    RAG 的检索器和生成器都建在 Transformer 之上,先要熟悉这个架构。

    读编码器-解码器结构与多头注意力的概念;跳过机器翻译实验。

  2. 2
    BERT: Pre-training of Deep Bidirectional Transformers for Language UnderstandingBERT:用于语言理解的深度双向 Transformer 预训练 · 2018

    RAG 的查询和文档编码器是 BERT 式的双向编码器。

    读预训练加微调的范式,以及 [CLS] 表示怎么用;跳过各任务细节。

  3. 3
    Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer探索迁移学习的极限:统一的文本到文本 Transformer · 2019

    RAG 的生成端是文本到文本的序列到序列模型,T5 展示了这种统一形式。

    读文本到文本框架的思路,以及编码器-解码器预训练目标的概念。

  4. 4
    End-To-End Memory Networks端到端记忆网络 · 2015

    带多跳注意力读取外部记忆,是把外部知识接入神经网络的早期形式。

    读记忆的软注意力读取与多跳机制的概念;理解它与检索式记忆的区别。

  5. 5
    Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs基于分层可导航小世界图的高效、鲁棒近似最近邻搜索 · 2016

    向量检索靠近似最近邻索引,HNSW 是常用的一类图索引。

    读多层邻近图与对数复杂度搜索的基本思路;不必深究建图参数。

  6. 6
    Billion-scale similarity search with GPUs基于 GPU 的十亿级相似性搜索 · 2017

    RAG 的文档向量库用 FAISS 做最大内积搜索,这篇是其核心实现依据。

    读乘积量化和 GPU 上 k-选择的概念,弄清为什么能支持亿级文档检索。

  7. 7
    REALM: Retrieval-Augmented Language Model Pre-TrainingREALM:检索增强的语言模型预训练 · 2020

    REALM 把可学习的检索器放进语言模型预训练,是 RAG 最直接的同类前作,要对比两者怎么处理检索。

    读检索器与语言模型联合训练的做法,以及检索结果如何作为潜变量被边缘化。

  8. 8
    Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks面向知识密集型 NLP 任务的检索增强生成 · 2020 · 就是这篇

    目标论文:把预训练检索器与序列到序列生成器端到端结合,用于知识密集型任务。

    读RAG-Sequence 与 RAG-Token 两种边缘化方式,以及检索器与生成器的联合微调;对照 REALM 看区别。

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
推荐janalsncm · 2023-01

“It's a couple years old but the best I've seen in this area is Retrieval Augmented Generation [2].”

推荐 RAG,称这是该领域见过最好的方法
Wolfram Alpha as the Way to Bring Computational Knowledge Superpowers to ChatGPT原评论 ↗
引用salamo · 2023-01

“There was a 2020 paper called Retrieval Augmented Generation that describes this technique too [1].”

指出 2020 年的 RAG 论文已描述过这种技术
How to implement Q&A against your docs with GPT3 embeddings and Datasette原评论 ↗
引用pyth0 · 2023-05

“This more or less is already a thing and it's called RAG [1][2].”

指出这个想法已经存在,就叫 RAG
Anthropic - Introducing 100K Token Context Windows, Around 75,000 Words原评论 ↗
引用HarHarVeryFunny · 2023-05

“then using some type of Retrieval Augmented Generation (RAG) to process that using the extended contexts ?”

提议用 RAG 来处理扩展后的上下文
Anthropic - Introducing 100K Token Context Windows, Around 75,000 Words原评论 ↗
引用nonfamous · 2023-06

“Isn’t Retrieval-Augmented Generation the standard nomenclature for this pattern?”

反问 RAG 不就是这种模式的标准叫法吗
Emerging Architectures for LLM Applications原评论 ↗
引用lqhl · 2023-07

“RAG has been studied in various research papers, such as the one available at Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”

引用 RAG 论文作背景,说明这个想法与之类似
Teach your LLM to answer with facts, not fiction原评论 ↗
看全部 14 条 →
引用chank · 2023-08

“this concept already exists and is in practice at many companies that require knowledge driven results.”

指出这种检索增强的做法已被许多公司用于知识类任务
GPU-Accelerated LLM on a $100 Orange Pi原评论 ↗
引用simonw · 2023-10

“The paper that coined the term used the hyphen, though I think I prefer it without: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”

指出创造这个术语的论文用了连字符
Jina AI Launches First Open-Source 8K Text Embedding, Rivaling OpenAI原评论 ↗
引用filterfiber · 2023-11

“retrieval augmented generation - Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”

把检索增强列为替代长上下文的已知方案之一
Is anyone using self hosted LLM day to day and training it like a new employee原评论 ↗
引用regularfry · 2023-12

“I'm not sure this is the paper that coined it, but here's an example from 2020: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”

给出 2020 年的 RAG 例子,但不确定是否为术语源头
What I learned using private LLMs to write an undergraduate history essay原评论 ↗
引用_akhe · 2024-03

“Original RAG paper: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”

指出这是最初的 RAG 论文
Show HN: Ragdoll Studio (fka Arthas.AI) is the FOSS alternative to character.ai原评论 ↗
引用jiayuanzhang · 2024-05

“We all know that Generative Search Engines are built on RAG (Retrieval-Augmented Generation)[1] combined with Large Language Models (LLMs).”

引用 RAG 说明生成式搜索引擎建立在它与 LLM 之上
Show HN: Devv – AI search engine for devs, built on a custom search index原评论 ↗
引用jiayuanzhang · 2024-05

“We all know that Generative Search Engines are built on RAG (Retrieval-Augmented Generation)[1] combined with Large Language Models (LLMs).”

引用 RAG 说明生成式搜索引擎建立在它与 LLM 之上
Show HN: I made a better Perplexity for developers原评论 ↗
引用peter_d_sherman · 2024-10

“Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2021) (apparently the original paper where the term 'RAG' was coined):”

指出这是创造 RAG 一词的原始论文
Headstart accelerates software development by up to 100x with Claude原评论 ↗
被提交为 story · 2 次