arXiv:2609.06327cs.DSSep 2026

Manuscript Offprint

arXiv:2609.06327

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 SS of the key-value pairs such that attention computed from SS alone is within ε\varepsilon of the full output, in ℓ2\ell_2, simultaneously for every query in a ball. Liberty, Andoni and Kleiner proved that unweighted coresets of size O(deρ+12log⁡ρ+o(log⁡log⁡ρ)/ε)O(\sqrt{d}e^{\rho+\frac{1}{2}\log \rho+o(\log \log \rho)}/\varepsilon) exist, ρ\rho being the query radius times the centred key radius, against a lower bound Ω(deρ/ε)\Omega(\sqrt{d}e^{\rho}/\varepsilon), 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+ρ))/ε)O(e^{\rho}(\sqrt{d_v}+\sqrt{d_k}\log(1+\rho))/\varepsilon) exist and are computable in randomised polynomial time, the first with a whole-ball guarantee at the existential size up to log⁡(1+ρ)\sqrt{\log(1+\rho)}. A dimension-free sampling cap O(e2ρ/ε2)O(e^{2\rho}/\varepsilon^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ρ/ε)O_{d_k,d_v}(e^{\rho}/\varepsilon), 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−ρ\varepsilon \ll e^{-\rho} 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ρ)O(e^{\rho}), dimension-free.

1 Introduction

Fix an attention head with keys k1,…,kn∈Rdkk_1, \ldots, k_n \in \mathbb{R}^{d_k} and values v1,…,vn∈Rdvv_1, \ldots, v_n \in \mathbb{R}^{d_v}, and write

A(q)=∑i=1neq⊤kivi,B(q)=∑i=1neq⊤ki,Attn(q)=A(q)B(q).(1)A(q)=\sum_{i=1}^{n} e^{q^\top k_i}v_i,\qquad B(q)=\sum_{i=1}^{n} e^{q^\top k_i},\qquad \mathrm{Attn}(q)=\frac{A(q)}{B(q)}. \tag{1}

For S⊆[n]S \subseteq [n] write AttnS\mathrm{Attn}_S for the same expression over SS. An unweighted query-oblivious ε\varepsilon-coreset is a subset SS with

sup⁡∥q∥≤ϱ∥AttnS(q)−Attn(q)∥2≤ε.(2)\sup_{\|q\|\leq \varrho} \|\mathrm{Attn}_S(q)-\mathrm{Attn}(q)\|_2 \leq \varepsilon. \tag{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

ρ:=ϱκ,κ≥max⁡i∥ki−kˉ∥,kˉ=1n∑iki,(3)\rho:=\varrho\kappa,\qquad \kappa\geq \max_i \|k_i-\bar{k}\|,\quad \bar{k}=\frac{1}{n}\sum_i k_i, \tag{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ˉ-\bar{k} multiplies numerator and denominator in (1) by the same factor e−q⊤kˉe^{-q^{\top}\bar{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 max⁡i∥ki∥\max_i \|k_i\| silently permits e2ρe^{2\rho}. Throughout, after centring and rescaling once, we may and do assume the normalised model

1n∑iki=0,∥ki∥≤1,∥q∥≤ρ,∥vi∥≤1.(4)\frac{1}{n}\sum_{i}k_{i}=0,\qquad\|k_{i}\|\leq1,\qquad\|q\|\leq\rho,\qquad\|v_{i}\|\leq1. \tag{4}

Centring and the joint rescaling k↦(k−kˉ)/κk \mapsto (k - \bar{k})/\kappa, q↦κqq \mapsto \kappa q leave (2) unchanged; dividing every viv_i by max⁡i∥vi∥\max_i \|v_i\| scales its left side by the same factor, so ε\varepsilon is measured in units of max⁡i∥vi∥\max_i \|v_i\|. Two facts about (4) are used repeatedly: every weight eq⊤kie^{q^\top k_i} lies in [e−ρ,eρ][e^{-\rho}, e^\rho], and by Jensen’s inequality B(q)≥nexp⁡(q⊤kˉ)=nB(q) \geq n \exp(q^\top \bar{k}) = n for every qq.

Liberty, Andoni and Kleiner [19] proved that an unweighted coreset of size O(deζ/ε)O(\sqrt{d}e^{\zeta}/\varepsilon) exists, ζ=ρ+12log⁡ρ+o(log⁡log⁡ρ)\zeta = \rho + \frac{1}{2}\log \rho + o(\log \log \rho), d=dk=dvd = d_k = d_v, against a lower bound Ω(deρ/ε)\Omega(\sqrt{d}e^{\rho}/\varepsilon) under conditions on dd and ε\varepsilon relative to ρ\rho. They identified the vector values as their main difficulty, conjectured that closing the residual ρ1/2+o(1)\rho^{1/2+o(1)} (a log⁡n\sqrt{\log n} 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ρe^{\rho} is moderate on transformer caches, and whether the construction of Theorem 1.2 beats sampling there, is taken up experimentally later.