Manuscript Offprint
arXiv:2611.06055Softmax 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 \tilde{O}(n^{2-2/(\lfloor d/2\rfloor+1)): 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 .
*Corresponding author.
Contents 1 Introduction 1 1.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Technical Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.1 Normalization and the Planar Base Case . . . . . . . . . . . . . . . . . . . . . 4 1.2.2 Temperature Interpolation and Common-Anchor Blocks . . . . . . . . . . . . 5 1.2.3 Random Prefix Chains and Heavy/Light Recursion . . . . . . . . . . . . . . . 6 1.3 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2 Preliminaries 9 2.1 Computation and Error Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.2 Random Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3 Analytic Estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 A Dimension-Preserving Reduction from Maximum Inner Product 13 3.1 Computing Exact Maxima from Attention . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2 Conditional Hardness in Superconstant Dimension . . . . . . . . . . . . . . . . . . . 14 4 A Deterministic Algorithm in Two Dimensions 14 4.1 Shifted-Kernel Products in the Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.2 Centering and Radial Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3 Radial and Boundary Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.4 Polynomial Approximation and Moment Sweeps . . . . . . . . . . . . . . . . . . . . 17 4.5 Kernel Products and Attention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.6 Online Queries after Preprocessing the Keys . . . . . . . . . . . . . . . . . . . . . . . 19 5 Shifted Kernels and Dimension Induction 19 5.1 Exact Maxima and Normalized Directions . . . . . . . . . . . . . . . . . . . . . . . . 20 5.2 Shifted-Kernel Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.3 Biased Products and Temperature Interpolation . . . . . . . . . . . . . . . . . . . . . 21 5.4 The Induction on the Dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6 Geometric Data Structures in Fixed Dimension 23 6.1 Classical Geometric Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.2 Support Queries and Strict Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.3 Envelope Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.4 Sampling Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7 Biased Exponential Products and the Main Theorem 25 7.1 Orientations, Hits, and Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 7.2 Anchor Blocks and Direct Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 7.3 Random Prefix Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 7.4 The Full Random Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 7.5 Truncated Prefixes and the Heavy/Light Recursion . . . . . . . . . . . . . . . . . . . 33 7.6 Error Analysis and the Proof of Proposition 5.6 . . . . . . . . . . . . . . . . . . . . . 34 7.7 Proof of Theorem 1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 8 A Static-Query Comparison with Semigroup Halfplane Aggregation 35 ii
9 Conclusion and Further Directions 36
A Numerical Stability and Precision 38 A.1 Input Size, Temperature, and Reduction Cost ..... 38 A.2 Arithmetic for Planar Kernel Products ..... 38 A.3 Arithmetic for Biased Block Products ..... 41 A.4 Precision under Composition and Recursion ..... 41 A.5 Exact Geometric Computation ..... 42 A.6 Uniform Perturbations and Caps ..... 43 A.7 Support Queries and Envelope Construction ..... 44 A.8 Interior Shifts for Cell Location ..... 45 A.9 Integer Encodings of Halfspace Ranges ..... 45
B Geometric Constructions and Sampling Proofs 45 B.1 Classical Polytope Facts ..... 45 B.2 Constructing Cuttings with a Fixed Bounding Simplex ..... 46 B.3 Strict Halfspace Reporting ..... 51 B.4 Canonical Cells and Point Location ..... 51 B.5 Sampling and Potential Estimates ..... 53 B.6 Implementing Batch Maximum Inner Product ..... 54
AI Methodology 56
Acknowledgment 56
References 56
iii
1 Introduction
Transformers and related attention-based architectures are central to modern AI, with wide applications in areas such as language processing [VSP+17], visual recognition [DBK+21], and biomolecular structure prediction [AAD+24]. By exponentiating query-key inner products into a sharp distribution concentrated on the most relevant keys, attention also exhibits close connections to classical problems in Theoretical Computer Science (TCS), such as Maximum Inner Product (Max-IP) problem, making it a fundamental subject of study in TCS.
As frontier problems grow in complexity, extending the context length of Transformers has become essential. However, the cost of direct attention evaluation grows quadratically, with pairwise interactions for a context of length even in fixed dimension. This quadratic bottleneck restricts the deployment of Transformers in a wide range of long-context applications, such as repository-level code generation or full-document analysis.
Practical algorithms reduce the cost of attention through memory-efficient exact evaluation, as in FlashAttention [DFERR22], and random-feature approximation with provable error guarantees, as in Performer [CLD+21]. Nevertheless, these methods did not establish a non-trivial asymptotic upper bound for attention that faithfully preserves the exact softmax semantics. Establishing theoretical upper bounds for attention helps us delineate the fundamental boundaries of where attention can be applied.
Formally, softmax attention maps queries, keys, and values to normalized exponential averages. For query vectors , key vectors , and scalar values , the output associated with query is
More generally, each key carries a vector of values, one for each value channel, and the output of a query has one such average for each channel. Direct evaluation processes all query-key pairs, although the input and output sizes are only linear in when the dimension and number of value channels are fixed.
An inverse temperature rescales each score to and is absorbed into the query coordinates. The polylogarithmic dependence on coordinate magnitudes therefore extends the computational bounds to every positive rational temperature (Remark 2.3).
Gupta, Huang, Saha, Xu, and Ye [GHSXY26] gave an algorithm with running time
for every fixed dimension . For each query, their algorithm retains keys whose scores lie within a logarithmic window of the row maximum and approximates the exponential on that window by a polynomial. It evaluates the resulting monomial sums with a simplex range-searching data structure [Mat92b], whose query cost yields the exponent . Their reduction from maximum inner product also established conditional hardness in dimension via the lower bound of Chen [Che20]. They further observe that attention whose query or key matrix has rank at most reduces to dimension through a rank factorization [GHSXY26, Theorem 1.2], so fixed-dimensional algorithms also apply to low-rank attention with a large head dimension. Additionally, they gave a reduction from -dimensional Max-IP to -dimensional attention, where Max-IP is the natural geometric core of attention: given query vectors and points , the batch problem asks for all maxima .
However, the above upper bound is not sufficiently tight, considering that in fixed dimension , the best known algorithms answer maximum-inner-product queries on points in
time, where [MS93; Cha96b]; for this is near-linear [PS85; DK90]. Furthermore, because the reduction increases the dimension by one, one cannot obtain non-trivial hardness for 4-dimensional attention.
While Max-IP only seeks the extreme inner product, computing attention requires aggregating the exponentially weighted contributions of all keys. This leaves the question whether the global aggregation in softmax attention makes it strictly harder than Max-IP, or if we can still match the best known complexity of batch Max-IP and give a dimension-preserving reduction in every fixed dimension.
In this work, we study the bit complexity of softmax attention, with prescribed entrywise additive error . Our running-time bounds depend polynomially on the input encoding length and on , so inverse-polynomial error contributes only polylogarithmic factors.
Theorem 1.1 (Attention in every fixed dimension; proof in Section 7.7). Fix integers and , and let . There is a Las Vegas algorithm for Attention (Definition 2.1) with value channels whose expected running time is
Here soft-O suppresses factors of the form
with constants that may also depend on the fixed number of value channels.
For , , and , the expected running time is . This is near-linear for ; Table 1 lists the exponents for and compares them with the previous bounds. For the bound is ; an algorithm for this case was already known [GHSXY26, Lemma A.1]. Since for every , Theorem 1.1 improves the bound of [GHSXY26] in every dimension , while retaining their polylogarithmic dependence on and . Moreover, in the plane , our algorithm is completely deterministic and runs in time (Theorem 4.1).
Writing , the same algorithm supports a variable number of value channels in expected time , where soft-O suppresses factors polynomial in .
Batch maximum inner product also reduces to attention in the same dimension. For integer matrices and with rows and , the problem BatchMaxIP asks for every .
When the values equal the keys, the inner product of the attention output with the original query is a softmax average of the scores. Its distance from the maximum is at most , so integer rounding determines every maximum exactly at a suitable precision; Section 3.1 contains the formal reduction and proof. Whereas the earlier reduction of [GHSXY26] used polylogarithmically many calls in dimension , Theorem 1.2 reduces batch maximum inner product to a single attention call within the same dimension .
Table 1: Time bounds and the offline counting baseline derived in Section 1.2.1 by combining polynomial approximation with offline halfspace range counting. Here is fixed, , coordinate encoding lengths are polylogarithmic, magnitudes are polynomial, and . The exponent is the same in dimensions and , where ; the algorithm is Las Vegas for and deterministic for . The last column lists the best known deterministic real-RAM bound for exact batch maximum inner product [PS85; DK90; MS93; Cha96b], which reduces to attention by Theorem 3.1.
| Dimension | Time upper bounds | |||
|---|---|---|---|---|
| Prior work [GHSXY26] | Offline counting baseline | This work | Batch Max-IP | |
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
Theorem 1.2 (Dimension-preserving reduction, informal). The problem BatchMaxIP reduces to one attention call with value channels, namely
For a suitable absolute constant in , the attention instance has the same and uses inverse-polynomial error for polynomially bounded integer inputs; the reduction requires deterministic near-linear additional bit operations for fixed . Scaling by dB, where bounds the integer coordinates, yields a constant-error version.
The reduction also transfers the conditional quadratic lower bound for maximum inner product [SXY26] under the Orthogonal Vectors Hypothesis (OVH) [Wil05] to every constructible dimension with and . This hardness consequence was already observed in [SXY26] through the earlier reduction. Section 3.2 gives the precise statement.
Consequences in fixed dimension. Theorems 1.1 and 1.2 show that, in every fixed dimension, the best known exponents for attention and for batch maximum inner product coincide. Hence, for , an attention algorithm with exponent below on instances with value channels, polynomial magnitudes, and inverse-polynomial or constant error would improve the exponent for integer batch maximum inner product with polynomially bounded coordinates, and hence for offline halfspace emptiness, in the same dimension. Applying a single-channel attention algorithm to each of the value columns gives this implication as well (Theorem 3.1(c)), since is fixed. Both problems admit near-linear algorithms for , whereas whether improvements for batch maximum inner product in higher dimensions transfer back to attention remains open (Section 9).
The planar algorithm also yields a static data structure that preprocesses fixed keys, values, numerical bounds, and error tolerance in time and space and answers each query satisfying

Figure 1: Scores in one attention row. The shaded interval contains the near-maximal keys; each omitted key contributes at most to the shifted numerator.
these bounds in time (Corollary 4.6). For exact halfplane aggregation over a faithful semigroup with near-linear storage, a query may require operations [AMX12] (Section 8). The attention data structure avoids this barrier by using exponential decay to sum over a geometrically convenient superset of near-maximal keys with a small omitted contribution. Similarly, while relative-error halfplane counting admits near-linear storage through random sampling [AH08], with query time polylogarithmic in the input size and polynomial in the reciprocal of the relative error, the attention bound is polylogarithmic in both the input size and .
1.2 Technical Overview
Subtracting the maximum score from each row leaves the attention output unchanged and puts the exponential weights in , with a weight of 1 in every row. By exponential decay, the total contribution from keys outside a logarithmic window of the maximum is small, so it suffices to aggregate the potentially numerous keys within that window.
In the plane, we describe these keys by radial and boundary ranges over which polynomial moments can be summed in near-linear time. In higher dimensions, we cover the significant pairs by pairwise disjoint Cartesian blocks and evaluate them through lower-dimensional kernels, in total expected time . For , the reductions are
Here denotes shifted-kernel products in dimension , and denotes biased exponential products with -dimensional inner products.
1.2.1 Normalization and the Planar Base Case
For one value channel, write the shifted numerator and denominator as
Since and , approximating both sums to a small constant multiple of ensures error at most in their ratio (Lemma 2.5).
For a window width , every key whose score is below has shifted weight at most . Discarding any subset of such keys changes by at most and by at most . Thus a logarithmic window suffices (Figure 1), as in [GHSXY26]. We may retain any superset of this window, which allows us to use radial ranges in the plane and common-anchor blocks in higher dimensions.
The score threshold defines a halfspace range, over which the approach of [GHSXY26] evaluates monomial sums. If and , combining this approach with offline range counting and the standard space/query tradeoff [AE99] gives time . For , we obtain the offline counting baseline in Table 1, with exponent 8/5 in dimension four compared with 4/3 for batch maximum inner product.
To go beyond the baseline and achieve the maximum-inner-product exponent determined by , we use the geometry of halfspace emptiness and convex polytopes to organize near-maximal pairs. Polynomial moments and common-anchor blocks yield the corresponding weighted sums within this bound, including for near-maximal sets containing almost all keys.
In the plane, we center the key polygon at its area centroid . This translation adds the same scalar to every score in a row and preserves the attention output. We continue to write for the centered keys and polygon.
Centering ensures that every score lies between and the support value . Thus, when , all shifted scores lie in and we retain every key. For , write each nonzero key as , where lies on the boundary of and . Separate thresholds on and retain every key within of the maximum and only keys within of it. The boundary threshold selects a single arc, so the selected range is specified by a radial threshold and at most two intervals in the boundary order.
Expanding the approximating polynomial in query and key coordinates reduces the product to range sums of weighted key monomials. An offline sweep with binary indexed trees [Fen94] computes these moments, which we combine with the query coefficients to obtain the kernel product. Reversing the updates and queries computes the transpose product, and storing successive versions of the sweep in persistent segment trees [DSST89] yields the online data structure.
1.2.2 Temperature Interpolation and Common-Anchor Blocks
For general we induct on the dimension. For rows and columns , the shifted kernel is the matrix with entries
Attention is the ratio of a product for a value channel and the product for the all-ones vector. The shifted-kernel problem (Definition 5.3) asks for with a given vector , or with a given vector , to additive error ; the entries of and have absolute value at most . We prove by induction that a Las Vegas algorithm computes either product in expected time . The suppressed numerical parameters include the weight bound and error tolerance .
The induction includes both the forward product and the transpose product , since the anchor's orientation determines which lower-dimensional product evaluates a block. The planar algorithm computes both products deterministically in time and serves as the base case (Lemma 5.7).
For the first reduction, group nonzero queries by the position and sign of a largest coordinate. After applying the corresponding signed permutation to queries and keys, write and , where and . Then
Here the row-dependent factor still multiplies the inner product. To decouple them, we partition the rows into dyadic intervals of and use Lagrange interpolation on each interval to approximate e by a linear combination of exponentials e at fixed nodes . By Lemma 2.6, the error decreases exponentially with the number of nodes, uniformly over , and the sum of the absolute interpolation coefficients grows at most exponentially in that number. Consequently, nodes and precision bits suffice. At a fixed node , we rescale by to write the exponent as
with bilinear coordinates and a bias on each side, defining the intermediate product problem for the matrix . In Proposition 5.5, we combine its forward outputs using the interpolation coefficients, or exchange rows and columns and absorb those coefficients into the input weights for a transpose product.
Directly factoring the entire biased matrix into a row-shifted kernel and diagonal matrices would give diagonal factors and , where . However, these factors can be exponentially large in the input magnitudes. Instead, we obtain polynomially bounded factors by partitioning the significant pairs into blocks with a common anchor, a row or column whose scores across the block lie in a window of width below zero, with constant slack, where . If column anchors , subtracting its score cancels the row bias, so that
After shifting these inner products by their maxima, the block factors as
where is a shifted kernel in dimension , with rows and columns . For a row anchor, the analogous factorization uses in place of . In both cases, the anchor condition bounds the diagonal factors by , giving expected evaluation time .
We construct disjoint anchor blocks with total expected evaluation time by sampling one side and grouping the other side according to its first near-maximal sample.
1.2.3 Random Prefix Chains and Heavy/Light Recursion
To construct the blocks, we use one side as sources and the other as targets. When columns serve as sources, the points define affine functions evaluated at the row targets. A small rational perturbation shared by all samples puts these functions in general position and changes each score by at most a constant slack in the window. We then use the resulting geometry to define the blocks while retaining the original scores to evaluate them.
For a sample of sources, we triangulate their maximizing regions into canonical cells, where , so that each cell has a sampled owner whose function equals the envelope on all of . After preprocessing, ray shooting locates each target in time. The cell's conflict set consists of the sources that exceed its owner somewhere on the cell, a condition we test at its vertices using a constant number of strict halfspace-reporting queries.
Start with logarithmically many sources and expose doubling prefixes of a random permutation, with batches . For a source set of size , the sampling estimates imply
simultaneously for all prefix cells with constant probability, by a union bound over the possible cells fixed by the shared perturbation. We test both inequalities and resample upon failure.
A source is a hit for a target if its perturbed score is at least -L. We assign each target to the first of containing a hit and use a maximizing source in that set as its anchor. For a

Figure 2: A schematic level of the random doubling prefix for , in the column orientation. (a) A square window of the maximizing regions of the perturbed functions in , with each polygon triangulated for the illustration. Thick lines bound the maximizing regions, and thin lines triangulate them. (b) The shaded cell , with owner , enlarged. Dashed lines separate the regions where different sources of have the largest perturbed score. The markers represent targets in whose first hit occurs after . Filled markers of the same shape share an anchor and form one anchor block with source set ; hollow markers have their first hit in a later batch.
first hit in , the preceding prefix's envelope lies below the hit threshold at the target, so every hit exceeds the owner of the target's prefix cell and belongs to its conflict set .
Targets with the same cell and anchor form a block with source set (Figure 2), and the bound on limits each cell to such blocks. Targets first hit in form blocks with the full source set, completing a collection with disjoint target sets that covers every significant pair when the chain reaches the full source set.
For sources and targets, the cell counts and conflict sizes over the complete doubling chain sum to , which is also the time for constructing the blocks. By concavity, the logarithmic number of anchors per cell and the disjoint target sets imply the same bound for anchor evaluation, so the complete algorithm is near-linear when or .
When and the two sides are balanced, however, a full prefix is too costly. For and two sides of size , we have and instead truncate the prefix at sources. Suppressing logarithmic factors, the final prefix has cells with conflicts each, so reporting costs operations. In a light cell, the unassigned targets become the sources of a full prefix, with cost per cell and time across all light cells. We recurse on the heavy cells, whose total potential is of order at most . The two bounds balance at , for a total expected running time of .
In general, at a recursive node with side sizes , a full prefix with the smaller side as sources runs in near-linear time when . Otherwise, at a balanced node, we use the larger side as sources and truncate at sources. Cells with unassigned targets are processed by a full prefix in the reverse orientation; heavy cells are handled recursively. The reporting and light-cell cost and the total heavy-child potential have respective bounds
Balancing them gives local expected time , where . Sec-tion 7.5 specifies the integer prefix size and light-cell threshold, for which the heavy children's potentials sum to at most one quarter of their parent's. The total expected running time is therefore .
Since the evaluated blocks are disjoint, each output coordinate receives at most contributions. A block tolerance of order and a score window of order keep the combined approximation error and omitted tail within . Appendix A.4 shows that these parameters require polynomially many precision bits at every recursive level.
1.3 Related Work
Complexity of attention. Alman and Song [AS23] established a sharp magnitude threshold for logarithmic dimension. Entries of magnitude permit time at inverse-polynomial error, and magnitude of order supports a conditional quadratic lower bound at the same error tolerance.
Duman Keles, Wijewardena and Hegde [DWH23] proved quadratic lower bounds under the Orthogonal Vectors Hypothesis (OVH) [Wil05] for exact and approximate attention in every dimension with , and Alman and Song [AS24] extended the magnitude threshold of [AS23] to gradient computation. Further lower bounds concern subquadratic alternatives to attention [AY25] and multi-head, multi-layer transformers [SXYY26]. For exact integer maximum inner product, the dimension in which OVH implies quadratic hardness was lowered to a polynomial in by Williams [Wil18], to by Chen [Che20], and to every constructible superconstant dimension by Saha, Xu and Ye [SXY26].
Kernel sums and approximate attention. The fast multipole method and the fast Gauss transform [GR87; GS91] compute kernel sums in fixed dimension in near-linear time, with error relative to the total weight. Alman, Chu, Schild and Song [ACSS20] determine fine-grained limits of such methods as the dimension grows. The identity expresses attention through Gaussian kernel sums with weights , whose ratios can be as large as . An error bound relative to the total weight can then require relative precision , leading to polynomial dependence on in fixed dimension even with a polylog dependence on precision.
KDEformer [ZHDK23] and HyperAttention [HJK+24] achieve subquadratic time under bounds on entry magnitudes or other data-dependent parameters. Using halfspace reporting, Chen, Liang, Sha, Shi, and Song [CLSSS25] locate large attention entries with error guarantees under distributional assumptions. In contrast, our algorithms achieve worst-case guarantees for arbitrary rational inputs, with factors polynomial in , , and the coordinate encoding lengths.
Maximum inner product and halfspace range searching. Following Matousek's introduction of shallow cuttings and partitions for halfspace reporting and emptiness [Mat92a], Matousek and Schwarzkopf [MS93] constructed static ray-shooting structures with preprocessing for halfspaces, logarithmic query time, and a space/query tradeoff. Matousek's linear-optimization queries [Mat93] then led to an algorithm for the extreme points of an -point set with time exponent plus an arbitrarily small positive constant. Chan [Cha96a; Cha96b]
We used DeepSeek Harness through several rounds of interactive prompting to brainstorm proof ideas here.
Their convention is , where Q and K are the matrices with rows and . We use ; under it, their bounds on the query and key magnitudes are divided by .
simplified these query methods, derived output-sensitive applications, and observed that static data structures replace the small polynomial loss by polylogarithmic factors. Deterministic structures for ray shooting, range reporting, and linear-programming queries were subsequently given by Ramos [Ram99; Ram00]. For ray-shooting queries in a polytope defined by halfspaces in dimension , Chan [Cha96b, Corollary 2.4] stated the batch bound
Corollary 2.2 there treats . The polylogarithmic factors were later improved for the extreme points of a point set in even dimension [Cha12] and for the decision version [CZ22]; these remain the best known exponents. We refer to the surveys [Mat94; AE99; Aga17].
Lower bounds. Erickson [Eri96; Eri00] proved an lower bound for offline halfspace emptiness in every dimension at least five, for polyhedral partitioning algorithms. Such algorithms cover space by a constant number of constant-complexity polyhedra and recurse on the points and halfspaces that meet each of them. This lower bound matches the best known upper bound for up to polylogarithmic factors, whereas establishing comparable bounds for general algorithms or in dimension four remains open.
Convex hulls, triangulations, and random sampling. Our geometric decomposition relies on the upper bound theorem [McM70], the randomized incremental construction of convex hulls [CS89], with a deterministic alternative due to Chazelle [Cha93] (see [Sei17]), the pulling triangulation [Cla88] and canonical triangulations [CF90], and the random-sampling analysis of Clarkson and Shor [Cla87; CS89]. Our random prefixes follow randomized incremental constructions, with exact tests on conflict sizes and batch intersections ensuring deterministic participation bounds for every accepted decomposition. To remove degeneracies within the bit-complexity model, we apply an explicit rational moment-curve perturbation shared by all samples. For background on perturbation methods and exact computation, we refer to the symbolic schemes of [EM90; EC95] and the geometric and algebraic methods in [Yap97; BPR06].
Independent and concurrent work. Very recently, during the final preparation of this manuscript, we became aware of independent and concurrent work by Mausberg [Mau26] on the same problem. They improve upon the previously best-known result of Gupta, Huang, Saha, Xu and Ye [GHSXY26], obtaining an almost-linear Las Vegas algorithm for Attention and Attention. In comparison, our work gives a deterministic near-linear algorithm for Attention, a near-linear Las Vegas algorithm for Attention, and a Las Vegas algorithm for higher dimensions with expected running time , where . The techniques we use are also very different from those of Mausberg.
2 Preliminaries
For a positive integer , write . We use for the natural logarithm and for the binary logarithm. For a matrix , let , and let denote entrywise multiplication. Throughout, suppresses factors polynomial in the input encoding lengths, the
Following standard terminology, we use almost-linear for and near-linear for , i.e., linear up to polylogarithmic factors. Note that [Mau26] uses the term near-linear in its title to refer to an bound.
logarithms of the instance size and numerical magnitudes, and the required precision in bits; Section 2.1 collects these parameters in . The notation suppresses polylogarithmic factors in the instance size. A subscript permits dependence on the fixed dimension and number of value channels.
Definition 2.1. Given , , and with rows , , and , define
All input coordinates are rationals of magnitude at most , with signed numerators and positive denominators of bit length at most , the coordinate encoding length. Given a target additive error for an integer , the problem asks for a rational matrix satisfying
Our geometric algorithms allow any fixed number r of value channels; the one-call reductions use r = d.
Every entry of the ideal output is a convex combination of the corresponding value coordinates and has absolute value at most .
Extend the values by the all-ones channel , and define the shifted kernel by
For , write and
Then for . Each row of contains a unit entry, so and ; we denote their approximations by and . Thus kernel products suffice for all value channels, with the product equal to the denominator shared by the ratios.
A zero query has maximum zero and an all-ones shifted-kernel row, so its attention output is the average of the values. In a forward kernel product, such a row returns the sum of the input weights; in a transpose product, the weights on all zero rows contribute their sum to every output coordinate. We process these rows together in time per channel before applying the algorithms below. Coordinate normalization and support queries may therefore assume nonzero query vectors.
We compare the complexity of attention with that of the batch maximum-inner-product problem, defined as follows.
Definition 2.2. For integer matrices and with rows and and coordinate magnitudes at most an integer , the batch problem BatchMaxIP asks for
The global problem MaxIP asks for . Each is an integer in .
2.1 Computation and Error Bounds
We measure complexity in bit operations, so each batch or preprocessing time bound also applies to space. Our randomized algorithms are Las Vegas, and their running times are measured in expectation.
Throughout the paper, bounds an instance's rational input encoding lengths, the logarithms of its size and numerical magnitudes, and the required precision in bits. Geometric predicates are evaluated exactly. Intermediate geometric quantities, scalar exponentials, polynomial coefficients, and weighted sums use -bit representations or approximations, as established in Appendix A. Approximate outputs lie on a common dyadic grid whose mesh is proportional to the target tolerance, uniformly in and . For a data structure, the magnitude and encoding-length bounds on future queries are fixed before preprocessing; a query or target satisfying these bounds is admissible.
Subproblems formed by restricting index sets inherit the numerical bounds of their enclosing instance. For variable , soft-O also suppresses factors polynomial in , with constants and degrees depending only on .
We write the running-time bounds using
When the dimension is clear, we abbreviate to ; the function is symmetric and nondecreasing in both arguments.
Remark 2.3 (Arbitrary positive temperature). A positive rational inverse temperature is absorbed into the queries by replacing with . This adds only the encoding length of to the coordinate encoding lengths and replaces the magnitude bound by . The resulting dependence on temperature is polylogarithmic in its magnitude.
An irrational inverse temperature can be replaced by a positive dyadic approximation at the precision derived in Appendix A.1, including for the usual scaling .
2.2 Random Sampling
The algorithms in Sections 6 and 7 sample uniform subsets and permutations, using standard probability estimates for sampling without replacement.
Lemma 2.4. Let be a nonempty finite set, let , and let be a uniformly random subset of of a given size . Then , and satisfies for every positive integer .
Proof. Apply Hoeffding's comparison theorem for sampling without replacement [Hoe63, Theorem 4] to the indicators of membership in . Writing , , and gives
The first bound follows as . For , the second follows from the exponential Markov inequality with , and is immediate when or .
2.3 Analytic Estimates
Lemma 2.5 (Perturbation and ratio bounds). For with , let and . Then
If , , and , then
Proof. The softmax Jacobian has operator norm at most 2 from to ; the maximum and the exponential on are 1-Lipschitz. The ratio bound follows by writing its numerator as and using .
Temperature interpolation uses a single set of nodes to approximate uniformly over . Placing the nodes in the middle half of each dyadic interval keeps their distance from any point in the interval within three quarters of its lower endpoint, yielding exponential decay of the interpolation error.
Lemma 2.6. Let be an integer, fix a lower endpoint , and let
The nodes define a Lagrange interpolation polynomial of degree at most . For all and ,
Proof. For fixed , consider the function , whose -th derivative is . The nodes are distinct and lie in , so for every and every . By the Lagrange remainder formula [DLMF, Eq. (3.3.5)], for some ,
The function on is maximized at , so
Together with and , the remainder has absolute value at most
For the coefficients, consecutive nodes are apart, so
Each of the factors in the numerator of is at most , hence
Summing over and using and , we obtain
3 A Dimension-Preserving Reduction from Maximum Inner Product
We now show that BatchMaxIP reduces to a single call to Attention in the same dimension. The idea is to set both the keys and the values equal to at a logarithmic inverse temperature : taking the inner product of the resulting attention output with yields a softmax average of the scores , which lies within of the maximum and can be rounded to recover exactly.
3.1 Computing Exact Maxima from Attention
Consider an instance of BatchMaxIP with matrices and and coordinate magnitudes at most an integer . To ensure that the softmax average and the attention approximation error each contribute less than to the inner product with , we set , , and , so and . The dimension may grow in this section, and soft-O suppresses only logarithmic factors in .
Theorem 3.1 (Dimension-preserving reduction). Set and . Each of the attention reductions below solves BatchMaxIP with the same and deterministic additional time .
(a) One call with , value channels, magnitude bound , and error tolerance .
(b) One call with , value channels, magnitude bound , and constant error tolerance .
(c) For either value matrix , calls with one value channel each, using its columns separately and the same error tolerance.
Proof. Let , let be the exact output in part (a), and write , where . The entropy identity , together with , implies
For an approximate output with coordinatewise error at most , we have . Rounding to the nearest integer determines exactly.
In part (b), scaling the values scales the exact output to , so dividing the inner product of its approximation with by estimates with error at most . Since , the same rounding applies. All value channels share the same softmax probabilities, so the scalar calls compute the vector output in part (c). In all three cases, the inputs and dyadic outputs have logarithmic encoding length in , and forming the inputs and rounding the outputs require coordinate operations (Appendix A.1).
Computing also solves MaxIP with the same additional cost, which is near-linear for fixed and polynomially bounded integer inputs. The reductions are deterministic and preserve Las Vegas guarantees.
3.2 Conditional Hardness in Superconstant Dimension
We use the randomized version of the Orthogonal Vectors Hypothesis (OVH) [Wil05], which states that for every , there is a constant such that randomized algorithms with bounded error cannot determine in time whether two sets of Boolean vectors in contain an orthogonal pair. Although the attention lower bounds of [AS23; GHSXY26] were originally stated under the Strong Exponential Time Hypothesis (SETH) [IP01], their reductions factor through orthogonal vectors and hold directly under OVH; hence they are unaffected by recent subexponential-time results refuting ETH and SETH (while all algorithmic bounds and reductions elsewhere in this paper are unconditional).
We say that a dimension function is constructible if its value can be computed in time. Saha, Xu, and Ye [SXY26, Theorem 4.7] establish conditional hardness for integer orthogonal vectors in every constructible superconstant dimension, with -bit entries. Their Lemma B.1, based on [Wil18; Che20], reduces integer orthogonal vectors in dimension to exact integer maximum inner product in dimension . Applying their theorem with , which is constructible and tends to infinity, and padding with zeros establishes the same hardness for exact integer maximum inner product in dimension . They observe that this lower bound transfers to attention through the reduction of [GHSXY26, Lemma C.3], which uses polylogarithmically many attention calls with queries and keys in dimension and already works at constant error. In superconstant dimension, the extra dimension and the extra calls of that reduction are immaterial; even so, applying Theorem 3.1 directly yields this hardness at the same dimension and input sizes.
Corollary 3.2. Assume the randomized OVH, and let be a constructible function with and . Then attention in dimension , with , value channels, and polynomial coordinate magnitudes, requires time at either inverse-polynomial error or constant error tolerance .
Proof. Suppose attention on these instances has running time for some constant . Theorem 3.1 solves the maximum-inner-product hard instances with one vector-valued call or scalar calls, on inputs of polynomial magnitude and with inverse-polynomial error tolerance. Since , the additional work is and either implementation runs in total time . Parts (b) and (c) imply the same complexity at constant error, so composing either reduction with the deterministic OV-to-Max-IP reductions of [Wil05; SXY26] contradicts randomized OVH.
4 A Deterministic Algorithm in Two Dimensions
We begin with the two-dimensional case (), which both establishes Theorem 4.1 and serves as the base case for our dimension induction in Section 5. Our main geometric observation is that centering the key polygon at its area centroid allows us to enclose all near-maximal keys for each query within a simple shell region specified by a radial threshold and at most two intervals along the polygon boundary, over which polynomial moments can be summed by a one-dimensional sweep. Throughout this section, the number of value channels is fixed, and denotes the total number of query and key vectors.
Theorem 4.1 (Planar attention; proof in Section 4.5). For and any fixed number of value channels, approximate attention as defined in Definition 2.1 can be computed deterministically in time.
4.1 Shifted-Kernel Products in the Plane
For query vectors ( ) and keys ( ), define the shifted kernel of the original inputs by
We compute either the forward product or the transpose product , with input weights and .
Lemma 4.2. Let be integer bounds on the absolute values of the geometric coordinates and input weights, respectively, and let bound their rational encoding lengths and that of the error tolerance . Each of and can be computed deterministically to coordinatewise additive error at most in time.
To prove Lemma 4.2, we construct a rational approximation whose rowwise error implies product error (Section 4.5), and show in Sections 4.2–4.4 how to evaluate its forward and transpose products through moment sweeps.
4.2 Centering and Radial Coordinates
Given a target rowwise error , we round the input coordinates to the dyadic grid of Appendix A.2, changing each kernel row by at most in norm (Lemma A.1). Collinear rounded keys admit a one-dimensional sweep, described in the same appendix. Otherwise, when their hull has positive area, we compute its vertices in cyclic order and translate all rounded keys by the negative of its area centroid . The resulting common shift of each row and its maximum leaves the rounded shifted scores unchanged.
In Sections 4.2–4.4, write for the rounded queries and for the rounded and centered keys, and let
be the centered key polygon, with . The matrix always denotes the original shifted kernel. The origin is now the area centroid and lies in the interior of ; since , the working coordinates satisfy and . Computing the hull costs time, after which each is computed by an -time support query [PS85; DK90], with ties resolved by a fixed vertex order.
Set the score window and polynomial degree to
with the constants specified in Appendix A.2, which also includes all rounding errors in this section.
Lemma 4.3. For the centered two-dimensional polygon above and , set
Then h > 0 and .
Proof. The origin lies in the interior, so . To bound the minimum, triangulate the polygon by a fan from a vertex with . Each triangle then has one vertex projecting to and two projecting to at most , so its centroid projects to at most . Their area-weighted average is the polygon's centroid projection, zero, so .
By Lemma 4.3, every centered key satisfies
For each nonzero key, the ray from the origin through it meets the boundary at a unique point , so we can write
We call the key's radial ratio and sort the nonzero keys by the cyclic order of their boundary points, equivalently by angle about the origin. Each comparison uses a halfplane test and a cross product, with keys sharing a boundary point stored as separate consecutive entries that retain their own indices and weights.
Binary search among the angularly ordered vertices locates the ray's sector; intersecting its edge determines in time, with a ray through a vertex returning that vertex. Keys at the origin contribute only to the constant moment in Section 4.4.
4.3 Radial and Boundary Ranges
For each row, we select a range containing every key within of the maximum. When , all shifted scores lie in by the centroid bound, so we set . For , on the other hand, we define
Lemma 4.4. For ,
Proof. If , then and . Since and ,
Conversely, both lower bounds defining are positive, so every satisfies
Thus contains every near-maximal key, including a maximizer, and widens the score window by at most a factor of two. Set
so that the centroid bound for and Lemma 4.4 for imply
For a row with , the boundary condition selects a closed arc containing the maximizing face. Since each intermediate level line meets the boundary at the two ends of its intersection segment, projection is monotone along either chain from a maximum to a minimum. Binary search locates the arc endpoints, and cutting the cyclic order at a fixed position represents the arc by at most two disjoint intervals. All radial and boundary thresholds are inclusive, so the searches and sweeps below include equality at every endpoint. Together with the radial threshold, these intervals describe the part of the closed shell between and in the arc's angular sector (Figure 3).

Boundary arc
Radial threshold
Both conditions hold
Figure 3: A non-symmetric convex pentagon centered at its area centroid, with . Blue marks the eligible boundary arc, and the orange dashed polygon is . All points in the shaded region, including its boundary, satisfy both retention conditions.
4.4 Polynomial Approximation and Moment Sweeps
For , . The degree- Taylor polynomial satisfies
by the standard remainder bound (Lemma A.2). Let be a rational approximation at the precision specified in Appendix A.2. Define
Both approximations are from below, so .
Lemma 4.5. For the original shifted kernel T, the matrix P satisfies
Proof. For the rounded coordinates, omitted keys have weight below , and the Taylor and scalar approximations contribute per selected key. Summing these errors and adding the coordinate-rounding error proves the rowwise estimate.
Separated polynomial weights. Setting and expanding first in and then in the two coordinates gives
The expansion has terms indexed by nonnegative , each factoring into a query coefficient and a key monomial. For the rounded weights , the common denominators of Appendix A.2 allow exact summation of these terms with polynomial bit lengths.
Keys at the origin belong to exactly when . Their total weight contributes to the constant moment in forward products, and their transpose products involve only the term.
Forward multiplication. For a rounded input vector , the required moments are
We first precompute the moments over all keys for rows with . To handle rows with , a Fenwick tree [Fen94] on the array of keys in boundary order supports the sweep below.
(1) Sort the rows with by and the nonzero keys by , both in nonincreasing order.
(2) Before answering a row, insert the vectors of weighted monomials for every key at or above the row's radial threshold.
(3) Query the row's one or two boundary intervals to obtain its moments.
For every row, the sum of these moments weighted by and scaled by is .
Transpose multiplication. For a rounded input vector z, we reverse updates and queries to evaluate
Use a difference Fenwick tree on the same array in boundary order for interval additions and point queries.
(1) Sort the rows with by and the nonzero keys by , both in nondecreasing order.
(2) Before processing key , add the vector over the boundary intervals of every row whose threshold is at most .
(3) Query the boundary index of key to obtain the contribution from rows with to each inner sum.
Adding completes the inner sum for every key; its weighted sum with the key monomials, scaled by , is the transpose product.
4.5 Kernel Products and Attention
Proof of Lemma 4.2. Set . By Lemma 4.5,
The moment sweeps evaluate the products with in time. Including the input and output rounding detailed in Appendix A.2, both errors are at most .
Proof of Theorem 4.1. By Lemma 4.2, the products in Section 2 can be computed to tolerance in time for fixed r. Lemma 2.5 then implies an attention error at most .
4.6 Online Queries after Preprocessing the Keys
Because the forward sweep in Section 4.4 inserts keys in nonincreasing order of independent of the queries, we can make the sweep structure persistent [DSST89]: storing successive versions of the boundary-order segment tree allows any arriving query to retrieve the exact moments it needs in time. This yields the following static data structure.
Corollary 4.6. Fix a constant number of value channels, matrices and with rows and , and an error tolerance as in Definition 2.1. Given bounds and on the magnitudes and rational encoding lengths of all key, value, and future query coordinates, there is a deterministic data structure with preprocessing time and storage that, for any query satisfying these bounds, returns an -additive approximation to
in time. The suppressed factors depend on , , , and ; the guarantee holds for every query in an arbitrarily long, possibly adaptive stream.
Proof. Set the parameters of Section 4.2 with , , and . Round the keys and values as in Appendix A.2; these choices depend only on the given bounds and tolerance.
For a two-dimensional hull, we center the keys and use their radial ratios and boundary order to build a persistent binary segment tree [DSST89] storing interval moments for every value channel and the all-ones channel. We insert the nonzero keys in nonincreasing order of radial ratio and also store the global moments over all keys.
Upon arrival, a query is rounded to the same geometric grid and its support value is computed by a support query. We read the global moments when , or select the version at the radial threshold when , and read the moments from its one or two boundary intervals. Combining these moments with the row coefficients and dividing the numerator by the denominator yields the approximate attention output, with the common factor canceling from the ratio.
By Lemmas 4.5 and 2.5, the error is . Appendix A.2 includes the rounding errors and establishes the preprocessing, storage, and query costs. Because the stored moments are exact, the error bound holds for every query satisfying the input bounds, including throughout an adaptive stream.
5 Shifted Kernels and Dimension Induction
Using the planar shifted-kernel algorithm as the base case, we prove the fixed-dimensional bound for by induction on the dimension. Each inductive step consists of two reductions (Figure 4):
First, Lagrange temperature interpolation decouples the row scales from the inner products, reducing to with an additive scalar bias on each side. Second, partitioning the significant pairs into common-anchor blocks allows us to cancel these biases and reduce to . Throughout Sections 5–7, is fixed and we use the precision convention of Section 2.1.
5.1 Exact Maxima and Normalized Directions
The reduction begins by computing the row maxima exactly and normalizing each nonzero row by a coordinate of largest absolute value. Both these maxima and those used later in the anchor factorization can be computed within Chan's offline ray-shooting bound [Cha96b, Corollaries 2.2 and 2.4], with the bit complexity stated below.
Proposition 5.1 (Exact maxima; proof in Appendix B.6). For fixed , let () be queries and () be points. A Las Vegas algorithm computes every maximum and a maximizing index in expected time . For , the algorithm is deterministic and runs in time.

Anchor-block factorization Proposition 7.1 geometric decomposition in Section 6
Figure 4: One induction step, read clockwise from the upper left. Row shifts express attention through ; Lagrange temperature interpolation then gives , whose anchor blocks factor through . The induction ends at the planar kernel algorithm.
Definition 5.2 (Coordinate normalization). For , let exchange coordinates and , and let also change the sign of the last coordinate. For , let be the least index with and let be the corresponding permutation, with the sign chosen so that has a positive last coordinate. Write
Rows sharing form a coordinate group; there are at most groups. For a signed coordinate permutation and , define the affine function , and write . By orthogonality,
For , we have .
5.2 Shifted-Kernel Products
Definition 5.3 (Shifted-kernel products). For , an instance of consists of rational rows (), rational columns (), and an error tolerance . Their shifted kernel is
The task is to compute either the forward product , with , or the transpose product , with . Let integers bound the magnitudes of coordinates and input weights, respectively, and let bound the encoding lengths of all input rationals, including .
A solution is a vector approximating the specified product to coordinatewise additive error .
In dimensions , the algorithm shifts each row by its exact maximum, computed by Proposition 5.1 or provided with the instance, and evaluates the products over blocks. In recursive calls from the anchor factorizations of Lemma 7.4, these maxima are already computed, so the kernel calls reuse them. Moreover, because these factorizations involve both forward and transpose products, the induction maintains both operations, which the planar algorithm computes in time for the base case (Lemma 5.7).
5.3 Biased Products and Temperature Interpolation
The intermediate problem has bilinear coordinates and one scalar bias on each side. Its lifted source points lie in .
Definition 5.4 (Biased exponential products). For , an instance of consists of rational rows indexed by and columns indexed by , with nonpositive scores
Given weights and an error tolerance , the task is to approximate to coordinatewise additive error . Let integers bound the magnitudes of coordinates and biases, and of input weights, respectively, and let bound the encoding lengths of all input rationals. Write .
The score formula is symmetric under exchanging with , which transposes and preserves its numerical parameters. A forward biased-product call on the exchanged instance therefore computes times a vector with the same symmetric running-time bound . By contrast, in , rowwise normalization breaks this symmetry by fixing an orientation, so the anchor factorization of Lemma 7.4 uses the forward product for a row anchor and the transpose product for a column anchor.
Proposition 5.5. Let . If can be solved by a Las Vegas algorithm in expected time , then can be solved by a Las Vegas algorithm in the same expected time.
Proof of Proposition 5.5. Consider a instance with parameters , , and input weights for the forward product or for the transpose product. Use the supplied row maxima or compute them by Proposition 5.1 in expected time . After handling zero rows as in Section 2, we apply Definition 5.2 to write each nonzero row as with . Setting , we have
We partition these nonzero rows by their normalizing permutation and dyadic temperature interval into groups
where ranges over powers of two. Since , the number of nonempty groups is .
Within each nonempty group , we apply Lemma 2.6 with nodes and coefficients . Because is shared by all rows in the group, we can absorb it into the column vectors and row shifts: each node defines a instance with rows and columns . Its matrix has nonpositive scores
We solve these instances at tolerance
with a small absolute constant. For forward multiplication, we apply each matrix to and combine the returned vectors for as
Conversely, for transpose multiplication, we exchange the two sides of each biased instance and use weights , then sum the resulting vectors over all groups and nodes. Since , the logarithm of the weight bound remains .
By Lemma 2.6, the interpolation error is at most for either product, to which the biased calls add at most per forward output coordinate and per transpose output coordinate. A large enough constant in and a small enough constant in give error at most , leaving for the arithmetic errors analyzed in Appendix A.4.
Since there are groups and nodes, each defining a biased instance with side sizes at most , possibly exchanged, the total expected cost is by symmetry and monotonicity of . Normalizing the rows, computing the interpolation coefficients, and combining the outputs require an additional operations.
To complete the induction, Section 7 partitions the significant pairs of a biased instance into common-anchor blocks. Lemma 7.4 reduces each block product to a call, and the total expected evaluation time is .
Proposition 5.6 (Proof in Section 7.6). Let and suppose a Las Vegas algorithm solves in expected time . Then can be solved by a Las Vegas algorithm in expected time .
5.4 The Induction on the Dimension
Lemma 5.7. KP can be solved deterministically in time.
Proof. Lemma 4.2 computes either product to error in time.
Theorem 5.8 (Kernel products in fixed dimension). For every fixed integer , a Las Vegas algorithm solves in expected time .
Proof. The base case is Lemma 5.7. Assuming the result in dimension , Proposition 5.6 solves in expected time , and Proposition 5.5 then solves within this bound.
Across the reductions, the numerical parameters grow by a fixed polynomial at each step and thus remain polynomial in the original parameters for fixed (Appendix A.4).
6 Geometric Data Structures in Fixed Dimension
The biased-product algorithm uses the support, reporting, point-location, and sampling results in Lemmas 6.2, 6.3, 6.8, and 6.9. The underlying geometric constructions are usually analyzed in the real-RAM model [MS93; CS89; Cha96a; Cha96b]; Appendices A and B provide the rational implementations and bit-complexity bounds needed here.
In this section, is fixed and . Input and query bounds are fixed before preprocessing, with parameter as in Section 2.1. We use polytope for a bounded intersection of closed halfspaces with , and denote its interior and vertex set by int and vert(). For , write for its projection onto the first coordinates. Ties may be resolved by returning any maximizing index in a support query and any closed cell containing the point in a location query.
Definition 6.1. A finite indexed collection of affine hyperplanes in is in general position if the normal vectors of any at most of its members are linearly independent and no of its members have a common point. A finite indexed collection of closed halfspaces is in general position if their bounding hyperplanes are.
6.1 Classical Geometric Primitives
McMullen's Upper Bound Theorem implies that there are vertices for a -polytope defined by halfspaces [McM70; Sei17]. For , these vertices and their incidences can be enumerated by Clarkson and Shor's algorithm in expected arithmetic operations [CS89, Theorems 4.7 and 4.8]. For queries, we use the high-storage ray-shooting structure of Matousek and Schwarzkopf [MS93, Lemma 7], with deterministic alternatives in dimensions two and three [PS85; DK90].
The rational version, stated in Proposition B.3 in Appendix B.2, has the same soft-O bounds. Its implementation fixes a bounding simplex and constructs each geometric object from a constant number of original constraints.
6.2 Support Queries and Strict Reporting
A support query asks for a point maximizing a given linear objective, and polarity reduces it to ray shooting. The nonzero gaps between rational scores allow a general-position perturbation for which each perturbed maximizing index also maximizes the original objective.
Lemma 6.2 (Proof in Appendix A.7). Let be a nonempty list of points in , with repetitions allowed. A Las Vegas algorithm builds a support-query structure in expected time , deterministically for . Given an admissible , the structure returns and a maximizing index in time .
Support queries also test whether a strict halfspace contains any source. Applying the standard binary-tree reduction from emptiness to reporting [Cha96a, Observation 2.3] within groups of size at most yields a tradeoff between preprocessing and query time.
Lemma 6.3 (Proof in Appendix B.3). Let be a nonempty list of points in , with repetitions allowed, and let be an integer with . A Las Vegas algorithm builds a reporting structure in expected time , deterministically for . Given an admissible query , the structure reports in time . For , the preprocessing and query costs are and , respectively.
6.3 Envelope Cells
For , we organize near-maximal pairs by sampling sources and partitioning the upper envelope of their affine functions (Definition 5.2) into cells, each with a designated maximizing source. The perturbation and the bounding region containing all target positions are fixed across samples. We index sources by s and targets by i, in either orientation of the matrix.
Definition 6.4. Let be integers, let , and let () satisfy . The instance parameter also bounds and .
Apply once the uniform perturbation of Appendix A.6, obtaining source points shared by all samples. For every nonempty , define
and let the envelope polytope be the epigraph of clipped by the fixed rational bounding halfspaces constructed in Appendix A.7. These halfspaces are shared by every sample, and the lower boundary over is the graph of . For , the facet of source is the possibly empty subset of where its source constraint is tight.
Lemma 6.5 (Proof in Appendix A.7). The perturbed envelope in Definition 6.4 satisfies:
(a) for every and every with .
(b) Let be an admissible target with , and let . Every that maximizes over also maximizes over .
(c) For every nonempty , the constraints of are in general position, and is bounded and has nonempty interior. Its constraint coefficients and vertices have bits.
The perturbed sources, envelope vertices, and their affine values at vertices or targets satisfying the input bounds all have bits. Lemmas 6.2 and 6.3 therefore apply with a uniform bit bound.
To decompose the envelope into cells, we apply Clarkson's recursive vertex construction [Cla88, Section 3] to triangulate the source facets of the sampled envelope and project the simplices onto the target coordinates. Each projected cell has an owner whose function equals the sampled maximum on the entire cell, and its conflict set consists of the sources that exceed this owner somewhere on the cell. These sets contain every source that can improve a target's sampled maximum.
Definition 6.6. Let . Triangulate the source facets of by the fixed rule of Definition B.7 in Appendix B.4, and project its simplices onto their first coordinates. These projected simplices are the canonical cells. A cell inherits its owner from its source facet. The cells and their order depend only on , with the perturbation and bounding halfspaces fixed. The conflict set of relative to the ground set is
Lemma 6.7 (Proof in Appendix B.4). Let . The canonical cells of satisfy:
(a) Every cell is a closed -dimensional simplex with rational vertices, and its owner satisfies for every . The union of the cells contains .
(b) For every cell with owner , we have and .
(c) has at most canonical cells, where depends only on .
(d) Over all nonempty , at most distinct owner-cell pairs occur. For a fixed ground set , each such pair has a fixed conflict set, independent of the sample in which it occurs.
Because the cells are closed, a target on a shared boundary may be placed in any cell containing it. To find such a cell, we use the face-by-face ray-shooting descent of Matousek and Schwarzkopf [MS93, proof of Theorem 10] and Chan [Cha96b, proof of Theorem 4.1], using the fixed triangulation order for the vertices. The descent then identifies a cell in the enumerated list.
Lemma 6.8. Let . A Las Vegas algorithm enumerates and locates the canonical cells with expected preprocessing time . It returns
(a) the list of all canonical cells of in the order of Definition 6.6, each with its owner and vertices;
(b) a structure that, given an admissible target with , locates a canonical cell of containing , and returns its index in the list and its owner in time .
The list in part (a) is determined by .
Appendix B.4 proves Lemma 6.8, including the exact representation and comparison of cell indices.
6.4 Sampling Bounds
We resample whenever a cell has too many conflicts. A uniform sample passes these tests with high probability by Clarkson–Shor sampling [Cla87; CS89], with a union bound over the finite set of canonical configurations fixed by the shared perturbation.
Sampling parameters. For the original instance size , we fix a bound on the number of doubling prefix levels and an initial prefix size by setting
where depends only on and is chosen in Appendix B.5.
Lemma 6.9 (Proof in Appendix B.5). In the setup of Definition 6.4, assume and use the parameters (6.1). Let , and let be a uniformly random subset of of a given size . With probability at least , every canonical cell of satisfies , where the conflict sets are taken relative to .
7 Biased Exponential Products and the Main Theorem
Let be fixed and set as in (2.1). Assuming a Las Vegas algorithm for with expected running time , we solve by covering its significant pairs with disjoint blocks, with total expected construction and evaluation time .
For an instance with row set , column set , and logarithmic parameter as in Section 2.1, we evaluate each block against the restricted input vector and add its contribution to , initially zero and indexed by . The block tolerances ensure that their accumulated errors and the omitted tail remain within .
Proposition 7.1 (Block decomposition). Under the preceding inductive hypothesis, let and set the window , anchor window , and block tolerance as in (7.1) below. There is a Las Vegas algorithm that constructs and evaluates a finite collection of nonempty blocks with the following properties.
(a) Coverage and anchors. The blocks are pairwise disjoint subsets of , and every pair outside them has score less than . Each block is evaluated directly or has an anchor: either a column with for every , or a row with for every .
(b) Block evaluation. Each block product is approximated to coordinatewise error at most . Evaluating an anchor block involves one call and one computation of exact batch maxima, in expected time ; direct evaluation costs time.
(c) Total cost and error. The construction and evaluation have expected running time . Extend each block output by zero to and let be their sum. Then
7.1 Orientations, Hits, and Parameters
Because our recursive decomposition samples whichever side of a subproblem is more favorable, and reverses the roles of the two sides on light cells, we distinguish between the fixed row/column indices and the current source/target sets . The two orientations are as follows:
\begin{array}{c|cc}{{{column~orientation}}}&{{{sources~\Sigma}}}&{{{targets~\Theta}}} \\{{{\hline row~orientation}}}&{{{J}}}&{{{I}}} \\{{{\hline}}}&{{{I}}}&{{{J}}} \\\end{array}In the geometric procedures, we index sources by and targets by in either orientation, as in Section 6.3. Write for the source data and for the target data in the current orientation. With and , the quantity is the score of the corresponding original row-column pair. Reversing the orientation exchanges the two data families. Each block product maps the original column weights to the original row outputs, through for a column anchor and for a row anchor (Lemma 7.4).
For each orientation, fix the perturbation and bounding halfspaces of Definition 6.4 before sampling, with in the column orientation and in the row orientation, with . The instance bounds satisfy that definition for both sources and target positions, so the perturbed functions and the rule for forming canonical cells are fixed across all recursive calls. Lemmas 6.5 and 6.8(b) guarantee the perturbation bounds and point-location queries at every node.
Shared parameters. The sampling parameters , , and are those in (6.1). For the entire biased-product instance, set
with integer . The constants in the window and tolerance satisfy
Scores below the window contribute at most the tail term above, and the extra unit in allows for the perturbation. Every node restricts the original index sets with the perturbations, windows, and tolerances fixed. Thus the numerical factor in every local running time is a single polynomial in the original parameter (Appendix A.3).
Hits. We select blocks using the perturbed functions and evaluate them with the original scores . The perturbation error of at most (Lemma 6.5) relates the geometric hit threshold to the original score window.
Lemma 7.2. A source is a hit for target if .
(a) A hit has original score at least -L - 1/8.
(b) A source that is not a hit has original score below .
(c) Let , and let be a canonical cell of containing . If no source in hits , every hit in belongs to .
Proof. Parts (a) and (b) follow from the perturbation bound (Lemma 6.5(a)). For part (c), the owner has score below the hit threshold at , so every hit satisfies and belongs to by Definition 6.6.
7.2 Anchor Blocks and Direct Blocks
Definition 7.3. A block is a set of pairs with and . Its matrix is . A column anchor of the block is a column with for all , and a row anchor is a row with for all . An anchor block is a block with a specified column or row anchor.
The product of a block is . Subtracting a common anchor score reduces it to a shifted-kernel product in dimension , using the transpose for a column anchor and the forward product for a row anchor (Figure 5). Small blocks are evaluated directly.
(a) Column anchor

(b) Row anchor
kernel rows I, columns J
factorization uses

kernel rows I, columns J
factorization uses T
Figure 5: Two possible anchor types for an original block . The highlighted scores lie in . (a) Subtracting a column anchor's score cancels the row bias; each kernel row then has its maximum over , so has indices and appears transposed. (b) Subtracting a row anchor's score cancels the column bias; the maxima are over and keeps indices . Lemma 7.4 proves both factorizations and estimates their diagonal factors.
Lemma 7.4 (Anchor factorization). An anchor block can be evaluated to any error tolerance by a Las Vegas algorithm in expected running time
The algorithm computes exact batch maxima once in dimension d-1 and uses one call.
Proof. Column anchor. Suppose anchors the block, so for all . Subtracting its score cancels the row bias and yields , where and for . Define
Thus is the shifted kernel of Definition 5.3 in dimension with rows (), columns (), and shifts . Define the vectors and by
so the identity implies , that is,
We have because ; if is a maximizing index for , then , hence .
Row anchor. Symmetrically, for a row anchor , set and define the shifted kernel
Set
Subtracting the anchor score cancels the column bias, so the block product equals
By the same maximum comparison as above, , and by the anchor condition, .
Proposition 5.1 computes the maxima in expected time . We pass them to the inductive kernel algorithm; its call and the diagonal multiplications have the same expected time bound by Appendix A.3.
Lemma 7.5. The product of a block can be approximated to any error tolerance deterministically in running time .
Proof. Since every score is nonpositive, Lemma A.3 approximates each exponential with bit operations. Multiplying by the weights and summing gives the block product to error .
7.3 Random Prefix Chains
The top-level procedure DECOMPOSE processes thin nodes with full prefixes and balanced nodes with truncated prefixes. In both cases, CHAIN builds the prefix chain and ASSIGN groups targets by their first hits, and in truncated mode, the final prefix's envelope also locates the remaining targets and defines the recursive subproblems.
A node is a block with a designated sampling side. Its source and target data follow the orientation convention of Section 7.1. Conflict sets are relative to , and the support and reporting structures are built on the fixed perturbed points .
Procedure CHAIN. The input is a node with , a top size , and a reporting structure for . The procedure runs in full mode if and in truncated mode otherwise.
-
Draw a uniformly random permutation of and store the source positions. Let be its prefix of size , where , and stop at the first with . For , put .
-
For , where the level is included only in truncated mode, perform the following steps.
(a) Build the envelope structures of of Lemma 6.8.
(b) For each canonical cell of , in the order of Definition 6.6, use to report the sets for the vertices (Lemma 6.7(b)). Let be the union of these sets, with duplicates removed. Then check the conditions
At the first cell that violates (V1) or (V2), discard all structures built in steps 1 and 2 and return to step 1.
- Return the prefixes, the batches, the envelope structures of the levels processed in step 2, and all their canonical cells with their conflict sets.
An attempt of Procedure CHAIN is one pass through steps 1 and 2; it is accepted when it reaches step 3. Since the source permutation determines the canonical cells, their order, and their conflict sets (Definition 6.6 and Lemma 6.8(a)), acceptance with exact reporting depends only on this permutation, independently of the randomness used in geometric preprocessing.
Procedure ASSIGN. The input is the output of an accepted attempt of Procedure CHAIN for a node, together with the target set of the node. The mode is that of the chain.
-
For each set , build the structure of Lemma 6.2 for the points .
-
For each target , apply the first applicable rule.
(A1) Query the structure of with the vector . It returns and a maximizing source . If , assign the target the label (init, ).
(A2) Query the structures of in this order with the vector , and let be the least index such that the returned maximizer satisfies , if such an index exists. Locate in by Lemma 6.8(b), which identifies a canonical cell containing , and assign the target the label .
(A3) In full mode, call the target a tail target. In truncated mode, locate in , which identifies a canonical cell containing , and assign the target the label (fin, ).
- Sort the labeled targets into groups with equal labels. The source set of a group is for a label (init, ), and for labels and (fin, ).
We represent the cell in a target label by its index in the list of Lemma 6.8(a), where CHAIN has already stored its conflict set.
Level sums. For we have , and . Hence , and since , the number of levels satisfies . Since the sizes with double from one level to the next and are less than ,
and the same bounds hold with in place of if . For the sums of over and over are and , both less than .
Lemma 7.6. After an accepted attempt of Procedure CHAIN, Procedure ASSIGN assigns at most one label to each target. In truncated mode every target receives a label, and in full mode every target without a label is a tail target. Moreover, the following hold.
(a) For a group with label (init, ) or , the source lies in the source set of the group, and it anchors the group's block. For a label , moreover, .
(b) Consider a target and a source . If is a tail target or belongs to a labeled group whose source set excludes , their original pair has score below .
(c) The Cartesian products of each target group with its nonempty source set are pairwise disjoint subsets of the pairs of the node, and every other pair of the node has score less than . Step 1 has expected running time ; steps 2 and 3 require time.
Proof. The first applicable rule assigns each target at most one label, and (A3) assigns every remaining target in truncated mode. A support query returns a hit precisely when its queried set contains one (Lemma 6.2).
Part (a). For a group labeled (init, ) or , the assigned source hits every target of the group, so by Lemma 7.2(a). In an initial group, . In a later group, the preceding prefix has no hit at , so Lemma 7.2(c) implies . Thus is an anchor in the group's source set.
Part (b). A tail target has no hit in , so all its scores are strictly below by Lemma 7.2(b). An initial label (init, ) includes all sources in . For a label , the proof of part (a) shows that every hit lies in . For a label (fin, ), rule (A3) was applied, so the target has no hit in , and ; again every hit lies in by Lemma 7.2(c). In both cases, every source has original score below by Lemma 7.2(b).
Part (c). Every target has at most one label, so the groups have pairwise disjoint target sets, and these blocks are pairwise disjoint. Every pair outside these blocks either has a tail target or joins a labeled target to a source outside its group's source set, so its score is less than by part (b).
Cost. Since and , the sum of their k-th powers is by (7.2), so Lemma 6.2 implies the preprocessing bound. Processing each target requires at most support queries and one cell-location query, for a total of time including the final sorting.
For the running-time analysis, let be the group size of in Lemma 6.3 and set . A query returning then costs time.
Lemma 7.7. Each attempt of CHAIN is accepted with probability greater than 3/4, independently of earlier attempts. For every fixed permutation, its expected running time, over the remaining random choices, is
Summing over all attempts increases the bound by at most a constant factor.
Proof. Acceptance. At each level, is a uniform subset of . By Lemma 6.9, the probability of violating (V1) is at most per level and less than 1/8 over the fewer than levels.
For (V2), condition on and a cell satisfying (V1). The batch is a uniform subset of of size at most . Since , the random variable is hypergeometric, with mean at most . Lemma 2.4 implies
There are cell-level pairs, and a union bound with the sampling constants in Appendix B.5 gives probability less than 1/8 for any such failure. Each attempt is therefore accepted with probability greater than 3/4, independently of earlier attempts because acceptance depends only on the newly drawn permutation.
Cost. After drawing the permutation in time, we construct the envelope at each level in expected time and perform reports for each of its cells. The cells satisfying (V1) contribute time at that level, including forming unions and counting batch intersections. A cell violating (V1) contributes at most an additional before the attempt stops. This bound holds for every fixed permutation and conditionally on all earlier attempts, so the constant acceptance probability increases the expected total cost by at most a constant factor.
Geometric cost of a prefix chain. After preprocessing , running CHAIN and ASSIGN, including failed attempts, has expected cost
This follows for both full and truncated chains by combining Lemmas 7.7 and 7.6 with (7.2), using the logarithmic number of levels when . For evaluating the resulting blocks, each cell has at most logarithmically many anchors and the target groups are disjoint, so concavity relates the sum of their lower-dimensional kernel costs to the node sizes.
Exponents in the block-cost analysis. Set , , and , where is the exponent in the -dimensional bound and governs how the total block cost at level scales with the prefix size .
Lemma 7.8. Run Procedure ASSIGN after an accepted attempt of Procedure CHAIN on a node with source set and target set . For every group labeled (init, ) or , let be its block, with sides and . The target sets are disjoint, so ; at most blocks have an initial label (init, ), and each has . For each level , the collection of blocks labeled satisfies
All these anchor blocks together satisfy
This also bounds the expected time to evaluate the blocks to tolerance and accumulate their outputs. For odd , , so the product term is independent of , while for even , and .
Proof. By Lemma 7.6, the target groups are disjoint and at most initial groups use the full source set . At level , each of the cells has at most anchors by (V2), and each associated source set has size by (V1). The first two estimates follow by summing over these cells.
For nonempty , concavity and disjointness imply
Summing over the logarithmically many levels proves (7.4), with target terms totaling at most , source terms , and product terms . The initial blocks contribute at most , which also satisfies (7.4) because and .
Lemma 7.4 bounds each block evaluation by its term. Summing these conditional expectations and accumulating the outputs gives (7.4).
7.4 The Full Random Prefix
FULLPREFIX specializes CHAIN and ASSIGN to , then evaluates the resulting anchor groups.
Procedure FULLPREFIX. The input is a node with source set and target set .
-
If , evaluate the block of the node as a direct block by Lemma 7.5 with , add the result to , and stop.
-
Build the reporting structure with group size .
-
Run Procedure CHAIN with the top size , which is full mode, and the structure . Then run Procedure ASSIGN with the target set .
-
For every group with a label (init, ) or , evaluate the group's block with anchor , by Lemma 7.4 with , and add the result to .
Lemma 7.9. Procedure FULLPREFIX has expected running time .
Proof. If , direct evaluation costs time. Otherwise, the reporting structure is built in expected time and returns a report in time, with because . Substituting in (7.3) gives expected time for the chain and assignment. Equation (7.4) bounds anchor evaluation by this expression as well, since
7.5 Truncated Prefixes and the Heavy/Light Recursion
At a recursive node with block , write and . If , FULLPREFIX with the smaller side as sources takes near-linear time. Otherwise , and we use the larger side as sources with a truncated prefix. Define
For balanced sizes with and , we choose the prefix scale to balance the reporting and light-cell cost against the heavy-child potential bound . Setting both expressions equal to gives
This choice balances . Rounding to gives
(7.5)
If , then and give . Raising this inequality to the power and substituting yields , hence
In the latter case, direct evaluation costs . These estimates also apply to the batch-maxima algorithm in Appendix B.6.
For a final cell , let and count its unassigned targets and conflicting sources. We process light cells with by reversing the orientation and applying FULLPREFIX, and recurse on the heavy cells; setting ensures that the heavy children's potentials sum to at most of their parent's potential in the next lemma.
Lemma 7.10 (Heavy cells; proof in Appendix B.5). For balanced sizes and parameters as in (7.5), let be a finite list of pairs of positive integers with and for all . Call heavy if . Then
and for every .
Procedure DECOMPOSE. The input is the block at a recursive node v.
-
Let and .
-
Thin node. If , run FULLPREFIX with the smaller side as sources and stop.
-
Balanced node. Use the larger side as sources and the smaller side as targets . Set , , and . If , evaluate the block directly with tolerance by Lemma 7.5, add its output to , and stop.
-
Build with , run CHAIN with in truncated mode, and apply ASSIGN to . Evaluate the groups with assigned anchors as in step 4 of FULLPREFIX.
-
For every nonempty group with label , let be its target set, and set
and .
• If , do nothing.
• If and , call the cell light and reverse the parent orientation. Run FULLPREFIX with source set and target set .
• Otherwise, call the cell heavy and recurse on its block with DECOMPOSE.
Lemma 7.11. Procedure DECOMPOSE is a Las Vegas algorithm. Applied to , it evaluates pairwise disjoint direct or anchor blocks, each to coordinatewise error at most . Every omitted pair has score less than , and the procedure has expected running time .
Proof. Coverage. By Lemma 7.6, each assignment partitions its node's pairs into anchor blocks, blocks associated with final cells, and discarded pairs with scores below . A full prefix evaluates its anchor blocks, and a truncated prefix also passes each nonempty block from a final cell to FULLPREFIX or recursion. Direct evaluation includes every pair in a block, and changing orientation leaves its original row-column pairs unchanged. Induction therefore proves that the evaluated blocks are disjoint and cover every pair with score at least . Their individual errors are at most by Lemmas 7.4 and 7.5.
Local cost. A thin leaf is processed in expected time by Lemma 7.9. If step 3 evaluates a balanced node directly, the running time is by (7.6).
At a node reaching step 4, the final prefix has size . By (V1) and , its final groups satisfy
where the second inequality follows from disjointness of the target groups. By (7.5), we have , , and . Building the reporting structure with group size thus costs in expectation. Its query parameter is , so (7.3) with implies the same expected cost for the chain and assignment.
For the anchor blocks, the cost in (7.4) is
For odd , the last term is because and . For even , use , and to obtain
There are final cells. A nonempty light group satisfies and , so its call to FULLPREFIX, with the parent's targets as sources, requires expected time , for a total of over all light cells. These local bounds include failed sampling attempts and hold conditionally on the input to each node.
Summing the recursion. By Lemma 7.10, the heavy children have total potential at most one quarter of their parent's and total linear size ; each child also satisfies . Summing over the recursion as in Appendix B.5 yields total expected time .
7.6 Error Analysis and the Proof of Proposition 5.6
Proof of Propositions 7.1 and 5.6. Consider a instance with the notation of this section. The algorithm fixes the perturbations and bounding halfspaces for both orientations and the parameters (6.1) and (7.1) as in Section 7.1, sets , runs Procedure DECOMPOSE on , and returns the accumulated vector .
Correctness. By Lemma 7.11, the evaluated blocks are disjoint and each has error at most . In any row, at most block errors contribute, and each omitted pair has weight below . Hence
by (7.1). The total error, including final rounding, is at most .
Cost. The shared perturbations, accumulation of block outputs, and final rounding require time plus the linear terms in the block bounds (Appendix A.3). Adding the cost of DECOMPOSE from Lemma 7.11 gives total expected time .
7.7 Proof of Theorem 1.1
Proof of Theorem 1.1. For , apply Theorem 5.8 to the products defined in Section 2, using and tolerance . The returned ratios are -accurate by Lemma 2.5. The kernel algorithms are Las Vegas and have total expected cost
which also includes preparing the weight vectors and computing the final ratios, at cost . For fixed r, this is .
Adding a zero coordinate embeds a one-dimensional instance in the plane with identical scores. The planar algorithm therefore gives the required bound for , since .
8 A Static-Query Comparison with Semigroup Halfplane Aggregation
Corollary 4.6 preprocesses fixed keys and values in time and space and answers each query in time. Because truncating the exponentially decaying tail reduces each query to aggregating keys whose scores are close to the row maximum, it is natural to compare this bound with exact halfplane aggregation.
The comparison model. In the semigroup arithmetic model, preprocessing stores linear forms with nonnegative integer coefficients in the point weights, which belong to a commutative semigroup. A query combines stored forms by the semigroup operation, and the scheme must work for every weight assignment and every query in the prescribed set of ranges. Space counts the stored forms, and query cost counts the distinct forms used in an answer, allowing nonnegative integer coefficients (combining distinct forms requires at least binary semigroup operations).
Auxiliary geometric computation is free, with an adjoined identity element serving as the answer to an empty range. The lower bound applies to faithful semigroups, in which identically equal linear forms involve the same set of variables. Exact rational summation using only additions of weights fits this model.
Lemma 8.1. Let be a fixed integer. For all large enough , there is a labeled set of points with -bit rational coordinates, and a collection of halfspaces with -bit integer coefficients, such that every faithful-semigroup storage scheme using stored forms has worst-case query cost
These finite-precision halfspaces realize every halfspace range on .
Proof. Arya, Mount, and Xia [AMX12, Theorem 4.1(i)] prove this lower bound for scattered point sets, and their Lemma 4.6 shows that independent uniform points in are scattered with probability . We use such a set whose order type survives rounding to a dyadic grid with -bit coordinates.
Set . A uniform point lies within distance of a fixed proper affine subspace with probability . A union bound over the successive affine heights of all ordered -tuples shows that, with probability , every orientation determinant has magnitude at least . Fix a realization satisfying both this event and the scattered-set condition.
Round each coordinate to the nearest multiple of , with
By multilinearity, each orientation determinant changes by at most . Thus the rounded set has the same order type as , hence the same labeled halfspace ranges. Since the semigroup storage/query tradeoff depends only on these ranges, the lower bound transfers to .
Finally, lies on a grid with denominator . Lemma A.8 in Appendix A.9 represents each range by an -bit integer halfspace.
Corollary 8.2. For polynomial coordinate and value bounds, inverse-polynomial additive error tolerance, polylogarithmic coordinate encoding lengths, and a fixed number of value channels, planar attention admits a deterministic static structure with preprocessing time and space and query time. In contrast, a faithful-semigroup scheme for exact planar halfspace aggregation with stored forms has worst-case query cost
even for points and halfspaces whose coordinates and coefficients have -bit encodings.
Proof. Apply Corollary 4.6 for attention and Lemma 8.1 with and for halfspaces. Both structures are preprocessed before the query arrives.
9 Conclusion and Further Directions
We have shown that softmax attention in fixed dimension can be computed at arbitrary positive temperature within the best known batch maximum-inner-product bound in and ,
and deterministically in near-linear time in the plane. Together with the dimension-preserving reduction in Section 3, this identifies the current best exponents for the two problems.
The planar data structure also separates attention from exact range aggregation. After preprocessing and storage, each query requires time, whereas faithful-semigroup halfplane aggregation with near-linear storage has a polynomial worst-case query lower bound (Section 8).
The central open question is whether the agreement between the current bounds reflects equality of the optimal exponents. A dimension-preserving reduction from attention to batch maximum inner product with a subpolynomial additional factor in the running time would establish that equality.
Optimal exponents. For fixed , consider instances with . Let be the infimum of exponents for which attention with value channels can be computed by a Las Vegas algorithm in expected time whenever coordinate and value magnitudes are polynomially bounded, , and encoding lengths are polylogarithmic in . The algorithm may depend on the fixed exponents in these bounds. Define analogously for with polynomially bounded integer coordinates. Our reduction and upper bound imply
with equality to 1 for .
Conjecture 9.1 (Dimensional complexity of attention). For every fixed integer ,
and hence .
Such a black-box reduction would transfer future improvements for batch maximum inner product directly to attention, but constructing it for remains open. For lower bounds, the known unconditional results of the form apply to restricted models, including Erickson's polyhedral partitioning algorithms [Eri96] (Section 1.3).
Precision dependence and determinism. The factors suppressed by soft-O may be reduced through faster integer arithmetic, improved polynomial bases or interpolation nodes, and techniques that remove logarithmic losses in related geometric problems [Cha12; CZ22]. To derandomize the algorithms, we need deterministic replacements for the random prefixes, the source order in the batch-maxima procedure THINMAX (Appendix B.6), and the geometric preprocessing. Deterministic constructions of cuttings and convex hulls [Mat92a; Cha93] offer starting points for these replacements.
Offline aggregation. For offline halfspace aggregation, all queries are given in advance. A faithful-semigroup lower bound with exponent above would establish a batch analogue of the comparison in Section 8. For simplex ranges, Chazelle [Cha97] proved an offline semigroup lower bound of for points and simplices.
Implications for AI. Our near-linear algorithms in dimensions two and three motivate architectures with many micro-heads, each with small query and key dimensions and few value channels. By distributing representation across these heads, such architectures could use the algorithms to process longer contexts, with exact factorizations of small fixed rank offering a related route to low-dimensional scores [GHSXY26]. For a fixed key-value cache, the planar structure answers queries in time from stored aggregate moments (Corollary 4.6), suggesting that an extension to growing caches could reduce the repeated reads of keys and values that limit autoregressive decoding bandwidth [Sha19]. Developing these applications calls for studying the modeling capacity of many small heads, reducing the arithmetic cost, and updating the cached geometric information efficiently, and could inspire new designs for both AI models and hardware architectures.
A Numerical Stability and Precision
This appendix verifies that all intermediate quantities appearing in our geometric primitives, polynomial evaluations, and dimension reductions have bit lengths polynomial in the instance parameter of Section 2.1. The table locates the algorithms and their arithmetic analyses.
| Component | Algorithm and correctness | Bit complexity |
|---|---|---|
| Planar kernel products and online queries | Section 4 | Appendix A.2 |
| Anchor blocks | Section 7.2 | Appendix A.3 |
| Temperature interpolation | Section 5.3 | Appendix A.4 |
| Ray shooting | Appendix B.2 | Appendix A.5 |
| Support and reporting | Appendices A.7 and B.3 | Appendix A.6 |
| Envelope cells and location | Appendix B.4 | Appendices A.7 and A.8 |
| Batch Max-IP | Appendix B.6 | Appendices A.6–A.8 |
A.1 Input Size, Temperature, and Reduction Cost
Reading and rounding a rational coordinate to a prescribed dyadic precision requires time polynomial in its encoding length and the number of precision bits. For an irrational inverse temperature, use a positive dyadic with . The scores change by at most , so the output changes by at most by Lemma 2.5, leaving tolerance for the attention algorithm. This approximation needs bits. For , it is computable within the same polynomial bit cost. Thus temperature scaling and input preparation require time per entry.
The reductions in Section 3 consist of scaling input coordinates, computing inner products of length , and rounding. The resulting numbers have magnitudes polynomial in and denominators of logarithmic encoding length. Consequently all these numbers have polynomially bounded encoding lengths in , and the additional work is . In particular, this remains when , , and .
A.2 Arithmetic for Planar Kernel Products
For each call to Lemma 4.2, use the instance parameter of Section 2.1.
Geometric rounding. For the rowwise tolerance of Section 4.2, choose dyadic parameters
with small absolute constants satisfying the error estimates below. Both parameters have bits.
Lemma A.1. Let be obtained by rounding each coordinate of the original to with error at most , and set
For every , the original kernel satisfies
Proof. Rounding changes each inner product by . Lemma 2.5 bounds the change in each shifted exponential by as well, giving row error for a small enough constant in .
Collinear keys. For collinear rounded keys, translate one key to the origin and write with , using from a coordinate of maximum spread or setting every when all keys coincide. For query , let and . In the order of increasing , the selected range is a prefix, suffix, or the whole array. On this range, , so expanding the polynomial below in powers of reduces forward products and online queries to prefix sums of for , and transpose products to interval additions of weighted query coefficients. Every omitted shifted score is below , as required for the error estimates of Section 4.5.
Taylor approximation. Write .
Lemma A.2. For , and an integer ,
In particular, with the parameters of Section 4.2,
Proof. The Taylor terms are nonnegative. The standard remainder formula [DLMF, Eq. (1.4.36)], together with , implies the first bound. For a large enough constant in , the rescaled remainder is at most .
Scalar exponentials
Lemma A.3. For , let and have encoding lengths , and suppose . In poly() time, one can compute a nonnegative dyadic such that and its numerator and denominator have bits.
Proof. If , then and we return . Otherwise , so evaluating Taylor terms by Lemma A.2 produces an interval containing , with and . For , the reciprocal endpoints enclose in an interval of width at most , since . Rounding the lower endpoint down to a dyadic grid of mesh yields a nonnegative satisfying . The Taylor sums and endpoints have polynomial bit length, and the computation requires poly() time. The dyadic output has -bit numerator and denominator because and .
For the planar kernel, , so an absolute tolerance of ensures the relative error for in Section 4.4, with for a small enough constant in .
Rowwise kernel error. Every omitted rounded exponential weight is less than . For an entry with , the polynomial error is at most by Lemma A.2, and the approximation to the common factor contributes at most
Thus the row error relative to the rounded exponential weights is at most . Centering leaves the rounded shifted scores unchanged, so the triangle inequality and Lemma A.1 imply the error estimate relative to the original .
Product error. For either product, set
We round the input weights to a working vector or on a common dyadic grid with coordinatewise error at most , so the rounded entries have magnitude at most . The corresponding sweep then evaluates or exactly, and we round each output coordinate to within .
By Lemma 4.5, the rowwise kernel error is at most , whose contribution for the original input vector satisfies
The extra factor in the transpose bound comes from summing one entrywise error from each row. Since , the subsequent rounding of the input vector contributes at most for the forward product and for the transpose product. Each is at most , so the total error including output rounding is at most .
Attention and online queries. For planar attention, set and in the kernel calls. By Lemma 2.5, the ratio error is at most , so the total remains below after output rounding to error .
For the static structure, use and . Round the keys and each arriving query with the geometric mesh , and round the values with error at most . Let be the original shifted-kernel row and its row in . Then and . The ratio error for an original value channel of magnitude at most is at most
The second term is the value-rounding error under the nonnegative normalized weights. Rounding the output to error keeps the total below .
Exact moment sums. The geometric and weight grids have common dyadic denominators of bits, and the polynomial degree is . Before centering, scale the rounded keys of Lemma A.1 to integer coordinates. Their polygon's centroid is a ratio of sums of fixed-degree products of these coordinates, so the shoelace formula expresses all centered keys with polynomial bit length and a common denominator. The collinear case has the same property, since its parameters are differences of grid coordinates and one shared direction vector.
Because the weighted key monomials and row coefficients involve powers through degree and Taylor factorials, their numerators and common denominators have polynomial bit length. Summing at most signed terms over these denominators adds only numerator bits, so the sums and the polynomially many terms in each weighted sum have bit lengths polynomial in . The remaining geometric computations have the same bound because they consist of fixed-degree arithmetic and fixed-dimensional linear systems.
Each sweep requires bit operations and storage, as required by Lemma 4.2, including product rounding and attention divisions by denominators bounded away from zero. For the static structure, persistence stores nodes, and a query visits nodes to combine the moments with polynomially many coefficients. The common-denominator bounds hold uniformly over queries satisfying the input bounds, proving Corollary 4.6, and the query workspace can be reused throughout the stream.
A.3 Arithmetic for Biased Block Products
We now establish the bit-complexity bounds suppressed by in Lemmas 7.4 and 7.5. All blocks belong to one original biased-product instance and share its fixed window and tolerance . All precision bounds refer to the parameter of this original instance (Section 2.1).
Anchor products. The transformed coordinates in Lemma 7.4 are input coordinates or their differences. Hence the exact inner-product maxima and the rational exponents defining the diagonal factors have bit length polynomial in . The factors are bounded by , so we can approximate them by Lemma A.3 with a number of bits polynomial in and the target precision. For a block with , approximate the factors and kernel product to a common dyadic error . Including final rounding, the total error is . It suffices to use
additional bits to ensure block error at most . The scaled weights have magnitude at most and polynomial bit length, so the lower-dimensional kernel call has only a polynomial increase in its logarithmic parameters. The remaining scalar computations require time.
Direct products and accumulation. For a direct block, approximate each exponential and round each weighted term to a single dyadic grid before summing. The common denominator keeps intermediate bit lengths polynomial, and a suitable grid mesh ensures the error bound of Lemma 7.5 in time. In both kinds of blocks, round the block outputs to one grid shared by the whole decomposition, with mesh proportional to as in Section 2.1. Each output row receives at most block contributions, so the common denominator and all intermediate numerators have polynomial bit length in the original .
Group indices and accumulation. The labels distinguishing initial, first-hit, and final groups contain only a constant number of source, cell, and level indices. Label comparisons and the computation of sampling parameters involve numbers of polynomial bit length in . Their running time, together with accumulation and final rounding, is bounded by the linear terms in the block and geometric estimates.
A.4 Precision under Composition and Recursion
Here is the parameter of Section 2.1 for the current kernel-product or biased-product instance.
Interpolation coefficients and sums. In Proposition 5.5, round each exact coefficient to a single dyadic mesh , with a small absolute constant, and denote the result by . Then
Before interpolation, round the original weights toward zero to a common dyadic grid of mesh . The rounded weights have magnitude at most and change the exact kernel product by , since kernel entries are at most one. We apply the interpolation scheme to these rounded weights, using the rounded coefficients in both the forward output combination and the transpose input weights. Because each entry of the biased matrix lies in , coefficient rounding adds at most to either product, and the bound on the sum of absolute coefficients ensures the estimates for errors from the biased products in the main proof. With sufficiently small grid constants and final rounding error, these additional errors sum to at most .
One reduction step. The normalized directions and exact maxima have encoding lengths , since normalization uses a fixed number of rational operations per coordinate and each maximum equals an input inner product. Each interpolation coefficient is a product of polynomially many rationals of polynomial encoding length, and the number of nodes and groups is polynomial in . The coefficients therefore have polynomial encoding length, and their absolute sum requires only polynomially many additional precision bits in the biased calls. The transformed coordinates, weights, and error tolerances have the same polynomial bound. With weights and outputs on common dyadic grids, summing contributions adds logarithmically many bits in the number of terms, establishing the numerical cost in Proposition 5.5. These estimates also apply to the diagonal factors of anchor blocks, whose exponents are bounded above by the score window and whose entries below the target tolerance can be rounded to zero (Appendix A.3).
Recursion at a fixed dimension. The shared parameters of Section 7.1 and the exact geometry in Appendix A.5 ensure polynomial operand lengths at every node of one biased-product instance.
Recursion on the dimension. Each lower-dimensional call decreases the dimension and may replace by a fixed polynomial in . There are at most reductions before the planar base case, so their composition is a polynomial whose degree depends only on the fixed dimension. The numerical factors accumulated along this constant-length chain have the same property. Hence the hidden factors remain polynomial in the original encoding lengths and logarithmic parameters.
Computing attention. For Theorem 1.1, the tolerance adds precision bits. The kernel outputs have polynomial encoding length, so each division and output rounding requires time polynomial in the original numerical parameters.
A.5 Exact Geometric Computation
For fixed , we use the notation of Section 6 and the instance parameter of Section 2.1.
Lemma A.4. Suppose a geometric algorithm performs arithmetic or combinatorial operations and stores objects. If each geometric quantity is obtained from input points or constraints by a bounded-depth, bounded-degree algebraic computation, and each combinatorial operation acts on encodings of bit length polynomial in , then it has an exact implementation with running time and space . The implementation has the same expected bounds and is deterministic or Las Vegas according to the original algorithm.
Proof. The fixed-dimensional linear-algebra computations involve rationals of bits. More generally, bounded-degree algebraic numbers obtained at bounded depth have defining coefficients of bits, and exact sign tests, root isolation, and comparisons require time polynomial in [BPR06, Chapters 8 and 10]. Applying these bounds to each operation proves the claim, also after taking expectations.
Hull vertices and vertices in the low-dimensional hierarchies are intersections of original constraints [PS85; DK90; CS89], as are the vertices of the first triangulation in Appendix B.2. Its local arrangement vertices are intersections of original hyperplanes and facets of a first-stage simplex, using two fixed levels of linear algebra. The fixed-dimensional linear-programming predicates [Meg84, Sections 2 and 3.2] and auxiliary algebraic decompositions also have a fixed number of elimination levels. Since recursive nodes reuse subsets of the original constraints and the same bounding simplex, the same depth bounds hold at every recursive node and the bit lengths remain .
Distinct rational values obtained by a bounded number of these operations differ by at least . If each value changes by less than one quarter of this gap, every strict comparison has the same outcome and every perturbed minimizer or maximizer remains valid for the original values. This is a standard use of exact geometric computation [Yap97].
A.6 Uniform Perturbations and Caps
Lemma A.5. Let be an integer and let be points in of bit length at most , indexed by distinct positive integers at most . For a large enough positive integer depending only on , set and
(a) The perturbed points have bits and satisfy .
(b) In every signed coordinate permutation , the hyperplanes are in general position.
(c) Every intersection of d of these hyperplanes has -bit coordinates.
The constant may be increased to satisfy any fixed exponential separation bound of the form .
Proof. For at most normals, test a square minor containing the constant coordinate and distinct remaining coordinates; for hyperplanes, test their augmented determinant. As a polynomial in , the determinant has a highest-degree coefficient equal to a generalized Vandermonde determinant with distinct positive indices and distinct nonnegative exponents. Descartes' rule of signs implies that this coefficient is nonzero [DLMF, Section 1.11(ii)]. Clearing denominators gives a nonzero integer polynomial of bounded degree with -bit coefficients. For sufficiently small , its lowest-degree nonzero term dominates the rest. The coefficient bounds are uniform, so one value of works for every index subset and signed coordinate permutation. The perturbation estimate follows from the definition, and the intersection coordinates have bits by Lemma A.4.
We close the region above an envelope with explicit cap halfspaces.
Definition A.6. Let be integers and set
Let be the -th unit vector of for , and let . For a signed coordinate permutation , set
For a nonempty finite set of points in with and cap perturbations satisfying , write and define
The lower constraints are the source constraints, the upper ones are the cap constraints, and .
Lemma A.7. The capped polytope satisfies:
(a) whenever ;
(b) is bounded;
(c) a vertical downward ray from an interior point exits at , and every exit constraint with positive directional inner product is the constraint of a maximizing source.
Proof. On the target box, the source functions lie below , while every perturbed cap lies above it with a fixed positive margin. For boundedness, note that
For the chosen , the minimum cap lies below every source function whenever is sufficiently large, uniformly over the allowed cap perturbations. Their intersection is therefore bounded in both and . A downward ray exits through a source constraint at the largest source value.
A.7 Support Queries and Envelope Construction
Proof of Lemma 6.2. For each normalizing permutation, we form the cap halfspaces of Definition A.6 with and , indexing the caps by and the sources by distinct subsequent integers. Applying Lemma A.5 with the same source indexing and a uniform bit bound puts the combined constraints in general position. The caps together with any one source define the bounding simplex for Proposition B.3, whose structure we build using the interior point from Lemma A.7(a).
For a nonzero query , use its permutation from Definition 5.2 and shoot vertically downward from . Lemma A.7 gives a maximizer of the perturbed scores. Distinct original scores have gaps at least , and the perturbation changes each score by less than one quarter of this gap uniformly over queries satisfying the input bounds. The returned index therefore maximizes the original scores as well, and we evaluate its original score exactly. Since there are a fixed number of coordinate groups, Proposition B.3 gives preprocessing time and query time , deterministically for .
Envelope construction and proof of Lemma 6.5. Use the identity permutation and . Index the caps by and the sources by , and apply Lemma A.5 once to all these points with a uniform bit bound. Define and set
The bounding halfspaces and the height are shared by every sample. By Lemma A.7, each lies in the interior when , so the lower boundary over this box is exactly the graph of .
The cap coefficients, indices, and source coordinates have bits. Set the perturbation so that its effect on every source value in is at most and is less than one quarter of the gaps between distinct original values at every rational target satisfying the input bounds. These gaps are at least , so one perturbation constant depending only on the dimension suffices and also satisfies the cap perturbation bound, proving parts (a) and (b). For part (c), every subset remains in general position, its envelope polytope is bounded by Lemma A.7, and its vertex bit lengths follow from Lemma A.4. The interior point needed for ray shooting depends only on the target and the fixed height, so it has bits and is computable in time.
A.8 Interior Shifts for Cell Location
For a query satisfying the bounds of Lemma 6.8, the descent in Appendix B.4 follows a ray from the least vertex of a face through a point in that face. Write . For a shift specified below, we move the ray origin into the interior by setting . For every constraint with , its exit parameter changes from to
Every descent has at most steps, each using one original vertex and constraint, so its coordinates and exit parameters have bits. Their nonzero gaps and denominators are at least . A dyadic with bits then preserves every strict ordering among the exit parameters, so each shifted minimizer also minimizes the original parameters. Since the bounds are uniform over samples and targets, a single shift suffices for all location queries.
A.9 Integer Encodings of Halfspace Ranges
Lemma A.8. Fix and an integer . Let with . Every halfspace range on is realized by a halfspace with a nonzero integer normal and coefficients of bits.
Proof. Without loss of generality, the selected range is nonempty and proper. On the integer points , maximize the nonnegative separation margin subject to ; its positive maximum occurs at a vertex determined by tight constraints with integer coefficients of magnitude . Cramer's rule followed by clearing denominators yields integer of magnitude (Lemma A.4), and rescaling the normal by realizes the original range with the required encoding length.
B Geometric Constructions and Sampling Proofs
This appendix proves the geometric data structure bounds and sampling estimates stated in Section 6, together with the exact batch-maxima bound of Proposition 5.1; Appendix A details their exact rational implementations. Throughout, we follow the notation of Section 6 with fixed and .
B.1 Classical Polytope Facts
We use the active sets of faces to label the canonical cells. Relative to defining halfspaces , the active set of a face is , with the standard properties below [Zie95, Propositions 2.2, 2.3, and 2.16, and Theorem 2.7].
Lemma B.1. Let be a finite set of closed halfspaces in in general position whose intersection is bounded and has nonempty interior. For define , with , and .
(a) Every vertex of lies on exactly of the hyperplanes , .
(b) If , then contains a vertex of , , is a face of of dimension , iff , and . Every nonempty face of equals for exactly one set , its active set . In particular .
(c) The number of chains of faces of with is at most . Moreover, [McM70; Sei17].
The face identities follow from simplicity and independence of the active normals. Ordering the facets at each vertex gives the flag count in part (c), and McMullen's Upper Bound Theorem gives the vertex bound by polarity [McM70; Sei17].
Proposition B.2. Let . Let be a set of closed halfspaces in in general position whose intersection is bounded and has nonempty interior, and let members of be given whose intersection is bounded and has nonempty interior. A Las Vegas algorithm computes all vertices of , each with the members of whose bounding hyperplanes contain it, in expected arithmetic operations [CS89, Theorems 4.7 and 4.8].
Starting from the given bounding simplex, insert the remaining halfspaces in uniformly random order. Each feature is defined by variable constraints, and an intersection with such constraints has complexity . Thus the analysis of [CS89, Theorem 3.9] applies with the fixed constraints present in every sample. For rational inputs, Lemma A.4 implies expected running time .
B.2 Constructing Cuttings with a Fixed Bounding Simplex
Proposition B.3 (Ray shooting). Let be a finite collection of closed halfspaces in with rational coefficients, in general position, and let . Suppose that an interior point and a subset of members with bounded intersection are given. Let bound the bit lengths of the constraint coefficients and of . A Las Vegas algorithm builds a data structure in expected time ; for , these bounds hold deterministically. Given a ray with , , and coordinates of bit length at most , the structure returns in time a constraint such that and contains the ray's exit point from .
We give the details of the classical constructions of [CS89; MS93] to establish their bounds in our bit-complexity model (Section 2.1).
The ray-shooting algorithm uses the same bounding simplex for every sample and recursive node. Let be a finite collection of closed halfspaces in in general position with a common interior point , and let consist of halfspaces with bounded intersection . Write . For , define
Because the fixed constraints are present in every sample, is always a full-dimensional polytope containing in its interior. We triangulate by coning the lexicographically least vertex of each positive-dimensional face to the triangulations of the facets that omit it. A resulting full-dimensional simplex has vertices along a chain , where , is the least vertex of , and for . Denote the triangulation by , describing each simplex by the ordered active sets of its vertices.
Lemma B.4. Let , let , and let be its vertices in pulling-chain order. Define
Then , and for every ,
Moreover, , where .
Proof. By Lemma B.1, each lies on exactly hyperplanes of . General position of implies that these are also all the hyperplanes of through . Hence , and every sample in which occurs contains and avoids .
For the converse, suppose that and . Then , and each has the same complete active set. Let be the active set of the original face , and set
The constraints of belong to . The affinely independent points lie in and span aff , so . Consequently the form the same sequence of facet incidences, with for .
We show that is the least point of . A bounded polytope is the convex hull of its vertices, so is the least point of the original face . If were lexicographically smaller than , the point would satisfy all constraints active at for . Every other constraint of is strict at and holds for all small enough . The same point also satisfies the equalities of . This would be a point of smaller than , a contradiction. Thus is the bottom vertex of , and the original pulling chain occurs in .
Finally, the full pulling chains are a subset of the complete face chains counted in Lemma B.1(c), with prepended. By that lemma, their number is at most .
The set contains all halfspaces that prevent from occurring in a sample. To build a cutting, we also count the hyperplanes crossing its interior,
A hyperplane crossing the interior of has points of on both sides, so . The time for refining simplices with large depends on a moment estimate obtained by comparing a sample with a smaller uniform sample.
Lemma B.5. Let , and let be a uniformly random -element subset of , where is an integer with . For every fixed real ,
The estimate also applies to interior crossings, with in place of .
Proof. Set . For , the number of simplices and every summand are bounded by constants depending only on , so the claim follows.
For , let . For a fixed configuration , let and , and write for its probability of occurring in a uniformly random -element sample. Configurations with contribute zero to the desired expectation.
For the remaining configurations, drawing a uniform -element sample and then a uniform element subset is equivalent to drawing the smaller sample first and extending it uniformly. Lemma B.4 implies
where and an impossible selection has probability zero. Since and , we have . The probability that the extension avoids is at most . It follows that
For fixed , the function is bounded on . Multiplying this inequality by and summing over the finitely many configurations yields
by Lemma B.4. The last assertion follows from . This is the double-sampling argument underlying the configuration bounds of [CS89; CF90], with fixed in every sample.
Lemma B.6. Under the preceding assumptions, let and let be an integer with . A Las Vegas algorithm constructs closed full-dimensional simplices whose union contains , each meeting , such that the interior of each simplex is crossed by at most hyperplanes of . It also computes their closed conflict lists
The algorithm uses arithmetic and combinatorial operations in expectation. Every vertex is obtained from original constraints by linear algebra of depth at most two.
Proof. We draw a uniform -element sample , enumerate and its pulling triangulation, and count the interior crossings for each in time. Set and refine each simplex with as follows.
Local refinement. Let be the set of hyperplanes crossing int , which contains every hyperplane that can cross the interior of a subsimplex of , and set . We draw a uniform sample of size
from , with a positive integer depending only on and satisfying the sampling estimate below. Integer division and bit-length comparisons compute this size, which is . We form the sample's arrangement inside , triangulate the closures of its full-dimensional cells by pulling, and verify that every resulting simplex has at most interior crossings. If the test fails, we repeat the local sampling.
The ranges on consist of the hyperplanes crossing the interior of a full-dimensional simplex. For a simplex with vertices , the crossing condition is
On any hyperplanes, these ranges have distinct traces, determined by the signs of linear forms in the vertex coordinates. Thus the range space has VC dimension depending only on .
If , the full sample satisfies the crossing bound. Otherwise the random -net theorem [HW87], with , shows that independent draws intersect every range of size greater than with probability at least 1/2.
Deleting repetitions from the independent draws and filling uniformly from the unused elements gives a uniform -element subset by symmetry. It intersects every range met by the independent draws and is therefore an -net with probability at least 1/2. Since the interiors of the triangulated arrangement cells have no sample crossings, every such net satisfies the crossing bound, so local refinement requires at most two attempts in expectation.
If the local sample has hyperplanes, the arrangement inside has vertices. At each vertex, at most original hyperplanes and at most facet hyperplanes of are incident. There are thus complete face chains through each vertex, including incidences between cells, and simplices in the pulling triangulations. This count remains valid in the presence of dependencies among the original hyperplanes and the facet hyperplanes of . Since for , every accepted refinement has simplices.
Acceptance and cost. After all refinements, discard every simplex with . This is a fixed-dimensional linear-programming feasibility test on constraints using operations [Meg84]. Appendix A.5 specifies the predicates of bounded algebraic depth for this feasibility test. The remaining simplices cover , because the refinements cover . Accept if at most simplices remain, and otherwise draw a new outer sample , where the constant depends only on and satisfies the estimate below.
Conditional on , the number of simplices before discarding is at most
Its expectation is by Lemma B.5, and Markov's inequality gives outer acceptance probability at least 1/2 for a large enough . Each attempt, including the local retries, uses operations in expectation, since and all candidate lists are checked by enumeration. Repetition therefore increases the expected cost by at most a factor of two.
Each remaining simplex has at most interior crossings. A hyperplane that meets a closed simplex while avoiding its interior supports a face containing a vertex. By general position, at most original hyperplanes pass through any vertex, so at most additional hyperplanes belong to the closed conflict list.
Coordinates. Appendix A.5 constructs every cutting vertex from original constraints through two levels of linear algebra, with polynomial exact arithmetic cost.
Proof of Proposition B.3. For , the deterministic algorithms described in Appendix A.5 achieve the required real-RAM complexity [Cha96b, Lemma 2.1 and Corollary 2.2]. For , we use the static recursion of Matousek and Schwarzkopf [MS93, Lemma 7], with the cuttings constructed above. The implementation uses the same bounding simplex at every node and closed conflict lists, with bounded coordinate complexity.
Recursive structure. Every node keeps and stores a variable subset , representing . For above a constant threshold, set , where the positive rational depends only on and satisfies the preprocessing estimate below, and construct the cutting of Lemma B.6. The child for stores its closed conflict list , together with . As in [MS93, Lemmas 7 and 11], a query descends through a simplex containing the last point of the ray in the union of the cutting simplices. This union is compact and contains . A leaf scans its constraints and returns one minimizing the exit parameter
Exact auxiliary queries. To select the last simplex met by the ray, we use the sign-vector method of [MS93, Lemmas 11–12]. For each simplex facet , define
The signs of and determine the ray's intersection interval with each simplex and the order of all finite endpoints, including the cases and equal exit parameters. They come from polynomials of degree at most two in the ray parameters. Construct a sign-invariant cylindrical algebraic decomposition, including cells of every dimension, and associate each cell representing a ray that meets the union with a simplex of largest exit parameter; break ties by simplex index [BPR06].
This decomposition requires operations because the dimension is fixed. At query time, binary search among the ordered roots at each of the 2d levels locates the ray in exact geometric operations. Thus we obtain an exact implementation of the point-location structure of [CEGS91] used in the cited recursion.
Closed conflicts and ray exits. Let be the exit point from the current node polytope. The selected simplex contains a point of the ray at or beyond , and Lemma B.6 ensures the existence of a point .
The query origin remains interior to every node polytope, since their constraints are drawn from . For any tight at , we have and
The segment joining these two points lies in and intersects , so . Together with the fixed constraints , the child contains every constraint tight at . Its polytope contains the parent's and has the same ray exit, so induction along the query path proves that the leaf returns a valid original constraint.
Complexity. An accepted node has at most children, each with at most variable constraints, where . For small enough , its expected preprocessing cost is , since . Let be the worst expected preprocessing time of any node with at most variable constraints. Independent random choices for the children give
Set the leaf threshold so that and at every internal node. Then
For these shifted node sizes, the storage analysis of [MS93, Lemma 7] implies , and the single-path query analysis implies operations per query. The resampling procedures terminate with probability one, and the node sizes decrease above the leaf threshold.
Lemma A.4, applied to the representations in Appendix A.5, converts these operation counts to bit complexity. Preprocessing is deterministic for and Las Vegas in higher dimensions.
B.3 Strict Halfspace Reporting
Proof of Lemma 6.3. Partition , in its fixed enumeration order, into groups of size at most . Within each group, build the binary tree of [Cha96a, Observation 2.3] and use Lemma 6.2 to test its nodes. At a node containing , the query continues precisely when . A leaf stores the original source index, so repeated points are reported separately.
For a group of size , the tree requires expected time to preprocess, for a total of over all groups. A query visits the group roots and only additional nodes per reported index, each requiring one support query. Its total time is . The algorithm is deterministic for .
B.4 Canonical Cells and Point Location
Work in the setup of Definition 6.4, with .
Definition B.7. Let and . Order the vertices of lexicographically by their coordinates. For a nonempty face of , let be its least vertex; it exists by Lemma B.1(b). A pulling chain is a sequence of faces such that is the nonempty facet of a source and, for , is a facet of with . Its projected simplex is
with owner and label
where each active set is the sorted tuple of its constraint indices. The canonical cells are listed in the lexicographic order of these labels.
Proof of Lemma 6.7. Write . The recursive vertex triangulation of [Cla88, Section 3], using the least vertex on each face, triangulates every source facet into the simplices of Definition B.7. For a cell , projection from the graph to is an affine bijection. Hence each simplex projects to a closed -simplex with rational vertices, and its owner realizes the sampled envelope on the entire cell.
For every , the point lies on the lower boundary of by Definition 6.4. Hence it belongs to a simplex on a source facet, whose projection is a canonical cell containing the target, proving the coverage in part (a).
The suffix vertices of a pulling chain have the same affine hull as the corresponding face; the identity in Lemma B.1 then determines the chain from its vertex active sets. Thus distinct chains have distinct labels, and the labeled list depends only on the sample.
For part (b), the affine function is positive somewhere on a simplex exactly when it is positive at a vertex. The owner is maximal among the sampled sources on its entire facet, so .
For part (c), every pulling chain is a complete face chain. By Lemma B.1(c), their number is at most
Let be the implied constant in this bound, increased to at least one.
For part (d), each vertex is the unique intersection of the hyperplanes in its active set. Every such set is a subset of the fixed source and cap constraints. Thus the owner and vertex active sets have at most
possible encodings. Each encoding determines the vertices and owner, and hence the cell; because the source functions are fixed, its conflict set is fixed as well. □
Proof of Lemma 6.8. Write and let be its set of constraints. By Lemma 6.5(c), these constraints are in general position and their intersection is bounded. The point is interior by the cap inequalities in Appendix A.7. To descend from a face through a point , put and extend the ray to its exit point , where
By Lemma B.1(b), every minimizing constraint defines a facet omitting , and is the convex-combination relation used in the descent.
Faces. We begin by enumerating the vertices and their active constraints with Proposition B.2. Use the cap constraints and the source constraint of some as the initial constraints. Their intersection is , which is bounded and has nonempty interior by Lemma 6.5(c). The output consists of all vertices of with their active sets .
These active sets determine every face. By Lemma B.1(b), a set is the active set of a nonempty face if and only if for some vertex ; the vertices of are exactly those with . List the pairs with and sort by , represented as a sorted tuple of indices. This groups the vertices of each nonempty face and identifies its least vertex .
The facets of are exactly with for some vertex . Each such face has dimension by Lemma B.1(b), and every facet of contains a vertex whose active set contains its own. Thus, for every pair and every , form and remove repetitions by sorting. There are at most such pairs. We store the faces in a dictionary indexed by their active sets, together with these facet lists. For each with , let next be the first facet in this order that omits .
Cells. A depth-first search now enumerates the pulling chains, starting at each nonempty source facet and, at a face , continuing into the facets with . Every branch extends to a complete chain, and at most facets are skipped at ; their active sets have the form with . Each other facet starts a branch, so the search uses steps per complete chain.
Assign each chain its label from Definition B.7. The labels are distinct by the proof of Lemma 6.7; sorting them produces the list in part (a) and a dictionary from labels to positions. Each label and its vertices have -bit descriptions, so comparisons require time . There are at most chains by Lemma B.1(c).
Ray shooting. Build the structure of Proposition B.3 for , using as the interior point and the cap constraints together with the source constraint used above as . Their intersection is the bounded simplex .
Location. Given , first shoot a vertical ray from in direction . Its origin is interior by Lemma A.7(a), and part (c) identifies the answer as the source constraint of some with . Thus the exit point lies in the nonempty facet of . We then descend through faces: for , suppose we have a face of dimension and a point .
• If , then is a vertex and ; stop.
• If and , complete the chain by , and so on, and stop.
- Otherwise, set and in the formulas for the exit point above, so that , and set , with fixed in Appendix A.8. The point is interior, since for every . Query the structure with the ray . Let be the answer, compute and , and let , found in the dictionary.
Finally, find the resulting chain in the dictionary of tuples and return its position in the canonical cell list and its owner .
Correctness of a step. The shift from Appendix A.8 ensures that the constraint returned by the interior ray minimizes the original exit parameter . The exit point thus lies in a facet omitting the least vertex, with .
Correctness of the location. Each step selects a facet omitting the least vertex, and next completes the chain with the same property if the descent stops early. The resulting faces form a pulling chain, and iterating the convex-combination relation shows that
Thus , the projection onto the first coordinates, belongs to the enumerated cell of this chain, whose owner is .
Cost. The sample determines vertices, face incidences, and pulling chains, so enumeration, sorting, and preprocessing for ray shooting require expected time , including the exact arithmetic of Appendix A.5. Locating a cell requires at most ray queries and a constant number of dictionary lookups in total time, with coordinates obtained at bounded depth as in Appendix A.8.
B.5 Sampling and Potential Estimates
To fix the sampling parameters (6.1), let be an integer depending only on such that for every integer ,
Such a constant exists because both counts grow polynomially in times a logarithmic factor. Set
Then exceeds the number of prefix levels used below, and .
Proof of Lemma 6.9. By Lemma 6.7(d), at most owner-cell pairs occur over all nonempty subsets of , and each pair determines its conflict set . These pairs and their conflict sets are determined before sampling by the shared perturbation (Definition 6.4). Consider such a pair with . If this pair occurs in , then by Lemma 6.7(b). The probability of this event is at most by Lemma 2.4, and
By the definition of with , and since , the number of pairs is at most . A union bound over the pairs with large conflict sets implies failure probability at most .
Proof of Lemma 7.10. Let be the set of heavy . Since and every heavy has , we have . By and by the concavity of the power function with exponent , under which ,
where we used . Here , and by (7.5), proving the first bound. For the second,
by (7.5). Finally, , because .
Summing recursive costs. For a recursion satisfying the child-size bounds of Lemma 7.10, the sum of the potentials at depth is at most , where are the root sizes. Consequently,
The recursion has finite depth because . If each node has conditional expected cost with uniform numerical factors, summing these bounds and taking expectations establishes total expected time .
B.6 Implementing Batch Maximum Inner Product
Finally, we prove Proposition 5.1 for ( ) by adapting the envelope-sampling and heavy/light recursion framework of Section 7.5 to exact maximization. Working in the setup of Definition 6.4 with sources , and a nonempty finite list of rational targets in , we use the sampling parameters (6.1) with and bit bound . Both procedures below take nonempty subsets and and return the exact maximum of over for every .
As in Section 7.1, calls restrict the original point sets and share one perturbation and precision. Appendix A.5 provides -bit representations for their geometric quantities.
Procedure THINMAX(Θ, Σ). We permute Σ uniformly at random and process doubling prefixes, from one source to all of Σ, maintaining for each target its current maximum and a maximizing index. By duality, the reporting structure is built on lifted targets and queried by sources. In each round, we apply Lemma 6.3 with group size to the points , then query with direction and threshold for each source in the next batch. The values stay fixed during these reports; afterward, we update the maxima and maximizing indices using all reported values.
Lemma B.8. Procedure THINMAX(Θ, Σ) returns and a maximizing index for every , in expected running time .
Proof. The reporting inequality is exactly , so each update computes the maximum over the enlarged prefix. For the cost, let and be the sizes of two consecutive prefixes. Conditional on the larger prefix, its preceding prefix is a uniform -element subset. For a fixed target, order these sources by decreasing value, breaking ties by index. Every reported source precedes the first sampled source, so the expected number reported is at most
Ties can only reduce this count. There are rounds, each preprocessing points in expected time . Each source is queried at most once, and the expected total number of reports is , proving the bound.
Procedure MAXIMA( ). Let and , both positive. If , run THINMAX and return. If , use the support-query structure of Lemma 6.2 to answer every target directly and return.
Otherwise, compute from Section 7.5 and build the reporting structure on the perturbed sources with group size . Here by (7.6). Repeatedly draw a uniform sample of size , build its envelope cells, and compute each conflict set by the vertex reports of Lemma 6.7(b). Reject the sample at the first cell with , and otherwise accept it. Locate the targets in the accepted cells, obtaining groups . For each nonempty group, return the larger of the owner's original value and the maximum over . An empty conflict set needs no further call; otherwise use THINMAX when and recurse with MAXIMA when this inequality fails.
Lemma B.9. Procedure MAXIMA( ) is a Las Vegas algorithm returning and a maximizing index for every . Its expected running time is , where and .
Proof. For a target in cell , the owner or some source in maximizes the perturbed score over and, by Lemma 6.5(b), also maximizes the original score. Thus
where . This proves correctness by induction on , since Lemma 7.10 halves this product in every recursive child.
Both thin cases run in expected time . At a balanced node, the reporting structure requires expected preprocessing time . Each sampling attempt has cells, with reporting cost per cell passing the conflict check and at most for the first failing cell. The expected cost per attempt is thus . Since each attempt is accepted with probability at least 7/8 (Lemma 6.9), the expected total over all attempts has the same order. Each light cell costs in expectation by Lemma B.8; locating targets and returning answers adds . By (7.5), the total nonrecursive work is .
The target groups are disjoint and every conflict set has size at most . Summing over the recursion using Lemma 7.10 and Appendix B.5 yields total expected time .
Proof of Proposition 5.1. For , the structure of Lemma 6.2 answers all queries deterministically in time. For , partition the nonzero queries into the at most groups of Definition 5.2. In each group , apply MAXIMA to sources () and targets , with for an input bit bound . Each returned index maximizes the original inner product because and . Summing the running-time bounds in Lemma B.9 over the groups and evaluating the selected inner products exactly requires time.
AI Methodology
We used DeepSeek Harness to assist with the proof of Proposition 5.6. The tool materially affected Section 7. More details can be found in the footnote in Section 1.2.3. The authors verified the correctness and originality of all content, including references.
Acknowledgment
This work was supported by the National Key R&D Program of China, Project Number 2025YFA1016700. This work was also supported by the National Natural Science Foundation of China (NSFC) under Grant No. 62576011.
References
[AAD+24] Josh Abramson, Jonas Adler, Jack Dunger, Richard Evans, Tim Green, Alexander Pritzel, Olaf Ronneberger, Lindsay Willmore, Andrew J. Ballard, Joshua Bambrick, Sebastian W. Bodenstein, David A. Evans, Chia-Chun Hung, Michael O'Neill, David Reiman, Kathryn Tunyasuvunakool, Zachary Wu, Akvilé Žemgulytė, Eirini Arvaniti, Charles Beattie, Ottavia Bertolli, Alex Bridgland, Alexey Cherepanov, Miles Congreve, Alexander I. Cowen-Rivers, Andrew Cowie, Michael Figurnov, Fabian B. Fuchs, Hannah Gladman, Rishub Jain, Yousuf A. Khan, Caroline M. R. Low, Kuba Perlin, Anna Potapenko, Pascal Savy, Sukhdeep Singh, Adrian Stecula, Ashok Thillaisundaram, Catherine Tong, Sergei Yakneen, Ellen D. Zhong, Michal Zielinski, Augustin Žídek, Victor Bapst, Pushmeet Kohli, Max Jaderberg, Demis Hassabis, and John M. Jumper. "Accurate structure prediction of biomolecular interactions with AlphaFold 3". In: Nature 630.8016 (June 2024), pp. 493–500. ISSN: 1476-4687. DOI: 10.1038/s41586-024-07487-w.
[Aga17] Pankaj K. Agarwal. "Range Searching". In: Handbook of Discrete and Computational Geometry. Ed. by Jacob E. Goodman, Joseph O'Rourke, and Csaba D. Tóth. 3rd ed. CRC Press, 2017. Chap. 40. DOI: 10.1201/9781315119601.
[AE99] Pankaj K. Agarwal and Jeff Erickson. "Geometric Range Searching and Its Relatives". In: Advances in Discrete and Computational Geometry. Ed. by Bernard Chazelle, Jacob E. Goodman, and Richard Pollack. Vol. 223. Contemporary Mathematics. American Mathematical Society, 1999, pp. 1–56. DOI: 10.1090/conm/223/03131.
[ACSS20] Josh Alman, Timothy Chu, Aaron Schild, and Zhao Song. "Algorithms and Hardness for Linear Algebra on Geometric Graphs". In: 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, Durham, NC, USA, November 16-19, 2020. Ed. by Sandy Irani. IEEE, 2020, pp. 541–552. DOI: 10.1109/FOCS46700.2020.00057. URL: https://doi.org/10.1109/FOCS46700.2020.00057.
[AS23] Josh Alman and Zhao Song. "Fast Attention Requires Bounded Entries". In: Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023. Ed. by Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine. 2023. URL:
[AS24] Josh Alman and Zhao Song. "The Fine-Grained Complexity of Gradient Computation for Training Large Language Models". In: Advances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024. 2024. URL: http://papers.nips.cc/paper_files/paper/2024/hash/70fa5df8e3300dc30bf19bee44a56155-Abstract-Conference.html.
[AY25] Josh Alman and Hantao Yu. "Fundamental Limitations on Subquadratic Alternatives to Transformers". In: The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net, 2025. URL: https://openreview.net/forum?id=T2d0geb6y0.
[AH08] Boris Aronov and Sariel Har-Peled. "On Approximating the Depth and Related Problems". In: SIAM J. Comput. 38.3 (2008), pp. 899–921. DOI: 10.1137/060669474. URL: https://doi.org/10.1137/060669474.
[AMX12] Sunil Arya, David M. Mount, and Jian Xia. "Tight Lower Bounds for Halfspace Range Searching". In: Discret. Comput. Geom. 47.4 (2012), pp. 711–730. DOI: 10.1007/S00454-012-9412-X. URL: https://doi.org/10.1007/s00454-012-9412-x.
[BPR06] Saugata Basu, Richard Pollack, and Marie-Françoise Roy. Algorithms in real algebraic geometry. Springer, 2006.
[Cha96a] Timothy M. Chan. "Fixed-Dimensional Linear Programming Queries Made Easy". In: Proceedings of the Twelfth Annual Symposium on Computational Geometry, Philadelphia, PA, USA, May 24-26, 1996. Ed. by Sue Whitesides. ACM, 1996, pp. 284–290. DOI: 10.1145/237218.237397. URL: https://doi.org/10.1145/237218.237397.
[Cha96b] Timothy M. Chan. "Output-Sensitive Results on Convex Hulls, Extreme Points, and Related Problems". In: Discret. Comput. Geom. 16.4 (1996), pp. 369–387. DOI: 10.1007/BF02712874. URL: https://doi.org/10.1007/BF02712874.
[Cha12] Timothy M. Chan. "Optimal Partition Trees". In: Discret. Comput. Geom. 47.4 (2012), pp. 661–690. DOI: 10.1007/S00454-012-9410-Z. URL: https://doi.org/10.1007/s00454-012-9410-z.
[CZ22] Timothy M. Chan and Da Wei Zheng. "Hopcroft's Problem, Log-Star Shaving, 2D Fractional Cascading, and Decision Trees". In: Proceedings of the 2022 ACM-SIAM Symposium on Discrete Algorithms, SODA 2022, Virtual Conference / Alexandria, VA, USA, January 9 - 12, 2022. Ed. by Joseph (Seffi) Naor and Niv Buchbinder. SIAM, 2022, pp. 190–210. DOI: 10.1137/1.9781611977073.10. URL: https://doi.org/10.1137/1.9781611977073.10.
[Cha93] Bernard Chazelle. "An Optimal Convex Hull Algorithm in Any Fixed Dimension". In: Discret. Comput. Geom. 10 (1993), pp. 377–409. DOI: 10.1007/BF02573985. URL: https://doi.org/10.1007/BF02573985.
[Cha97] Bernard Chazelle. "Lower Bounds for Off-Line Range Searching". In: Discret. Comput. Geom. 17.1 (1997), pp. 53–65. DOI: 10.1007/BF02770864. URL: https://doi.org/10.1007/BF02770864.
[CEGS91] Bernard Chazelle, Herbert Edelsbrunner, Leonidas J. Guibas, and Micha Sharir. "A Singly Exponential Stratification Scheme for Real Semi-Algebraic Varieties and its Applications". In: Theor. Comput. Sci. 84.1 (1991), pp. 77–105. DOI: 10.1016/0304-3975(91)90261-Y. URL: https://doi.org/10.1016/0304-3975(91)90261-Y.
[CF90] Bernard Chazelle and Joel Friedman. "A deterministic view of random sampling and its use in geometry". In: Comb. 10.3 (1990), pp. 229–249. DOI: 10.1007/BF02122778. URL: https://doi.org/10.1007/BF02122778.
[CLSSS25] Bo Chen, Yingyu Liang, Zhizhou Sha, Zhenmei Shi, and Zhao Song. "HSR-Enhanced Sparse Attention Acceleration". In: Conference on Parsimony and Learning, Stanford University, USA, 24-27 March 2025. Ed. by Beidi Chen, Shijia Liu, Mert Pilanci, Weijie Su, Jeremias Sulam, Yuxiang Wang, and Zhihui Zhu. Vol. 280. Proceedings of Machine Learning Research. PMLR, 2025, pp. 105–133. URL: https://proceedings.mlr.press/v280/chen25a.html.
[Che20] Lijie Chen. "On The Hardness of Approximate and Exact (Bichromatic) Maximum Inner Product". In: Theory Comput. 16 (2020), pp. 1–50. DOI: 10.4086/TOC.2020.V016A004. URL: https://doi.org/10.4086/toc.2020.v016a004.
[CLD+21] Krzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamás Sarlós, Peter Hawkins, Jared Quincy Davis, Afroz Mohiuddin, Lukasz Kaiser, David Benjamin Belanger, Lucy J. Colwell, and Adrian Weller. "Rethinking Attention with Performers". In: 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL: https://openreview.net/forum?id=Ua6zuk0WRH.
[Cla87] Kenneth L. Clarkson. "New Applications of random Sampling in Computational Geometry". In: Discret. Comput. Geom. 2 (1987), pp. 195–222. DOI: 10.1007/BF02187879. URL: https://doi.org/10.1007/BF02187879.
[Cla88] Kenneth L. Clarkson. "A Randomized Algorithm for Closest-Point Queries". In: SIAM J. Comput. 17.4 (1988), pp. 830–847. DOI: 10.1137/0217052. URL: https://doi.org/10.1137/0217052.
[CS89] Kenneth L. Clarkson and Peter W. Shor. "Applications of Random Sampling in Computational Geometry, II". In: Discrete & Computational Geometry 4.5 (Oct. 1, 1989), pp. 387–421. ISSN: 1432-0444. DOI: 10.1007/BF02187740. URL: https://doi.org/10.1007/BF02187740.
[DFERR22] Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. "FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness". In: Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022. Ed. by Sanmi Koyejo, S. Mohamed, A. Agarwal, Danielle Belgrave, K. Cho, and A. Oh. 2022. URL: http://papers.nips.cc/paper_files/paper/2022/hash/67d57c32e20fd0a7a302cb81d36e40d5-Abstract-Conference.html.
[DLMF] NIST Digital Library of Mathematical Functions. https://dlmf.nist.gov/, Release 1.2.8 of 2026-09-15. F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, B. V. Saunders, H. S. Cohl, and M. A. McClain, eds. URL: https://dlmf.nist.gov/.
[DK90] David P. Dobkin and David G. Kirkpatrick. "Determining the Separation of Preprocessed Polyhedra - A Unified Approach". In: Automata, Languages and Programming, 17th International Colloquium, ICALP90, Warwick University, England, UK, July 16-20, 1990, Proceedings. Ed. by Mike Paterson. Vol. 443. Lecture Notes in Computer Science. Springer, 1990, pp. 400–413. DOI: 10.1007/BFB0032047. URL: https://doi.org/10.1007/BFb0032047.
[DBK+21] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. "An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale". In: 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL: https://openreview.net/forum?id=YicbFdNTTy.
[DSST89] James R. Driscoll, Neil Sarnak, Daniel Dominic Sleator, and Robert Endre Tarjan. "Making Data Structures Persistent". In: J. Comput. Syst. Sci. 38.1 (1989), pp. 86–124. DOI: 10.1016/0022-0000(89)90034-2. URL: https://doi.org/10.1016/0022-0000(89)90034-2.
[DWH23] Feyza Duman Keles, Pruthuvi Mahesakya Wijewardena, and Chinmay Hegde. "On The Computational Complexity of Self-Attention". In: International Conference on Algorithmic Learning Theory, February 20-23, 2023, Singapore. Ed. by Shipra Agrawal and Francesco Orabona. Vol. 201. Proceedings of Machine Learning Research. PMLR, 2023, pp. 597–619. URL: https://proceedings.mlr.press/v201/duman-keles23a.html.
[EM90] Herbert Edelsbrunner and Ernst P. Mücke. "Simulation of simplicity: a technique to cope with degenerate cases in geometric algorithms". In: ACM Trans. Graph. 9.1 (1990), pp. 66–104. DOI: 10.1145/77635.77639. URL: https://doi.org/10.1145/77635.77639.
[EC95] Ioannis Z. Emiris and John F. Canny. "A General Approach to Removing Degeneracies". In: SIAM J. Comput. 24.3 (1995), pp. 650–664. DOI: 10.1137/S0097539792235918. URL: https://doi.org/10.1137/S0097539792235918.
[Eri96] J. Erickson. "New lower bounds for halfspace emptiness". In: Proceedings of 37th Conference on Foundations of Computer Science. 1996, pp. 472–481. DOI: 10.1109/SFCS.1996.548506.
[Eri00] Jeff Erickson. "Space-Time Tradeoffs for Emptiness Queries". In: SIAM J. Comput. 29.6 (2000), pp. 1968–1996. DOI: 10.1137/S0097539798337212. URL: https://doi.org/10.1137/S0097539798337212.
[Fen94] Peter M. Fenwick. "A New Data Structure for Cumulative Frequency Tables". In: Softw. Pract. Exp. 24.3 (1994), pp. 327–336. DOI: 10.1002/SPE.4380240306. URL: https://doi.org/10.1002/spe.4380240306.
[GR87] L Greengard and V Rokhlin. "A fast algorithm for particle simulations". In: Journal of Computational Physics 73.2 (1987), pp. 325–348. ISSN: 0021-9991. DOI: 10.1016/0021-9991(87)90140-9. URL: https://www.sciencedirect.com/science/article/pii/0021999187901409.
[GS91] Leslie Greengard and John Strain. "The Fast Gauss Transform". In: SIAM J. Sci. Comput. 12.1 (1991), pp. 79–94. DOI: 10.1137/0912004. URL: https://doi.org/10.1137/0912004.
[GHSXY26] Shreya Gupta, Boyang Huang, Barna Saha, Yinzhan Xu, and Christopher Ye. "Subquadratic Algorithms and Hardness for Attention with Any Temperature". In: The Fourteenth International Conference on Learning Representations, ICLR 2026, Rio de Janeiro, Brazil, April 23-27, 2026. Ed. by Carl Vondrick, Bharath Hariharan, Colin Raffel, Lerrel Pinto, Diyi Yang, and Aleksandra Faust. proceedings.iclr.cc, 2026. URL: https://proceedings.iclr.cc/paper_files/paper/2026/hash/8a01099096c85890b1d1aff3c6b4ea56-Abstract-Conference.html.
[HJK+24] Insu Han, Rajesh Jayaram, Amin Karbasi, Vahab Mirrokni, David P. Woodruff, and Amir Zandieh. "HyperAttention: Long-context Attention in Near-Linear Time". In: The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL: https://openreview.net/forum?id=Eh00d2BJIM.
[HW87] David Haussler and Emo Welzl. "ε-Nets and Simplex Range Queries". In: Discrete & Computational Geometry 2.2 (June 1, 1987), pp. 127–151. ISSN: 1432-0444. DOI: 10.1007/BF02187876. URL: https://doi.org/10.1007/BF02187876.
[Hoe63] Wassily Hoeffding. "Probability Inequalities for Sums of Bounded Random Variables". In: Journal of the American Statistical Association 58.301 (1963), pp. 13–30.
[IP01] Russell Impagliazzo and Ramamohan Paturi. "On the Complexity of k-SAT". In: J. Comput. Syst. Sci. 62.2 (2001), pp. 367–375. DOI: 10.1006/JCSS.2000.1727. URL: https://doi.org/10.1006/jcss.2000.1727.
[Mat92a] Jirí Matousek. "Reporting Points in Halfspaces". In: Comput. Geom. 2 (1992), pp. 169–186. DOI: 10.1016/0925-7721(92)90006-E. URL: https://doi.org/10.1016/0925-7721(92)90006-E.
[Mat93] Jirí Matousek. "Linear Optimization Queries". In: J. Algorithms 14.3 (1993), pp. 432–448. DOI: 10.1006/JAGM.1993.1023. URL: https://doi.org/10.1006/jagm.1993.1023.
[Mat94] Jirí Matousek. "Geometric Range Searching". In: ACM Comput. Surv. 26.4 (1994), pp. 421–461. DOI: 10.1145/197405.197408. URL: https://doi.org/10.1145/197405.197408.
[Mat92b] Jiří Matoušek. "Efficient Partition Trees". In: Discrete & Computational Geometry 8.3 (Aug. 1992), pp. 315–334. ISSN: 1432-0444. DOI: 10.1007/BF02293051.
[MS93] Jirí Matousek and Otfried Schwarzkopf. "On Ray Shooting in Convex Polytopes". In: Discret. Comput. Geom. 10 (1993), pp. 215–232. DOI: 10.1007/BF02573975. URL: https://doi.org/10.1007/BF02573975.
[Mau26] Samuel Mausberg. Near-Linear Attention in Three Dimensions. Version v2. Oct. 2026. DOI: 10.5281/zenodo.23195937. URL: https://doi.org/10.5281/zenodo.23195937.
[McM70] P. McMullen. "The maximum numbers of faces of a convex polytope". In: Mathematika 17.2 (1970), pp. 179–184. DOI: 10.1112/S0025579300002850.
[Meg84] Nimrod Megiddo. "Linear Programming in Linear Time When the Dimension Is Fixed". In: J. ACM 31.1 (1984), pp. 114–127. DOI: 10.1145/2422.322418. URL: https://doi.org/10.1145/2422.322418.
[PS85] Franco P. Preparata and Michael Ian Shamos. Computational Geometry : An Introduction. Third corrected printing, 1990. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1985.
[Ram99] Edgar A. Ramos. "On Range Reporting, Ray Shooting and k-Level Construction". In: Proceedings of the Fifteenth Annual Symposium on Computational Geometry, Miami Beach, Florida, USA, June 13-16, 1999. Ed. by Victor Milenkovic. ACM, 1999, pp. 390–399. DOI: 10.1145/304893.304993. URL: https://doi.org/10.1145/304893.304993.
[Ram00] Edgar A. Ramos. "Linear programming queries revisited". In: Proceedings of the Sixteenth Annual Symposium on Computational Geometry, Clear Water Bay, Hong Kong, China, June 12-14, 2000. Ed. by Siu-Wing Cheng, Otfried Cheong, Pankaj K. Agarwal, and Steven Fortune. ACM, 2000, pp. 176–181. DOI: 10.1145/336154.336198. URL: https://doi.org/10.1145/336154.336198.
[SXY26] Barna Saha, Yinzhan Xu, and Christopher Ye. "Furthest Pair Requires Quadratic Time in Superconstant Dimension under SETH". In: CoRR abs/2606.25887 (2026). DOI: 10.48550/ARXIV.2606.25887. arXiv: 2606.25887. URL: https://doi.org/10.48550/arXiv.2606.25887.
[SXY26] Barna Saha, Yinzhan Xu, Christopher Ye, and Hantao Yu. "On the Computational Hardness of Transformers". In: Proceedings of the 58th Annual ACM Symposium on Theory of Computing, STOC 2026, Salt Lake City, UT, USA, June 22-26, 2026. Ed. by Aditya Bhaskara and Artur Czumaj. ACM, 2026, pp. 1073–1084. DOI: 10.1145/3798129.3800819. URL: https://doi.org/10.1145/3798129.3800819.
[Sei17] Raimund Seidel. "Convex hull computations". In: Handbook of discrete and computational geometry. Chapman and Hall/CRC, 2017, pp. 687–703.
[Sha19] Noam Shazeer. "Fast Transformer Decoding: One Write-Head is All You Need". In: CoRR abs/1911.02150 (2019). DOI: 10.48550/ARXIV.1911.02150. arXiv: 1911.02150. URL: https://doi.org/10.48550/arXiv.1911.02150.
[VSP+17] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. "Attention is All you Need". In: Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA. Ed. by Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett. 2017, pp. 5998–6008. URL: https://proceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html.
[Wil05] Ryan Williams. "A new algorithm for optimal 2-constraint satisfaction and its implications". In: Theor. Comput. Sci. 348.2-3 (2005), pp. 357–365. DOI: 10.1016/J.TCS.2005.09.023. URL: https://doi.org/10.1016/j.tcs.2005.09.023.
[Wil18] Ryan Williams. "On the Difference Between Closest, Furthest, and Orthogonal Pairs: Nearly-Linear vs Barely-Subquadratic Complexity". In: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018. Ed. by Artur Czumaj. SIAM, 2018, pp. 1207–1215. DOI: 10.1137/1.9781611975031.78. URL: https://doi.org/10.1137/1.9781611975031.78.
[Yap97] Chee-Keng Yap. "Towards Exact Geometric Computation". In: Comput. Geom. 7 (1997), pp. 3–23. DOI: 10.1016/0925-7721(95)00040-2. URL: https://doi.org/10.1016/0925-7721(95)00040-2.
[ZHDK23] Amir Zandieh, Insu Han, Majid Daliri, and Amin Karbasi. "KDEformer: Accelerating Transformers via Kernel Density Estimation". In: International Conference on Machine Learning, ICML 2023, 23-29 July 2023, Honolulu, Hawaii, USA. Ed. by Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett. Vol. 202. Proceedings of Machine Learning Research. PMLR, 2023, pp. 40605–40623. URL: https://proceedings.mlr.press/v202/zandieh23a.html.
[Zie95] Günter M. Ziegler. Lectures on polytopes. Graduate texts in mathematics; 152. New York: Springer, 1995.