要約
実際には、トランスフォーマーベースのモデルは推論段階でコンテキスト内の概念を学習できることが観察されています。
既存の文献、たとえば \citet{zhang2023trained,huang2023context} は、このコンテキスト内学習能力について理論的に説明していますが、各サンプルの入力 $x_i$ と出力 $y_i$ が同じトークンに埋め込まれていると仮定しています (つまり、
構造化データ)。
ただし、実際には、これらは 2 つのトークン (つまり、非構造化データ \cite{wibisono2023role}) で表現されます。
この場合、この論文では、トランスフォーマーのアーキテクチャの利点を研究するために線形回帰タスクの実験を実施し、トランスフォーマーが非構造化データから学習できる理由を説明するための対応する理論的直観をいくつか提供します。
私たちは、コンテキスト内の学習を促進するトランスフォーマーの正確なコンポーネントを研究します。
特に、(1) 先読みアテンション マスクを備えた 2 層のソフトマックス (セルフ) アテンションを持つトランスフォーマーは、各例の $x_i$ の隣のトークンに $y_i$ が含まれているかどうかをプロンプトから学習できることがわかります。
(2) 位置エンコーディングによりパフォーマンスをさらに向上させることができます。
(3) 入力埋め込み次元が高いマルチヘッド アテンションは、シングルヘッド アテンションよりも優れた予測パフォーマンスを持っています。
要約(オリジナル)
In practice, it is observed that transformer-based models can learn concepts in context in the inference stage. While existing literature, e.g., \citet{zhang2023trained,huang2023context}, provide theoretical explanations on this in-context learning ability, they assume the input $x_i$ and the output $y_i$ for each sample are embedded in the same token (i.e., structured data). However, in reality, they are presented in two tokens (i.e., unstructured data \cite{wibisono2023role}). In this case, this paper conducts experiments in linear regression tasks to study the benefits of the architecture of transformers and provides some corresponding theoretical intuitions to explain why the transformer can learn from unstructured data. We study the exact components in a transformer that facilitate the in-context learning. In particular, we observe that (1) a transformer with two layers of softmax (self-)attentions with look-ahead attention mask can learn from the prompt if $y_i$ is in the token next to $x_i$ for each example; (2) positional encoding can further improve the performance; and (3) multi-head attention with a high input embedding dimension has a better prediction performance than single-head attention.
arxiv情報
| 著者 | Yue Xing,Xiaofeng Lin,Namjoon Suh,Qifan Song,Guang Cheng |
| 発行日 | 2024-02-01 16:39:45+00:00 |
| arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google