Sparser is Faster and Less is More: Efficient Sparse Attention for Long-Range Transformers

要約

自己回帰トランスフォーマー、特に拡張コンテキスト ウィンドウ内で長いシーケンスを効率的に処理することは、二次計算の複雑さとセルフ アテンション メカニズムに固有の相当な KV メモリ要件により、重大な課題を引き起こします。
この研究では、パフォーマンスを維持しながら、これらの計算およびメモリの障害を克服するように設計された新しいスパース アテンション メカニズムである SPARSEK アテンションを紹介します。
私たちのアプローチは、スコアリング ネットワークと微分可能なトップ K マスク演算子 SPARSEK を統合して、クエリごとに一定数の KV ペアを選択することで、勾配ベースの最適化を可能にします。
その結果、SPARSEK Attendance は、生成中に線形な時間計算量と一定のメモリ フットプリントを提供します。
実験結果から、SPARSEK Attendance は以前の sparse tention 手法よりも優れたパフォーマンスを示し、特に言語モデリングと下流タスクにおいて、トレーニングと推論の両方で速度が大幅に向上することが明らかになりました。
さらに、私たちの手法は最小限の微調整で事前トレーニングされた大規模言語モデル (LLM) にシームレスに統合でき、さまざまなアプリケーションで長距離の依存関係を効果的に管理する実用的なソリューションを提供します。

要約(オリジナル)

Accommodating long sequences efficiently in autoregressive Transformers, especially within an extended context window, poses significant challenges due to the quadratic computational complexity and substantial KV memory requirements inherent in self-attention mechanisms. In this work, we introduce SPARSEK Attention, a novel sparse attention mechanism designed to overcome these computational and memory obstacles while maintaining performance. Our approach integrates a scoring network and a differentiable top-k mask operator, SPARSEK, to select a constant number of KV pairs for each query, thereby enabling gradient-based optimization. As a result, SPARSEK Attention offers linear time complexity and constant memory footprint during generation. Experimental results reveal that SPARSEK Attention outperforms previous sparse attention methods and provides significant speed improvements during both training and inference, particularly in language modeling and downstream tasks. Furthermore, our method can be seamlessly integrated into pre-trained Large Language Models (LLMs) with minimal fine-tuning, offering a practical solution for effectively managing long-range dependencies in diverse applications.

arxiv情報

著者 Chao Lou,Zixia Jia,Zilong Zheng,Kewei Tu
発行日 2024-06-24 15:55:59+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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