Scaling Context Requires Rethinking Attention

Carles Gelada, Jacob Buckman, Sean Zhang, Txus Bach
7/6/2025
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

We argue that neither transformers nor sub-quadratic architectures are well suited to training at long sequence lengths: the cost of processing the context is too expensive in the former, too inexpensive in the latter. Approaches such as sliding window attention which reduce the cost-per-token of a transformer impair in-context learning, and so are also unsuitable. To address these limitations, we introduce power attention, an architectural layer for linear-cost sequence modeling whose state size can be adjusted independently of parameters, unlocking the advantages of linear attention on practical domains. We develop and open-source a set of GPU kernels for efficient power attention, identifying a novel pattern of operation fusion to avoid memory and bandwidth bottlenecks. Our experiments on the in-context learning of power attention shows that these models dominate both exponential attention and linear attention at long-context training.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gelada2025scaling,
  title  = {Scaling Context Requires Rethinking Attention},
  author = {Carles Gelada and Jacob Buckman and Sean Zhang and Txus Bach},
  year   = {2025},
  eprint = {2507.04239},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.04239v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.04239.svg)](https://codeofpaper.com/paper/2507.04239)

Discussion