Self-Adjust Softmax

要約

SoftMax関数は、トランススコアの各列を1つに合計して正規化し、他の代替機能よりも優れたパフォーマンスを達成するために重要です。
ただし、SoftMax関数は、注意スコアの一部の要素が1つまたはゼロに近い確率など、極端な値に近づくと、グラデーションの消失の問題に直面する可能性があります。
この論文では、$ softmax(x)$を$ x \ cdot softmax(x)$に変更することにより、この問題に対処するために、自己調整的なsoftmax(sa-softmax)を提案します。
x _ {\ min}、0))} {max(0、x_ {max}) – min(x_ {min}、0)}
\ cdot softmax(x)$。
Sa-softmaxは、バニラソフトマックス機能と比較して、勾配特性が強化されていることを理論的に示しています。
さらに、SAソフトマックスの注意は、既存の変圧器モデルにシームレスに統合され、マイナーな調整により注意メカニズムに統合できます。
バニラソフトマックス関数と比較して、SAソフトマックスを使用してトランスモデルの経験的パフォーマンスを評価するための実験を実施しました。
これらの実験は、最大27億パラメーターのモデルを含む、多様なデータセット、言語タスク、および位置エンコーディング方法で行われます。

要約(オリジナル)

The softmax function is crucial in Transformer attention, which normalizes each row of the attention scores with summation to one, achieving superior performances over other alternative functions. However, the softmax function can face a gradient vanishing issue when some elements of the attention scores approach extreme values, such as probabilities close to one or zero. In this paper, we propose Self-Adjust Softmax (SA-Softmax) to address this issue by modifying $softmax(x)$ to $x \cdot softmax(x)$ and its normalized variant $\frac{(x – min(x_{\min},0))}{max(0,x_{max})-min(x_{min},0)} \cdot softmax(x)$. We theoretically show that SA-Softmax provides enhanced gradient properties compared to the vanilla softmax function. Moreover, SA-Softmax Attention can be seamlessly integrated into existing Transformer models to their attention mechanisms with minor adjustments. We conducted experiments to evaluate the empirical performance of Transformer models using SA-Softmax compared to the vanilla softmax function. These experiments, involving models with up to 2.7 billion parameters, are conducted across diverse datasets, language tasks, and positional encoding methods.

arxiv情報

著者 Chuanyang Zheng,Yihang Gao,Guoxuan Chen,Han Shi,Jing Xiong,Xiaozhe Ren,Chao Huang,Xin Jiang,Zhenguo Li,Yu Li
発行日 2025-02-25 15:07:40+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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