Functional Programming for Modular Bayesian Inference
Publication Date
2018-09Journal Title
Proceedings of the ACM on Programming Languages
ISSN
2475-1421
Publisher
Association for Computing Machinery
Volume
2
Number
83
Type
Article
This Version
VoR
Metadata
Show full item recordCitation
Ścibior, A., Kammar, O., & Ghahramani, Z. (2018). Functional Programming for Modular Bayesian Inference. Proceedings of the ACM on Programming Languages, 2 (83) https://doi.org/10.1145/3236778
Abstract
We present an architectural design of a library for Bayesian modelling and inference in modern functional programming languages. The novel aspect of our approach are modular implementations of existing state-of- the-art inference algorithms. Our design relies on three inherently functional features: higher-order functions, inductive data-types, and support for either type-classes or an expressive module system. We provide a perfor- mant Haskell implementation of this architecture, demonstrating that high-level and modular probabilistic programming can be added as a library in sufficiently expressive languages.
We review the core abstractions in this architecture: inference representations, inference transformations, and inference representation transformers. We then implement concrete instances of these abstractions, counterparts to particle filters and Metropolis-Hastings samplers, which form the basic building blocks of our library. By composing these building blocks we obtain state-of-the-art inference algorithms: Resample-Move Sequential Monte Carlo, Particle Marginal Metropolis-Hastings, and Sequential Monte Carlo Squared. We evaluate our implementation against existing probabilistic programming systems and find it is already com- petitively performant, although we conjecture that existing functional programming optimisation techniques could reduce the overhead associated with the abstractions we use. We show that our modular design enables deterministic testing of inherently stochastic Monte Carlo algorithms. Finally, we demonstrate using OCaml that an expressive module system can also implement our design.
Keywords
probabilistic programming, functional programming, Bayesian inference, higher-order functions, inductive types, type-classes, module systems, monads, monad transformers, machine learning, Anglican, WebPPL, Markov Chain Monte Carlo, Sequential Monte Carlo, Monte Carlo samplers
Sponsorship
EPSRC (1471629)
EPSRC (via University of Sheffield) (143103)
Alan Turing Institute (EP/N510129/1)
Embargo Lift Date
2100-01-01
Identifiers
External DOI: https://doi.org/10.1145/3236778
This record's URL: https://www.repository.cam.ac.uk/handle/1810/286013
Statistics
Total file downloads (since January 2020). For more information on metrics see the
IRUS guide.
Recommended or similar items
The current recommendation prototype on the Apollo Repository will be turned off on 03 February 2023. Although the pilot has been fruitful for both parties, the service provider IKVA is focusing on horizon scanning products and so the recommender service can no longer be supported. We recognise the importance of recommender services in supporting research discovery and are evaluating offerings from other service providers. If you would like to offer feedback on this decision please contact us on: support@repository.cam.ac.uk
The following licence files are associated with this item: