トランスフォーマーの誕生:メモリの視点から
Birth of a Transformer: A Memory Viewpoint
June 1, 2023
著者: Alberto Bietti, Vivien Cabannes, Diane Bouchacourt, Herve Jegou, Leon Bottou
cs.AI
要旨
トランスフォーマーに基づく大規模言語モデルは、実証的な成功を収めてきました。しかし、それらがより広く展開されるにつれ、モデルをより信頼性の高いものにするために、その内部メカニズムをより深く理解する必要性が高まっています。これらのモデルは、訓練データから膨大な量の知識を保持し、コンテキストやプロンプトで提供される新しい情報に迅速に適応するように見えます。本研究では、トークンがグローバルまたはコンテキスト固有のバイグラム分布から生成される合成設定を考慮することで、トランスフォーマーがこれらの2種類の知識をどのようにバランスさせるかを調査します。簡略化された2層トランスフォーマーの訓練プロセスを注意深く実証分析することで、グローバルバイグラムの迅速な学習と、コンテキスト内バイグラムに対する「帰納ヘッド」メカニズムのより遅い発達を明らかにします。重み行列が連想記憶として果たす役割を強調し、訓練中に勾配がそれらの学習を可能にする仕組みについて理論的洞察を提供し、データ分布特性の役割を考察します。
English
Large language models based on transformers have achieved great empirical
successes. However, as they are deployed more widely, there is a growing need
to better understand their internal mechanisms in order to make them more
reliable. These models appear to store vast amounts of knowledge from their
training data, and to adapt quickly to new information provided in their
context or prompt. We study how transformers balance these two types of
knowledge by considering a synthetic setup where tokens are generated from
either global or context-specific bigram distributions. By a careful empirical
analysis of the training process on a simplified two-layer transformer, we
illustrate the fast learning of global bigrams and the slower development of an
"induction head" mechanism for the in-context bigrams. We highlight the role of
weight matrices as associative memories, provide theoretical insights on how
gradients enable their learning during training, and study the role of
data-distributional properties.