A New Algorithm for Compressed Counting with Applications in Shannon Entropy Estimation in Dynamic Data

Ping Li, Cun-Hui ZhangCOLT 2011

Abstract

Estimating Shannon entropy in massive, high-speed data streams is a critical task for network monitoring and data analysis. This paper presents a novel algorithm based on Compressed Counting (CC) using maximally-skewed stable random projections. By introducing a new estimator, $\hat{J}_{(\alpha)}$, the authors achieve near-perfect statistical optimality, effectively decoupling sample complexity from the approximation parameter $\Delta = 1 - \alpha$. Empirical results on real-world web crawl data demonstrate significant variance reduction compared to existing methods like Conditional Random Sampling.

Introduction

In the era of "Big Data," many applications involve Turnstile streams—dynamic sequences where values are frequently added or deleted. Calculating the Shannon entropy of these streams is essential for detecting anomalies such as DDoS attacks or understanding data distributions. However, exact calculation is often infeasible due to memory constraints. Approximation methods typically leverage the $\alpha$-th frequency moment as $\alpha \to 1$. A major hurdle has been the "variance explosion" as $\alpha$ approaches 1, which previously required a prohibitively large number of samples to maintain accuracy.

Methodology

The proposed approach utilizes Compressed Counting (CC) with maximally-skewed stable distributions for random projections. Unlike standard symmetric stable distributions, these skewed distributions allow for more efficient information capture. The core of the algorithm involves:

  1. Random Projections: Creating a compact "sketch" or summary of the massive data vector by multiplying it with a random matrix.
  2. The $\hat{J}_{(\alpha)}$ Estimator: A simple average of transformed sketch entries: $$\hat{J}_{(\alpha)} = \frac{\Delta}{k} \sum_{j=1}^k x_j^{-\alpha/\Delta}$$
  3. Statistical Analysis: Using Fisher Information to demonstrate that the estimator is nearly 100% statistically optimal, approaching the theoretical Cramér-Rao lower bound.

Theoretical Optimality and Stability

A key breakthrough of this work is the reduction of sample complexity. Previous algorithms scaled with $O(\frac{1}{\nu^2 \Delta})$ or $O(\frac{1}{\nu^2 \Delta^2})$. The new CC algorithm achieves a complexity of $O(1/\nu^2)$, removing the dependency on $\Delta$. This means that as the approximation gets closer to the true Shannon entropy limit, the computational cost does not grow exponentially.

Relative efficiency measures ($G_R$ and $G_L$) as a function of the parameter $\nu$ for various values of $\Delta$. The convergence of the curves for $\Delta = 10^{-2}$ and $\Delta = 10^{-6}$ illustrates the stability of the estimator as it approaches the entropy limit.

Empirical Results

The algorithm was tested on web crawl data representing various levels of sparsity (from common words like "A" to rare words like "TWIST"). Key findings include:

  • High Accuracy: As few as 10 samples ($k=10$) provided remarkably accurate entropy estimates.
  • Stability: Performance stabilized for $\Delta < 10^{-3}$, meaning practitioners do not need to fine-tune $\alpha$ to extreme decimals to achieve reliable results.
  • Superiority over CRS: Compared to Conditional Random Sampling (CRS), the CC algorithm showed variance reductions ranging from 2.1x to 113.7x, depending on the data's sparsity.

Conclusion and Future Work

This research provides a statistically optimal and computationally efficient framework for entropy estimation in dynamic streams. While the current implementation uses dense matrices, the authors suggest that future work exploring sparse random projections could further reduce computational overhead, making the algorithm even more suitable for hardware-level implementation in high-speed network routers.

Summary updated

BibTeX
@article{li2011new,
  author = {Ping Li and Cun-Hui Zhang},
  title = {{A New Algorithm for Compressed Counting with Applications in Shannon Entropy Estimation in Dynamic Data}},
  journal = {COLT},
  year = {2011},
}
Figure