paper-with-me

홈 › Papers

RACE Attention: A Strictly Linear-Time Attention Layer for Training on Outrageously Large Contexts

2025-10-05 · Sahil Joshi, Agniva Chowdhury, Amar Kanakamedala, Ekam Singh, Evan Tu, Anshumali Shrivastava arxiv

Softmax Attention has a quadratic time complexity in sequence length, which becomes prohibitive to run at long contexts, even with highly optimized GPU kernels. For example, FlashAttention-2/3 (exact, GPU-optimized implementations of Softmax Attention) cannot complete a single forward-backward pass of a single attention layer once the context exceeds ~4 million tokens on an NVIDIA GH200 (96 GB). We introduce Repeated Arrays-of-Count Estimators (RACE) Attention, a kernel-inspired alternative to Softmax Attention that is strictly linear in sequence length and embedding size. RACE Attention replaces the exponential kernel with a sharpened angular similarity, and approximates attention outputs via Gaussian random projections and soft Locality-Sensitive Hashing (LSH), avoiding construction of the full attention matrix. Across language modeling, masked language modeling, and text/image classification, RACE Attention matches or outperforms strong baselines up to 64K seqeuence length while reducing wall-clock time and memory usage. In addition, we conduct a controlled scaling study on a single attention layer and demonstrate processing of up to 12 million tokens on an NVIDIA GH200 GPU and 75 million tokens on an Intel Xeon Gold 5220R CPU in a single forward-backward pass, which is well beyond the capabilities of current state-of-the-art attention implementations. RACE Attention thus offers a practical and theoretically grounded mechanism for long-context training on today's hardware. We release our code at https://github.com/sahiljoshi515/RACE_Attention.

📄 PDF Abstract BibTeX arXiv:2510.04008

Code (0)

등록된 구현이 없습니다.

Tasks

Image Classification

Similar Papers 제목 키워드 기반

SLAY: Geometry-Aware Spherical Linearized Attention with Yat-Kernel

2026-02-04 · Jose Miguel Luna, Taha Bouhsine, Krzysztof Choromanski arxiv

We propose a new class of linear-time attention mechanisms based on a relaxed and computationally efficient formulation of the recently introduced E-Product, often referred to as the Yat-kernel (Bouhsine, 2025). The resu…

Higher-order Linear Attention

2025-10-31 · Yifan Zhang, Zhen Qin, Mengdi Wang, Quanquan Gu arxiv

The quadratic cost of scaled dot-product attention is a central obstacle to scaling autoregressive language models to long contexts. Linear-time attention and State Space Models (SSMs) provide scalable alternatives but a…

Efficient Linear Attention for Multivariate Time Series Modeling via Entropy Equality

2025-11-05 · Mingtao Zhang, Guoli Yang, Zhanxing Zhu, Mengzhu Wang 외 arxiv

Attention mechanisms have been extensively employed in various applications, including time series modeling, owing to their capacity to capture intricate dependencies; however, their utility is often constrained by quadr…

Flexformer: Flexible Linear Transformer with Learnable Attention Kernel

2026-06-26 · Haoran Zhang, Feng Zhou arxiv

Transformer models rely on attention mechanism to capture long-range dependencies but suffer from quadratic complexity, limiting their scalability to long sequences. Kernel-based linear attention reduces this complexity …

Kalman Linear Attention: Parallel Bayesian Filtering For Efficient Language Modelling and State Tracking

2026-02-11 · Vaisakh Shaj, Cameron Barker, Aidan Scannell, Andras Szecsenyi 외 arxiv

State-space language models such as Mamba and gated linear attention (GLA) offer linear-complexity, parallelisable alternatives to transformers, but their linear state updates limit expressivity and robust state tracking…

Language Modelling