Bayesian inference is a powerful tool for data analysis, but it often becomes computationally prohibitive when applied to massive datasets. Standard Markov chain Monte Carlo (MCMC) methods require a full pass over all $N$ data points to compute a single transition, making them slow for "tall" data. In this work, presented at AISTATS 2024, the authors introduce Coreset MCMC, a novel approach that scales Bayesian inference by building a small, weighted subset of data—a "coreset"—on the fly.
The Challenge of Large-Scale Inference
Existing solutions for scaling MCMC generally fall into two categories, each with significant drawbacks:
- Subsampling MCMC: Methods like Stochastic Gradient Langevin Dynamics (SGLD) use random mini-batches. However, they often require model-specific "control variates" to manage variance or suffer from slow convergence.
- Bayesian Coresets: These involve finding a small subset of $M$ points ($M \ll N$) and assigning weights so their "mini-posterior" matches the full posterior. Traditionally, constructing these coresets requires an expensive "inner-loop" optimization that is difficult to tune and can be slower than the inference itself.
Coreset MCMC bridges this gap by providing a method that is simple to implement, easy to tune, and computationally efficient.
Methodology: Interleaved Sampling and Optimization
The core innovation of Coreset MCMC is a "meta-algorithm" that interleaves two processes:
- Sampling: It runs $K$ parallel Markov chains targeting the current coreset posterior.
- Weight Updating: It uses the samples from those chains to update the coreset weights via Stochastic Gradient Descent (specifically using the ADAM optimizer).
Crucially, the authors use a specific gradient identity for the Kullback–Leibler (KL) divergence that involves a covariance term. This allows them to estimate the gradient of the "distance" between the coreset posterior and the true posterior using only the MCMC draws and a small subsample of the full data. Unlike previous methods, Coreset MCMC is kernel-agnostic—it can be used with any MCMC sampler (e.g., Slice sampling, HMC) and does not require a separate pre-processing step to find weights.
Key Insights and Results
The authors evaluated Coreset MCMC on several benchmarks, including flight delay data ($N \approx 98,000$), bikeshare data ($N \approx 15,000$), and synthetic sparse regression. Several key insights emerged:
- Dual-Purpose Draws: The MCMC draws serve as both the inference output and the training data for weight optimization, eliminating the need for expensive inner-loop optimizations.
- Parallelization Benefits: Increasing the number of chains ($K$) improves the gradient estimate for the weights. Since these chains run in parallel, accuracy improves without a significant wall-clock time penalty.
- Efficiency and Stability: Coreset MCMC was 2 to 10 times faster to train than competing coreset methods like Quasi-Newton Coresets (QNC). It also outperformed standard subsampling MCMC methods in terms of "Effective Sample Size (ESS) per second" by roughly two orders of magnitude while remaining stable in complex models where other methods failed.
Limitations and Future Outlook
While Coreset MCMC represents a significant advancement, it relies on the assumption that an "exact" coreset exists to achieve perfect convergence. In complex models, a small coreset may only provide an approximation, leading to residual error. Additionally, while easier to tune than previous methods, it still requires selecting a learning rate for weight updates. Future work may explore better initialization strategies to help the stochastic optimization identify posterior modes more quickly in high-dimensional spaces.
Overall, Coreset MCMC offers a practical and scalable path for Bayesian inference in large-scale engineering and data science applications.
Summary updated