Does Self-Attention Need Separate Weights in Transformers?

要約

自己注意の成功は、長距離の依存関係を捉え、文脈理解を強化する能力にあるが、計算の複雑さと、固有の方向性を持つ逐次データを扱う上での課題によって制限されている。本研究では、(キー、値、クエリ)表現のそれぞれについて3つの個別の行列の代わりに、1つの重み行列のみを学習する共有重み自己注意をベースとしたBERTモデルを導入する。我々の共有重みアテンションは、学習パラメータサイズを半分以上、学習時間を10分の1程度に削減する。さらに、GLUEの小さなタスクにおいて、BERTベースラインよりも高い予測精度を実証し、特に、ノイズの多いデータや領域外のデータに対する汎化能力を実証した。実験結果は、我々の共有自己注意手法が注意ブロックにおいて66.53%のパラメータサイズ削減を達成することを示している。GLUEデータセットにおいて、共有重み自己注意ベースのBERTモデルは、標準、対称、ペアワイズ注意ベースのBERTモデルに対して、それぞれ0.38%、5.81%、1.06%の精度向上を示す。モデルとソースコードはAnonymousで入手可能です。

要約(オリジナル)

The success of self-attention lies in its ability to capture long-range dependencies and enhance context understanding, but it is limited by its computational complexity and challenges in handling sequential data with inherent directionality. This work introduces a shared weight self-attention-based BERT model that only learns one weight matrix for (Key, Value, and Query) representations instead of three individual matrices for each of them. Our shared weight attention reduces the training parameter size by more than half and training time by around one-tenth. Furthermore, we demonstrate higher prediction accuracy on small tasks of GLUE over the BERT baseline and in particular a generalization power on noisy and out-of-domain data. Experimental results indicate that our shared self-attention method achieves a parameter size reduction of 66.53% in the attention block. In the GLUE dataset, the shared weight self-attention-based BERT model demonstrates accuracy improvements of 0.38%, 5.81%, and 1.06% over the standard, symmetric, and pairwise attention-based BERT models, respectively. The model and source code are available at Anonymous.

arxiv情報

著者 Md Kowsher,Nusrat Jahan Prottasha,Chun-Nam Yu,Ozlem Ozmen Garibay,Niloofar Yousefi
発行日 2025-05-02 04:24:25+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

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