Probabilistic programming has emerged as a powerful paradigm by decoupling modelling from inference. However, users often encounter a frustrating "leaky abstraction": the way a model is written drastically changes how well the inference engine works. This paper introduces a way to automatically "reshape" probabilistic models to make them much easier for computers to solve, developing two new algorithms—iHMC and VIP—that significantly improve the speed and reliability of Bayesian inference without requiring manual tuning.
The Problem: Leaky Abstractions and Neal's Funnel
A classic example of this leaky abstraction is Neal’s Funnel, a geometry where one variable controls the variance of another. Standard algorithms like Hamiltonian Monte Carlo (HMC) often get "stuck" in the narrow neck of the funnel. Experts usually fix this by manually rewriting the model using a "non-centred parameterisation" (NCP), which transforms the funnel into a nice, easy-to-sample sphere.
However, manual rewriting is difficult. It requires deep statistical knowledge, breaks the separation between the model and the solver, and the "best" way to write the model often depends on the specific dataset being used. The authors aim to automate this process so that users can write intuitive models while the system handles the heavy lifting of finding the best geometry for inference.
Proposed Methods: iHMC and VIP
The authors leverage effect handlers (a feature in modern Probabilistic Programming Languages like Edward2 and Pyro) to intercept and transform "sample" statements in a program at runtime. They propose two main strategies:
- Interleaved HMC (iHMC): This algorithm alternates between two different geometries, taking one step in the "centred" space and the next in the "non-centred" space. This makes the sampler robust; if one geometry is bad for a certain part of the posterior, the other likely compensates for it.
- Variationally Inferred Parameterisation (VIP): This is the paper's most novel contribution. The authors define a continuous space of parameterisations using a variable $\lambda \in [0, 1]$, where $\lambda=1$ is centred and $\lambda=0$ is non-centred. They use Variational Inference (VI) to optimize $\lambda$ alongside the model parameters. Essentially, the system "learns" the best coordinate system for the specific dataset before it starts sampling.
Key Insights: The Parameterisation Spectrum
A major takeaway from this work is that the "best" parameterisation is actually a spectrum. Traditionally, researchers chose strictly between "centred" or "non-centred." VIP shows that the optimal choice is often somewhere in between (partial centring), and this optimal point shifts depending on how much data you have (data strength).
Furthermore, the authors found that the Evidence Lower Bound (ELBO)—a metric from Variational Inference—correlates well with how efficiently an MCMC sampler will run. By maximizing the ELBO, they are effectively "pre-conditioning" the model for HMC. Unlike "black-box" methods that try to learn a complex warping of the space using neural networks, this approach is "white-box." It uses the existing structure of the probabilistic program to perform simple, interpretable transformations that are computationally cheap.
Results and Performance
The authors evaluated their methods on several classic Bayesian hierarchical models, including the Eight Schools problem, Radon levels in US homes, German Credit, and Election '88.
- Robustness: In cases where standard HMC failed catastrophically (yielding almost zero "effective samples"), both iHMC and VIP provided reliable results.
- Efficiency: On the German Credit dataset, VIP-HMC achieved an Effective Sample Size (ESS) per gradient evaluation that was more than 3x higher than both the centred and non-centred baselines.
- Automation: The system successfully found the "correct" parameterisation for different states in the Radon dataset automatically, whereas a human would have had to tune each state's model individually.
Limitations and Future Work
The current implementation of VIP assumes that the posterior can be well-approximated by a diagonal Gaussian after transformation. It might struggle with models that have heavy tails (like Cauchy distributions) or highly non-linear structural dependencies (like complex time series).
Additionally, while $\lambda$ covers a wide range of common reparameterisations, other types (like "whitening" multivariate Gaussians) aren't yet fully automated in this framework. Finally, like all variational methods, the VIP optimization is non-convex and could occasionally get stuck in local optima during the pre-processing phase. The authors suggest that future work could involve using symbolic algebra to automatically detect even more complex hierarchical structures in programs, further reducing the burden on the human modeller.
Summary updated