paper-with-me

Papers

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

2025-01-23 · Bo Gao, Michael W. Spratling

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 decomposing the Softmax operation into a non-linear transformation and the $l_1$-norm. We identify the latter as essential for maintaining model performance. By replacing the non-linear transformation with the Softplus activation function and introducing a dynamic scale factor for different token lengths based on invariance entropy, we create a novel attention mechanism with performance better than conventional Softmax attention across various inference lengths. To further improve the length extrapolation ability of the proposed attention mechanism, we introduce a novel re-weighting mechanism that amplifies significant attention weights while diminishing weaker ones, enabling the model to concentrate more effectively on relevant tokens. When combined with our proposed attention mechanism, this approach maintains nearly constant validation loss even at 16$\times$ the training token length, ensures numerical stability, and achieves superior results on downstream benchmarks.

📄 PDF Abstract BibTeX arXiv:2501.13428

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Attention 설명 없음
(TravEL!!Guide)How Do I File a Claim with Expedia? How Do I File a Claim with Expedia? Call ☎️ +1-(888) 829 (0881) or +1-805-330-4056 or +1-805-330-4056 for Fast Help & Exclusive Travel Discounts!Need to file a claim with…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

DoPE: Denoising Rotary Position Embedding

2025-11-12 · Jing Xiong, Liyang Fan, Hui Shen, Zunhai Su 외 arxiv

Positional encoding is essential for large language models (LLMs) to represent sequence order, yet recent studies show that Rotary Position Embedding (RoPE) can induce massive activation. We investigate the source of the…

Information Entropy Invariance: Enhancing Length Extrapolation in Attention Mechanisms

2025-01-15 · Kewei Li, Yanwen Kong, Yiping Xu, Jianlin Su 외

Since the emergence of research on improving the length extrapolation capabilities of large language models in 2021, some studies have made modifications to the scaling factor in the scaled dot-product attention mechanis…

KERPLE: Kernelized Relative Positional Embedding for Length Extrapolation

2022-05-20 · Ta-Chung Chi, Ting-Han Fan, Peter J. Ramadge, Alexander I. Rudnicky

Relative positional embeddings (RPE) have received considerable attention since RPEs effectively model the relative distance among tokens and enable length extrapolation. We propose KERPLE, a framework that generalizes r…

DiversityLanguage ModelingLanguage ModellingPosition

Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation

2021-08-27 · ICLR 2022 4 · Ofir Press, Noah A. Smith, Mike Lewis

Since the introduction of the transformer model by Vaswani et al. (2017), a fundamental question has yet to be answered: how does a model achieve extrapolation at inference time for sequences that are longer than it saw …

Inductive BiasPlaying the Game of 2048PositionWord Embeddings

Transformer Working Memory Enables Regular Language Reasoning and Natural Language Length Extrapolation

2023-05-05 · Ta-Chung Chi, Ting-Han Fan, Alexander I. Rudnicky, Peter J. Ramadge

Unlike recurrent models, conventional wisdom has it that Transformers cannot perfectly model regular languages. Inspired by the notion of working memory, we propose a new Transformer variant named RegularGPT. With its no…