Separations in the Representational Capabilities of Transformers and Recurrent Architectures

要約

変圧器アーキテクチャは基礎モデルに広く採用されています。
推論コストが高いため、効率的なリカレント アーキテクチャ (RNN) の可能性を探ることに新たな関心が集まっています。
この論文では、インデックス検索、最近傍法、有界 Dyck 言語の認識、文字列の等価性など、実際に関連するいくつかのタスクにわたるトランスフォーマーと RNN の表現能力の違いを分析します。
検討したタスクについて、結果はさまざまなアーキテクチャに必要なモデルのサイズに基づいた分離を示しています。
たとえば、対数幅の 1 層 Transformer はインデックス ルックアップを実行できるのに対し、RNN は線形サイズの隠れ状態を必要とすることを示します。
逆に、一定サイズの RNN は境界のある Dyck 言語を認識できますが、1 層の Transformer はこのタスクのために線形サイズを必要とすることを示します。
さらに、対数サイズの 2 層 Transformer は文字列の等価性や素性などの決定タスクを実行できるのに対し、1 層 Transformer とリカレント モデルはどちらもこれらのタスクに線形サイズを必要とすることを示します。
また、対数サイズの 2 層 Transformer がフォワード パスで最近隣アルゴリズムを実装できることも示します。
一方、リカレント モデルには線形サイズが必要です。
私たちの構築は $O(\log N)$ 次元空間における $N$ のほぼ直交するベクトルの存在に基づいており、下限は通信の複雑さの問題からの削減に基づいています。
実用的なサイズのシーケンスでのこれらのアーキテクチャのパフォーマンスの違いを強調する実験で理論的結果を補足します。

要約(オリジナル)

Transformer architectures have been widely adopted in foundation models. Due to their high inference costs, there is renewed interest in exploring the potential of efficient recurrent architectures (RNNs). In this paper, we analyze the differences in the representational capabilities of Transformers and RNNs across several tasks of practical relevance, including index lookup, nearest neighbor, recognizing bounded Dyck languages, and string equality. For the tasks considered, our results show separations based on the size of the model required for different architectures. For example, we show that a one-layer Transformer of logarithmic width can perform index lookup, whereas an RNN requires a hidden state of linear size. Conversely, while constant-size RNNs can recognize bounded Dyck languages, we show that one-layer Transformers require a linear size for this task. Furthermore, we show that two-layer Transformers of logarithmic size can perform decision tasks such as string equality or disjointness, whereas both one-layer Transformers and recurrent models require linear size for these tasks. We also show that a log-size two-layer Transformer can implement the nearest neighbor algorithm in its forward pass; on the other hand recurrent models require linear size. Our constructions are based on the existence of $N$ nearly orthogonal vectors in $O(\log N)$ dimensional space and our lower bounds are based on reductions from communication complexity problems. We supplement our theoretical results with experiments that highlight the differences in the performance of these architectures on practical-size sequences.

arxiv情報

著者 Satwik Bhattamishra,Michael Hahn,Phil Blunsom,Varun Kanade
発行日 2024-06-13 17:31:30+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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