Simple and Optimal Algorithms for Heavy Hitters and Frequency Moments in Distributed Models

Zengfeng Huang, Zhongzheng Xiong, Xiaoyi Zhu, Zhewei Wei

This paper, recently uploaded to arXiv, presents a significant theoretical breakthrough in distributed computing. The authors provide the first near-optimal, communication-efficient algorithms for two fundamental data analysis tasks—identifying "Heavy Hitters" and estimating frequency moments—across both static and continuous monitoring models.

TL;DR

The authors introduce a suite of simple, sampling-based algorithms that achieve near-optimal communication costs for distributed heavy hitters and frequency moments ($F_p$ for $p \ge 2$). By utilizing a novel thresholding trick and a method to dynamize non-linear sampling, they close long-standing complexity gaps in both the one-shot coordinator model and the continuous distributed tracking model.

What Problem Does This Paper Address?

In modern big data systems, information is often spread across many geographically distant nodes. Moving all this data to a central coordinator to calculate statistics is prohibitively expensive due to bandwidth constraints. Researchers instead aim to design algorithms where nodes send only tiny "sketches" or samples to a coordinator.

The paper focuses on two core problems:

  1. $\ell_p$ Heavy Hitters (HH): Finding items whose frequency is a significant fraction of the total "energy" (the $\ell_p$ norm) of the dataset.
  2. Frequency Moments ($F_p$): Estimating the sum of the $p$-th powers of all item frequencies, which is a proxy for data skew and diversity.

While these problems are well-understood for $p=2$ (the variance), they become exponentially harder for $p > 2$. Previous solutions either required too many rounds of communication, had costs that scaled poorly with the number of nodes ($k$), or depended on the total size of the "universe" of possible items ($n$).

Methods

The authors depart from traditional "sketching" techniques (like Count-Min or Count-Sketch) and instead lean into sampling-based approaches.

  • The $\ell_2$-HH Foundation: They first build a simple sampling algorithm for $\ell_2$ heavy hitters. Each site sends an item to the coordinator with a probability proportional to the square of its local frequency. This provides a very clean unbiased estimator.
  • The Thresholding Trick: To solve the harder $\ell_p$ case ($p > 2$), the authors introduce a "sparsification" step. Nodes ignore any item with a frequency below a certain threshold before running the $\ell_2$ algorithm. This simple move effectively eliminates the problematic dependence on the universe size ($n$) that plagued previous attempts.
  • Piece-wise Linear Dynamization: In the "tracking" model (where data is a continuous stream), sampling based on squared frequency is difficult because the probabilities change non-linearly as new items arrive. The authors solve this by approximating the quadratic sampling function with a piece-wise linear one, allowing nodes to "track" when an item needs to be reported without constant communication.
  • Recursive Sketching: They adapt a sophisticated technique from streaming literature called "recursive sketching" to the distributed environment to estimate $F_p$ moments using their new heavy hitter algorithms as a building block.

Datasets

Not discussed in the paper. This is a purely theoretical work focused on proving mathematical bounds and algorithmic complexity. No empirical experiments or real-world datasets were used for evaluation.

Key Insights and Ideas

  • Simplicity is Optimal: One of the most striking aspects of the paper is that the proposed algorithms are significantly simpler than previous state-of-the-art methods (such as those presented at STOC 2024), yet they achieve better or equal communication bounds.
  • $\ell_2$ as a Universal Tool: The paper demonstrates that a robust $\ell_2$ heavy hitter algorithm, when combined with clever thresholding, is powerful enough to solve the more general $\ell_p$ problem.
  • Bridging Static and Dynamic Models: By developing a general technique for sampling from non-linear probabilities in a tracking model, the authors provide a framework that could potentially be applied to other distributed monitoring problems beyond just frequency moments.

Key Results

The paper establishes several "firsts" and "bests" in communication complexity (using $\tilde{O}$ to hide logarithmic factors):

  • $\ell_p$ Heavy Hitters: They achieved a communication cost of $\tilde{O}(k^{p-1}/\epsilon^p)$, which is the first near-optimal result for $p > 2$ in the coordinator model.
  • $F_p$ Estimation (Tracking): They provided the first near-optimal algorithm for tracking $F_p$ moments with a cost of $\tilde{O}(k^{p-1}/\epsilon^2)$. This even improves upon 15-year-old bounds for the $F_2$ case.
  • One-Round $F_p$: They significantly improved the one-round communication cost for $F_p$ in the coordinator model, moving from previous polynomial dependencies on $\epsilon$ to a much more efficient $\tilde{O}(k^{p-1}/\epsilon^{p+2})$.

Limitations and Future Work

  • The One-Round Gap: While the authors improved the one-round $F_p$ estimation, a gap still exists between their upper bound ($\epsilon^{p+2}$) and the known lower bound ($\epsilon^p$). Closing this specific gap remains an open challenge.
  • Theoretical vs. Practical: As a theoretical paper, it does not account for the constant factors that might make these algorithms perform differently in a real-world network with latency and packet loss.
  • Non-Negative Assumption: The current algorithms assume non-negative frequency vectors (insertions only). Extending these optimal bounds to "turnstile" streams (where items can also be deleted) is a logical next step.

Summary updated

BibTeX
@inproceedings{huang2025simple,
  author = {Zengfeng Huang and Zhongzheng Xiong and Xiaoyi Zhu and Zhewei Wei},
  title = {{Simple and Optimal Algorithms for Heavy Hitters and Frequency Moments in Distributed Models}},
  booktitle = {STOC},
  year = {2025},
  doi = {10.1145/3717823.3718199},
}

Loading related content...

Figure