English

Optimally detecting uniformly-distributed $\ell_2$ heavy hitters in data streams

Data Structures and Algorithms 2026-02-10 v2

Abstract

Given a stream x1,x2,,xnx_1,x_2,\dots,x_n of items from a Universe UU of size poly(n)(n), and a parameter ϵ>0\epsilon>0, an item iUi\in U is said to be an 2\ell_2 heavy hitter if its frequency fif_i in the stream is at least ϵF2\sqrt{\epsilon F_2}, where F2=iUfi2F_2={\sum_{i\in U} f_i^2}. Efficiently detecting such heavy hitters is a fundamental problem in data streams and has several applications in both theory and in practice. The classical CountSketch\mathsf{CountSketch} algorithm due to Charikar, Chen, and Farach-Colton [2004], was the first algorithm to detect 2\ell_2 heavy hitters using O(log2nϵ)O\left(\frac{\log^2 n}{\epsilon}\right) bits of space, and their algorithm is optimal for streams with deletions. A work due to Braverman, Chestnut, Ivkin, Nelson, Wang, and Woodruff [2017] gave the BPTree\mathsf{BPTree} algorithm which detects 2\ell_2 heavy hitters in insertion-only streams using only O(log(1/ϵ)ϵlogn)O\left(\frac{\log(1/\epsilon)}{\epsilon}\log n \right) space. Note that any algorithm requires at least Ω(1ϵlogn)\Omega\left(\frac{1}{\epsilon} \log n\right) space to output O(1/ϵ)O(1/\epsilon) heavy hitters in the worst case. While BPTree\mathsf{BPTree} achieves optimal space bound for constant ϵ\epsilon, their bound could be sub-optimal for ϵ=o(1)\epsilon=o(1). For random order\textit{random order} streams, where the stream elements can be adversarial but their order of arrival is uniformly random, Braverman, Garg, and Woodruff [2020] showed that it is possible to achieve the optimal space bound of O(1ϵlogn)O\left(\frac{1}{\epsilon} \log n\right) for every ϵ=Ω(12logn)\epsilon = \Omega\left(\frac{1}{2^{\sqrt{\log n}}}\right). In this work, we generalize their result to partially random order\textit{partially random order} streams where only the heavy hitters are required to be uniformly distributed in the stream. We show that it is possible to achieve the same space bound, but with an additional assumption that the algorithm is given a constant approximation to F2F_2 in advance.

Keywords

Cite

@article{arxiv.2509.07286,
  title  = {Optimally detecting uniformly-distributed $\ell_2$ heavy hitters in data streams},
  author = {Santhoshini Velusamy and Huacheng Yu},
  journal= {arXiv preprint arXiv:2509.07286},
  year   = {2026}
}

Comments

In this version, we remove our previous result for random-order streams after becoming aware that it had already appeared in prior work by Braverman, Garg, and Woodruff [2020]. We now properly cite their result and present only our new contribution concerning partially random-order streams

R2 v1 2026-07-01T05:27:34.973Z