Skip to main content
QUICK REVIEW

[論文レビュー] In-Context Learning with Iterative Demonstration Selection

Chengwei Qin, Aston Zhang|arXiv (Cornell University)|Oct 15, 2023
Topic Modeling被引用数 6
ひとこと要約

本稿では、ゼロショットチェーン・オブ・トゥグラウンズ(Zero-shot-CoT)推論を用いて、文脈学習(ICL)のための多様でありながら意味的に関連するデモンストレーションを繰り返し選択する反復的デモンストレーション選択(IDS)を提案する。テストサンプルの推論経路を生成し、その経路と類似するデモンストレーションを繰り返し選択することで、複数の自然言語処理(NLP)タスクにおいて、類似性や多様性に依存する単一の手法に比べて一貫した性能向上を達成する。

ABSTRACT

Spurred by advancements in scale, large language models (LLMs) have demonstrated strong few-shot learning ability via in-context learning (ICL). However, the performance of ICL has been shown to be highly sensitive to the selection of few-shot demonstrations. Selecting the most suitable examples as context remains an ongoing challenge and an open problem. Existing literature has highlighted the importance of selecting examples that are diverse or semantically similar to the test sample while ignoring the fact that the optimal selection dimension, i.e., diversity or similarity, is task-specific. Based on how the test sample is answered, we propose Iterative Demonstration Selection (IDS) to leverage the merits of both dimensions. Using zero-shot chain-of-thought reasoning (Zero-shot-CoT), IDS iteratively selects examples that are diverse but still strongly correlated with the test sample as ICL demonstrations. Specifically, IDS applies Zero-shot-CoT to the test sample before demonstration selection. The output reasoning path is then used to choose demonstrations that are prepended to the test sample for inference. The generated answer is followed by its corresponding reasoning path for extracting a new set of demonstrations in the next iteration. After several iterations, IDS adopts majority voting to obtain the final result. Through extensive experiments on tasks including reasoning, question answering, and topic classification, we demonstrate that IDS can consistently outperform existing ICL demonstration selection methods.

研究の動機と目的

  • 文脈学習(ICL)のデモンストレーション選択に対する感受性を軽減し、性能に顕著な影響を与えること。
  • 最適なデモンストレーション選択戦略(多様性対類似性)がタスクに依存することを特定し、一方が他方を常に上回るとの仮定に疑問を呈すること。
  • ゼロショットチェーン・オブ・トゥグラウンズ推論を用いた反復的精錬によって、多様性と類似性の両方を統合する包括的な手法を提案すること。
  • モデルの微調整やモデルパラメータへのアクセスを必要とせず、凍結された大規模言語モデル(LLM)にも適用可能な、ICL性能の向上を実現すること。
  • 多様なNLPタスクおよびLLMアーキテクチャにおいて、堅牢性と一貫した向上を示すこと。

提案手法

  • テストサンプルに対してゼロショットチェーン・オブ・トゥグラウンズプロンプト(例:「段階的に考えてみましょう。」)を適用し、推論経路を生成する。
  • その推論経路と意味的に類似度の高い訓練例を初期デモンストレーションとして選択し、テスト入力の先頭に追加して推論を実行する。
  • 推論から新しい回答とその対応する推論経路が生成され、それが次の反復におけるデモンストレーション選択の基盤として用いられる。
  • この反復的プロセスは固定回数のステップにわたり継続され、各ステップで進化する推論経路に基づいてデモンストレーション集合が精錬される。
  • 複数の反復後、全ステップの出力の多数決を取ることで最終予測を得る。
  • 推論経路とデモンストレーション間の意味的類似度は、Sentence-BERT埋め込みを用いて計算され、選択をガイドする。
Figure 1: Illustration of in-context learning (ICL) on sentiment analysis. A frozen large language model directly generates the sentiment ‘Positive’ for the test sample ‘I like this movie.’ by taking the demonstrations and the test sample as input.
Figure 1: Illustration of in-context learning (ICL) on sentiment analysis. A frozen large language model directly generates the sentiment ‘Positive’ for the test sample ‘I like this movie.’ by taking the demonstrations and the test sample as input.

実験結果

リサーチクエスチョン

  • RQ1異なるNLPタスクにおいて、デモンストレーション選択の主な基準として、多様性または類似性のどちらが一貫して優れているか?
  • RQ2デモンストレーション選択において多様性と類似性を組み合わせることで、現在の最先端手法を超えるICL性能向上が達成可能か?
  • RQ3ゼロショットチェーン・オブ・トゥグラウンズ推論を用いた反復的精錬は、段階的に改善されたデモンストレーション選択と最終予測をもたらすか?
  • RQ4本手法は、デモンストレーション数、反復回数、および基盤となるLLMアーキテクチャの変化に対してどれほど頑健か?
  • RQ5パrameterの更新や内部モデル統計へのアクセスが不要な状態で、凍結された大規模言語モデルに効果的に適用可能か?

主な発見

  • IDSは、6つの多様なNLPデータセットにおいて、従来のICLデモンストレーション選択手法(Top-k-Consistency-CoTやRandom-Voting-CoTなど)を一貫して上回る。
  • 全評価データセット平均で、Top-k-Consistency-CoTに比べて0.9%の絶対的精度向上を達成し、個々のタスクでは0.4%から1.2%の改善を示した。
  • 4つのデモンストレーションを用いた場合、IDSはベンチマークで90.9%の精度を達成したのに対し、Top-k-Consistency-CoTは90.0%であった。これは、異なるデモンストレーション数の設定においても一貫した優位性を示している。
  • 反復回数に応じた性能は安定しており、3回の反復でピーク性能を示し、より多くの反復でも一貫した劣化を示さなかった。これはハイパーパramータ選択に対する頑健性を示している。
  • GPT-4で評価した場合、IDSは93.6%の精度を達成したのに対し、Top-k-Consistency-CoTは92.8%であった。これは、異なるLLMアーキテクチャ間でも本手法の頑健性を確認している。
  • IDSにおけるテストサンプルと選択されたデモンストレーション間の平均意味的類似度(0.46)は、Top-k-Consistency-CoT(0.69)よりも低く、これはIDSが意味的に関連性は保ちつつも、より多様な例を選択できていることを示している。
Figure 2: Illustration of our proposed Iterative Demonstration Selection (IDS). IDS first applies Zero-shot-CoT to the test sample to obtain a reasoning path, which is then used to select few-shot demonstrations from training examples through KNN. The selected demonstration examples are prepended to
Figure 2: Illustration of our proposed Iterative Demonstration Selection (IDS). IDS first applies Zero-shot-CoT to the test sample to obtain a reasoning path, which is then used to select few-shot demonstrations from training examples through KNN. The selected demonstration examples are prepended to

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。