要約
注意メカニズムは、トランスベースの大手言語モデル(LLMS)の印象的な能力に不可欠です。
ただし、シーケンスの長さへの二次依存のため、注意を計算することは計算集中です。
Top-Thetaの注意と呼ばれる新しいアプローチ、または単にTop-$ \ Theta $を紹介します。これは、慎重に較正されたしきい値と比較することにより、あまり重要でない注意要素を選択的にプルーナします。
この方法は、モデルの精度を維持しながら、自己関節マトリックス増殖の効率を大幅に改善し、生成デコード中に必要なVキャッシュ行の数を3倍に減らし、Prefillフェーズでは10倍の注意要素の数を減らします。
私たちの方法では、モデル再訓練を必要としません。
代わりに、分布シフトに回復力があるための短いキャリブレーションフェーズのみが必要であるため、さまざまなデータセットのしきい値を再調整する必要はありません。
Top-Kの注意とは異なり、Top-$ \ Theta $はフルベクトルの依存関係を排除し、タイリングとスケールアウト、および費用のかかるTOP-K検索を回避するのに適しています。
私たちのアプローチの重要な革新は、効率的な数値補償技術の開発であり、注意スコアの積極的な剪定の下でもモデルの精度を維持するのに役立ちます。
要約(オリジナル)
The attention mechanism is essential for the impressive capabilities of transformer-based Large Language Models (LLMs). However, calculating attention is computationally intensive due to its quadratic dependency on the sequence length. We introduce a novel approach called Top-Theta Attention, or simply Top-$\theta$, which selectively prunes less essential attention elements by comparing them against carefully calibrated thresholds. This method greatly improves the efficiency of self-attention matrix multiplication while preserving model accuracy, reducing the number of required V cache rows by 3x during generative decoding and the number of attention elements by 10x during the prefill phase. Our method does not require model retraining; instead, it requires only a brief calibration phase to be resilient to distribution shifts, thus not requiring the thresholds for different datasets to be recalibrated. Unlike top-k attention, Top-$\theta$ eliminates full-vector dependency, making it suitable for tiling and scale-out and avoiding costly top-k search. A key innovation of our approach is the development of efficient numerical compensation techniques, which help preserve model accuracy even under aggressive pruning of attention scores.
arxiv情報
著者 | Konstantin Berestizshevsky,Renzo Andri,Lukas Cavigelli |
発行日 | 2025-02-12 12:50:15+00:00 |
arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google