In-Context Learning with Representations: Contextual Generalization of Trained Transformers

要約

インコンテキスト学習 (ICL) とは、事前トレーニングされた大規模言語モデルの優れた機能を指し、推論中にいくつかの例を与えられて新しいタスクを学習できます。
ただし、ICL の理論的理解は、特にプロンプ​​ト内の目に見えない例に一般化するようにトランスフォーマーをトレーニングできるかどうかについてはほとんど調査されていません。そのためには、モデルが一般化のプロンプトの文脈上の知識を取得する必要があります。
この論文では、非線形回帰タスクのレンズを通した勾配降下法による変圧器のトレーニング ダイナミクスを調査します。
ここでの文脈的な一般化は、文脈内の各タスクのテンプレート関数を学習することによって達成できます。すべてのテンプレート関数は、$m$ 基底関数を持つ線形空間内にあります。
部分的にラベル付けされたプロンプトが与えられた場合、ラベルにガウス ノイズが含まれており、各プロンプトのサンプル数がテンプレートを決定するのに十分ではない場合、ラベルのない入力をコンテキスト内で予測するために、1 層マルチヘッド トランスフォーマーのトレーニング ダイナミクスを分析します。
穏やかな仮定の下で、単層マルチヘッド変圧器のトレーニング損失が全体的な最小値に線形に収束することを示します。
さらに、トランスフォーマーは、基底関数に対してリッジ回帰を実行する方法を効果的に学習します。
私たちの知る限り、この研究は、プロンプトに少数のクエリと回答のペアしか含まれていない場合に、トランスフォーマーがコンテキスト (つまり、テンプレート) 情報を学習して、未見の例とタスクの両方に一般化できることを証明できる最初の実証です。

要約(オリジナル)

In-context learning (ICL) refers to a remarkable capability of pretrained large language models, which can learn a new task given a few examples during inference. However, theoretical understanding of ICL is largely under-explored, particularly whether transformers can be trained to generalize to unseen examples in a prompt, which will require the model to acquire contextual knowledge of the prompt for generalization. This paper investigates the training dynamics of transformers by gradient descent through the lens of non-linear regression tasks. The contextual generalization here can be attained via learning the template function for each task in-context, where all template functions lie in a linear space with $m$ basis functions. We analyze the training dynamics of one-layer multi-head transformers to in-contextly predict unlabeled inputs given partially labeled prompts, where the labels contain Gaussian noise and the number of examples in each prompt are not sufficient to determine the template. Under mild assumptions, we show that the training loss for a one-layer multi-head transformer converges linearly to a global minimum. Moreover, the transformer effectively learns to perform ridge regression over the basis functions. To our knowledge, this study is the first provable demonstration that transformers can learn contextual (i.e., template) information to generalize to both unseen examples and tasks when prompts contain only a small number of query-answer pairs.

arxiv情報

著者 Tong Yang,Yu Huang,Yingbin Liang,Yuejie Chi
発行日 2024-08-19 16:47:46+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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