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
- Samuel Mausberg (ORCID: https://orcid.org/0009-0006-1091-8044)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-06
- DOI
- https://doi.org/10.5281/zenodo.23195761
- Primary Topic
- Complexity and Algorithms in Graphs
- Type
- preprint