Latent Attention for Linear Time Transformers

要約

トランスフォーマーの標準的なアテンション メカニズムの時間計算量は、シーケンスの長さに応じて二次関数的に変化します。
潜在ベクトルを介した注意の定義に基づいて、これを時間の経過とともに線形スケーリングに減らす方法を紹介します。
このメソッドは、標準のアテンション メカニズムのドロップイン代替品としてすぐに使用できます。
私たちの「Latte Transformer」モデルは双方向タスクと一方向タスクの両方に実装でき、因果バージョンでは言語生成タスクの推論中にメモリと時間効率が高い反復実装が可能です。
次のトークンの予測は、標準のトランスフォーマーではシーケンスの長さに比例してスケールされますが、Latte トランスフォーマーでは次のトークンを計算するために一定の時間が必要です。
私たちの方法の経験的なパフォーマンスは標準的な注意に匹敵しますが、標準的な注意における実際的なものよりもはるかに大きなコンテキストウィンドウにスケーリングすることができます。

要約(オリジナル)

The time complexity of the standard attention mechanism in a transformer scales quadratically with the length of the sequence. We introduce a method to reduce this to linear scaling with time, based on defining attention via latent vectors. The method is readily usable as a drop-in replacement for the standard attention mechanism. Our ‘Latte Transformer’ model can be implemented for both bidirectional and unidirectional tasks, with the causal version allowing a recurrent implementation which is memory and time-efficient during inference of language generation tasks. Whilst next token prediction scales linearly with the sequence length for a standard transformer, a Latte Transformer requires constant time to compute the next token. The empirical performance of our method is comparable to standard attention, yet allows scaling to context windows much larger than practical in standard attention.

arxiv情報

著者 Rares Dolga,Marius Cobzarenco,David Barber
発行日 2024-02-27 13:54:48+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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