Lune

EMNLP2025Top-tier venue

Self-Adjust Softmax

Chuanyang Zheng, Yihang Gao, Guoxuan Chen, Han Shi, Jing Xiong, Xiaozhe Ren, Chao Huang, Zhenguo Li, Yu Li

2025Year
4Top-tier citations

Abstract

The softmax function is crucial in Transformer attention, which normalizes each row of the attention scores with summation to one. Usually, tokens with larger attention scores are important for the final prediction. However, the softmax function can face a gradient vanishing issue for such important tokens (e.g., probabilities close to one), leading to optimization difficulties for the important tokens so that the performance may not be better. In this paper, we propose Self-Adjusting Softmax (SA-Softmax) to address this issue by modifying sof tmax(z) to z • sof tmax(z) and its normalized variant (z-min(zmin,0)) max(0,zmax)-min(zmin,0) • sof tmax(z). 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.

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext 2e53cca1-a07e-4383-8d0a-a1013e80d246

Cited by top-tier papers4

Ask how each one uses it

Builds on22

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines