Probabilistic Inference by Program Transformation in Hakaru (System Description)

  • Praveen NarayananEmail author
  • Jacques Carette
  • Wren Romano
  • Chung-chieh Shan
  • Robert Zinkov
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9613)


We present Hakaru, a new probabilistic programming system that allows composable reuse of distributions, queries, and inference algorithms, all expressed in a single language of measures. The system implements two automatic and semantics-preserving program transformations—disintegration, which calculates conditional distributions, and simplification, which subsumes exact inference by computer algebra. We show how these features work together by describing the ideal workflow of a Hakaru user on two small problems. We highlight our composition of transformations and types in design and implementation.


  1. 1.
    Carette, J., Kiselyov, O., Shan, C.-c.: Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. J. Funct. Program. 19(5), 509–543 (2009)Google Scholar
  2. 2.
    Carette, J., Shan, C.-c.: Simplifying probabilistic programs using computer algebra (2015).
  3. 3.
    Giry, M.: A categorical approach to probability theory. In: Banaschewski, B. (ed.) Categorical Aspects of Topology and Analysis. Lecture Notes in Mathematics, vol. 915, pp. 68–85. Springer, Heidelberg (1982)CrossRefGoogle Scholar
  4. 4.
    Goodman, N.D., Mansinghka, V.K., Roy, D., Bonawitz, K., Tenenbaum, J.B.: Church: A language for generative models. In: Proceedings of the 24th Conference on Uncertainty in Artificial Intelligence, pp. 220–229. AUAI Press (2008)Google Scholar
  5. 5.
    Goodman, N.D., Stuhlmüller, A.: The design and implementation of probabilistic programming languages. (2014). Accessed 20 November 2015
  6. 6.
    Kiselyov, O., Shan, C.-c.: Embedded probabilistic programming. In: Taha, W.M. (ed.) DSL 2009. LNCS, vol. 5658, pp. 360–384. Springer, Heidelberg (2009)Google Scholar
  7. 7.
    MacKay, D.J.C.: Introduction to Monte Carlo methods. In: Jordan, M.I. (ed.): Learning and Inference in Graphical Models. Kluwer (1998)Google Scholar
  8. 8.
    Mansinghka, V.K., Selsam, D., Perov, Y.N.: Venture: a higher-order probabilistic programming platform with programmable inference. CoRR abs/1404.0099 (2014).
  9. 9.
    Pearl, J.: Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, San Francisco (1988). revised 2nd printing (1998)zbMATHGoogle Scholar
  10. 10.
    Ramsey, N., Pfeffer, A.: Stochastic lambda calculus and monads of probability distributions. In: Conference Record of the Annual ACM Symposium on Principles of Programming Languages POPL 2002, pp. 154–165. ACM Press (2002)Google Scholar
  11. 11.
    Ścibior, A., Ghahramani, Z., Gordon, A.D.: Practical probabilistic programming with monads. In: Proceedings of the 8th ACM SIGPLAN Symposium on Haskell, pp. 165–176. ACM (2015)Google Scholar
  12. 12.
    Shan, C.-c., Ramsey, N.: Symbolic Bayesian inference by lazy partial evaluation (2015).
  13. 13.
    Wood, F., van de Meent, J.W., Mansinghka, V.: A new approach to probabilistic programming inference. In: Proceedings of the 17th International conference on Artificial Intelligence and Statistics, pp. 1024–1032 (2014)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Praveen Narayanan
    • 1
    Email author
  • Jacques Carette
    • 2
  • Wren Romano
    • 1
  • Chung-chieh Shan
    • 1
  • Robert Zinkov
    • 1
  1. 1.Indiana UniversityBloomingtonUSA
  2. 2.McMaster UniversityHamiltonCanada

Personalised recommendations