Optimally detecting uniformly-distributed $\ell_2$ heavy hitters in data streams
Santhoshini Velusamy, Huacheng Yu
TL;DR
The paper advances $ ext{l}_2$-heavy hitter detection in data streams under partially random order by extending BGW20’s sample-and-check paradigm. It achieves the space bound $Oigl(rac{\, extlog n}{\, extepsilon}igr)$ for identifying $ ext{l}_2$-$ ext{ε}$-heavy hitters in insertion-only streams, given a constant approximation to the second moment $F_2$ and access to a random oracle, under a uniform distribution of heavy hitters. A key contribution is the introduction of the $K$-super heavy hitter (K-SHH) framework and a multi-level execution forest that manages many candidates with limited space, enabling robust detection in partially random order streams. The results bridge random-order and adversarial streaming models and have implications for memory-efficient heavy-hitter detection in practical data environments with partial randomness.
Abstract
Given a stream $x_1,x_2,\dots,x_n$ of items from a Universe $U$ of size poly$(n)$, and a parameter $ε>0$, an item $i\in U$ is said to be an $\ell_2$ heavy hitter if its frequency $f_i$ in the stream is at least $\sqrt{εF_2}$, where $F_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 $\mathsf{CountSketch}$ algorithm due to Charikar, Chen, and Farach-Colton [2004], was the first algorithm to detect $\ell_2$ heavy hitters using $O\left(\frac{\log^2 n}ε\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 $\mathsf{BPTree}$ algorithm which detects $\ell_2$ heavy hitters in insertion-only streams using only $O\left(\frac{\log(1/ε)}ε\log n \right)$ space. Note that any algorithm requires at least $Ω\left(\frac{1}ε \log n\right)$ space to output $O(1/ε)$ heavy hitters in the worst case. While $\mathsf{BPTree}$ achieves optimal space bound for constant $ε$, their bound could be sub-optimal for $ε=o(1)$. For $\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\left(\frac{1}ε \log n\right)$ for every $ε= Ω\left(\frac{1}{2^{\sqrt{\log n}}}\right)$. In this work, we generalize their result to $\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 $F_2$ in advance.
