TL;DR
This paper introduces a novel "white-box" inference algorithm that learns directly from the structure of probabilistic programs. They then present a meta-learning approach to train this algorithm, enabling it to generalize to new programs and achieve competitive or superior test-time efficiency compared to traditional methods like HMC.
What Problem Does This Paper Address?
Probabilistic programming languages (PPLs) are powerful tools for expressing complex probabilistic models. However, efficiently inferring the posterior distribution of these models is a significant challenge. While general-purpose inference algorithms exist, they often struggle with performance and universality. Researchers have explored ways to customize inference, but this paper tackles the problem from a different angle: instead of manually tuning inference, they propose learning an inference algorithm itself from a set of example probabilistic programs. This learned algorithm should be efficient and generalize to unseen but similar programs.
Methods
The core innovation is a white-box inference algorithm. Unlike traditional black-box methods that treat programs as opaque, this algorithm inspects the program's structure. It breaks down a probabilistic program into its atomic commands (like sampling, observation, or assignment) and uses a separate neural network for each command type. These networks process the program's structure and internal state to compute an approximate posterior distribution.
The meta-learning aspect involves training the parameters of these neural networks. The authors define an optimization objective that balances minimizing the difference between the learned posterior and the true posterior (using KL divergence) with minimizing the error in estimating the marginal likelihood. This objective is optimized using stochastic gradient descent.
Datasets
The paper does not introduce new datasets. Instead, they generate synthetic datasets of probabilistic programs for various model classes (e.g., Gaussian, hierarchical, clustering, Milky Way models, Rosenbrock function) to train and evaluate their meta-learning approach. These programs are generated randomly with varying parameters and structures.
Key Insights and Ideas
- Program Structure as Inference Signal: The most significant insight is that the explicit structure of a probabilistic program contains valuable information that can be directly leveraged for inference, rather than treating it as a black box.
- Meta-Learning Inference: The idea of learning an entire inference algorithm, rather than just tuning its components, is a powerful paradigm shift. This allows for more adaptive and potentially more efficient inference tailored to specific classes of models.
- Generalization through Structure: By learning from program structures, the approach shows promise for generalizing to new programs with unseen parameters or even slightly different structures, as long as they belong to the same learned class.
- Efficiency Gains: The white-box approach, by processing the program sequentially and using neural networks, can achieve significant speedups over traditional methods like HMC, especially when high accuracy is not strictly required or when dealing with complex models.
Key Results
- The learned inference algorithm demonstrated good generalization to unseen programs in terms of both parameters and model structures across various model classes.
- In several experiments, the proposed approach achieved higher test-time efficiency (measured by ESS per second) compared to HMC and other importance sampling methods. For instance, in one comparison, their method achieved the highest ESS per unit time, with significant speedups over HMC.
- The learned algorithm was able to accurately capture marginal posteriors, often matching or exceeding the accuracy of HMC, especially in cases where HMC struggled to converge.
Limitations and Future Work
- Scalability: The meta-algorithm does not currently scale well to very large programs or state-space models with many time steps due to computational constraints.
- Program Size Generalization: The learned inference algorithm does not generalize to programs with significantly different sizes (e.g., from clustering models with two clusters to ten clusters).
- Multimodality: Handling models with multimodal posteriors remains a challenge, as the training samples might be biased towards a single mode. The authors suggest exploring multiple Markov chains and advanced mixing techniques.
- Independence Assumption: The current approach relies on a mean-field Gaussian assumption for the approximating distribution, which could be relaxed to capture richer dependency structures.
Future work includes addressing these limitations, exploring automatic guide generation, and investigating the interaction between program compilation and meta-learned inference.
Summary updated