# Nearly Optimal Attention Coresets

Edo Liberty, Alexandr Andoni, Eldar Kleiner · 2026-05-08

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)$ in $\mathbb{R}^d$, there exists a subset $(K', V')$ of size at most $O(\sqrt{d}\, e^{\rho + o(\rho)}/\epsilon)$ such that

$$
\bigl\| \mathrm{Attn}(q, K, V) - \mathrm{Attn}(q, K', V') \bigr\| \leq \varepsilon
$$

simultaneously for all queries whose norm is bounded by $\rho$. This outperforms the best known results for this problem. We also offer an improved lower bound showing that $\varepsilon$-coresets must have size $\Omega(\sqrt{d}\, e^\rho / \epsilon)$.

[Read the Paper](https://arxiv.org/abs/2605.05602)