One Attack to Rule Them All: Tight Quadratic Bounds for Adaptive Queries on Cardinality Sketches
Edith Cohen, Jelani Nelson, Tamás Sarlós, Mihir Singhal, Uri Stemmer
TL;DR
Cardinality sketches enable compact, composable representations of sets, but adaptive queries undermine standard non-adaptive guarantees, prompting a need for robust understanding of adaptivity. The authors present a universal attack framework that identifies a small determining pool and uses a core peeling strategy to drive errors under adaptive interactions, yielding near-tight bounds. They prove that any composable sketch of rank $k$ can be compromised with $\tilde{O}(k^4)$ adaptive queries, while monotone maps enjoy a tighter $\tilde{O}(k^2)$ bound; they extend the same framework to linear sketches over $\mathbb{R}$ and $\mathbb{F}_p$, achieving $\tilde{O}(k^2)$ queries. The framework also recovers and strengthens prior results for statistical queries and MinHash/HyperLogLog sketches, and highlights fundamental vulnerabilities of sketch-based systems under adaptivity with implications for differential privacy and robustness in distributed/quasi-streaming settings.
Abstract
Cardinality sketches are compact data structures for representing sets or vectors. These sketches are space-efficient, typically requiring only logarithmic storage in the input size, and enable approximation of cardinality (or the number of nonzero entries). A crucial property in applications is \emph{composability}, meaning that the sketch of a union of sets can be computed from individual sketches. Existing designs provide strong statistical guarantees, ensuring that a randomly sampled sketching map remains robust for an exponential number of queries in terms of the sketch size $k$. However, these guarantees degrade to quadratic in $k$ when queries are \emph{adaptive}, meaning they depend on previous responses. Prior works on statistical queries (Steinke and Ullman, 2015) and specific MinHash cardinality sketches (Ahmadian and Cohen, 2024) established that this is tight in that they can be compromised using a quadratic number of adaptive queries. In this work, we develop a universal attack framework that applies to broad classes of cardinality sketches. We show that any union-composable sketching map can be compromised with $\tilde{O}(k^4)$ adaptive queries and this improves to a tight bound of $\tilde{O}(k^2)$ for monotone maps (including MinHash, statistical queries, and Boolean linear maps). Similarly, any linear sketching map over the reals $\mathbb{R}$ and finite fields $\mathbb{F}_p$ can be compromised using $\tilde{O}(k^2)$ adaptive queries, which is optimal and strengthens some of the recent results by~\citet{GribelyukLWYZ:FOCS2024}, who established a weaker polynomial bound.
