cs.DSSep 6, 2026

Query-Oblivious Coresets for Softmax Attention: Improved Bounds and Efficient Constructions

Authors: Ofek I. Cohen

Organizations: Tel Aviv University.

Abstract

A query-oblivious coreset for a softmax-attention head is a subset of the key-value pairs whose attention output is within ε\varepsilon of the full one 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^{ρ+\frac12\logρ+o(\log\logρ)}/\varepsilon) exist, ρρ the query radius times the centred key radius, against a lower bound Ω(deρ/ε)Ω(\sqrt d e^ρ/\varepsilon), and conjectured that closing the gap needs new techniques. It does not: a spherical lift of both balls into one exponential-kernel instance lets the Bozzai-Rothvoss chaining bound apply, and Chevet's inequality splits key from value dimension, giving coresets of size O(eρ(dv+dklog⁡(1+ρ))/ε)O(e^ρ(\sqrt{d_v}+\sqrt{d_k\log(1+ρ)})/\varepsilon) in randomised polynomial time, the first constructive whole-ball guarantee within log⁡(1+ρ)\sqrt{\log(1+ρ)} of the lower bound. A sampling cap O(e2ρ/ε2)O(e^{2ρ}/\varepsilon^{2}) completes the envelope; in fixed dimension Tai's diameter-free bound removes the logarithm, settling the Gaussian-restriction case of a Bozzai-Rothvoss question for the kernels. We give theLiberty-Andoni-Kleiner lower boud transfer the one-waycommunication bounds of Chen et r is the price of one signing forall queries. A census of every head of Qwen2.5-7B-Instruct and Llama-3-8B-Instruct finds ρρ at least 23.877, so everyactor eρ/εe^ρ/\varepsilonprescribes a coreset larger than the cache: the algorithmic contribution is asymptotic on these models.

Figures & tables

Appendix figures & tables12 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

May 7, 2026

Nearly Optimal Attention Coresets

We consider the problem of estimating the Attention mechanism in small space, and prove the existence of coresets for it of nearly optimal size. Specifically, we show that for any set of unit-norm keys and values (K,V)(K,V) in Rd\mathbb{R}^d, there exists a subset (K′,V′)(K',V') of size at most O(deρ+o(ρ)/ε)O({\sqrt{d} e^{ρ+o(ρ)}/\varepsilon}) such that ∥Attn⁡(q,K,V)−Attn⁡(q,K′,V′)∥≤ε\left\| \operatorname{Attn}(q,K,V)- \operatorname{Attn}(q,K',V') \right\| \le \varepsilon simultaneously for all queries whose norm is bounded by ρρ. This outperforms the best known results for this problem. We also offer an improved lower bound showing that ε\varepsilon-coresets must have size Ω(deρ/ε)Ω({\sqrt{d} e^ρ/ε}).
Sep 29, 2026

Efficiently Approximating Attention Is Hard

Softmax attention is ubiquitous in modern machine learning, but its quadratic scaling with sequence length makes it costly. To reduce this cost, attention is often approximated with fast algorithms, which incur error but can still perform well in practice and on some inputs. At the same time, the growing diversity of attention applications makes approximation guarantees that do not depend on particular input structure a compelling target. For such uniform guarantees over all inputs, known runtime lower bounds rule out fast algorithms for near-exact attention, but leave open the practically important regime: is there an efficient algorithm with even a modest uniform approximation guarantee? We answer this question negatively. Under standard complexity-theoretic assumptions, no truly subquadratic algorithm can approximate attention with any nontrivial additive or relative guarantee uniformly over all inputs. This impossibility holds in the mildest parameter regime for which known algorithms do not already achieve strong approximation guarantees in near-linear time, and extends to practically relevant relaxations: even after polynomial preprocessing of the KV cache, no efficient algorithm can obtain a nontrivial uniform approximation guarantee, or identify a small set of keys receiving substantial attention under sparsity. Overall, our results settle the computational limits of uniform attention approximation.
Oct 7, 2026

Attention via Black-Box Vector Search

Sparse attention mechanisms estimate attention over nn tokens using a small subset of keys. Many existing approaches use maximum inner product search (MIPS) to retrieve the heaviest keys, which motivates the following question: given black-box access to a MIPS oracle, how many keys must be retrieved to output an ε\varepsilon-accurate attention estimate? We answer this question by unifying prior approaches through the framework of priority sampling. With a single MIPS index, we show that Θ(n/ε)Θ(\sqrt{n}/\varepsilon) retrieved keys are both sufficient and necessary. With Θ(log⁡n)Θ(\log n) indices, we give an algorithm that retrieves only O(log⁡n+1/ε2)O(\log n+1/\varepsilon^2) keys and prove that this is near-optimal. More generally, we design algorithms that establish a smooth tradeoff between the number of MIPS indices and number of retrieved keys. We then show that if we allow augmentation of keys and queries, we can bypass the above lower bounds: there exists a simple priority-sampling estimator using a single MIPS index and O(1/ε2)O(1/\varepsilon^2) retrieved keys. When integrated into LLM inference, our algorithms outperform top-kk and sampling approaches used in prior work and yield attention approximation that scales favorably to long contexts.