CLAILGJan 31, 2025

Scalable-Softmax Is Superior for Attention

arXiv:2501.19399v137 citationsh-index: 1
Originality Incremental advance
AI Analysis

This addresses a key bottleneck in scaling attention mechanisms for language models, offering a practical solution for improving length generalization, though it is incremental as it modifies an existing component rather than introducing a new paradigm.

The paper tackled the problem of attention distribution flattening in Transformer-based language models as context size increases, by proposing Scalable-Softmax (SSMax) to replace Softmax, resulting in faster loss reduction during pretraining and significant improvements in long-context performance and key information retrieval.

The maximum element of the vector output by the Softmax function approaches zero as the input vector size increases. Transformer-based language models rely on Softmax to compute attention scores, causing the attention distribution to flatten as the context size grows. This reduces the model's ability to prioritize key information effectively and potentially limits its length generalization. To address this problem, we propose Scalable-Softmax (SSMax), which replaces Softmax in scenarios where the input vector size varies. SSMax can be seamlessly integrated into existing Transformer-based architectures. Experimental results in language modeling show that models using SSMax not only achieve faster loss reduction during pretraining but also significantly improve performance in long contexts and key information retrieval. Furthermore, an analysis of attention scores reveals that SSMax enables the model to focus attention on key information even in long contexts. Additionally, although models that use SSMax from the beginning of pretraining achieve better length generalization, those that have already started pretraining can still gain some of this ability by replacing Softmax in the attention layers with SSMax, either during or after pretraining.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes