Pseudorandom Hashing for Space-bounded Computation with Applications in Streaming

Praneeth Kacham, Rasmus Pagh, Mikkel Thorup, David P. Woodruff

Abstract

Streaming algorithms are essential for processing high-volume data on the fly using minimal memory. However, many of these algorithms rely on the assumption of "true" randomness, which is impractical to store. While Nisan’s Pseudorandom Generator (PRG) has served as the theoretical standard for space-bounded computation since 1990, it introduces a significant "derandomization tax" in the form of logarithmic update times. This paper introduces HashPRG, a symmetric generalization of Nisan’s generator that offers a tunable trade-off between memory and speed. HashPRG enables the first time-optimal ($O(1)$ update) derandomizations for several fundamental streaming problems, including $F_p$ moment estimation and CountSketch.

1. Introduction

In the turnstile model of streaming, a high-dimensional vector $x \in \mathbb{R}^d$ undergoes a sequence of updates. To estimate properties of $x$ using sublinear space, researchers utilize linear sketches—random projections of the data. While these sketches are theoretically sound under full randomness, the memory required to store the random bits often exceeds the memory of the algorithm itself.

To mitigate this, Pseudorandom Generators (PRGs) are used to expand a small, storable "seed" into a long string of bits. The challenge lies in the computational cost: evaluating these generators during every update can significantly slow down data processing. HashPRG addresses this bottleneck by reimagining the structure of space-bounded PRGs to prioritize update efficiency without sacrificing the rigorous guarantees required for derandomization.

2. The HashPRG Architecture

HashPRG evolves the classical binary tree structure of Nisan’s PRG into a more flexible framework characterized by two primary innovations:

2.1 $b$-way Branching and Larger Alphabets

Nisan’s generator typically utilizes a binary tree, requiring a depth of $\log(L)$ to generate $L$ bits. HashPRG employs a $b$-way branching tree. By increasing the "alphabet size" (the amount of data processed at each node), the depth of the evaluation tree is reduced. This allows for faster computation of specific blocks of pseudorandom bits. In the Word RAM model, this architecture allows for a block of bits to be computed in $O(k)$ time using a seed of size $O(bkn)$.

2.2 The Symmetry Property

Unlike its predecessors, HashPRG is designed to be symmetric. Specifically, if the indices of the output blocks are XORed, the distribution of the resulting string remains invariant. This symmetry is a breakthrough for analyzing complex structures like CountSketch, as it allows the analysis to treat specific parts of the random string as statistically identical without simulating the entire generation process.

3. Methodology

The authors evaluate HashPRG within the Word RAM model, comparing its performance against established theoretical lower bounds. A key methodological contribution is the "reduction to smaller Finite State Machines (FSMs)." The authors demonstrate that to derandomize many streaming algorithms, a PRG does not need to fool the entire complex algorithm; it only needs to fool a simplified FSM that tracks the algorithm's internal state transitions. This insight allows HashPRG to achieve high performance while maintaining theoretical robustness.

4. Key Results and Applications

The application of HashPRG to "white whale" problems in streaming yields significant improvements over the state-of-the-art:

  • $F_p$ Estimation ($p > 2$): HashPRG provides the first derandomization with $O(1)$ update time and optimal space, removing the reliance on "random oracle" assumptions.
  • $F_p$ Estimation ($0 < p < 2$): In high-accuracy regimes, update times were improved from $O(\log^2 (1/\epsilon) \log \log (1/\epsilon))$ to $O(\log d)$.
  • CountSketch: The framework enables a derandomization that matches the space complexity of a random oracle, eliminating the logarithmic space blowup previously required by Nisan's PRG.
  • $\ell_\infty$ Estimation: The paper introduces a new algorithm using $O(\epsilon^{-2} \log d)$ bits to estimate the maximum element with additive error, a result proven to be optimal.

5. Discussion and Limitations

HashPRG represents a significant shift in the trade-off between time and space in derandomization. While it achieves $O(1)$ update times, this efficiency comes at the cost of a seed length of $d^\epsilon$ (where $\epsilon$ is a small constant). Although $d^\epsilon$ is still sublinear relative to the vector dimension $d$, it is larger than the polylogarithmic seeds used by slower, more memory-efficient generators.

6. Conclusion

HashPRG breaks a decades-old speed barrier in space-bounded computation. By introducing symmetry and $b$-way branching to PRG construction, the authors provide a practical path toward derandomizing high-speed streaming applications. Future research may extend these principles to other domains, such as graph algorithms and complexity theory, where Nisan’s PRG has long been the only viable, albeit slow, option.

Summary updated

BibTeX
@inproceedings{kacham2023pseudorandom,
  author = {Praneeth Kacham and Rasmus Pagh and Mikkel Thorup and David P. Woodruff},
  title = {{Pseudorandom Hashing for Space-bounded Computation with Applications in Streaming}},
  booktitle = {FOCS},
  year = {2023},
  doi = {10.1109/focs57990.2023.00093},
}
Figure