Near-Linear Attention in Three Dimensions

Given n query vectors, n key vectors, and scalar values, softmax attention returns one exponentially weighted average per query. We give an n 2O(√log n)-time randomised algorithm in three dimensions on a RAM with O(log n)-bit words. Coordinates are logarithmic-bit rationals bounded by n10, values lie in [−1, 1], and the simultaneous additive error is at most n−10 with probability at least 2/3. Thus the optimal word-RAM exponent is α(3) = 1. The algorithm builds small sampled hulls. Within a simplicial normal cone, keys satisfying its three facet inequalities have a nonnegative score-deficit formula; dyadic coefficient bins let many queries share their moment sums. The other keys recurse. A bounded-degree triangulation makes each sampled facet occur in at most nine frames, and the expected total facet-conflict size is linear. Queries follow single paths, whose recorded local maxima also recover the global maxima. All moment sums and polynomial reconstruction use exact integers. Without a time cutoff, every execution meets the error bound and the stated running time holds in expectation.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-10-06
DOI
https://doi.org/10.5281/zenodo.23195762
Primary Topic
Complexity and Algorithms in Graphs
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Near-Linear Attention in Three Dimensions

Samuel Mausberg
Zenodo (CERN European Organization for Nuclear Research)
Complexity and Algorithms in Graphs
preprint

Near-Linear Attention in Three Dimensions

Samuel Mausberg
preprint en

Abstract

Given n query vectors, n key vectors, and scalar values, softmax attention returns one exponentially weighted average per query. We give an n 2O(√log n)-time randomised algorithm in three dimensions on a RAM with O(log n)-bit words. Coordinates are logarithmic-bit rationals bounded by n10, values lie in [−1, 1], and the simultaneous additive error is at most n−10 with probability at least 2/3. Thus the optimal word-RAM exponent is α(3) = 1. The algorithm builds small sampled hulls. Within a simplicial normal cone, keys satisfying its three facet inequalities have a nonnegative score-deficit formula; dyadic coefficient bins let many queries share their moment sums. The other keys recurse. A bounded-degree triangulation makes each sampled facet occur in at most nine frames, and the expected total facet-conflict size is linear. Queries follow single paths, whose recorded local maxima also recover the global maxima. All moment sums and polynomial reconstruction use exact integers. Without a time cutoff, every execution meets the error bound and the stated running time holds in expectation.

Zenodo (CERN European Organization for Nuclear Research)
Complexity and Algorithms in Graphs
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.