Not All Demonstration Examples are Equally Beneficial: Reweighting Demonstration Examples for In-Context Learning

要約

最近、大規模言語モデル (LLM) は、モデルのスケールアップに伴ってインコンテキスト学習 (ICL) 機能を獲得し、入力シーケンスの先頭にいくつかのデモンストレーション例を追加するだけで、下流のタスクに迅速に適応できるようになりました。
それにもかかわらず、ICL の現在の慣例ではすべてのデモンストレーション サンプルが平等に扱われており、サンプルの品質は通常は不均一であるため、依然として改善の余地があります。
この論文では、デモンストレーション例にほぼ最適な重みを決定する方法と、ICL 中にそれらを適用する方法を調査します。
追加の検証データがない場合に重みの品質を評価するために、最終的な ICL パフォーマンスと強い相関関係を示すマスクされた自己予測 (MSP) スコアを設計します。
重み検索プロセスを迅速化するために、連続重み空間を離散化し、ビーム検索を採用します。
ほぼ最適な重みが得られたので、それらを異なるモデル位置でのデモンストレーションに適用するための 2 つの戦略をさらに提案します。
8 つのテキスト分類タスクに関する実験結果は、私たちのアプローチが従来の ICL よりも大幅に優れていることを示しています。
私たちのコードは https:github.com/Zhe-Young/WICL で公開されています。

要約(オリジナル)

Large Language Models (LLMs) have recently gained the In-Context Learning (ICL) ability with the models scaling up, allowing them to quickly adapt to downstream tasks with only a few demonstration examples prepended in the input sequence. Nonetheless, the current practice of ICL treats all demonstration examples equally, which still warrants improvement, as the quality of examples is usually uneven. In this paper, we investigate how to determine approximately optimal weights for demonstration examples and how to apply them during ICL. To assess the quality of weights in the absence of additional validation data, we design a masked self-prediction (MSP) score that exhibits a strong correlation with the final ICL performance. To expedite the weight-searching process, we discretize the continuous weight space and adopt beam search. With approximately optimal weights obtained, we further propose two strategies to apply them to demonstrations at different model positions. Experimental results on 8 text classification tasks show that our approach outperforms conventional ICL by a large margin. Our code are publicly available at https:github.com/Zhe-Young/WICL.

arxiv情報

著者 Zhe Yang,Damai Dai,Peiyi Wang,Zhifang Sui
発行日 2023-10-12 13:15:11+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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