Beyond Scaling Laws: Understanding Transformer Performance with Associative Memory

要約

Transformer モデルのサイズを大きくしても、必ずしもパフォーマンスが向上するとは限りません。
この現象は経験的なスケーリング法則では説明できません。
さらに、モデルがトレーニング サンプルを記憶するため、汎化能力が向上します。
トランスフォーマーベースの言語モデルの記憶プロセスとパフォーマンスダイナミクスに光を当てる理論的枠組みを紹介します。
各変換器ブロックが近似最近傍検索を効果的に実行できるように、ホップフィールド ネットワークを使用した連想メモリで変換器の動作をモデル化します。
これに基づいて、注目のメカニズムについて洞察に富んだ説明を提供する、現代の連続ホップフィールド ネットワークのエネルギー関数に類似したエネルギー関数を設計します。
マジョリゼーション最小化手法を使用して、Transformer の層状アーキテクチャをキャプチャするグローバル エネルギー関数を構築します。
特定の条件下では、達成可能な最小のクロスエントロピー損失は、ほぼ 1 に等しい定数によって下から制限されることを示します。さまざまなデータ サイズで GPT-2 を使用した実験を実行し、バニラ トランスフォーマーをトレーニングすることによって、理論的結果を実証します。
2M トークンのデータセット。

要約(オリジナル)

Increasing the size of a Transformer model does not always lead to enhanced performance. This phenomenon cannot be explained by the empirical scaling laws. Furthermore, improved generalization ability occurs as the model memorizes the training samples. We present a theoretical framework that sheds light on the memorization process and performance dynamics of transformer-based language models. We model the behavior of Transformers with associative memories using Hopfield networks, such that each transformer block effectively conducts an approximate nearest-neighbor search. Based on this, we design an energy function analogous to that in the modern continuous Hopfield network which provides an insightful explanation for the attention mechanism. Using the majorization-minimization technique, we construct a global energy function that captures the layered architecture of the Transformer. Under specific conditions, we show that the minimum achievable cross-entropy loss is bounded from below by a constant approximately equal to 1. We substantiate our theoretical results by conducting experiments with GPT-2 on various data sizes, as well as training vanilla Transformers on a dataset of 2M tokens.

arxiv情報

著者 Xueyan Niu,Bo Bai,Lei Deng,Wei Han
発行日 2024-05-14 15:48:36+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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