How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representations

要約

トランスフォーマー アーキテクチャに基づく大規模な言語モデルは、優れたインコンテキスト学習 (ICL) 機能を実証していますが、そのような機能の理解はまだ初期段階にあり、既存の理論とメカニズムの理解は、主に単純な関数クラスの学習などの単純なシナリオに焦点を当てています。
このペーパーでは、表現による学習を研究することで、より複雑なシナリオにおける ICL を理解するための最初のステップを踏みます。
具体的には、構成構造を備えた合成インコンテキスト学習問題を構築します。この場合、ラベルは、インスタンスごとに異なる線形関数で構成された、おそらく複雑ではあるが固定された表現関数を介した入力に依存します。
構築により、最適な ICL アルゴリズムは、まず表現関数によって入力を変換し、次に変換されたデータセット上で線形 ICL を実行します。
我々は、そのようなアルゴリズムを適度な深さとサイズで近似的に実装する変換器の存在を理論的に示します。
経験的に、トレーニングされたトランスフォーマーはこの設定で最適に近い ICL パフォーマンスを一貫して達成し、下位層がデータセットを変換し、上位層が線形 ICL を実行する望ましい分析を示すことがわかりました。
広範なプローブと新しい貼り付け実験を通じて、入力と表現の両方での具体的なコピー動作、上位層のみの線形 ICL 機能、ICL 後の表現選択メカニズムなど、トレーニング済みトランスフォーマー内のいくつかのメカニズムをさらに明らかにします。
よりハードな混合設定。
これらの観察されたメカニズムは私たちの理論とよく一致しており、より現実的なシナリオで変圧器がどのように ICL を実行するかを明らかにする可能性があります。

要約(オリジナル)

While large language models based on the transformer architecture have demonstrated remarkable in-context learning (ICL) capabilities, understandings of such capabilities are still in an early stage, where existing theory and mechanistic understanding focus mostly on simple scenarios such as learning simple function classes. This paper takes initial steps on understanding ICL in more complex scenarios, by studying learning with representations. Concretely, we construct synthetic in-context learning problems with a compositional structure, where the label depends on the input through a possibly complex but fixed representation function, composed with a linear function that differs in each instance. By construction, the optimal ICL algorithm first transforms the inputs by the representation function, and then performs linear ICL on top of the transformed dataset. We show theoretically the existence of transformers that approximately implement such algorithms with mild depth and size. Empirically, we find trained transformers consistently achieve near-optimal ICL performance in this setting, and exhibit the desired dissection where lower layers transforms the dataset and upper layers perform linear ICL. Through extensive probing and a new pasting experiment, we further reveal several mechanisms within the trained transformers, such as concrete copying behaviors on both the inputs and the representations, linear ICL capability of the upper layers alone, and a post-ICL representation selection mechanism in a harder mixture setting. These observed mechanisms align well with our theory and may shed light on how transformers perform ICL in more realistic scenarios.

arxiv情報

著者 Tianyu Guo,Wei Hu,Song Mei,Huan Wang,Caiming Xiong,Silvio Savarese,Yu Bai
発行日 2023-10-16 17:40:49+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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