Skip to main content
QUICK REVIEW

[论文解读] Investigating the performance of Retrieval-Augmented Generation and fine-tuning for the development of AI-driven knowledge-based systems

Róbert Lakatos, Péter Pollner|arXiv (Cornell University)|Mar 12, 2024
Semantic Web and OntologiesComputer Science被引用 3
一句话总结

本研究对比了使用 GPT-J-6B、OPT-6.7B、LLaMA 和 LLaMA-2 模型构建基于 AI 的知识系统时,检索增强生成(RAG)与微调(FN)的性能。RAG 在 ROUGE 上优于 FN 16%,在 BLEU 上优于 15%,在余弦相似度上优于 53%,显著降低了幻觉现象,尽管 FN 的 METEOR 分数略高。

ABSTRACT

The development of generative large language models (G-LLM) opened up new opportunities for the development of new types of knowledge-based systems similar to ChatGPT, Bing, or Gemini. Fine-tuning (FN) and Retrieval-Augmented Generation (RAG) are the techniques that can be used to implement domain adaptation for the development of G-LLM-based knowledge systems. In our study, using ROUGE, BLEU, METEOR scores, and cosine similarity, we compare and examine the performance of RAG and FN for the GPT-J-6B, OPT-6.7B, LlaMA, LlaMA-2 language models. Based on measurements shown on different datasets, we demonstrate that RAG-based constructions are more efficient than models produced with FN. We point out that connecting RAG and FN is not trivial, because connecting FN models with RAG can cause a decrease in performance. Furthermore, we outline a simple RAG-based architecture which, on average, outperforms the FN models by 16% in terms of the ROGUE score, 15% in the case of the BLEU score, and 53% based on the cosine similarity. This shows the significant advantage of RAG over FN in terms of hallucination, which is not offset by the fact that the average 8% better METEOR score of FN models indicates greater creativity compared to RAG.

研究动机与目标

  • 评估并比较检索增强生成(RAG)与微调(FN)在构建领域特定、基于知识的 AI 系统中的性能。
  • 评估将 RAG 与微调模型结合的影响,鉴于这两种技术在实践中均被广泛使用。
  • 衡量 RAG 与 FN 方法在幻觉减少与语言创造力之间的权衡。
  • 确定 RAG 的最优配置,包括向量搜索阈值和基于嵌入的检索在特定领域数据集上的应用。

提出的方法

  • 使用从索引数据库($ID_s$ 和 $ID_q$)中检索的向量嵌入句子实现检索增强生成(RAG),将相关上下文注入大语言模型(LLM)的输入提示中。
  • 对 GPT-J-6B、OPT-6.7B、LLaMA-7B 和 LLaMA-2-7B 模型应用微调(FN),使用领域特定数据集($Q\textbackslash}A_{CORN}$、$Q\textbackslash}A_{UB}$、$Q\textbackslash}A_{COVID}$)进行五轮训练。
  • 使用标准自然语言处理指标(ROUGE、BLEU、METEOR 和余弦相似度 CS)在保留的测试集上评估性能。
  • RAG 系统使用基于向量嵌入的语义搜索引擎,检索段落的阈值在 0.0 到 1.0 之间以 0.1 为增量进行调优。
  • 基线性能通过未使用 RAG 或 FN 的 LLaMA-2-7B 基础模型测量,以建立参考基准。
  • 表现最佳的 RAG 配置使用 LLaMA-2-7B 基础模型与 $ID_s$ 数据集,阈值为 0.5,实现了相关性与召回率之间的最佳平衡。
(a) COVID
(a) COVID

实验结果

研究问题

  • RQ1在特定领域的知识系统中,RAG 是否在事实一致性与知识检索准确性方面优于微调?
  • RQ2将微调模型与 RAG 结合会对整体性能产生何种影响?是否带来性能提升?
  • RQ3RAG 与 FN 在减少幻觉方面表现如何比较?以与真实答案的余弦相似度衡量。
  • RQ4在使用不同大语言模型和特定领域数据集时,RAG 的最优检索阈值是多少?

主要发现

  • 基于 RAG 的系统在 ROUGE 得分上优于微调模型 16%,在 BLEU 得分上优于 15%,在余弦相似度上优于 53%,表明其在事实一致性方面更优且幻觉更少。
  • 表现最佳的 RAG 配置使用 LLaMA-2-7B 基础模型与 $ID_s$ 数据集,ROUGE 得分为 0.3,BLEU 为 0.063,METEOR 为 0.22,余弦相似度为 0.57。
  • 微调模型获得了更高的 METEOR 得分(0.242 vs. 0.222),表明其语言流畅性或创造力更强,但代价是显著更高的幻觉现象。
  • 将微调模型与 RAG 结合并未提升性能;事实上,微调模型在 RAG 中的最佳阈值为 1.0,表明检索到的上下文大多被拒绝。
  • 未使用 RAG 或 FN 的基线 LLaMA-2-7B 模型的 ROUGE 得分为 0.142,被所有 RAG 和 FN 变体超越。
  • 余弦相似度显示,基于 RAG 的系统与真实答案的对齐度显著更高(0.545),而微调模型仅为 0.356,证实了 RAG 在事实准确性方面的优势。
(b) CORN
(b) CORN

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。