Approaching I/O-optimality for Approximate Attention

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Papp, Pál András, Sobczyk, Aleksandros, Zouzias, Anastasios
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917524964114432
author Papp, Pál András
Sobczyk, Aleksandros
Zouzias, Anastasios
author_facet Papp, Pál András
Sobczyk, Aleksandros
Zouzias, Anastasios
contents 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. Existing methods in the literature, most notably FlashAttention and its variants, incur an I/O cost that depends quadratically on $n$, while a trivial lower bound only requires $Ω(nd)$ I/O's to read the inputs and write the output. In this work, we present a technique for computing attention where the I/O cost only depends almost-linearly on $n$ in most parameter regimes. This is achieved by developing I/O-efficient algorithms inspired by the recent approximate attention framework of Alman and Song. We also prove corresponding lower bounds in each parameter regime to show that our algorithms are indeed close to I/O-optimal.
format Preprint
id arxiv_https___arxiv_org_abs_2605_23751
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Approaching I/O-optimality for Approximate Attention
Papp, Pál András
Sobczyk, Aleksandros
Zouzias, Anastasios
Machine Learning
68T07, 68Q17, 68T50
F.2.2; I.2.7
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. Existing methods in the literature, most notably FlashAttention and its variants, incur an I/O cost that depends quadratically on $n$, while a trivial lower bound only requires $Ω(nd)$ I/O's to read the inputs and write the output. In this work, we present a technique for computing attention where the I/O cost only depends almost-linearly on $n$ in most parameter regimes. This is achieved by developing I/O-efficient algorithms inspired by the recent approximate attention framework of Alman and Song. We also prove corresponding lower bounds in each parameter regime to show that our algorithms are indeed close to I/O-optimal.
title Approaching I/O-optimality for Approximate Attention
topic Machine Learning
68T07, 68Q17, 68T50
F.2.2; I.2.7
url https://arxiv.org/abs/2605.23751