[Paper Review] Back to the Future: an Even More Nearly Optimal Cardinality Estimation Algorithm
This paper introduces a new cardinality estimation algorithm based on the Flajolet-Martin-85 (FM85) sketch with three novel estimators, achieving superior space efficiency and accuracy over compressed HyperLogLog (HLL) sketches. By leveraging zstd compression and analyzing the entropy of FM85 and HLL, the authors demonstrate that compressed FM85 sketches are smaller than the entropy of HLL, making them more space-efficient while simultaneously outperforming HLL in accuracy and speed across all three dimensions of the time/space/accuracy tradeoff.
We describe a new cardinality estimation algorithm that is extremely space-efficient. It applies one of three novel estimators to the compressed state of the Flajolet-Martin-85 coupon collection process. In an apples-to-apples empirical comparison against compressed HyperLogLog sketches, the new algorithm simultaneously wins on all three dimensions of the time/space/accuracy tradeoff. Our prototype uses the zstd compression library, and produces sketches that are smaller than the entropy of HLL, so no possible implementation of compressed HLL can match its space efficiency. The paper's technical contributions include analyses and simulations of the three new estimators, accurate values for the entropies of FM85 and HLL, and a non-trivial method for estimating a double asymptotic limit via simulation.
Motivation & Objective
- To develop a more space-efficient and accurate cardinality estimation algorithm than existing HyperLogLog (HLL) implementations.
- To demonstrate that FM85 sketches, when combined with novel estimators and compression, can outperform HLL in all three dimensions: time, space, and accuracy.
- To precisely compute the asymptotic entropy of FM85 and HLL sketches, enabling a fair comparison of space efficiency.
- To introduce and validate three new estimators for FM85 that improve accuracy over the original FM85 estimator.
- To develop a non-trivial simulation method for estimating the double asymptotic limit that defines the Error Constant in cardinality estimation.
Proposed method
- The algorithm applies three novel estimators—ICON, MDL, and Historic Inverse Probability—to the compressed state of the FM85 sketch, which tracks the leftmost uncollected coupon in each of k rows.
- The FM85 sketch is compressed using the zstd library at compression level 1, enabling space efficiency beyond theoretical limits of HLL.
- Entropy is calculated using arithmetic coding with probabilities derived from the cumulative collection likelihood of each coupon, based on the number of draws n.
- The Error Constant is estimated via a non-trivial simulation method that approximates the double asymptotic limit of the Root Mean Squared Error divided by n as k→∞ and n→∞.
- An apples-to-apples comparison is conducted between compressed FM85 and compressed HLL using identical k values (k=2^15 for FM85, k=2^16 for HLL) to ensure fair accuracy comparison.
- The HLL sketch is compressed directly via zstd, while the FM85 sketch uses the same compression pipeline, allowing direct comparison of compressed sizes and performance.
Experimental results
Research questions
- RQ1Can FM85 sketches with novel estimators achieve better accuracy per bit of entropy than HLL sketches?
- RQ2Is it possible to compress FM85 sketches to sizes smaller than the entropy of HLL sketches, enabling superior space efficiency?
- RQ3Do the new estimators for FM85 significantly improve accuracy over the original FM85 estimator and existing HLL estimators?
- RQ4Can a simulation-based method accurately estimate the double asymptotic limit that defines the Error Constant in cardinality estimation?
- RQ5Does the combination of FM85 with advanced estimators and zstd compression yield a system that outperforms HLL in all three dimensions: time, space, and accuracy?
Key findings
- The entropy of FM85 sketches is approximately 4.70×k bits, while HLL sketches have an entropy of 2.83×k bits, indicating that HLL is inherently more compressible.
- The Error Constant for the new ICON estimator is 0.693, which is below the threshold of 0.807 required to outperform HLL in accuracy per bit, making it superior to HLL.
- Compressed FM85 sketches are smaller than the entropy of HLL, meaning no possible HLL implementation using known estimators can match FM85’s space efficiency.
- In empirical benchmarks, FM85 with the ICON estimator is more accurate than HLL’s standard estimator, and FM85 with the MDL estimator outperforms HLL’s MDL estimator.
- FM85 is faster than HLL despite sending twice as many bytes to zstd, due to the higher compressibility of its sketch state.
- The prototype processes 1 billion items in 4.3 seconds, demonstrating practical performance suitable for production use.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.