$k$NN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inference

要約

In-Context Learning (ICL) は、コンテキスト内のデモンストレーションを条件とした迅速な完了としてターゲット タスクを定式化するもので、LLM の一般的な利用となっています。
この論文では、コンテキストの長さの制限により、トレーニングデータでスケールアップできないという、この典型的な使用法の実際の苦境を最初に開示します。
その上、既存の研究は、ICL もさまざまなバイアスに悩まされており、繊細なキャリブレーション処理が必要であることを示しています。
両方の課題に対処するために、シンプルで効果的なソリューション $k$NN Prompting を提唱します。これは、最初に分散表現のトレーニング データを使用して LLM にクエリを実行し、次に単純に最近傍を参照することでテスト インスタンスを予測します。
その 2 倍の優位性を実証するために、包括的な実験を実施します。
これは、同等の少数ショット シナリオの下で、最先端のキャリブレーション ベースの方法よりも大幅に優れています。
2) コンテキストを超えて: $k$NN Prompting は、利用可能な限り多くのトレーニング データを使用してさらに効果的にスケールアップでき、継続的に大幅な改善をもたらします。
スケーリングの傾向は、2 ショットから 1024 ショットの範囲の 10 桁、および 0.8B から 30B の範囲の異なる LLM スケールにわたって保持されます。
データのスケーリングをモデルのスケーリングにうまく橋渡しし、LLM 展開の勾配のないパラダイムに新しい可能性をもたらします。
コードは公開されています。

要約(オリジナル)

In-Context Learning (ICL), which formulates target tasks as prompt completion conditioned on in-context demonstrations, has become the prevailing utilization of LLMs. In this paper, we first disclose an actual predicament for this typical usage that it can not scale up with training data due to context length restriction. Besides, existing works have shown that ICL also suffers from various biases and requires delicate calibration treatment. To address both challenges, we advocate a simple and effective solution, $k$NN Prompting, which first queries LLM with training data for distributed representations, then predicts test instances by simply referring to nearest neighbors. We conduct comprehensive experiments to demonstrate its two-fold superiority: 1) Calibration-Free: $k$NN Prompting does not directly align LLM output distribution with task-specific label space, instead leverages such distribution to align test and training instances. It significantly outperforms state-of-the-art calibration-based methods under comparable few-shot scenario. 2) Beyond-Context: $k$NN Prompting can further scale up effectively with as many training data as are available, continually bringing substantial improvements. The scaling trend holds across 10 orders of magnitude ranging from 2 shots to 1024 shots as well as different LLMs scales ranging from 0.8B to 30B. It successfully bridges data scaling into model scaling, and brings new potentials for the gradient-free paradigm of LLM deployment. Code is publicly available.

arxiv情報

著者 Benfeng Xu,Quan Wang,Zhendong Mao,Yajuan Lyu,Qiaoqiao She,Yongdong Zhang
発行日 2023-03-24 06:16:29+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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