Lower Bounds for Pseudo-Deterministic Counting in a Stream

Vladimir Braverman, Robert Krauthgamer, Aditya Krishnan, Shay Sapir

TL;DR

This paper establishes the first non-trivial space lower bounds for pseudo-deterministic approximate counting in data streams. The authors prove that requiring a randomized algorithm to consistently output the same "canonical" result across different runs forces a significant increase in memory—from the $O(\log \log n)$ bits used by standard randomized counters to at least $\Omega(\sqrt{\log n / \log \log n})$ bits.

What Problem Does This Paper Address?

In the world of data streams, memory is the scarcest resource. To process massive datasets, researchers typically rely on two relaxations: approximation (getting close to the right answer) and randomization (being right most of the time). For the fundamental task of counting $n$ items, these relaxations allow the famous Morris’s counter to use just $O(\log \log n)$ bits of space, whereas a deterministic algorithm requires $\Omega(\log n)$.

However, randomized algorithms have a frustrating quirk: if you run the same algorithm twice on the same data, you might get two different answers because of different "random coins." This makes debugging and reproducibility difficult. Pseudo-deterministic (PD) algorithms solve this by guaranteeing that for any input, they output the same "canonical" solution with high probability.

The central question this paper tackles is: Does this requirement for consistency come at a space cost? Specifically, can a PD algorithm match the exponential space savings of standard randomized algorithms for approximate counting?

Methods

The authors prove their lower bound using a reduction from a new problem they introduce called Shift Finding.

  1. The Shift Finding Problem: Imagine you have a known string $F$ that starts with many zeros and ends with many ones. You are given query access to a version of $F$ that has been shifted by some unknown amount $s^*$. The goal is to find $s^*$ using as few queries as possible.
  2. The Connection: The authors show that if a PD streaming algorithm uses very little space, it can be used to solve the Shift Finding problem with very few queries. By proving that Shift Finding is "hard" (requires many queries), they imply that the streaming algorithm must use "a lot" of space.
  3. Communication Complexity: They formalize this using one-way communication complexity. Alice (who knows the shift) sends the state of the streaming algorithm to Bob. Bob then uses that state to simulate queries and solve the Shift Finding problem. If Bob succeeds, the message Alice sent must have been large enough to encode the necessary information.
  4. Case Analysis: The proof splits into two scenarios based on the "canonical function" of the PD algorithm—essentially looking at how many times the output changes from 0 to 1 as the stream grows. They use binary search for "rare" changes and random sampling for "frequent" changes to bound the complexity in both cases.

Key Insights and Ideas

  • The "Canonical Function" as a Map: A PD algorithm effectively defines a fixed, deterministic mapping from every possible stream to a specific output value. The authors exploit this fixed mapping to treat the algorithm's internal state as a reliable "message" that can be queried.
  • Shift Finding as a Bridge: By translating a streaming problem (space-constrained) into a query problem (query-constrained), the authors provide a new toolkit for proving lower bounds in pseudo-determinism.
  • The Tracking Penalty: The paper highlights that "tracking" (providing a correct count at every single step of the stream) is much harder for PD algorithms than for standard randomized ones, requiring $\Omega(\log n)$ space—essentially no better than deterministic counting.

Key Results

The paper provides a detailed landscape of the space requirements for approximate counting, summarized in the table below:

Known space bounds (in bits) for 2-approximate counting in a stream of length at most n.
  • Main Lower Bound: Every PD streaming algorithm that $c$-approximates the count must use $\Omega(\sqrt{\log n / \log \log n})$ bits of space. This effectively answers a 2020 open question by showing that PD algorithms cannot match the $O(\log \log n)$ space of Morris's counter.
  • Shift Finding Algorithm: The authors provide a deterministic algorithm to solve the Shift Finding problem using $O(\sqrt{cn})$ queries.
  • Tracking Bound: For PD algorithms that must be correct at every time step (tracking), they prove a tight $\Omega(\log n)$ lower bound.

Limitations and Future Work

  • Tightness of the Bound: While the $\Omega(\sqrt{\log n / \log \log n})$ bound is a significant step, it is not yet tight. The authors note that a concurrent, independent work (Grossman et al., 2023) uses a different Markov chain-based technique to show a tight $\Omega(\log n)$ bound.
  • Shift Finding Complexity: The authors leave it as an open question whether Shift Finding can be solved in $poly(\log n)$ queries. If it can, their specific technique would immediately yield a nearly-tight $\Omega(\log n / \log \log n)$ space bound for PD counting.
  • Generalization: A natural next step is applying these techniques to more complex streaming problems, such as estimating $\ell_p$ norms or frequency moments, where the gap between randomized and deterministic space complexity is even larger.

Summary updated

BibTeX
@inproceedings{braverman2023lower,
  author = {Vladimir Braverman and Robert Krauthgamer and Aditya Krishnan and Shay Sapir},
  title = {{Lower Bounds for Pseudo-Deterministic Counting in a Stream}},
  booktitle = {ICALP},
  year = {2023},
  doi = {10.4230/lipics.icalp.2023.30},
}
Figure