Skip to main content
QUICK REVIEW

[Paper Review] New Cardinality Estimation Methods for HyperLogLog Sketches

Otmar Ertl|arXiv (Cornell University)|Jun 20, 2017
Advanced Image and Video Retrieval TechniquesComputer Science16 references7 citations
TL;DR

This paper introduces two new cardinality estimation methods for HyperLogLog (HLL) sketches that are unbiased across the full cardinality range. The first method improves the original HLL estimator using theoretically derived corrections, while the second applies maximum likelihood (ML) estimation to jointly model two HLL sketches, significantly enhancing accuracy for set operations like intersection and union compared to the inclusion-exclusion principle.

ABSTRACT

This work presents new cardinality estimation methods for data sets recorded by HyperLogLog sketches. A simple derivation of the original estimator was found, that also gives insight how to correct its deficiencies. The result is an improved estimator that is unbiased over the full cardinality range, is easy computable, and does not rely on empirically determined data as previous approaches. Based on the maximum likelihood principle a second unbiased estimation method is presented which can also be extended to estimate cardinalities of union, intersection, or relative complements of two sets that are both represented as HyperLogLog sketches. Experimental results show that this approach is more precise than the conventional technique using the inclusion-exclusion principle.

Motivation & Objective

  • To address the bias and accuracy limitations of the original HyperLogLog estimator across the full cardinality range.
  • To develop a method that avoids reliance on empirically tuned parameters or patchwork estimators.
  • To extend HLL cardinality estimation to set operations (union, intersection, relative complement) with improved precision.
  • To provide a theoretically grounded, unbiased alternative to existing empirically calibrated HLL estimators.
  • To explore the potential of HLL sketches for locality-sensitive hashing using ML-based Jaccard distance estimation.

Proposed method

  • Derives a corrected version of the original HLL estimator using a simple theoretical derivation based on the underlying distribution of register values.
  • Applies the maximum likelihood (ML) principle to the joint likelihood function of two HLL sketches to estimate cardinalities of set operations.
  • Uses the sufficient statistic of HLL registers (register values) to construct the likelihood function for ML estimation.
  • Employs the Broyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm to numerically maximize the likelihood function for joint estimation.
  • Simplifies the joint probability model under Poisson approximation to enable analytical insights and bounds on register equality probabilities.
  • Proposes a method to estimate Jaccard distances between sets represented as HLL sketches using ML-based intersection and union estimates.

Experimental results

Research questions

  • RQ1Can a theoretically derived correction improve the original HLL estimator without relying on empirical data?
  • RQ2Can maximum likelihood estimation be effectively applied to two HLL sketches to improve intersection and union cardinality estimates?
  • RQ3How does the ML-based joint estimation method compare in accuracy to the conventional inclusion-exclusion principle for set operations?
  • RQ4Can HLL sketches be used as a basis for locality-sensitive hashing, and what is the theoretical justification for this?
  • RQ5What is the relationship between register value equality and Jaccard distance in HLL sketches under Poisson approximation?

Key findings

  • The proposed corrected estimator is unbiased across the entire cardinality range and does not require empirically tuned parameters.
  • The ML-based method for two HLL sketches significantly reduces estimation error for intersections, unions, and relative complements compared to the inclusion-exclusion principle.
  • The ML estimator achieves higher precision than conventional methods, especially when the resulting cardinality is small relative to input sizes.
  • Theoretical analysis shows that the probability of equal register values in two HLL sketches depends on the Jaccard distance, supporting HLL's potential for locality-sensitive hashing.
  • The approximation of register equality probability using logarithmic integrals yields tight bounds that validate the ML approach's theoretical foundation.
  • The ML method enables more accurate Jaccard distance estimation by combining precise estimates of intersection and union sizes from HLL sketches.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.