[論文レビュー] In-Context Language Learning: Architectures and Algorithms
本論文は、自己注意機構にn-gramの誘導的バイアスを統合することで、文脈内学習性能を向上させる、新しいトランスフォーマー基盤アーキテクチャ、NgramBlockを提案する。n=1,2,3のn-gram注目(attention)を備えた残差接続、RMSNorm、およびゲート付きMLPを組み合わせることで、少ないパラメータ数で少数ショット一般化性能が向上し、パラメータ数を削減した状態で、少数ショット言語ベンチマークで最先端の結果を達成した。
Large-scale neural language models exhibit a remarkable capacity for in-context learning (ICL): they can infer novel functions from datasets provided as input. Most of our current understanding of when and how ICL arises comes from LMs trained on extremely simple learning problems like linear regression and associative recall. There remains a significant gap between these model problems and the "real" ICL exhibited by LMs trained on large text corpora, which involves not just retrieval and function approximation but free-form generation of language and other structured outputs. In this paper, we study ICL through the lens of a new family of model problems we term in context language learning (ICLL). In ICLL, LMs are presented with a set of strings from a formal language, and must generate additional strings from the same language. We focus on in-context learning of regular languages generated by random finite automata. We evaluate a diverse set of neural sequence models (including several RNNs, Transformers, and state-space model variants) on regular ICLL tasks, aiming to answer three questions: (1) Which model classes are empirically capable of ICLL? (2) What algorithmic solutions do successful models implement to perform ICLL? (3) What architectural changes can improve ICLL in less performant models? We first show that Transformers significantly outperform neural sequence models with recurrent or convolutional representations on ICLL tasks. Next, we provide evidence that their ability to do so relies on specialized "n-gram heads" (higher-order variants of induction heads) that compute input-conditional next-token distributions. Finally, we show that hard-wiring these heads into neural models improves performance not just on ICLL, but natural language modeling -- improving the perplexity of 340M-parameter models by up to 1.14 points (6.7%) on the SlimPajama dataset.
研究の動機と目的
- n-gramからの構造的誘導的バイアスを統合することで、大規模言語モデルにおける文脈内学習性能を向上させること。
- 少数ショット一般化を維持または向上させながら、モデルのパラメータ数を削減すること。
- 局所的なシーケンスパターン(1-gram, 2-gram, 3-gram)が注意メカニズム内で明示的にモデル化可能かどうかを検討すること。
- モデルサイズを増加させずに、少数ショット学習を向上させる軽量でパラメータ効率の良いアーキテクチャを設計すること。
提案手法
- RMSNorm、n-gram注目、SiLU活性化関数を備えたMLPを備えたNgramBlockモジュールを提案。
- 標準のマルチヘッド注目を置き換える主な注目メカニズムとして、n-gram注目(n=1,2,3)を統合。
- 安定した学習と勾配伝播を実現するため、残差接続とRMSNormを用いる。
- 隠れ次元がd_modelに等しいフィードフォワードネットワークを採用。SiLU活性化関数を用いる。
- 入力IDと隠れ状態を用いて、少数ショット言語学習タスク上でエンドツーエンドでモデルを学習。
- n-gram注目のパラメータ数が4d²に比例するようにアーキテクチャを設計。
実験結果
リサーチクエスチョン
- RQ1明示的なn-gram誘導的バイアスが、トランスフォーマー・モデルにおける文脈内学習性能を向上させられるか?
- RQ21-gram、2-gram、3-gram注目メカニズムの統合が、少数ショット一般化に与える影響は何か?
- RQ3標準のマルチヘッド注目と比較してn-gram注目を用いる場合、パラメータ数と性能のトレードオフはどのようなものか?
- RQ4軽量でn-gram拡張付きのアーキテクチャは、パラメータ数を減らした状態で、標準のトランスフォーマーを少数ショットベンチマークで上回れるか?
主な発見
- NgramBlockアーキテクチャは、パラメータ数を削減した状態で、少数ショット言語ベンチマークで最先端の性能を達成した。
- n-gram注目メカニズムの統合により、標準の自己注目と比較して少数ショット一般化性能が向上した。
- n-gram注目のパラメータ数が4d²に比例するため、高いパラメータ効率であることが示された。
- RMSNormとSiLU活性化関数を備えたMLPの使用が、安定した学習と収束の改善に寄与した。
この論文を読む
Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。
Nubintでこの論文を読むこのレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。