Introduction
In fields such as Bayesian inference and Monte Carlo integration, researchers often generate massive sets of sample points ($n$) to represent complex probability distributions. However, downstream applications—such as high-fidelity heart simulations or complex ecological models—often impose strict limits on the number of points that can be processed. This creates a need for "distribution compression" or "thinning": the process of selecting a small, high-quality subset (a "coreset") of size $\sqrt{n}$ that accurately represents the original distribution.
The Challenge: Speed vs. Accuracy
Traditional thinning methods, like simple subsampling, are fast but often result in high approximation errors. Conversely, state-of-the-art methods like Kernel Thinning (KT) provide near-optimal accuracy but suffer from a major computational bottleneck: their runtime scales quadratically ($O(n^2)$) with the number of input points. For a dataset with a million points, $O(n^2)$ scaling becomes prohibitively slow, requiring days of computation on high-performance clusters.
Methods: The Compress++ Meta-Procedure
This paper introduces Compress++, a meta-algorithm that accelerates slow, high-accuracy thinning procedures to near-linear $O(n \text{ polylog } n)$ time. The approach relies on two key innovations:
- COMPRESS (Divide-and-Conquer): This algorithm recursively splits the input points into smaller groups, compresses them, and recombines them using a "halving" primitive. The theoretical foundation of this method is that randomized decisions made during recursion allow errors to cancel out rather than accumulate, maintaining high fidelity to the original distribution.
- COMPRESS++ (Two-Stage Refinement): This is the full pipeline. It first uses the fast
COMPRESSroutine to reduce the initial $n$ points to a slightly larger intermediate coreset. Then, it applies a high-accuracy but slower thinning algorithm (like KT) only to this much smaller intermediate set.
By offloading the bulk of the computation to the near-linear stage, Compress++ makes high-quality compression practical for million-point datasets on standard hardware.
Evaluation and Results
The authors evaluated Compress++ on a variety of targets, including synthetic Gaussian mixtures and real-world Markov Chain Monte Carlo (MCMC) samples from differential equation posteriors in ecology and cardiology.
Performance Gains
The empirical results demonstrate massive speedups. For a 100-dimensional dataset with 250,000 points, the standard Kernel Thinning algorithm takes over 24 hours to complete. In contrast, KT-Compress++ finishes in less than an hour—a 32x speedup. Similar improvements were observed for Kernel Herding, which saw a 45x speedup.
Maintaining Accuracy
Crucially, these speedups come with minimal loss in accuracy. Across all benchmarks, the error (measured by Maximum Mean Discrepancy, or MMD) of the Compress++ variants closely tracked the performance of the original $O(n^2)$ algorithms. In some low-dimensional cases, the meta-procedure even improved the accuracy of the underlying herding algorithm.
Conclusion
Compress++ represents a significant step forward in making high-quality distribution summaries accessible. By reducing the computational complexity of thinning from quadratic to near-linear, it enables researchers to process larger datasets and more complex models without sacrificing statistical accuracy. This "near-linear" transformation changes distribution compression from an overnight cluster job into a routine task that can be performed in minutes on a laptop.
Summary updated