Scalable-Softmax multiplies logits by log n to fix attention flattening in long context

RobertTLange · x · 2026-11-26

Robert Lange highlights another way long context breaks transformers: as the number of keys grows, softmax flattens and the maximum attention weight shrinks, making it harder for the model to prioritize key information.

The arXiv paper "Scalable-Softmax Is Superior for Attention" proposes SSMax, which multiplies logits by a factor growing with log n (context length) and can seamlessly replace softmax in existing Transformer architectures. Experiments show faster loss reduction in pretraining, significantly better long-context and key information retrieval performance, and attention that stays focused even in long contexts. Models trained with SSMax from scratch get the best length generalization, but swapping softmax for SSMax mid- or post-pretraining still recovers some of the benefit.

He also links QK-Norm as another fix for the same problem: normalize q/k to unit length, learn a scale, and drop the 1/√dk — which previously kept attention logits from blowing up at scale in ViT-22B.

Related event: Thread Explains Why Attention Divides by √d_k and Its Alternatives(4 posts)→

Original post →

More from Models

Models channel →