TL;DR
This paper introduces "inference combinators," a novel DSL for building custom importance samplers for probabilistic programs. This framework allows for the creation of user-programmable, correct-by-construction inference strategies that can be learned and adapted, paving the way for more flexible and powerful probabilistic machine learning models.
What Problem Does This Paper Address?
Probabilistic programming languages (PPLs) are powerful tools for defining complex probabilistic models. However, performing inference (i.e., estimating model parameters or latent variables) in these models, especially for structured or complex domains, remains a significant challenge. While deep learning has enabled amortized variational inference, these methods often struggle with structured domains where simple gradient estimates are insufficient. Existing approaches that combine variational inference with more advanced sampling techniques like MCMC or importance sampling are often difficult to implement generically within PPLs because they require deep knowledge of the underlying model's structure. This paper addresses this gap by proposing a new approach to "inference programming" – a language for defining inference strategies that operate on probabilistic programs, rather than just defining the models themselves.
Methods
The core contribution is the introduction of inference combinators, which form a DSL for constructing importance samplers. These combinators are elementary operations that can be composed to define complex sampling strategies. The key combinators include:
extend(p, f): Composes a target programpwith a primitive programf(acting as a kernel) to define a density on an extended space.compose(q', q): Chains two inference programsq'andq, allowing the output of one to be the input of the other.propose(p, q): Uses samples from an inference programqas proposals for a target programp. This is crucial for learning proposals and handles cases where the proposal and target might not share the same set of variables.resample(q): Performs importance resampling on the samples, weights, traces, and density maps generated by an inference programq.
The paper formalizes the semantics of these combinators, proving that they preserve "proper weighting," a property ensuring that the generated samples are correctly weighted with respect to the target density. This allows for the construction of user-programmable, correct-by-construction inference algorithms. The framework is implemented in Probabilistic Torch, and the learned proposals are trained using variational objectives.
Datasets
Not discussed in the paper. The paper focuses on a framework and its evaluation on synthetic tasks and existing benchmarks for object tracking.
Key Insights and Ideas
- Separation of Concerns: The paper elegantly separates the definition of probabilistic models (the "modeling language") from the definition of inference strategies (the "inference language"). This allows for reusable and composable inference components.
- "Correct by Construction" Inference: By defining inference combinators with formal semantics that guarantee proper weighting, the framework ensures that the resulting samplers are statistically sound, reducing the burden on the user to manually verify correctness.
- Composability for Advanced Inference: The combinator-based approach makes it significantly easier to implement complex, state-of-the-art inference methods (like annealed importance sampling and amortized population Gibbs) that would be cumbersome to build from scratch.
- Learning Proposals as Programs: The
proposecombinator, in particular, allows inference programs themselves to be used as proposals, enabling nested learning of inference strategies and facilitating advanced techniques like nested variational inference.
Key Results
The paper demonstrates the flexibility and power of inference combinators through two main experiments:
- Annealed Variational Inference: The framework was used to implement an annealed importance sampler that learned intermediate densities and annealing schedules. Results (reported in Table 1) showed that learning the annealing schedule (NVI*) improved sample quality (log expected weight and ESS) compared to standard annealed variational objectives (AVO).
- Amortized Population Gibbs (APG) for Object Tracking: The combinator DSL was used to implement APG samplers for an unsupervised multi-object tracking task. The APG sampler, trained using the proposed framework, outperformed a baseline RWS sampler and a hand-coded HMC-RWS method on a fixed computational budget (Table 2). Qualitative results (Figure 4) showed the model could identify, track, and reconstruct objects in video frames.
Limitations and Future Work
- Technical Rigor: While the paper provides formal semantics and proofs of proper weighting, the authors acknowledge that fully addressing measurability issues for higher-order functions in probabilistic programming requires advanced theoretical work (referencing Ścibior et al., 2017). However, they argue these issues are not problematic in practice with current PPLs.
- Denotational Semantics: The full denotational semantics for inference programs are relegated to an appendix due to space limitations, but are stated to be straightforward extensions of primitive program semantics.
- Future Work: The authors suggest that this framework opens up opportunities to develop novel nested variational methods for probabilistic programs. The ability to learn proposals and generative models simultaneously through composable inference strategies is a key direction. The paper also hints at further exploration of objectives for learning proposals at multiple levels of nesting.
Summary updated