RAFT: 言語モデルをドメイン固有のRAGに適応させる
RAFT: Adapting Language Model to Domain Specific RAG
March 15, 2024
著者: Tianjun Zhang, Shishir G. Patil, Naman Jain, Sheng Shen, Matei Zaharia, Ion Stoica, Joseph E. Gonzalez
cs.AI
要旨
大規模言語モデル(LLM)を大規模なテキストデータコーパスで事前学習させることは、現在では標準的なパラダイムとなっています。これらのLLMを多くの下流タスクに適用する際には、RAGベースのプロンプティングやファインチューニングを通じて、新たな知識(例:時事ニュースやプライベートなドメイン知識)を事前学習済みモデルに追加することが一般的です。しかし、モデルがそのような新たな知識を獲得するための最適な方法論は、依然として未解決の問題です。本論文では、Retrieval Augmented FineTuning(RAFT)を紹介します。これは、モデルが「オープンブック」形式のドメイン内設定で質問に答える能力を向上させるトレーニング手法です。RAFTでは、質問と一連の検索された文書が与えられた場合、モデルに質問の回答に役立たない文書(これを「ディストラクター文書」と呼びます)を無視するように訓練します。RAFTは、質問に答えるために役立つ関連文書から正確なシーケンスを引用することでこれを実現します。これに加えて、RAFTのチェーン・オブ・シンクスタイルの応答が、モデルの推論能力を向上させるのに役立ちます。ドメイン固有のRAGにおいて、RAFTはPubMed、HotpotQA、Gorillaデータセット全体でモデルの性能を一貫して向上させ、事前学習済みLLMをドメイン内RAGに適応させるためのポストトレーニング手法を提供します。RAFTのコードとデモはgithub.com/ShishirPatil/gorillaでオープンソース化されています。
English
Pretraining Large Language Models (LLMs) on large corpora of textual data is
now a standard paradigm. When using these LLMs for many downstream
applications, it is common to additionally bake in new knowledge (e.g.,
time-critical news, or private domain knowledge) into the pretrained model
either through RAG-based-prompting, or fine-tuning. However, the optimal
methodology for the model to gain such new knowledge remains an open question.
In this paper, we present Retrieval Augmented FineTuning (RAFT), a training
recipe that improves the model's ability to answer questions in a "open-book"
in-domain settings. In RAFT, given a question, and a set of retrieved
documents, we train the model to ignore those documents that don't help in
answering the question, which we call, distractor documents. RAFT accomplishes
this by citing verbatim the right sequence from the relevant document that
would help answer the question. This coupled with RAFT's chain-of-thought-style
response helps improve the model's ability to reason. In domain-specific RAG,
RAFT consistently improves the model's performance across PubMed, HotpotQA, and
Gorilla datasets, presenting a post-training recipe to improve pre-trained LLMs
to in-domain RAG. RAFT's code and demo are open-sourced at
github.com/ShishirPatil/gorilla.Summary
AI-Generated Summary