Softmax Attention with Any Temperature in Fixed Dimension: Matching the Best Known Maximum-Inner-Product Bounds
Abstract
Attention is central to modern AI models for language, vision, and scientific modeling. However, direct evaluation compares every query with every key, requiring quadratic time in the context length, which limits its scalability to long contexts. Consequently, characterizing the complexity bounds of attention is of fundamental importance. For every fixed dimension , we give an algorithm for queries, key-value pairs, and additive error , with expected time For fixed dimension and a fixed number of value channels, soft-O hides factors of the form where bounds input encoding lengths and bounds coordinate and value magnitudes. In particular, the dependence on and is polylogarithmic, which allows arbitrary positive temperature. When and , the bound is : near-linear in dimensions two and three, with exponent in dimensions four and five and in dimensions six and seven. It improves the previous upper bound and matches the best known batch maximum-inner-product bound in each fixed dimension. Additionally, we reduce integer batch maximum inner product computation to one attention call with the same dimension and input sizes .
Create a lesson
Metadata
- Categories
- cs.DS, cs.CC, cs.CG, cs.LG
- Comments
- 65 pages, 5 figures
Related papers
A Tight Superlinear Lower Bound on the Sketching Dimension of Weighted Spectral Sparsification
Shared title terminologycs.DSYanyu Chen, Yu Chen, Mingji Yang
An Order-Optimal Square-Root Bound for Online Maximin Share Allocation with Known Types
Shared title terminologycs.DSZheyu Zhou
Improved Bounds for Online Matching with Random Edge Arrivals
Shared title terminologycs.DSYilong Feng, Haolong Li, Zonghan Yang
Tight Competitive Bounds for Online Matching on Forests
Shared title terminologycs.DSBartłomiej Bosek, Grzegorz Gutowski, Paweł Putra et al.
A Sub-3^n Upper Bound on the Number of Stable Matchings
Shared title terminologycs.DSKen-ichi Kawarabayashi, Hikaru Wada, Masataka Yoneda
A 2.81^n upper bound on the number of stable matchings
Shared title terminologycs.DSEbrahim Ghorbani, Matthias Mnich