Table of Contents
Fetching ...

Near-Optimal Relative Error Streaming Quantile Estimation via Elastic Compactors

Elena Gribelyuk, Pachara Sawettamalya, Hongxun Wu, Huacheng Yu

TL;DR

This work presents a nearly-optimal streaming algorithm for the relative-error quantile estimation problem using $\tilde O(\epsilon^{-1}\log(\epsilon n))$ space, which almost matches the trivial $\Omega(\epsilon^{-1} \log (\epsilon n))$ lower bound.

Abstract

Computing the approximate quantiles or ranks of a stream is a fundamental task in data monitoring. Given a stream of elements $x_1, x_2, \dots, x_n$ and a query $x$, a relative-error quantile estimation algorithm can estimate the rank of $x$ with respect to the stream, up to a multiplicative $\pm ε\cdot \mathrm{rank}(x)$ error. Notably, this requires the sketch to obtain more precise estimates for the ranks of elements on the tails of the distribution, as compared to the additive $\pm εn$ error regime. Previously, the best-known algorithms for relative error achieved space $\tilde O(ε^{-1}\log^{1.5}(εn))$ (Cormode, Karnin, Liberty, Thaler, Vesel{y}, 2021) and $\tilde O(ε^{-2}\log(εn))$ (Zhang, Lin, Xu, Korn, Wang, 2006). In this work, we present a nearly-optimal streaming algorithm for the relative-error quantile estimation problem using $\tilde O(ε^{-1}\log(εn))$ space, which almost matches the trivial $Ω(ε^{-1} \log (εn))$ lower bound. To surpass the $Ω(ε^{-1}\log^{1.5}(εn))$ barrier of the previous approach, our algorithm crucially relies on a new data structure, called an elastic compactor, which can be dynamically resized over the course of the stream. Interestingly, we design a space allocation scheme which adaptively allocates space to each compactor based on the "hardness" of the input stream. This approach allows us to avoid using the maximal space simultaneously for every compactor and facilitates the improvement in the total space complexity. Along the way, we also propose and study a new problem called the Top Quantiles Problem, which only requires the sketch to provide estimates for a fixed-length tail of the distribution. This problem serves as an important subproblem in our algorithm, though it is also an interesting problem of its own right.

Near-Optimal Relative Error Streaming Quantile Estimation via Elastic Compactors

TL;DR

This work presents a nearly-optimal streaming algorithm for the relative-error quantile estimation problem using space, which almost matches the trivial lower bound.

Abstract

Computing the approximate quantiles or ranks of a stream is a fundamental task in data monitoring. Given a stream of elements and a query , a relative-error quantile estimation algorithm can estimate the rank of with respect to the stream, up to a multiplicative error. Notably, this requires the sketch to obtain more precise estimates for the ranks of elements on the tails of the distribution, as compared to the additive error regime. Previously, the best-known algorithms for relative error achieved space (Cormode, Karnin, Liberty, Thaler, Vesel{y}, 2021) and (Zhang, Lin, Xu, Korn, Wang, 2006). In this work, we present a nearly-optimal streaming algorithm for the relative-error quantile estimation problem using space, which almost matches the trivial lower bound. To surpass the barrier of the previous approach, our algorithm crucially relies on a new data structure, called an elastic compactor, which can be dynamically resized over the course of the stream. Interestingly, we design a space allocation scheme which adaptively allocates space to each compactor based on the "hardness" of the input stream. This approach allows us to avoid using the maximal space simultaneously for every compactor and facilitates the improvement in the total space complexity. Along the way, we also propose and study a new problem called the Top Quantiles Problem, which only requires the sketch to provide estimates for a fixed-length tail of the distribution. This problem serves as an important subproblem in our algorithm, though it is also an interesting problem of its own right.

Paper Structure

This paper contains 59 sections, 21 theorems, 74 equations, 10 figures, 3 tables, 4 algorithms.

Key Result

Theorem 1

Let $0 < \delta \leq 0.5$ and $0 < \epsilon \leq 1$. There is a randomized, comparison-based, one-pass streaming algorithm that, when processing a stream $\pi$ consisting of $n$ elements, produces a sketch satisfying the following: for any query $x \in \mathcal{U}$, the sketch returns an estimate $\ where the probability is over the internal randomness of the streaming algorithm. Moreover, the tot

Figures (10)

  • Figure 1: Compacting the largest $\ell$ blocks in a relative compactor.
  • Figure 2: Our basic strategy.
  • Figure 3: Structure of $H$
  • Figure \ref{fig:basic}: Our basic strategy. (repeated from page \ref{['fig:basic']})
  • Figure \ref{fig:basic}: Tree-like intervals.
  • ...and 5 more figures

Theorems & Definitions (54)

  • Theorem 1
  • Corollary 2
  • proof
  • Lemma 4
  • Lemma 4
  • Lemma 4
  • Remark 5
  • Lemma 5
  • Remark 6
  • Lemma 7
  • ...and 44 more