大規模言語モデルのためのインコンテキスト例の検索学習
Learning to Retrieve In-Context Examples for Large Language Models
July 14, 2023
著者: Liang Wang, Nan Yang, Furu Wei
cs.AI
要旨
大規模言語モデル(LLM)は、文脈内学習の能力を示し、少数の入力-出力例に基づいて様々なタスクを実行できることが実証されています。しかし、文脈内学習の効果は、選択された例の品質に大きく依存します。本論文では、LLM向けに高品質な文脈内例を特定できる密な検索モデルを反復的に訓練する新しいフレームワークを提案します。我々のフレームワークは、まずLLMのフィードバックに基づいて候補例の品質を評価する報酬モデルを訓練し、その後、知識蒸留を用いて双方向エンコーダベースの密な検索モデルを訓練します。30のタスクセットでの実験により、このフレームワークが文脈内学習の性能を大幅に向上させることが示されました。さらに、訓練中に見られなかったタスクに対するフレームワークの汎化能力も確認されています。詳細な分析により、我々のモデルが類似したパターンを持つ例を検索することで性能を向上させ、その効果が様々なサイズのLLMにわたって一貫していることが明らかになりました。
English
Large language models (LLMs) have demonstrated their ability to learn
in-context, allowing them to perform various tasks based on a few input-output
examples. However, the effectiveness of in-context learning is heavily reliant
on the quality of the selected examples. In this paper, we propose a novel
framework to iteratively train dense retrievers that can identify high-quality
in-context examples for LLMs. Our framework initially trains a reward model
based on LLM feedback to evaluate the quality of candidate examples, followed
by knowledge distillation to train a bi-encoder based dense retriever. Our
experiments on a suite of 30 tasks demonstrate that our framework significantly
enhances in-context learning performance. Furthermore, we show the
generalization ability of our framework to unseen tasks during training. An
in-depth analysis reveals that our model improves performance by retrieving
examples with similar patterns, and the gains are consistent across LLMs of
varying sizes.