Unmasking Vulnerabilities: Cardinality Sketches under Adaptive Inputs
Sara Ahmadian, Edith Cohen
Abstract
Cardinality sketches are popular data structures that enhance the efficiency of working with large data sets. The sketches are randomized representations of sets that are only of logarithmic size but can support set merges and approximate cardinality (i.e., distinct count) queries. When queries are not adaptive, that is, they do not depend on preceding query responses, the design provides strong guarantees of correctly answering a number of queries exponential in the sketch size . In this work, we investigate the performance of cardinality sketches in adaptive settings and unveil inherent vulnerabilities. We design an attack against the ``standard'' estimators that constructs an adversarial input by post-processing responses to a set of simple non-adaptive queries of size linear in the sketch size . Empirically, our attack used only queries with the widely used HyperLogLog (HLL++) sketch. The simple attack technique suggests it can be effective with post-processed natural workloads. Finally and importantly, we demonstrate that the vulnerability is inherent as any estimator applied to known sketch structures can be attacked using a number of queries that is quadratic in , matching a generic upper bound.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9d51dd11-e5a1-4691-847a-bbc73c3b7c41Cited by top-tier papers6
- A Strong Separation for Adversarially Robust ℓ0 Estimation for Linear SketchesElena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu et al.FOCS 2024 · 2 citations
- Adversarial Robustness on Insertion-Deletion StreamsElena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu et al.STOC 2026 · 2 citations
- The Cost of Compression: Tight Quadratic Black-Box Attacks on Sketches for ℓ2 Norm EstimationSara Ahmadian, Edith Cohen, Uri StemmerNeurIPS 2025 · 1 citation
- Breaking the Quadratic Barrier: Robust Cardinality Sketches for Adaptive QueriesEdith Cohen, Mihir Singhal, Uri StemmerICML 2025
- Adaptively Robust Resettable StreamingEdith Cohen, Elena Gribelyuk, Jelani Nelson, Uri StemmerICML 2026
Builds on11
- Adversarially Robust Streaming Algorithms via Differential PrivacyAvinatan Hassidim, Haim Kaplan, Yishay Mansour, Yossi Matias et al.NeurIPS 2020 · 85 citations
- The Flajolet-Martin Sketch Itself Preserves Differential Privacy: Private Counting with Minimal SpaceAdam D. Smith, Shuang Song, Abhradeep ThakurtaNeurIPS 2020 · 48 citations
- On Adaptive Distance EstimationYeshwanth Cherapanamjeri, Jelani NelsonNeurIPS 2020 · 34 citations
- On the Robustness of CountSketch to Adaptive InputsEdith Cohen, Xin Lyu, Jelani Nelson, Tamás Sarlós et al.ICML 2022 · 29 citations
- Tight Bounds for Adversarially Robust Streams and Sliding Windows via Difference EstimatorsDavid P. Woodruff, Samson ZhouFOCS 2021 · 25 citations
Related papers
- One Attack to Rule Them All: Tight Quadratic Bounds for Adaptive Queries on Cardinality SketchesEdith Cohen, Jelani Nelson, Tamás Sarlós, Mihir Singhal et al.SODA 2026
- Tricking the Hashing Trick: A Tight Lower Bound on the Robustness of CountSketch to Adaptive InputsEdith Cohen, Jelani Nelson, Tamás Sarlós, Uri StemmerAAAI 2023 · 14 citations
- A Better Cardinality Estimator with Fewer Bits, Constant Update Time, and MergeabilityYang Du, He Huang, Yu-e Sun, Kejian Li et al.INFOCOM 2023 · 6 citations
- Sketch-Flip-Merge: Mergeable Sketches for Private Distinct CountingJonathan Hehir, Daniel Ting, Graham CormodeICML 2023 · 12 citations
- HyperLogLogLog: Cardinality Estimation With One Log MoreMatti Karppa, Rasmus PaghKDD 2022 · 24 citations
