跳到主要内容Skip to main content

RAG(检索增强生成)RAG (Retrieval-Augmented Generation)

RAG (Retrieval-Augmented Generation)

  • 智能体Agents
  • 第三站 · 用深Station 3 · Going Deeper
  • 引用核验 2026-11-17refs checked 2026-11-17
解决什么问题What problem it solves

让模型在回答前先检索外部资料,把找到的原文片段放进上下文,再据此作答。Let the model retrieve external material first, put the found passages into context, and answer from them.

这是什么What it is

RAG 把参数化记忆(模型权重)与非参数化记忆(外部文档索引)组合起来:先用检索器找相关片段,再让生成模型基于片段写答案。

它的价值不只是多知道一些事实,还在于答案可以附出处、资料可以更新而不用重训模型。

RAG combines parametric memory (model weights) with non-parametric memory (an external document index): a retriever finds relevant passages, then a generator answers from them.

Its value is not only more facts: answers can carry sources, and the corpus can be updated without retraining the model.

A RAG pipeline: documents are chunked and embedded, candidates are retrieved and reranked, then the generator answers with citations.
一条 RAG 链路:文档先被切块并转成向量,检索召回候选,重排收窄,生成阶段带上引用。A RAG pipeline: documents are chunked and embedded, candidates are retrieved and reranked, then the generator answers with citations.
为什么需要知道Why it matters

遇到私有资料、时效性强的问题,微调不是唯一答案;RAG 往往更快、更可追溯,但检索错、分块错会直接传导到答案。For private or time-sensitive knowledge, fine-tuning is not the only option. RAG is often faster and traceable, but retrieval and chunking errors propagate straight into the answer.

别名Chinese aliases

检索增强生成 · 检索增强 · RAG 检索

出处Sources
  • Lewis 等 · RAG 原始论文(arXiv 2005.11401)Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks ↗
  • Gao 等 · RAG 综述(arXiv 2312.10997)Gao et al., Retrieval-Augmented Generation for Large Language Models: A Survey ↗