Approaching I/O-optimality for Approximate Attention

Pál András Papp, Aleksandros Sobczyk, Anastasios Zouzias
5/22/2026
cs.LG

No confident code implementation found for this paper.

Abstract

We revisit the I/O complexity of attention in large language models. Given query-key-value matrices $Q,K,V\in\mathbb{R}^{n\times d}$, and a machine with fast memory size $M$, the goal is to compute the "attention matrix" $A=\text{softmax}(Q K ^{\top}/\sqrt{d}) V$ with the minimal number of data transfers between fast and slow memory.

Show full abstract

Existing methods in the literature, most notably FlashAttention and its variants, incur an I/O cost that depends quadratically on the context length $n$, while a trivial lower bound only requires $Ω(nd)$ I/O's to read the inputs and write the output. In this work we show that the dependence on $n$ can be reduced to almost-linear, by developing I/O-efficient algorithms inspired by the recent approximate attention method of Alman and Song [NeurIPS'23]. We also provide (algorithm-specific) lower bounds in different parameter regimes, which nearly match the corresponding upper bounds, indicating that the proposed algorithms are indeed close to I/O-optimal.

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{papp2026approaching,
  title  = {Approaching I/O-optimality for Approximate Attention},
  author = {Pál András Papp and Aleksandros Sobczyk and Anastasios Zouzias},
  year   = {2026},
  eprint = {2605.23751},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.23751v2}
}

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/2605.23751.svg)](https://codeofpaper.com/paper/2605.23751)

Discussion