Query-Oblivious Coresets for Softmax Attention: Improved Bounds and Efficient Constructions
Ofek I. Cohen
Abstract
A query-oblivious coreset for a softmax-attention head is a subset S of the key-value pairs such that attention computed from S alone is within ε of the full output, in ℓ2, simultaneously for every query in a ball. Liberty, Andoni and Kleiner proved that unweighted coresets of size O(deρ+21logρ+o(loglogρ)/ε) exist, ρ being the query radius times the centred key radius, against a lower bound Ω(deρ/ε), and conjectured that closing the gap needs new techniques. We show it does not. A spherical lift of both balls into one exponential-kernel instance lets the chaining bound of Bozzai and Rothvoss apply directly, and Chevet's inequality splits key from value dimension: unweighted coresets of size O(eρ(dv+dklog(1+ρ))/ε) exist and are computable in randomised polynomial time, the first with a whole-ball guarantee at the existential size up to log(1+ρ). A dimension-free sampling cap O(e2ρ/ε2) completes the envelope. In fixed dimension the logarithm disappears: completing the key ball to a sphere makes the kernel an unweighted Gaussian one, so Tai's diameter-free bound gives Odk,dv(eρ/ε), ruling out a matching logarithmic lower bound there and answering the Gaussian-restriction case of a question of Bozzai and Rothvoss for the exponential and Hellinger kernels. We restate the Liberty-Andoni-Kleiner bound in the centred convention with a full proof, and show that the one-way communication bounds of Chen et al. transfer to query-oblivious coresets, where for ε≪e−ρ they are the strongest floors known. The dimensional factor is the price of one signing for all queries: for a single query the discrepancy is O(eρ), dimension-free.
1 Introduction
Fix an attention head with keys k1,…,kn∈Rdk and values v1,…,vn∈Rdv, and write
For S⊆[n] write AttnS for the same expression over S. An unweighted query-oblivious ε-coreset is a subset S with
∥q∥≤ϱsup∥AttnS(q)−Attn(q)∥2≤ε.(2)
Compressing the key-value cache of a transformer to such a subset keeps attention correct for every query the model may later produce, without reweighting and without knowing the queries. The governing parameter is
ρ:=ϱκ,κ≥imax∥ki−kˉ∥,kˉ=n1i∑ki,(3)
Tel Aviv University. ofeki@mail.tau.ac.il the product of the query radius and the centred key radius. Translating all keys by −kˉ multiplies numerator and denominator in (1) by the same factor e−q⊤kˉ, for the full set and for every subset alike, so (2) is invariant under centring; the centred radius can be twice the uncentred one, and a theorem phrased with maxi∥ki∥ silently permits e2ρ. Throughout, after centring and rescaling once, we may and do assume the normalised model
n1i∑ki=0,∥ki∥≤1,∥q∥≤ρ,∥vi∥≤1.(4)
Centring and the joint rescaling k↦(k−kˉ)/κ, q↦κq leave (2) unchanged; dividing every vi by maxi∥vi∥ scales its left side by the same factor, so ε is measured in units of maxi∥vi∥. Two facts about (4) are used repeatedly: every weight eq⊤ki lies in [e−ρ,eρ], and by Jensen’s inequality B(q)≥nexp(q⊤kˉ)=n for every q.
Liberty, Andoni and Kleiner [19] proved that an unweighted coreset of size O(deζ/ε) exists, ζ=ρ+21logρ+o(loglogρ), d=dk=dv, against a lower bound Ω(deρ/ε) under conditions on d and ε relative to ρ. They identified the vector values as their main difficulty, conjectured that closing the residual ρ1/2+o(1) (a logn in the worst case) would “require completely different approaches”, and gave no algorithm. This paper closes most of that gap by two reductions to known kernel-discrepancy theorems and gives the first polynomial-time construction with the uniform guarantee (2) at this size. Whether eρ is moderate on transformer caches, and whether the construction of Theorem 1.2 beats sampling there, is taken up experimentally later.
1.1 Results
Theorem 1.1 (Upper envelope). Let ε∈(0,1], dk,dv≥1, and let the instance satisfy (4). There is an unweighted subset S satisfying (2) with
where F(dk,dv)=7dvedv/4(fT(dk+1+2dv)+1) and fT(D) is Tai's diameter-free Gaussian-kernel discrepancy constant in RD, which is finite for every D and, as far as is known, exponential in D. Of the three non-trivial branches, the second has explicit constant 32; the first has constants explicit up to Dudley's constant and the Gaussian ψ2 constant, given in Appendix B.
Provenance, branch by branch. The first branch is the halving reduction of [19, Thm. 4] fed with the chaining bound of Bozzai and Rothvoss [7, Thm. 1.11] through a two-slack spherical lift (Lemma 3.1), with the key and value dimensions split by Chevet's inequality [12], and with the denominator propagated through the recursion by its own discrepancy constraint (Lemma 3.5); the last device is what removes the side conditions of [19]. The second branch is the standard sampling bound in a reproducing-kernel Hilbert space [20, 22], run in a two-block space so that one draw controls numerator and denominator together; its averaged form is [15, Thm. 4.5] and its weighted streaming form is SubGen [29]. The third branch is Tai's theorem [25] transported, with a value-encoding gadget and a repair of Tai's global-balance step (Section 5).
Theorem 1.2 (Polynomial time). Under (4) and ε∈(0,1], there are randomised algorithms producing a set S satisfying (2)
(a) with probability at least 21, of size O(eρ(dv+dklog(1+ρ))/ε) always, in expected time O(nω+1+n2(dk+dv)), ω<2.372 the matrix-multiplication exponent;
(b) for n≥2 and δ∈(0,21], with probability at least 1−δ, of size O(eρ(dv+dklog(1+ρ))+log(logn/δ))/ε) always, in the same time;
(c) with probability at least 41, of the size in (a), in expected time O(ndk)+poly(eρ/ε,dk,dv), by sampling O(e2ρ/ε2) pairs and balancing the sample.
The Gram–Schmidt walk [4] replaces Banaszczyk's theorem inside the halving, as in [22, 7]; the rejection scheme on checkable constraints is Tai's [25, Alg. 1]. BalanceKV [17] and [9] run discrepancy walks on the same tensor features for attention with a guarantee per query, and [15] in mean squared error over a query distribution; [19] is uniform over the ball but existential. Theorem 1.2 is the first polynomial-time construction whose guarantee is one signing uniform over the query ball at the existential size up to log(1+ρ): the per-query walks of [17] become uniform through a union bound over a net of the ball, at a polylogarithmic cost and with e2ρ in place of eρ, which is how [19] restate them. Proposition 1.5 shows that the uniform quantity is a different one, not a different proof.
Theorem 1.3 (The logarithm is not minimax in fixed dimension). For every dk there is a finite g(dk)≤fT(dk+1)+1 such that for every ρ>0, every n and all keys in the unit ball of Rdk there is a signing σ∈{±1}n with ∣∑iσi∣≤1 and
∥q∥≤ρsupi∑σieq⊤ki≤g(dk)eρ.
Consequently, for fixed dk there is no c>0 such that for all large ρ some configuration forces minσsup∥q∥≤ρ∣∑iσieq⊤ki∣≥ceρdklog(1+ρ); and the third branch of (5) holds. The constant g(dk) is exponential in dk as far as [25] is concerned, and the statement says nothing about d growing with ρ.
Theorem 1.4 (Lower bounds). Under (4):
(a) ([19, Thm. 7], centred form.) There are constants c,C,ε0>0 such that for dk≥2, dv≥1, ρ≥2 and 0<ε≤ε0/dv there is an instance for which every ε-coreset has ∣S∣≥cdvmin{eρ/(εdv),e2ρ,exp(dk/(Cρ2))}; in particular ∣S∣=Ω(eρdv/ε) when εdv≳e−ρ and dk≳ρ2(ρ+logεdv1).
(b) (Mean floor.) For every ρ≥0 there are instances for which every ε-coreset has ∣S∣=Ω(min{dv,ε−2}).
(c) ([9], transferred.) For scalar values, in the two parameter regimes (a) and (b) of Fact 6.1, there are instances for which every ε-coreset has ∣S∣≥Ω~(min{n,(1/ε)1−1/a−o(1)}), respectively ∣S∣≥Ω~(min{n,eρ(1−o(1))/ε}).
Part (a) is the lower bound of [19], whose one-bit-per-(key, value coordinate) gadget appears earlier in the streaming bit model ([14, Thm. 6], [17, Thm. 3.2]); what we add is a centred instance compatible with (3) and a complete proof (Appendix D). The counting step of [19, Thm. 7], as written, encodes the indices of o(md) retained pairs, which cost Θ(log(md)) bits each and so yield only Ω(md/log(md)); the constant-fraction count of Appendix D removes the logarithm. Part (c) is a transfer: the streaming bounds of [9] are one-way communication bounds whose proofs use nothing about the data structure beyond its bit length, and a coreset is such a data structure.
Proposition 1.5 (What query-obliviousness costs). Under (4) with scalar values ∣vi∣≤1:
(i) for every fixed q there is a signing, computable in O(n) time from the weights eq⊤kivi (so in O(ndk) time in all), with ∣∑iσieq⊤kivi∣≤eρ; and for every ε∈(0,1] there is a subset S with ∣S∣≤24eρ/ε+3 and ∣AttnS(q)−Attn(q)∣≤ε;
RKHS 1/ε2 bounds (sampling and greedy); two-block form
[20]; [16, Thm. 24]; [15, Thm. 4.5]; [29]
Exponential kernel on a sphere is Gaussian
[7, §4.2]; [15, eq. (2)]; [25, eq. (3)]
Diameter-free Gaussian discrepancy in fixed dimension
[25, Lem. 13]; up to loglogn, [7, Thm. 1.9]
INDEX gadget multiplexed over value coordinates
[14, Thm. 6]; [17, Thm. 3.2]; [19, Thm. 7]
One-way bounds with side information
[9]
Beck–Fiala linear algebra; sorted alternating signing
[5]; [21]
Table 1: Inherited devices. Ours: the assembly in Theorem 1.1, the uniform-guarantee construction, the sphere completion and balance repair and value encoding of Section 5, the centred instance and full proof in Theorem 1.4(a), the transfer in (c), and Proposition 1.5.
(ii) for every r≥2, every dk≥r and every 0<ρ≤r there is a centred instance of r keys with values vi≡1 such that every signing satisfies sup∥q∥≤ρ∣∑iσieq⊤ki∣≥ρr/e.
In particular, at ρ=1, one signing for the whole ball costs Ω(dk) where each single query costs O(1).
1.2 What is inherited and what is new
Table 1 lists every device in the paper with its source. The claims we make are: the four-branch envelope (5) and the observation that the ρ1/2+o(1) of [19] is an artefact of its width input; the polynomial-time construction with a uniform-over-the-ball guarantee, in its three forms; the fixed-dimension collapse of the logarithm, including the balance repair (Lemma 5.3) and the value encoding (Lemma 5.4); the centred value-direction instance and its full proof; the transfer of [9]; and Proposition 1.5. Two framings must be kept apart. Against the value-direction floor of Theorem 1.4(a), with dk=dv=d, the gap is log(1+ρ); in fixed dimension the upper bound loses the logarithm, but there the floor no longer applies (it needs dk≳ρ3), and we prove no lower bound of order eρ/ε. For scalar values, no lower bound with any dk-dependence is known, so there the gap is the entire dimensional factor min{dklog(1+ρ),F(dk,1)} against 1, and the sampling branch is unmatched from below.
1.3 Related work
Kernel-density coresets by discrepancy go back to Phillips [21] and Phillips-Tai [22], who also posed the O(d/ε) question; Karnin-Liberty [16] lifted dot-product kernels by tensor powers; Bozzai-Rothvoss [7] proved the chaining bound we use, and a fixed-dimension bound with a loglogn that Tai [25] removes for the Gaussian kernel; Charikar-Kapralov-Waingarten [10] gave quasi-Monte-Carlo structures for smooth kernels. For attention, BalanceKV [17] and Chen et al. [9] give discrepancy-based streaming algorithms with per-query guarantees and streaming lower bounds, Haris-Onak [14] bit-model lower bounds, Haverbeck et al. [15] an averaged risk analysis, Zandieh et al. [29] a sampling bound, Schröder-Mackey [23] a weighted near-linear-time construction, and Liberty-Andoni-Kleiner [19] the existential bounds we improve. Thinning-based attention approximation [8, 13] selects unweighted or weighted subsets with guarantees for the observed queries rather than uniformly over a ball. Wang [28] proves an oblivious-versus-adaptive separation for KV caches in a combinatorial pointer-chasing model; ours is a softmax-discrepancy separation and the two are not comparable. Sui and Zhang [24] study the approximation rank of attention, a different object. Bohbot et al. [6] prove a C(R)/n token-sample rate for i.i.d. tokens, superficially like our sampling cap but for a different problem.
2 Why one signing for the whole ball
A coreset built for the cache of a decoding transformer is used by queries that are computed from the compressed cache: the query at step t+1 is a function of the attention outputs at steps ≤t, which were produced from S. A guarantee that holds with probability 1−δ for each query fixed in advance is a statement about queries independent of the randomness that produced S; the closed loop makes them dependent, and the failure events at successive steps are neither independent nor controlled. A guarantee uniform over the ball, as in (2), is insensitive to this. This is a modelling argument, not a theorem; Proposition 1.5 is the theorem, and it says the uniform guarantee is a different quantity, priced by the dimension.
Proof of Proposition 1.5. (i) Write wi:=eq⊤kivi and M:=maxi∣wi∣≤eρ. Process the indices in any order, maintaining Pj:=∑i≤jσiwi, and choose σj with σjwjPj−1≤0. Inductively ∣Pj−1∣≤M: if Pj−1=0 then ∣Pj∣=∣wj∣≤M; if Pj−1∈(0,M] then σjwj∈[−M,0] and Pj∈(−M,M]; symmetrically for Pj−1∈[−M,0). So ∣Pn∣≤M. The coreset statement is Corollary 2.2 below.
(ii) Let cj:=ej−r1∑i≤rei∈Rr⊆Rdk, j=1,…,r. Then ∑jcj=0 and ∥cj∥2=1−r1≤1, so the instance satisfies (4) with the given ρ. Fix a signing σ, put T:=∑jσj, and for z∈{±1} consider qz:=ρzr−1/2∑jσjej, of norm ρ. Then qz⊤cj=ρzr−1/2(σj−T/r), so
One of the two choices of z makes the bracket at least rsinh(ρ/r) in absolute value, and ∣T∣≤r gives e−ρzT/(rr)≥e−ρ/r≥e−1 for ρ≤r. Since sinhx≥x, the absolute value is at least ρr/e.
Lemma 2.1 (Three constraints at one query; Beck–Fiala [5]). Let a1,…,am∈R3 with ∣ai(c)∣≤Mc for c=1,2,3. There is σ∈{±1}m, computable in polynomial time, with ∣∑iσiai(c)∣≤3Mc for each c.
Proof. Maintain x∈[−1,1]m with ∑ixiai=0 and the set F of indices with ∣xi∣<1, starting from x=0, F=[m]. While ∣F∣≥4 the map ↦∑i∈Fyiai from RF to R3 has a nonzero kernel element y; move x←x+ty with ∣t∣ minimal such that a coordinate in F reaches ±1. The invariant is preserved and ∣F∣ decreases, so the loop ends with ∣F∣≤3 after at most m steps. Put σi=xi for i∈/F and σi=sign(xi) for i∈F (sign 0:=1); then ∣σi−xi∣≤1 on F and ∑iσiai=∑i∈F(σi−xi)ai has c-th coordinate at most 3Mc in absolute value. □
Corollary 2.2 (A coreset for one query). Under (4) with scalar values, for every fixed q with ∥q∥≤ρ and every ε∈(0,1] there is S⊆[n], computable deterministically in polynomial time, with ∣AttnS(q)−Attn(q)∣≤ε and ∣S∣≤24eρ/ε+3.
Proof. Write wi=eq⊤ki∈(0,eρ] and D:=3eρ. Given Sj of size nj with Aj=∑Sjwivi, Bj=∑Sjwi, apply Lemma 2.1 to ai=(wivi,wi,1) with M1=M2=eρ, M3=1, replace σ by −σ if ∑σi<0, and let Sj+1={i∈Sj:σi=+1}. With δA=∑σiwivi, δB=∑σiwi we have ∣δA∣,∣δB∣≤D, Aj+1=21(Aj+δA), Bj+1=21(Bj+δB), and nj/2≤nj+1≤nj/2+23, hence n/2j≤nj≤n/2j+3. By Jensen B0≥n, and by induction Bj≥n/2j−D. If n/2j≥4D then Bj−D≥n/2j+1 and, since ∣Aj∣≤Bj,
Take ℓ≥0 maximal with n/2ℓ≥4D/ε (if none, n<4D/ε and S=[n] serves). Then n/2j≥4D for j<ℓ, the errors sum to at most 4D2ℓ/n≤ε, and ∣Sℓ∣<8D/ε+3. □
Remark 2.3. At the level of coreset size the separation is not proved: the per-query size is O(eρ/ε) for scalar values, the query-oblivious upper bound is O(eρmin{dklog(1+ρ),F(dk,1)}/ε), and whether a query-oblivious coreset for scalar values needs any factor of dk is the open key-direction question; the local INDEX architecture cannot settle it, since one bit per token decoded at one query yields at most eρdv/ε (see [19] and Appendix D). From the kernel-density side, uniformity in the query is the standard definition of kernel discrepancy [22, 25, 7]; the distinction is meaningful against the attention literature [17, 9, 15].
3 The upper bound
3.1 Two reductions
Bozzai and Rothvoss [7] consider Ke(α)(x,y)=exp(−α(1−⟨x,y⟩)) on Sd×Sd and prove discKe(α)(n)=O(dlog(2max{α,1})) with a randomised polynomial-time colouring (their Theorem 1.11). Their theorem is for points on a sphere; ours lie in a ball and the queries in another.
Lemma 3.1 (Two-slack lift). Under (4) with ρ>0 put ki:=(ki,1−∥ki∥2,0) and q:=(q/ρ,0,1−∥q∥2/ρ2), both in Sdk+1⊂Rdk+2. Then ⟨ki,q⟩=q⊤ki/ρ and eq⊤ki=eρKe(ρ)(ki,q).
Proof. The two slack coordinates are orthogonal, contribute nothing to the inner product, and normalise both vectors; the identity is exact on the whole key ball and query ball. □
Corollary 3.2 (Scalar discrepancy). Under (4) with ρ>0,
σmin∥q∥≤ρsupi∑σieq⊤ki=O(eρdklog(2+ρ)),
constructively, by [7, Thm. 1.11] applied to {ki}⊂Sdk+1.
Writing ki=κk^i silently assumes ∥ki∥=κ; the lift is the correct reduction. The guard log(1+ρ) for ρ<1, where the query ball collapses and the width degenerates, is a computation inside the same chaining method (Lemma B.3); [7] cap the bandwidth at max{α,1}, so their bound does not vanish as α→0.
For vector values one runs the colouring on the tensor features ϕ(ki)⊗vi and needs the signed sum controlled simultaneously for all q and all unit u∈Rdv. Let ψ(z)=⨁m≥0z⊗m/m!, so ⟨ψ(y),ψ(z)⟩=ey⊤z, and, for ρ>0, put ϕ0(k)=e−ρ/2ψ(ρk), Φ0(q)=eρ/2ψ(q/ρ), so that ⟨Φ0(q),ϕ0(k)⟩=eq⊤k, ∥ϕ0(k)∥≤1 and ∥Φ0(q)∥≤eρ on the respective balls. The test set is T=Q⊗Sdv−1 with Q={Φ0(q):∥q∥≤ρ} of radius eρ.
Lemma 3.3 (Chevet's inequality, two-sided). For bounded A⊂H1, B⊂H2 in Hilbert spaces, with w the Gaussian width, max{rad(A)w(B),rad(B)w(A)}≤w(A⊗B)≲rad(A)w(B)+rad(B)w(A).
The upper bound is [12], see [27, §8.7]; the lower bound freezes one factor. With w(Sdv−1)=Θ(dv) and w(Q)=O(eρdklog(1+ρ)) (Lemma B.3 and Dudley's inequality) this gives w(T)=O(eρ(dv+dklog(1+ρ))); Appendix B derives the same bound with explicit constants directly from the entropy integral, which is what the proofs consume.
3.2 The reduction to a coreset
Definition 3.4 (Balanced signing). σ∈{±1}P is (DA,DB,DN)-balanced on P⊆[n] if
Lemma 3.5 (One halving step). Let σ be (DA,DB,DN)-balanced on P, ∣P∣=m, and let P′ be the larger of the two sign classes. Then (i) m/2≤∣P′∣≤m/2+DN/2; (ii) BP′(q)≥21(BP(q)−DB) for all ∥q∥≤ρ; (iii) ∥AttnP′(q)−AttnP(q)∥≤(DA+DB)/(2BP′(q)) for all ∥q∥≤ρ.
Proof. Replacing σ by −σ preserves (6), so assume P′ is the +1 class; then AP′=21(AP+δA), BP′=21(BP+δB) with ∥δA∥≤DA, ∣δB∣≤DB. (i) and (ii) are immediate. For (iii), AttnP′−AttnP=(AP′BP−APBP′)/(BP′BP)=(δA−AttnPδB)/(2BP′), and ∥AttnP∥≤1 because it is a convex combination of the vi. □
The recursion halves ℓ times. Sizes obey n/2j≤nj≤n/2j+DN. Denominators obey BP0≥n by Jensen and then BPj≥n/2j−DB by (ii), so BPj≥n/2j+1 as long as n/2j≥2DB; the per-level error is then at most 2j+1(DA+DB)/n by (iii), the errors sum to ≤ε when 2ℓ+1(DA+DB)≤εn, and the survivors number at most 4(DA+DB)/ε+DN (Appendix B). This is the halving of [19, Thm. 4]; propagating the denominator by (ii) instead of re-centring at every level is what removes their side conditions n≥2cρdlogn and the accumulating key-mean bound, and no key-mean constraint is needed for existence.
Lemma 3.6 (One level). Under (4) every P⊆[n] admits a (DA,DB,DN)-balanced signing with DA≤C1′eρ(dv+dklog(1+ρ)), DB≤C1′eρ(1+dklog(1+ρ)), DN=105, for an explicit absolute constant C1′.
The proof (Appendix B) applies Banaszczyk's theorem [3] to the data vectors xi=21(ϕ0(ki)⊗vi,ϕ0(ki),1), of norm at most one, and the body {y:supTX⟨y,t⟩≤θX,X∈{A,B,Nˉ}} whose three blocks are independent under the Gaussian measure and each of measure at least 0.8 by Dudley's inequality and Borell–TIS. The first branch of Theorem 1.1 follows.
3.3 The sampling branch
Theorem 3.7 (Sampling cap). Under (4) and ε∈(0,1] there is an unweighted subset satisfying (2) with ∣S∣≤min{n,⌈32e2ρ/ε2⌉}. A uniformly random subset of size min{n,⌈128e2ρ/ε2⌉} satisfies (2) with probability at least 43.
Proof. In H⊕(H⊗Rdv) put zi:=2−1/2(ϕ0(ki),ϕ0(ki)⊗vi), ∥zi∥≤1. For a uniformly random subset S of size s, sampling without replacement, E∥s1∑Szi−n1∑izi∥2≤1/s; so some S has norm deviation at most s−1/2, and by Markov's inequality a random S has deviation at most 2s−1/2 with probability ≥43. Reading the two blocks against 2Φ0(q) and 2Φ0(q)⊗u, ∥u∥=1, gives simultaneously for all q∥AˉS(q)−Aˉ(q)∥≤δ and ∣BˉS(q)−Bˉ(q)∣≤δ with δ=2eρ⋅ (deviation), bars denoting averages. By Jensen Bˉ≥1, and ∥Aˉ∥≤Bˉ. If δ≤21 then BˉS≥Bˉ/2 and ∥AttnS−Attn∥≤∥AˉS−Aˉ∥/BˉS+∥Aˉ∥∥BˉS−Bˉ∥/(BˉSBˉ)≤4δ. With s≥32e2ρ/ε2 (deterministic deviation s−1/2), or s≥128e2ρ/ε2 (random deviation 2s−1/2), 4δ≤ε≤1. □
The mean at q=0 shows the ε−2 is a phase transition (Theorem 1.4(b)). Theorem 1.1 is the minimum of Lemma 3.6 with the halving, Theorem 3.7, and Theorem 5.5 below.
4 Polynomial time
Banaszczyk’s theorem is existential. The Gram–Schmidt walk [4] outputs, for vectors of norm at most one, a signing whose signed sum is σGS-subgaussian with σGS=40, in time O(m(m+N)ω). Two things change. The uniform constraints are no longer certified by a body of measure one half; they hold in expectation, through Dudley’s inequality for the subgaussian process t↦⟨∑σixi,t⟩ on the test sets. And the two finite-dimensional constraints, cardinality and key sum, are checkable in O(mdk) time, so rejection sampling makes them hold surely; the key sum is the checkable surrogate for the uncheckable denominator bound, which is why the algorithm carries a fourth block ki in its data vectors.
Definition 4.1 (One level of the algorithm). Given P, ∣P∣=m, form the Gram matrix Gij=41[eρ(ki⊤kj−1)(1+⟨vi,vj⟩)+ki⊤kj+1] of the vectors xi=21(ϕ0(ki)⊗vi,ϕ0(ki),ki,1) in O(m2(dk+dv)) time, factor G=RR⊤ by pivoted Cholesky in O(m3), and run the Gram–Schmidt walk on the rows ri of R, which realise the xi up to a linear isometry of their span. Accept σ if ∣∑i∈Pσi∣≤4σGS and ∥∑i∈Pσiki∥≤4σGSdk; otherwise repeat with fresh randomness. Output the larger sign class.
Lemma 4.2 (Acceptance and conditional bounds). Each trial is accepted with probability at least 21. Conditional on acceptance, with ZX:=supt∈TX⟨∑iσixi,t⟩ for X∈{A,B}, E[ZX∣acc]≤2CDK∗Dud(TX) and P(ZX>21CDK∗[Dud(TX)+4ueρ]∣acc)≤4e−u2 for all u≥0, where K∗ is an absolute multiple of σGS, CD is Dudley's constant, Dud(T):=∫0∞logN(T,η)dη is the entropy integral in the Euclidean metric, and Dud(TA)≤21eρdklog(1+ρ)+8eρdv, Dud(TB)≤21eρdklog(1+ρ)+4eρ.
Proof of Theorem 1.2(a),(b). Full details are in Appendix C. (a) Let Dˉ be an explicit majorant of the sum of the two conditional expectation bounds. Run Definition 4.1 for ℓ levels, ℓ maximal with 2ℓ+2Dˉ≤εn. The checks hold surely, so sizes obey n/2j≤nj≤n/2j+4σGS and the key sum stays bounded by 4σGSdk, whence by Jensen BPj≥nj/2 once nj≥ρ⋅4σGSdk/log2, which the stopping rule guarantees. Lemma 3.5(iii) bounds the level-j error by 2(aj+bj)/nj with aj,bj the realised suprema, and since the accepted signing at level j depends on the history only through Pj, the tower property and Lemma 4.2 give Esupq∥AttnPℓ−Attn∥≤∑j<ℓ2j+1Dˉ/n≤ε/2; Markov's inequality finishes. The size is <8Dˉ/ε+4σGS by maximality. (b) Apply the conditional tail with u=log(16L/δ), L=max{1,⌈log2n⌉}, at each of at most L levels; a union bound over 2L events leaves probability 1−δ/2 on which every aj+bj is at most D∗=O(eρ(dv+dklog(1+ρ))+log(L/δ)), and the error telescopes deterministically; log(16L/δ)=O(log(logn/δ)). □
Corollary 4.3 (Sample, then balance). Draw a uniformly random S0⊆[n] of size s0, where s0=min{n,⌈2048e2ρ/ε2⌉}, redrawing until ∥kˉS0∥≤2s0−1/2 (a check costing O(s0dk) time); centre the sampled keys at kˉS0, rescale keys and queries by the centred radius, and run the algorithm of Theorem 1.2(a) on (KS0,VS0) with target ε/2. With probability at least 41 the output satisfies (2); its size is O(eρ(dv+dklog(1+ρ))/ε) always, and the expected running time is O(ndk)+O(s0ω+1+s02(dk+dv)).
Proof. If s0=n the check passes trivially and Theorem 1.2(a) applies directly. Otherwise, E∥kˉS0∥2≤1/s0 for sampling without replacement from centred vectors of norm at most one, so by Markov each draw passes the check ∥kˉS0∥≤2s0−1/2 with probability ≥43, and the expected number of draws is at most 34. By Theorem 3.7 with ε/2, a single draw has supq∥AttnS0−Attn∥≤ε/2 except with probability ≤41, hence except with conditional probability ≤31 given the check. Given the check, the sampled instance, re-centred at kˉS0 and rescaled, surely has centred radius κ′≤1+2s0−1/2 and parameter ρ′=ρκ′≤ρ(1+2s0−1/2). Since s0≥2048e2ρ gives 2s0−1/2≤e−ρ/(162) and ρe−ρ≤1/e, we have both ρ′≤ρ+0.017 and ρ′≤1.05ρ; hence eρ′≤1.02eρ and log(1+ρ′)≤log(1+1.05ρ)≤1.05log(1+ρ), the last step by concavity (clog(1+ρ)−log(1+cρ) is nondecreasing in ρ for c≥1); so the size bound of Theorem 1.2(a) on the sample, which holds always, is of the stated order. Theorem 1.2(a) on the re-centred, rescaled sample with target ε/2 succeeds with conditional probability ≥21, its randomness being independent of S0; its guarantee is uniform over the original ball ∥q∥≤ρ, because translating the keys and jointly rescaling keys and queries leave every AttnS(q) unchanged; and the triangle inequality gives error ≤ε with probability ≥32⋅21=31≥41. Times follow from Theorem 1.2(a) with n replaced by s0, plus O(ndk) to compute the centring and the sample and O(s0dk) per check. □
Open Problem 4.4 (Verification). Is there a polynomial-time algorithm that, given keys, values and a signing, approximates sup∥q∥≤ρ∥∑iσieq⊤kivi∥ within a constant factor? A verifier would remove the additive term of Theorem 1.2(b) by repetition, and would amplify Corollary 4.3. In fixed dimension Tai's grid certificate is such a verifier for the third branch.
5 Fixed dimension: the logarithm disappears
Write T(x,p):=e−∥x−p∥2 for the Gaussian kernel in Tai's normalisation.
Lemma 5.1 (Transfer). Let ∥ki∥≤1 in Rdk and ρ>0. Put ki′:=(ki,1−∥ki∥2)∈Sdk, pi:=ρ/2ki′, and xq:=(q,0)/2ρ for ∥q∥≤ρ. Then eq⊤ki=e∥q∥2/(2ρ)+ρ/2T(xq,pi), and for all real ci, sup∥q∥≤ρ∣∑icieq⊤ki∣≤eρsupx∈Rdk+1∣∑iciT(x,pi)∣.
Proof. ∥xq−pi∥2=∥q∥2/(2ρ)+ρ/2−q⊤ki; exponentiate, use ∥q∥2/(2ρ)≤ρ/2, and enlarge the supremum. □
The identity is not new: for points on a sphere it is how [7, §4.2] prove their Theorem 1.11, the attention form with a weighted context measure is [15, eq. (2)], and the algebra is in [25, eq. (3)]. What the lemma adds is the completion of the ball to a sphere: every key lands on one sphere of radius ρ/2, so the weights e∥ki′∥2/2 of the weighted form are uniform and an unweighted colouring theorem applies.
Fact 5.2 (Tai [25], Lemma 13 and Algorithm 1). For every D there is a finite fT(D) such that every finite P⊂RD admits σ∈{±1}P with supx∈RD∣∑p∈Pσ(p)T(x,p)∣≤fT(D), with no assumption on the diameter of P, computable by a Las Vegas algorithm in expected time polynomial in ∣P∣ for fixed D. The proof partitions RD into the cells of side two centred at (2Z)D, colours each cell by the Gram–Schmidt walk until a finite grid certifies ∣∑p∈Qgσg(p)T(x,p)∣≤CDe−∥x−g∥2/3 for all x and the cell is balanced, ∣∑p∈Qgσg(p)∣≤1, and sums the resulting convergent series ∑r≥1(2r+1)De−4(r−1)2/3 over shells of cells.
Lemma 5.3 (Global balance). The colouring of Fact 5.2 can be modified, without changing fT(D) or the running time, so that ∣∑p∈Pσ(p)∣≤1.
Proof. Lemma 13 of [25] infers global balance from per-cell balance, which fails when several cells have odd size with uncoordinated excesses. Negating σg on one cell preserves ∣∑p∈Qgσg(p)T(x,p)∣ pointwise, hence the certificate. Even cells contribute 0 to ∑pσ(p) and odd cells ±1; enumerate the odd cells g1,…,gr and negate σgj whenever its contribution differs from (−1)j. The total is then 0 or ±1. Negating every second odd cell would not suffice, since the excesses need not agree beforehand. □
Proof of Theorem 1.3, scalar part. Apply Fact 5.2 with Lemma 5.3 to (pi) from Lemma 5.1 and use the inequality there with ci=σi. Coincident points may first be perturbed by 1/(2n) each, which moves every signed kernel sum by at most 21 since ∣T(x,p)−T(x,p′)∣≤∥p−p′∥; this is the +1 in g(dk)≤fT(dk+1)+1. If some c>0 worked for all large ρ then g(dk)≥cdklog(1+ρ)→∞. □
Values are absorbed geometrically.
Lemma 5.4 (Two-coordinate encoding). For w∈[21,1] let R=log(1/w)<1 and a(w)=(R2,R2−R4). Then T((x,0),(p,a(w)))=wT(x,p) and T((x,21,0),(p,a(w)))=e−1/4T(x,p).
Proof. T((x,z),(p,a))=T(x,p)e−∥z−a∥2, ∥a∥2=R2, and ∥(21,0)−a∥2=(21−R2)2+R2−R4=41.
Theorem 5.5 (No logarithm: the coreset). Put D=dk+1+2dv and F(dk,dv)=7dvedv/4(fT(D)+1), which is exponential in dv and, as far as is known, in dk. Under (4), every P⊆[n] admits a (Feρ,Feρ,1)-balanced signing, computable in expected polynomial time for fixed (dk,dv), and hence for every ε∈(0,1] an unweighted ε-coreset of size min{n,8Feρ/ε+1} exists and is computable in expected polynomial time for fixed (dk,dv).
Proof. For i∈P, j∈[dv] put wij=(3+vij)/4∈[21,1] and p^i=(pi,a(wi1),…,a(widv))∈RD. Colour by Fact 5.2 with Lemma 5.3 (after the perturbation of the previous proof), obtaining supx^∣∑iσiT(x^,p^i)∣≤f:=fT(D)+1. Reading the sum at (x,(21,0),…,(21,0)) and at the same point with the jth pair replaced by (0,0), Lemma 5.4 gives ∣∑iσiT(x,pi)∣≤edv/4f and ∣∑iσiT(x,pi)wij∣≤e(dv−1)/4f for all x. Since vij=4wij−3, each value coordinate of the signed sum is bounded by (4e(dv−1)/4+3edv/4)f≤7edv/4f, and the Euclidean norm over j by dv times that. Lemma 5.1 converts both bounds at the cost eρ. The halving of Section 3.2 with DA=DB=Feρ, DN=1 gives size min{n,4(DA+DB)/ε+1}.
Regime
Best upper bound
Best lower bound
Gap
dk=dv=d,εd≳e−ρ,dk≳ρ3
eρdlog(1+ρ)/ε
eρd/ε (1.4a, [19])
log(1+ρ)
dk=dv=d fixed, ρ→∞
F(d,d)eρ/ε
Ω(d) only (1.4a; its eρ branch needs dk≳ρ3)
eρ/ε unmatched from below
scalar values; dk≳ρ3 or dk=polylogn
eρmin{dklog(1+ρ),F(dk,1)}/εeρ/ε
(1.4a at dv=1; 1.4c)
whole dk factor
ε≪e−ρ,dk=Θ(logan), scalar
min{n,eρ(1/dklog(1+ρ))/ε}, i.e. no(1)/ε
(1/ε)1−1/a−o(1)
(1/ε)1/a+o(1)no(1)
ρ→0
min{n,ε−2,…}
min{dv,ε−2} (1.4b)
none for dv≥ε−2
Table 2: Lower-bound status under (4). The sampling branch e2ρ/ε2 is unmatched from below except through the mean floor.
Remark 5.6 (Kernel-density reading). Bozzai and Rothvoss ask in their conclusions whether the loglogn of their fixed-dimension Theorem 1.9 can be dropped for kernels other than the Gaussian, and remark that Tai's technique “does not appear to generalize to other kernels”. For the exponential kernel Ke(α) on Sd and the Hellinger kernel exp(−α∥x−y∥2) on the simplex it does, through the identity they themselves use: both are the Gaussian kernel T on the point set α/2xi⊂Rd+1, respectively αxi⊂Rd, so Fact 5.2 with Lemma 5.3 gives discrepancy fT(d+1)+1, respectively fT(d)+1, uniformly in α, and coreset complexity Od(1/ε) by halving. This settles the Gaussian-restriction case of their question and says nothing about the Laplacian or Jensen-Shannon kernels, nor about the growth of fT. In attention language it is Theorem 1.3 without the sphere completion.
Open Problem 5.7 (Growth of the diameter-free constant). Is fT(D)=O(D)? This is the discrepancy form of the O(d/ε) question of [22, §5] and the first open question of [7]. A positive answer would give attention coresets of size O(eρdvedv/4dk+dv/ε) through Theorem 5.5, and removing the edv/4 would need a weighted version of Fact 5.2. Nothing here bears on either.
6 Lower bounds
Table 2 is the summary. Part (b) of Theorem 1.4 is one line: with n=dv and vi=ei, attention at q=0 is the mean dv−1∑ei, and a subset of size s has error 1/s−1/dv. Part (a) is proved in Appendix D by a distributional one-way INDEX argument on the instance {(ui,bijxijej),(−ui,0)} built from a spherical code ∣⟨ui,uh⟩∣≤1/ρ; the antipodal keys make the instance centred, and the −uh weights are the inverses of the uh weights, which keeps the denominator ≤dv(2eρ+2em). The floor min{dv,ε−2} is the r→0 form of [17, Thm. 3.2]. On this instance weighting does not help: at q=0 the output of any weighted subset is a probability vector supported on S, whose distance from dv−11 is at least (1−s/dv)2/s+(dv−s)/dv2 by Cauchy-Schwarz, so weighted subsets face the same floor. (On the lookup instance of [15, Lem. B.4], by contrast, two weighted atoms reproduce attention exactly at q=0 and at one further query [15, Lem. B.8].)
Fact 6.1 ([9], Lemmas 5.3, 6.7, 7.7 and Theorem 4.12). Let r bound ∥ki∥ and ∥q∥ for the un-normalised kernel eq⊤k. Their streaming attention problem (Definition 2.2) asks for z^ with ∥z^−Attn(q)∥≤ε∥softmax(K,q)∥2∥V∥F with probability 1−δ for each fixed query. The proofs of the lower bounds in their Theorems 7.1 and 7.2 construct, from any data structure for this problem occupying S bits, a public-coin one-way protocol for INDEX2m,m with message length S+o(m): the 2m keys are public random points, the values are Alice's bits vi=xi∈{0,1} (one-dimensional), and
Bob’s query is a public key, rescaled in regime (a). The only property of the data structure used is that it is a function of Alice’s input of at most S bits from which Bob’s single query can be answered. With Rpub,→(INDEX2m,m)=Ω(m) this gives: (a) if r=logo(1)n, d=Θ(logan) for a constant a>2, and n−100<ε<n−c, then S≥Ω~(min{n,(1/ε)1−1/a−o(1)}); here the keys are N(0,(r/2)2Id/d) and Bob’s query is kj⋅(r/2)/∥kj∥; (b) if Ω(logn)≤r2<21logn and d=(logn)1+Ω(1), then S≥Ω~(min{n,er2(1−o(1))/ε}); here the keys lie on the sphere of radius r and Bob’s query is a key.
Proof of Theorem 1.4(c). Consider the family of instances of Fact 6.1: 2m public keys, values vi=xi, Bob's query q. With probability 1−o(1) over the keys all norms are as required and, the keys being i.i.d. isotropic, ∥kˉ∥=o(r); call such key sets good. Rescale keys by 1/r and the query by r, which leaves eq⊤ki unchanged; translate the keys by −kˉ, which leaves Attn unchanged; and rescale by the centred radius κ. A good instance now satisfies (4) with ρ=Θ(r2) in regime (a) (keys of norm ≈r/2, query of norm r/2) and ρ=r2(1+o(1)) in regime (b); the regime hypotheses of Fact 6.1 are conditions on their r and are unaffected by the normalisation, and in (b) er2(1−o(1))=eρ(1−o(1)).
Suppose every good instance admitted a query-oblivious unweighted ε-coreset with ∣S∣≤s. Exactly m values equal 1, so ∥V∥F=m, and softmax(K,q) has 2m nonnegative entries summing to 1, so ∥softmax(K,q)∥2≥(2m)−1/2; hence ∣AttnS(q)−Attn(q)∣≤ε at Bob's query meets their guarantee with parameter 2ε and no failure probability. Alice, who knows x and the public keys, sends the indices in S and the bits xi,i∈S: at most ⌈log2(2m+1)⌉+s(1+⌈log2(2m)⌉)=O(slogm) bits, the first term encoding ∣S∣. Bob evaluates AttnS(q) from the public keys and the message. This is a data structure of O(slogm) bits answering Bob's query on all good key sets, the bad ones charged to the reduction's failure budget, so the reductions of Fact 6.1 give O(slogm)+o(m)≥Ω(m), i.e. s≥Ω(m/logm). Substituting m from the two regimes gives the two bounds. □
Remark 6.2 (Where the transferred bounds sit). Regime (a) has eρ=no(1) and ε<n−c, so ε≪e−ρ: there Theorem 1.4(a) gives only cdvmin{e2ρ,exp(dk/Cρ2)}=no(1) and the mean floor gives 1 for scalar values, while the transferred bound is polynomial in 1/ε. Regime (b) has eρ∈[nΩ(1),n1/2+o(1)] and the shape eρ/ε of Theorem 1.4(a) at dv=1, with eo(ρ) and polylogarithmic losses in place of explicit constants and with dk polylogarithmic in n in place of dk≳ρ3. Whether the side-information decoding of [9] composes with multiplexing over dv value coordinates to give dv times these floors is open, as is any lower bound with a factor of dk.
7 Conclusion
The Liberty–Andoni–Kleiner gap is an artefact of its width input: two reductions to known theorems narrow it to log(1+ρ) against their value-direction floor, and Tai's theorem removes even that in fixed dimension.
The fixed-dimension branch is governed by the growth in D of Tai's constant (Open Problem 5.7), and is exponential in dv and, as far as is known, in dk; against it we prove no lower bound of order eρ/ε, since Theorem 1.4(a) forces eρ only once dk≳ρ2(ρ+logεdv1). For scalar values no lower bound carries a factor of dk, and the sampling branch is unmatched from below. The construction succeeds with constant probability at the stated size, which a verifier for the signing objective (Open Problem 4.4) would remove. Two questions are empirical: how large ρ is on real heads, and whether a guarantee uniform over the ball helps in a closed decoding loop.
A Tools
Fact A.1 (Banaszczyk [3]). Let K⊆RN be a convex body (compact, convex, nonempty interior; symmetry not required) with γN(K)≥21, γN the standard Gaussian measure on RN, and x1,…,xm∈RN with ∥xi∥≤1. Then some σ∈{±1}m has ∑iσixi∈5K.
Fact A.2 (Gram-Schmidt walk [4], Thm. 1.4). There is a randomised algorithm which, given x1,…,xm∈RN with ∥xi∥≤1, runs in time O(m(m+N)ω) and outputs σ such that y=∑iσixi satisfies Ee⟨θ,y⟩≤eσGS2∥θ∥2/2 for all θ, with σGS=40. Consequently Ey=0, E⟨θ,y⟩2≤σGS2∥θ∥2, and ∥⟨θ,y⟩∥ψ2≤CψσGS∥θ∥ for an absolute Cψ≥1 ([27, Prop. 2.5.2]).
Fact A.3 (Dudley's inequality, expectation and tail; [27], Thms. 8.1.3 and 8.1.6). Let (Xt)t∈T have subgaussian increments ∥Xt−Xs∥ψ2≤Kd(t,s). Then for every t0, and for every u≥0 with probability at least 1−2e−u2,
A centred Gaussian process Xt=⟨g,t⟩, t∈T⊂RN, has such increments with K=KG absolute in the Euclidean metric.
Fact A.4 (Borell-TIS; [1], Thm. 2.1.1). For a centred Gaussian process bounded a.s. on T with σ2=suptEXt2, Z=suptXt satisfies P(Z>EZ+r)≤e−r2/(2σ2).
Fact A.5 (Covering numbers; [27], Cor. 4.2.13). For 0<η≤1, N(Sd−1,η)≤(3/η)d and N(Bd,η)≤(3/η)d.
Fact A.6 (Spherical caps; [2, Lemma 2.2]). For u uniform on Sd−1 and a fixed unit vector v, P(∣⟨u,v⟩∣≥t)≤2e−dt2/2 for all t≥0.
Lemma A.7 (Distributional one-way INDEX). Let x∈{0,1}N be uniform, let t∈[N] be uniform and independent, and let public randomness R be independent of both. If Alice sends M=M(x,R) of at most b bits and Bob outputs x^t=x^t(M,t,R) with P(x^t=xt)≥1−δ for some δ≤21, then b≥(1−h(δ))N, h the binary entropy.
Proof. For each fixed t let δt be Bob's error probability, so N1∑tδt≤δ. By Fano's inequality H(xt∣M,R)≤h(δt). The bits of x are independent, so b≥H(M∣R)≥I(x;M∣R)=N−H(x∣M,R)≥N−∑tH(xt∣M,R)≥∑t(1−h(δt))≥N(1−h(δ)), the last step by concavity of h and its monotonicity on [0,21]. (This is the average-case form of the classical bound of [18].) □
B Proof of the first branch of Theorem 1.1
Throughout, (4) holds. To keep every Gaussian process finite-dimensional we truncate the feature map: for M∈N let ψM(z)=⨁m≤Mz⊗m/m! in Ed,M=⨁m≤M(Rd)⊗m, so ⟨ψM(y),ψM(z)⟩=eM(y⊤z) with eM(s)=∑m≤Msm/m!.
Lemma B.1 (Truncation). For all y,z, all M and all u,u′ in a Hilbert space: (i)∥ψM(y)⊗u−ψM(z)⊗u′∥≤∥ψ(y)⊗u−ψ(z)⊗u′∥ and ∥ψM(z)∥≤∥ψ(z)∥;(ii) if ∣s∣≤ρ then ∣es−eM(s)∣≤τM(ρ):=∑m>Mρm/m!, and τM(ρ)≤2−M whenever M+1≥2eρ.
Proof. (i) The squared norm on the left is ∑m≤M(∥y∥2m∥u∥2+∥z∥2m∥u′∥2−2(y⊤z)m⟨u,u′⟩)/m!, each summand nonnegative by 2∣(y⊤z)m⟨u,u′⟩∣≤∥y∥2m∥u∥2+∥z∥2m∥u′∥2; the untruncated squared norm is the same sum over all m. (ii) The first bound is termwise; for m≥M+1≥2eρ, ρm/m!≤(eρ/m)m≤2−m. □
Data and test vectors. Fix P⊆[n],∣P∣=m, and M. Let E=(Edk,M⊗Rdv)⊕Edk,M⊕R and, for i∈P,
by Lemma B.1(i) and ∥ki∥≤1. Test vectors, for ∥q∥≤ρ and u∈Sdv−1: tA(q,u)=2(eρ/2ψM(q/ρ)⊗u,0,0), tB(q)=2(0,eρ/2ψM(q/ρ),0), tN=2(0,0,1), and TA={tA(q,u)}, TB={±tB(q)}, TN={±tN}. For yσ=∑i∈Pσixi,
Lemma B.2 (Lipschitz bound). For ∥q∥,∥q′∥≤ρ, ∥Φ(q)−Φ(q′)∥≤Λ∥q−q′∥/ρ with Λ=eρρ(1+ρ).
Proof. Φ is C1 (the partial sums are polynomial and their derivatives converge uniformly on bounded sets), and for h∈Rdk, ∥DΦ(q)[h]∥2=∂h∂h′⟨Φ(q),Φ(q′)⟩∣q′=q,h′=h=eρe∥q∥2/ρ(∥h∥2/ρ+(q⊤h)2/ρ2)≤e2ρ∥h∥2(1/ρ+1). Integrate along the segment.
Lemma B.3 (Entropy integral of Q). IQ:=∫0∞logN(Q,η)dη≤5.2eρdklog(1+ρ) for every ρ>0.
Proof. Let Δ=diam(Q)≤min{2eρ,2Λ}. By Lemma B.2 and Fact A.5, N(Q,η)≤(3Λ/η)dk for η≤Λ; for Λ≤η≤Δ the point Φ(0) is an η-net, so the same bound holds on (0,Δ], and N=1 beyond Δ. With a=Δ/Λ≤2 and η=Λs, IQ≤Λdk∫0alog(3/s)ds≤Λdkφ(a), φ(a):=a(log(3/a)+π/2), which is increasing on (0,2] (its derivative at a=2 exceeds 0.73 and decreases in a). If ρ≥1, use a≤a0=2/ρ(1+ρ), Λa0=2eρ, and log(3/a0)≤log(23(1+ρ))≤1.6log(1+ρ), 0.887≤1.07log(1+ρ), giving IQ≤2eρdk(1.27+1.07)log(1+ρ)<4.7eρdklog(1+ρ). If ρ<1, use a≤2: IQ≤Λdkφ(2)<3.047Λdk≤4.31eρρdk with Λ≤eρ2ρ, and ρ≤1.2012log(1+ρ) by concavity, giving IQ<5.2eρdklog(1+ρ). □
Lemma B.4 (Entropy integrals of the test sets). With Wk=eρdklog(1+ρ) and Wv=eρdv, Dud(TA)≤21Wk+8Wv, Dud(TB)≤21Wk+4eρ, and diam(TA), diam(TB)≤4eρ. The same bounds hold for the untruncated sets TA={2Φ(q)⊗u}, TB={±2Φ(q)}.
Proof. By Lemma B.1(i) the map 2Φ(q)⊗u↦tA(q,u) is a contraction, so it suffices to treat TA. Since ∥Φ(q)⊗u−Φ(q′)⊗u′∥≤∥Φ(q)−Φ(q′)∥+eρ∥u−u′∥, the product of an η/4-net of Q and an η/(4eρ)-net of Sdv−1 is an η-net of TA; the integral runs over η≤4eρ, and log(ab)≤loga+logb gives Dud(TA)≤4IQ+4eρ∫01dvlog(3/η)dη≤4IQ+4eρdv(log3+π/2)≤21Wk+8Wv. For TB the sphere is replaced by {±1}, contributing 4eρlog2≤4eρ. □
By Dudley's inequality w(Q)≤CDKGIQ and w(T)=21EsupTA⟨g,t⟩≤21CDKG(21Wk+8Wv), which is the upper bound quoted after Lemma 3.3.
Lemma B.5 (Product body). Let g be standard Gaussian on E, KX={y:supTX⟨y,t⟩≤θX} and K=KA∩KB∩KN. Then K is closed, symmetric and convex, the three events {g∈KX} are independent, each has probability ≥0.8, so γ(K)≥0.512; and with N=dimE, R=10N, the set KR=K∩RBE is a convex body with γ(KR)≥0.502 and 5KR⊆5K.
Proof. Each KX is an intersection of closed half-spaces and TX=−TX, so KX is closed, convex, symmetric; the functionals depend on disjoint blocks of y, whose Gaussian coordinates are independent. Block N:P(2∣gN∣>25)≤51 by Markov. Blocks A,B:TA is the continuous image of a compact set, so ZA=supTA⟨g,t⟩ is the supremum of a centred Gaussian process with σ2≤4e2ρ; Fact A.3 and Lemma B.4 give EZA≤CDKG(21Wk+8Wv), and Fact A.4 with r=2eρ2log5<3.6eρ gives P(ZA>θA)≤51; likewise for B. K need not be bounded, so intersect with the ball: KR is compact, symmetric, convex, and contains the ball of radius minXθX/(2eρ) since ∣⟨y,t⟩∣≤2eρ∥y∥ for every test vector, so it is a convex body; and P(∥g∥>R)≤N/R2=0.01.
Proof of Lemma 3.6. Take M=⌈max{2eρ,log2(2n)}⌉. Fact A.1 in E with the vectors (7) and the body KR gives σ with supTX⟨yσ,t⟩≤5θX. By (8) and symmetry, ∣∑σieM(q⊤ki)⟨vi,u⟩∣≤5θA for all q,u, so the Euclidean norm of ∑σieM(q⊤ki)vi is at most 5θA; ∣∑σieM(q⊤ki)∣≤5θB; ∣∑σi∣≤5θN=105. By Lemma B.1(ii) and the choice of M, replacing eM by e(⋅) changes each kernel sum by at most m⋅2−M≤21≤eρ. So DA=5θA+eρ, DB=5θB+eρ, DN=105 work, and with C1′=105CDKG+23 the stated bounds follow from (9). □
Proof of the first branch of Theorem 1.1. Set D=DA+DB from Lemma 3.6. If 2D>εn output [n]. Otherwise let ℓ be maximal with 2ℓ+1D≤εn, and obtain Pj+1 from Pj by Lemma 3.6 and Lemma 3.5, P0=[n], nj=∣Pj∣. Sizes: n/2j≤nj≤n/2j+DN. Denominators: BP0≥n by Jensen, and BPj≥n/2j−DB∑i=1j2−i≥n/2j−DB; for j≤ℓ, n/2j≥2D/ε≥2DB, so BPj≥n/2j+1. Error: Lemma 3.5(iii) at step j has denominator BPj+1≥n/2j+2, so ∥AttnPℓ−Attn∥≤∑j<ℓ2j+1D/n≤2ℓ+1D/n≤ε uniformly in q. Size: maximality gives n/2ℓ<4D/ε, so nℓ<4D/ε+DN, and 4D≤8C1′eρ(dv+dklog(1+ρ)). □
C Proofs for Section 4
Fix P,∣P∣=m, and the untruncated vectors xi=21(ϕ0(ki)⊗vi,ϕ0(ki),ki,1) in H=(Hdk⊗Rdv)⊕Hdk⊕Rdk⊕R, ∥xi∥≤1, with test vectors tA(q,u)=2(Φ(q)⊗u,0,0,0), tB(q)=2(0,Φ(q),0,0), tC(w)=2(0,0,w,0) for unit w, tN=2(0,0,0,1); the read-offs (8) hold with e(⋅), and ⟨yσ,tC(w)⟩=⟨∑σiki,w⟩.
Lemma C.1 (Isometric coordinates). Gij=⟨xi,xj⟩ is the matrix of Definition 4.1, positive semidefinite; if G=RR⊤ then the rows ri of R satisfy ⟨ri,rj⟩=Gij, there is a linear isometry ι of V=span{xi} onto span{ri} with ιxi=ri, and for every t∈H, ⟨∑σixi,t⟩=⟨∑σiri,ιΠt⟩ with Π the projection onto V and ∥ιΠt∥≤∥t∥.
Proof. Two families with the same Gram matrix are related by the isometry ∑aixi↦∑airi, well defined since ∥∑aixi∥2=a⊤Ga=∥∑airi∥2; and ⟨y,t⟩=⟨y,Πt⟩ for y∈V. □
We work in the real-RAM model; rows accurate to η≤1/(2m) change every read-off by at most 2mηeρ≤eρ, absorbed by thresholds exceeding 100eρ, and multiply the subgaussian constant by at most 1+η.
Lemma C.2 (Subgaussian process on the test sets). Let σ be the walk's output on r1,…,rm and Xt=⟨∑σixi,t⟩. Then EXt=0, ∥Xt−Xs∥ψ2≤K∗∥t−s∥ with K∗=CψσGS, and for X∈{A,B}, ZX=supTXXt satisfies EZX≤CDK∗Dud(TX) and P(ZX>21CDK∗[Dud(TX)+4ueρ])≤2e−u2; moreover E(∑σi)2≤4σGS2 and E∥∑σiki∥2≤4σGS2dk.
Proof. Xt=⟨y,ιΠt⟩ with y=∑σiri subgaussian by Fact A.2, so the increment bound follows with ∥Π(t−s)∥≤∥t−s∥. Fact A.3 on (TX,∥⋅∥) gives the expectation bound; for the tail, TX=−TX and X−t=−Xt give ZX≤21supt,s∣Xt−Xs∣ with diam(TX)≤4eρ (Lemma B.4, untruncated sets). The last two claims are EXt2≤σGS2∥Πt∥2 at t=tN and at t=tC(el), summed over l≤dk. □
Proof of Lemma 4.2. By Markov, each check fails with probability ≤41, so acceptance has probability ≥21; ZX≥0 by symmetry, and dividing by P(acc) gives the conditional statements. □
Lemma C.3 (Deterministic invariants). Let DN′=4σGS, DC′=4σGSdk. For all j, n/2j≤nj≤n/2j+DN′ and c_j := \|\sum_P_j k_i\| \leq D'_C; if nj≥ρDC′/log2 then BPj(q)≥nj/2 for all ∥q∥≤ρ.
Proof. Sizes are Lemma 3.5(i). cj+1≤21(cj+DC′)≤DC′ from c0=0. Jensen: BPj≥njeq⊤kˉPj≥nje−ρcj/nj≥nj/2. □
Lemma C.4 (Error per level). If nj+1≥ρDC′/log2 then ∥AttnPj+1(q)−AttnPj(q)∥≤2(aj+bj)/nj for all ∥q∥≤ρ, where aj,bj are the realised values of ZA,ZB at level j.
Proof. Lemma 3.5(iii) with (aj,bj), and BPj+1≥nj+1/2≥nj/4. □
Proof of Theorem 1.2(a), details. Let Dˉ=2CˉDKˉ∗(42Wk+8Wv+4eρ) with explicit numerical majorants CˉD,Kˉ∗ of the absolute constants, and ℓ maximal with 2ℓ+2Dˉ≤εn (ℓ=0 if none). Running time: level j costs O(m2(dk+dv))+O(m3) plus an expected two walks at O(m(2m)ω), with m≤n/2j+DN′, summing to O(nω+1+n2(dk+dv)). Size: nℓ≤n/2ℓ+DN′<8Dˉ/ε+DN′. Validity: for j<ℓ, nj+1≥n/2ℓ≥4Dˉ/ε≥4Dˉ, and Dˉ≥4240eρdklog(1+ρ)≥4240log2ρdk>221ρdk using infρ>0eρlog(1+ρ)/ρ≥log2, while ρDC′/log2<36.5ρdk. Error: the accepted σ(j) is a function of Pj and fresh randomness with the law of one trial conditioned on acceptance, so E[aj+bj∣history]≤Dˉ by Lemma 4.2, and by Lemma C.4, nj≥n/2j and the tower property, Esupq∥AttnPℓ−Attn∥≤∑j<ℓ2j+1Dˉ/n≤ε/2. □
Proof of Theorem 1.2(b), details. With u=log(16L/δ), Lemma 4.2 gives at each level P(aj>21CDK∗[Dud(TA)+4ueρ]∣history)≤δ/(4L), likewise for bj; a union bound over ≤2L events leaves probability ≥1−δ/2 on which aj+bj≤D∗ for all j<ℓ, with D∗=21CˉDKˉ∗(42Wk+8Wv+4eρ+8ueρ), with the majorants of (a) so that the stopping rule is computable (the tail bound of Lemma 4.2 then applies a fortiori). On that event the error is ≤2ℓ+1D∗/n≤ε deterministically with the stopping rule 2ℓ+1D∗≤εn, validity holds as before since D∗≥Dˉ/4, and the size is <4D∗/ε+DN′. □
D Proof of Theorem 1.4(a)
Let L=eρ, ρ≥2, dk≥2, dv≥1, ε≤ε0/dv with ε0:=1/(4010), and put c1:=1/(4010e). Define
Code. Draw u1,…,um i.i.d. uniform on Sdk−1. By Fact A.6 with t=1/ρ and a union bound over (2m) pairs, P(∃i=h:∣⟨ui,uh⟩∣>1/ρ)≤m2e−dk/(2ρ2)<1 when m<edk/(4ρ2), which (10) ensures; fix such a code (for m=1 there is nothing to check).
Instance. Let x=(xij)∈{0,1}m×dv and let b=(bij)∈{±1}m×dv be public signs. The instance has N′:=2mdv pairs: (ui,bijxijej) and (−ui,0) for i∈[m], j∈[dv]. The key centroid is zero, all keys have norm one, all values norm at most one, so (4) holds with the given ρ.
Decoding. For the query qi=ρui put wih=eρ⟨ui,uh⟩; then wii=L, and e−1≤wih≤e for h=i. The weight of the key −uh is wih−1. Hence
Bi:=B(qi)=dvh∑(wih+wih−1)≤dv(2L+2em),
a quantity depending only on the public keys. The jth numerator coordinate is A(qi)j=∑hwihbhjxhj, so bijA(qi)j=Lxij+Nij with Nij=∑h=iwihbijbhjxhj. Conditional on x and the code, EbNij=0 and EbNij2=∑h=iwih2xhj≤e2m, so by Chebyshev Pb(∣Nij∣>L/10)≤100e2m/L2≤101 by (10) (vacuous for m=1, where Nij=0).
Let S be an ε-coreset. Bob, holding (i,j), S, the data of S, the public keys and b, computes y^:=bijBiAttnS(qi)j. Since ∑j′(AttnS(qi)j′−Attn(qi)j′)2≤ε2, for j uniform in [dv] Markov's inequality gives ∣AttnS(qi)j−Attn(qi)j∣≤ε10/dv with probability ≥109. On that event ∣y^−(Lxij+Nij)∣≤Biε10/dv≤2ε10dv(L+em)≤L/20+L/20, using εdv≤ε0 for the first term and m≤c1L/(εdv) for the second (for m=1 the latter holds since c1L/(εdv)≥c1L/ε0=eρ−1≥e). Together with ∣Nij∣≤L/10, Bob's threshold x^ij:=1[y^>L/2] is correct. The two failure events have total probability ≤51 by a union bound, so Bob succeeds with probability ≥54 over x, b and (i,j).
Counting. Suppose that for every x and every b the instance admitted an ε-coreset of size at most s. Alice sends the positions of S among the N′ pairs and the bits xij of the selected pairs with key +ui: at most log2(sN′)+s+O(logN′)≤slog2(eN′/s)+s+O(logN′) bits, and N=mdv=N′/2 INDEX bits are being decoded. With s=0.03N this is ≤0.03Nlog2(2e/0.03)+0.03N+O(logN)≤0.256N+O(logN) bits, whereas Lemma A.7 with δ=51 requires at least (1−h(51))N>0.278N bits. For N≥N0 (an absolute constant) this is a contradiction, so some (x,b) yields an instance every ε-coreset of which has ∣S∣>0.03mdv≥0.015dvmin{⋯}. For N<N0: since c1,21>1/(1000e2), each term of the minimum in the theorem is at most 1000e2 times the corresponding term in (10), so dvmin{L/(εdv),L2,edk/(4ρ2)}≤1000e2dv⋅2m=2000e2N, and the claimed bound is at most 2000e2cN<2000e2cN0, which is below 1≤∣S∣ for c≤1/(2000e2N0). The same comparison of minima gives, for N≥N0, ∣S∣>0.015dvmin{⋯}≥(0.015/(1000e2))dvmin{L/(εdv),L2,edk/(4ρ2)}, so the first display holds with c=min{0.015,1/(2N0)}/(1000e2) and C=4. The regime statement selects the first branch of the minimum: L/(εdv)≲L2 iff εdv≳e−ρ, and L/(εdv)≲edk/(4ρ2) iff dk≳ρ2(ρ+logεdv1). □
What this proves and what it does not. The dv comes from multiplexing independent bits over output coordinates; the same one-bit-per-token architecture yields no key-dimension factor, because at any single query the signal available from one token is at most 2eρ/n against a required resolution ε/dv, which caps the argument at eρdv/ε. Breaking this requires side information, as in [9].
References
[1] R. J. Adler and J. E. Taylor. Random Fields and Geometry. Springer, 2007.
[2] K. Ball. An elementary introduction to modern convex geometry. In Flavors of Geometry, MSRI Publ. 31, pp. 1–58, 1997.
[3] W. Banaszczyk. Balancing vectors and Gaussian measures of n-dimensional convex bodies. Random Structures & Algorithms, 12(4):351–360, 1998.
[4] N. Bansal, D. Dadush, S. Garg, and S. Lovett. The Gram-Schmidt walk: a cure for the Banaszczyk blues. In STOC, 2018; Theory of Computing, 15(21), 2019.
[5] J. Beck and T. Fiala. “Integer-making” theorems. Discrete Applied Mathematics, 3(1):1–8, 1981.
[6] L. Bohbot, C. Letrouit, G. Peyré, and F.-X. Vialard. Token sample complexity of attention. arXiv:2512.10656, 2025.
[7] R. Bozzai and T. Rothvoss. Stronger coreset bounds for kernel density estimators via chaining. arXiv:2310.08548, 2023.
[8] A. M. Carrell, A. Gong, A. Shetty, R. Dwivedi, and L. Mackey. Low-rank thinning. arXiv:2502.12063, 2025.
[9] J. Y. Chen, Y. Feng, P. Indyk, M. Kapralov, E. Kochetkova, and B. Prokhorov. Towards tight bounds for streaming attention. arXiv:2606.07205, 2026.
[10] M. Charikar, M. Kapralov, and E. Waingarten. A quasi-Monte Carlo data structure for smooth kernel evaluations. In SODA, 2024; arXiv:2401.02562.
[11] B. Chazelle and J. Matoušek. On linear-time deterministic algorithms for optimization problems in fixed dimension. Journal of Algorithms, 21(3):579–597, 1996.
[12] S. Chevet. Séries de variables aléatoires gaussiennes à valeurs dans E⊗εF. Séminaire sur la Géométrie des Espaces de Banach, Exposé 19, 1978.
[13] A. Gong, A. M. Carrell, R. Dwivedi, and L. Mackey. Express language modeling. arXiv:2606.10944, 2026.
[14] T. Haris and K. Onak. Compression barriers for autoregressive transformers. In COLT, 2025; arXiv:2502.15955.
[15] J. Haverbeck, C. Amo Alonso, A. F. Posada-Moreno, S. Trimpe, and M. Pavone. The risk of KV cache compression: a kernel-discrepancy view of attention. arXiv:2607.01520, 2026.
[16] Z. Karnin and E. Liberty. Discrepancy, coresets, and sketches in machine learning. In COLT, 2019.
[17] I. Kochetkova, A. Sheth, I. Han, A. Zandieh, and M. Kapralov. BalanceKV: streaming attention approximation via discrepancy theory. In NeurIPS, 2025; arXiv:2502.07861.
[18] I. Kremer, N. Nisan, and D. Ron. On randomized one-round communication complexity. Computational Complexity, 8(1):21–49, 1999.
[19] E. Liberty, A. Andoni, and E. Kleiner. Nearly optimal attention coresets. arXiv:2605.05602, 2026.
[20] D. Lopez-Paz, K. Muandet, B. Schölkopf, and I. Tolstikhin. Towards a learning theory of cause-effect inference. In ICML, 2015.
[21] J. M. Phillips. ε-samples for kernels. In SODA, 2013.
[22] J. M. Phillips and W. M. Tai. Near-optimal coresets of kernel density estimates. In SoCG, 2018; Discrete & Computational Geometry, 63:867–887, 2020.
[23] T. Schröder and L. Mackey. WildCat: near-linear attention in theory and practice. arXiv:2602.10056, 2026.
[24] Y. Sui and J. Zhang. The approximation rank of softmax attention: sharp geometric laws and robust interaction dimension. arXiv:2608.28150, 2026.
[25] W. M. Tai. Optimal coreset for Gaussian kernel density estimation. In SoCG, LIPIcs 224, 63:1–63:15, 2022; arXiv:2007.08031.
[26] R. Tomioka and T. Suzuki. Spectral norm of random tensors. arXiv:1407.1870, 2014.
[27] R. Vershynin. High-Dimensional Probability. Cambridge University Press, 2018.
[28] X. Wang. How much cache does reasoning need? Depth-cache tradeoffs in KV-compressed transformers. arXiv:2604.17935, 2026.
[29] A. Zandieh, I. Han, V. Mirrokni, and A. Karbasi. SubGen: token generation in sublinear time and memory. arXiv:2402.06082, 2024.