paper

Softmax Attention with Any Temperature in Fixed Dimension: Matching the Best Known Maximum-Inner-Product Bounds

arXiv:2611.06055

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 .

arXiv comment65 pages, 5 figures