Abstract
Effective implementations of sampling-based probabilistic inference often require manually constructed, model-specific proposals. Inspired by recent progresses in meta-learning for training learning agents that can generalize to unseen environments, we propose a meta-learning approach to building effective and generalizable MCMC proposals. We parametrize the proposal as a neural network to provide fast approximations to block Gibbs conditionals. The learned neural proposals generalize to occurrences of common structural motifs across different models, allowing for the construction of a library of learned inference primitives that can accelerate inference on unseen models with no model-specific training required. We explore several applications including open-universe Gaussian mixture models, in which our learned proposals outperform a hand-tuned sampler, and a real-world named entity recognition task, in which our sampler yields higher final F1 scores than classical single-site Gibbs sampling.
Introduction
Probabilistic inference is a cornerstone of modern AI, yet standard Markov Chain Monte Carlo (MCMC) methods often struggle with complex dependencies. While single-site Gibbs sampling is easy to implement, it frequently fails when variables are tightly coupled or exhibit near-deterministic relationships. In such scenarios, the sampler becomes trapped in local modes, necessitating the manual design of "block proposals" by domain experts. This paper introduces Neural Block Sampling, a framework that automates the creation of these proposals by training neural networks to approximate block-Gibbs conditionals for recurring structural patterns.
Methodology: Learning to Sample
The core innovation lies in treating the proposal design as a meta-learning problem. Instead of training a sampler for a specific model, the authors train a network to understand the relationship between a model's local structure and its posterior distribution.
Structural Motifs and Parameter Agnosticism
The approach focuses on "motifs"—recurring local subgraphs such as chain segments or grid patches. By identifying these motifs within a larger model, the system can apply specialized sampling logic locally.
To ensure generalization, the proposal is parameterized as a Mixture Density Network (MDN). Crucially, this network takes the local model parameters (e.g., weights or conditional probability tables) as input. This "parameter-agnostic" design allows the same neural network to generate proposals for the same motif even when the underlying numerical values change across different problem instances.
Ensuring Correctness
Because the neural network provides an approximation of the true conditional distribution, the proposed values are passed through a Metropolis-Hastings (MH) step. This ensures that the Markov chain converges to the correct target distribution, maintaining the theoretical guarantees of MCMC even if the neural approximation is imperfect.
Experimental Evaluation
The authors evaluated Neural Block Sampling across three distinct domains:
- UAI Grid Models: On 180 binary-valued grid Bayesian Networks from the UAI 2008 Inference Competition, the neural sampler significantly outperformed single-site Gibbs. The advantage was most prominent in models with high determinism, where standard methods often fail to move.
- Open-Universe GMMs: In synthetic Gaussian Mixture Models with an unknown number of components, the learned proposals outperformed hand-tuned "split-merge" samplers (SDDS), exploring the cluster space more efficiently.
- Named Entity Recognition (NER): Applied to the CoNLL-2003 dataset modeled as a Conditional Random Field (CRF), the neural sampler achieved higher F1 scores than classical Gibbs sampling, demonstrating that improved mixing translates to better real-world performance.
Discussion and Future Work
Neural Block Sampling demonstrates that "amortized inference" can be achieved across models by focusing on structural primitives. While current motifs are manually identified, future work could involve automated motif detection. Additionally, while the current meta-learning is static, future iterations could use the MH acceptance rate as a reward signal for online fine-tuning. By building a library of these inference primitives, we can move toward "black-box" MCMC that is both efficient and truly generalizable.
Summary updated