[论文解读] Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs
该论文比较无监督微调与检索增强生成(RAG)在向大型语言模型注入知识方面的效果,结论是RAG持续优于微调,包括在未见知识上。
Large language models (LLMs) encapsulate a vast amount of factual information within their pre-trained weights, as evidenced by their ability to answer diverse questions across different domains. However, this knowledge is inherently limited, relying heavily on the characteristics of the training data. Consequently, using external datasets to incorporate new information or refine the capabilities of LLMs on previously seen information poses a significant challenge. In this study, we compare two common approaches: unsupervised fine-tuning and retrieval-augmented generation (RAG). We evaluate both approaches on a variety of knowledge-intensive tasks across different topics. Our findings reveal that while unsupervised fine-tuning offers some improvement, RAG consistently outperforms it, both for existing knowledge encountered during training and entirely new knowledge. Moreover, we find that LLMs struggle to learn new factual information through unsupervised fine-tuning, and that exposing them to numerous variations of the same fact during training could alleviate this problem.
研究动机与目标
- 评估在知识密集型任务中将知识注入到预训练LLM的效果。
- 将无监督微调与检索增强生成(RAG)作为知识注入方法进行比较。
- 在已知知识和新颖知识情境下评估性能。
- 研究数据增强(同义改写/改述)对学习新事实的影响。
- 提供在实际应用中哪种方法更可靠的建议。
提出的方法
- 使用问答(Q&A)视角和知识库 B_Q 定义一个知识注入框架。
- 将应用于预训练模型 M 和基础知识的两种变换 F 进行比较:微调(FT)和检索增强生成(RAG)。
- 以较低学习率实现无监督微调(持续预训练)以注入知识。
- 使用带有预训练嵌入模型(基于 faiss 的向量存储)的RAG,从 B_Q 检索前 K 篇文档并增强输入查询。
- 针对每个主题从 Wikipedia 创建辅助知识库,包含 QA 数据集和基于改写的增强以提升鲁棒性。
- 使用 LM-Evaluation-Harness 框架在 MMLU 科目和一个时事数据集上进行评估,包含 0-shot 和 5-shot 设置。

实验结果
研究问题
- RQ1RAG 是否在跨知识密集型任务的向 LLM 注入知识方面优于无监督微调?
- RQ2无监督微调能否有效学习新事实信息,还是 RAG 对已知与新事实都更可靠?
- RQ3通过改写进行的数据增强是否提高了通过微调学习与回忆新知识的能力?
- RQ40-shot 与 5-shot 设置对 FT 和 RAG 的知识注入性能有何影响?
主要发现
- RAG 在 MMLU 任务和时事数据上持续优于基线模型,且常常胜过无监督微调。
- 微调相对基线模型有提升,但与RAG相比不具竞争力,且将 FT 与 RAG 结合可能不稳定。
- 基于改写的数据增强在时事表现上呈单调提升,并通过重复帮助学习新信息。
- 通过微调学习新信息受益于多种改写变体,表明跨格式的重复有助于知识获取。
- 时事结果显示当辅助数据集与问题高度相关时,RAG 特别有效。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。