CLAILGJan 23, 2025

Softplus Attention with Re-weighting Boosts Length Extrapolation in Large Language Models

arXiv:2501.13428v4h-index: 1
Originality Highly original
AI Analysis

This addresses a critical bottleneck for deploying large language models in long-context applications, offering a significant improvement over existing methods.

The paper tackled the problem of numerical instability and reduced performance in large language models as inference token length increases by proposing a two-stage attention mechanism with Softplus activation and re-weighting, resulting in nearly constant validation loss at 16× training length and superior performance on long-context tasks.

Large language models have achieved remarkable success in recent years, primarily due to the implementation of self-attention mechanisms. However, traditional Softmax attention suffers from numerical instability and reduced performance as the length of inference tokens increases. This paper addresses these issues by proposing a new design principle for attention, viewing it as a two-stage process. We first decompose the Softmax operation into a non-linear positivity transformation and an $l_1$-normalisation step, identifying the latter as essential for maintaining model performance. In the first stage, we replace the standard exponential function with the more numerically stable Softplus activation and introduce a dynamic scale factor based on invariance entropy, creating a novel attention mechanism that outperforms conventional Softmax attention. In the second stage, we introduce a re-weighting mechanism that sharpens the attention distribution, amplifying significant weights while diminishing weaker ones. This enables the model to concentrate more effectively on relevant tokens and fundamentally improves length extrapolation. When combined, this two-stage approach ensures numerical stability and dramatically improves length extrapolation, maintaining a nearly constant validation loss at 16$\times$ the training length while achieving superior results on challenging long-context retrieval tasks and standard downstream benchmarks.

Foundations

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

Your Notes