Tricking the Hashing Trick: A Tight Lower Bound on the Robustness of CountSketch to Adaptive Inputs
Edith Cohen, Jelani Nelson, Tamás Sarlós, Uri Stemmer
Abstract
CountSketch and Feature Hashing (the "hashing trick") are popular randomized dimensionality reduction methods that support recovery of ℓ2-heavy hitters (keys i where v 2 i > ǫ v 2 2 ) and approximate inner products. When the inputs are not adaptive (do not depend on prior outputs), classic estimators applied to a sketch of size O(ℓ/ǫ) are accurate for a number of queries that is exponential in ℓ. When inputs are adaptive, however, an adversarial input can be constructed after O(ℓ) queries with the classic estimator and the best known robust estimator only supports Õ(ℓ 2 ) queries. In this work we show that this quadratic dependence is in a sense inherent: We design an attack that after O(ℓ 2 ) queries produces an adversarial input vector whose sketch is highly biased. Our attack uses "natural" non-adaptive inputs (only the final adversarial input is chosen adaptively) and universally applies with any correct estimator, including one that is unknown to the attacker. In that, we expose inherent vulnerability of this fundamental method.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
10 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Adaptive Machine Unlearning cites Adversarially Robust Streaming Algorithms via Differential Privacy
- A Strong Separation for Adversarially Robust ℓ0 Estimation for Linear Sketches cites Adversarially Robust Streaming Algorithms via Differential Privacy
- A Strong Separation for Adversarially Robust ℓ0 Estimation for Linear Sketches cites On the Robustness of CountSketch to Adaptive Inputs
- A Strong Separation for Adversarially Robust ℓ0 Estimation for Linear Sketches cites Unmasking Vulnerabilities: Cardinality Sketches under Adaptive Inputs
- On the Robustness of CountSketch to Adaptive Inputs cites Adaptive Machine Unlearning
- On the Robustness of CountSketch to Adaptive Inputs cites Oblivious Sketching of High-Degree Polynomial Kernels
- On the Robustness of CountSketch to Adaptive Inputs cites Adversarially Robust Streaming Algorithms via Differential Privacy
- Unmasking Vulnerabilities: Cardinality Sketches under Adaptive Inputs cites Adversarially Robust Streaming Algorithms via Differential Privacy
- Unmasking Vulnerabilities: Cardinality Sketches under Adaptive Inputs cites On the Robustness of CountSketch to Adaptive Inputs
- The Cost of Compression: Tight Quadratic Black-Box Attacks on Sketches for ℓ2 Norm Estimation cites Adversarially Robust Streaming Algorithms via Differential Privacy
- The Cost of Compression: Tight Quadratic Black-Box Attacks on Sketches for ℓ2 Norm Estimation cites A Strong Separation for Adversarially Robust ℓ0 Estimation for Linear Sketches
- The Cost of Compression: Tight Quadratic Black-Box Attacks on Sketches for ℓ2 Norm Estimation cites On the Robustness of CountSketch to Adaptive Inputs
- The Cost of Compression: Tight Quadratic Black-Box Attacks on Sketches for ℓ2 Norm Estimation cites Unmasking Vulnerabilities: Cardinality Sketches under Adaptive Inputs
- Adversarial Robustness on Insertion-Deletion Streams cites Adversarially Robust Streaming Algorithms via Differential Privacy
- Adversarial Robustness on Insertion-Deletion Streams cites Unmasking Vulnerabilities: Cardinality Sketches under Adaptive Inputs
Cited by top-tier papers10
- Unmasking Vulnerabilities: Cardinality Sketches under Adaptive InputsSara Ahmadian, Edith CohenICML 2024 · 7 citations
- Learning Together Securely: Prototype-Based Federated Multi-Modal Hashing for Safe and Efficient Multi-Modal RetrievalRuifan Zuo, Chaoqun Zheng, Lei Zhu, Wenpeng Lu et al.AAAI 2025 · 4 citations
- 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
Builds on11
- FetchSGD: Communication-Efficient Federated Learning with SketchingDaniel Rothchild, Ashwinee Panda, Enayat Ullah, Nikita Ivkin et al.ICML 2020 · 425 citations
- Adaptive Machine UnlearningVarun Gupta, Christopher Jung, Seth Neel, Aaron Roth et al.NeurIPS 2021 · 262 citations
- Adversarially Robust Streaming Algorithms via Differential PrivacyAvinatan Hassidim, Haim Kaplan, Yishay Mansour, Yossi Matias et al.NeurIPS 2020 · 85 citations
- Oblivious Sketching of High-Degree Polynomial KernelsThomas D. Ahle, Michael Kapralov, Jakob Bæk Tejs Knudsen, Rasmus Pagh et al.SODA 2020 · 42 citations
- On the Robustness of CountSketch to Adaptive InputsEdith Cohen, Xin Lyu, Jelani Nelson, Tamás Sarlós et al.ICML 2022 · 29 citations
Related papers
- CountSketches, Feature Hashing and the Median of ThreeKasper Green Larsen, Rasmus Pagh, Jakub TetekICML 2021 · 10 citations
- Breaking the Quadratic Barrier: Robust Cardinality Sketches for Adaptive QueriesEdith Cohen, Mihir Singhal, Uri StemmerICML 2025
- Lifting Linear Sketches: Optimal Bounds and Adversarial RobustnessElena Gribelyuk, Honghao Lin, David P. Woodruff, Huacheng Yu et al.STOC 2025 · 1 citation
- 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
- Compact Frequency Estimators in Adversarial EnvironmentsSam A. Markelon, Mia Filic, Thomas ShrimptonCCS 2023 · 4 citations
