RAG vs Fine-tuning: Pipelines, Tradeoffs, and a Case Study on Agriculture

要約

大規模言語モデル (LLM) のアプリケーションを構築するときに、開発者が独自のドメイン固有データを組み込む一般的な方法は 2 つあります。それは、検索拡張生成 (RAG) と微調整です。
RAG は外部データを使用してプロンプトを拡張し、微調整は追加の知識をモデル自体に組み込みます。
ただし、両方のアプローチの長所と短所はよく理解されていません。
このペーパーでは、微調整と RAG のためのパイプラインを提案し、Llama2-13B、GPT-3.5、GPT-4 などの複数の一般的な LLM における両方のトレードオフを示します。
当社のパイプラインは、PDF からの情報の抽出、質問と回答の生成、微調整への使用、結果の評価のための GPT-4 の活用など、複数の段階で構成されています。
RAG および微調整パイプラインのさまざまなステージのパフォーマンスを評価するための指標を提案します。
私たちは農業データセットについて詳細な調査を実施します。
産業としての農業は AI の普及があまり進んでいません。私たちは潜在的に破壊的なアプリケーションを研究しています。農家に場所固有の洞察を提供できたらどうなるでしょうか?
私たちの結果は、地理固有の知識を取得する際のデータセット生成パイプラインの有効性と、RAG と微調整の定量的および定性的な利点を示しています。
6 pp を超える精度の向上が見られます。
モデルを微調整すると、これが RAG で累積され、精度が 5 pp 向上します。
さらに遠く。
ある特定の実験では、微調整されたモデルが地理全体からの情報を活用して特定の質問に回答し、回答の類似性が 47% から 72% に増加することも実証しました。
全体として、この結果は、LLM を使用して構築されたシステムを、特定の業界にとって重要な側面にわたる知識に対応して組み込むためにどのように適応させ、他の産業分野での LLM のさらなるアプリケーションへの道を開くことができるかを示しています。

要約(オリジナル)

There are two common ways in which developers are incorporating proprietary and domain-specific data when building applications of Large Language Models (LLMs): Retrieval-Augmented Generation (RAG) and Fine-Tuning. RAG augments the prompt with the external data, while fine-Tuning incorporates the additional knowledge into the model itself. However, the pros and cons of both approaches are not well understood. In this paper, we propose a pipeline for fine-tuning and RAG, and present the tradeoffs of both for multiple popular LLMs, including Llama2-13B, GPT-3.5, and GPT-4. Our pipeline consists of multiple stages, including extracting information from PDFs, generating questions and answers, using them for fine-tuning, and leveraging GPT-4 for evaluating the results. We propose metrics to assess the performance of different stages of the RAG and fine-Tuning pipeline. We conduct an in-depth study on an agricultural dataset. Agriculture as an industry has not seen much penetration of AI, and we study a potentially disruptive application – what if we could provide location-specific insights to a farmer? Our results show the effectiveness of our dataset generation pipeline in capturing geographic-specific knowledge, and the quantitative and qualitative benefits of RAG and fine-tuning. We see an accuracy increase of over 6 p.p. when fine-tuning the model and this is cumulative with RAG, which increases accuracy by 5 p.p. further. In one particular experiment, we also demonstrate that the fine-tuned model leverages information from across geographies to answer specific questions, increasing answer similarity from 47% to 72%. Overall, the results point to how systems built using LLMs can be adapted to respond and incorporate knowledge across a dimension that is critical for a specific industry, paving the way for further applications of LLMs in other industrial domains.

arxiv情報

著者 Aman Gupta,Anup Shirgaonkar,Angels de Luis Balaguer,Bruno Silva,Daniel Holstein,Dawei Li,Jennifer Marsman,Leonardo O. Nunes,Mahsa Rouzbahman,Morris Sharp,Nick Mecklenburg,Rafael Padilha,Ranveer Chandra,Renato Luiz de Freitas Cunha,Roberto de M. Estevão Filho,Ryan Tsang,Sara Malvar,Swati Sharma,Todd Hendry,Vijay Aski,Vijetha Vijayendran,Vinamra Benara
発行日 2024-01-16 14:44:47+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.LG パーマリンク