NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Simpler Distribution Testing with Little Memory

Clément L. Canonne, Joy Qiping Yang

TL;DR

This paper presents simpler algorithms for testing if a data distribution is uniform, especially when memory is severely limited (streaming setting). The new algorithms match existing lower bounds and relax previous parameter restrictions, making distribution testing more accessible in resource-constrained environments.

What Problem Does This Paper Address?

Imagine you have a stream of data, and you want to know if it's coming from a perfectly uniform distribution or if it's significantly different. This is the problem of uniformity testing. The challenge here is that you can only store a tiny amount of information (limited memory, measured in bits) as the data streams in. This is crucial for applications like network monitoring or sensor data analysis where memory is scarce.

Previous work tackled this but often with complex algorithms or strict limitations on the parameters (like the size of the data domain or the desired accuracy). This paper aims to simplify these algorithms and broaden their applicability by removing some of these restrictions while still achieving the best possible performance in terms of sample and memory trade-offs. They also extend their findings to the related problem of closeness testing, where you want to know if two data streams come from the same distribution or if they are significantly different.

Methods

The authors introduce two main algorithmic approaches:

  1. Testing via Repetition (Deterministic Algorithm): This method leverages a known uniformity testing statistic (related to the total variation distance from uniform). The core idea is to divide the incoming data stream into many small batches. For each batch, they compute this statistic. By averaging these statistics over many batches, they can reliably detect deviations from uniformity. The clever part is how they manage memory: they only need to store the running average and a few parameters, keeping the memory footprint low. This approach is deterministic, meaning it always produces the same output for the same input.
  2. Domain Compression (Randomized Algorithm): This approach uses a technique called "domain compression," which is essentially a form of randomized hashing. The idea is to map the original, potentially large, data domain to a smaller domain. This allows them to store counts (histograms) of the data in the smaller domain within their limited memory. Once the data is "compressed," they can use a standard, sample-optimal uniformity testing algorithm on these counts. This method is randomized because it relies on the hash function (the partition).

Datasets

Not discussed in the paper. The paper focuses on theoretical algorithms and their performance guarantees on abstract data streams, not on specific real-world datasets.

Key Insights and Ideas

  • Simplicity is Key: The paper emphasizes that simpler algorithms with elementary proofs can achieve state-of-the-art results, making these techniques more accessible.
  • Trade-offs are Fundamental: The core of the work lies in understanding and optimizing the trade-off between the number of samples needed (n), the available memory (m), the domain size (k), and the accuracy (ε).
  • Repetition for Robustness: The "testing via repetition" strategy is a classic technique in property testing, and here it's cleverly adapted to the streaming memory constraint by batching.
  • Domain Compression as a General Tool: The domain compression technique is shown to be a powerful primitive that can be applied not just to uniformity testing but also to other distribution testing problems like closeness testing.
  • Deterministic vs. Randomized: The paper presents both a deterministic and a randomized algorithm, highlighting that in some memory regimes, randomization might offer better performance.

Key Results

The paper presents three main theoretical results (theorems):

  • Theorem 1.1 (Deterministic Uniformity Testing): Achieves optimal sample complexity for uniformity testing under memory constraints, with a sample size n proportional to k log k / ε^m. This holds for memory m in the range log k < m < min(n log k, k log k).
  • Theorem 1.2 (Randomized Uniformity Testing): Offers a different, often better, sample complexity for uniformity testing when memory is very low (m << (log k) / ε^4). The sample size n is proportional to k * sqrt(log n) / ε^2 * sqrt(m). This holds for memory m in the range log k < m <= k log n.
  • Theorem 1.3 (Randomized Closeness Testing): Extends the domain compression technique to closeness testing, achieving optimal sample complexity for this problem under memory constraints. The sample size n depends on k, ε, and m in a more complex way, reflecting the difficulty of closeness testing.

Crucially, by plugging in the maximum allowed memory (m = n log k or m = k log n), these results recover the well-known optimal sample complexities for uniformity and closeness testing in the unconstrained setting.

Limitations and Future Work

  • Lower Bound Optimality: While the paper provides upper bounds that match existing lower bounds, it leaves open the question of whether these lower bounds can be improved to prove the optimality of their specific tradeoffs across all parameter regimes.
  • Generalizability of Domain Compression: The authors suggest exploring which other distribution testing problems can benefit from the domain compression approach.
  • Deterministic vs. Randomized Separation: They propose investigating if there are specific parameter regimes where deterministic algorithms are fundamentally weaker than randomized ones for uniformity testing, similar to what's known in communication complexity.

Summary updated

BibTeX
@inproceedings{canonne2024simpler,
  author = {Clément L. Canonne and Joy Qiping Yang},
  title = {{Simpler Distribution Testing with Little Memory}},
  booktitle = {SOSA},
  year = {2024},
  doi = {10.1137/1.9781611977936.37},
}
Figure