skip to main content
research-article

Efficient synthesis of probabilistic programs

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

We show how to automatically synthesize probabilistic programs from real-world datasets. Such a synthesis is feasible due to a combination of two techniques: (1) We borrow the idea of ``sketching'' from synthesis of deterministic programs, and allow the programmer to write a skeleton program with ``holes''. Sketches enable the programmer to communicate domain-specific intuition about the structure of the desired program and prune the search space, and (2) we design an efficient Markov Chain Monte Carlo (MCMC) based synthesis algorithm to instantiate the holes in the sketch with program fragments. Our algorithm efficiently synthesizes a probabilistic program that is most consistent with the data. A core difficulty in synthesizing probabilistic programs is computing the likelihood L(P | D) of a candidate program P generating data D. We propose an approximate method to compute likelihoods using mixtures of Gaussian distributions, thereby avoiding expensive computation of integrals. The use of such approximations enables us to speed up evaluation of the likelihood of candidate programs by a factor of 1000, and makes Markov Chain Monte Carlo based search feasible. We have implemented our algorithm in a tool called PSKETCH, and our results are encouraging PSKETCH is able to automatically synthesize 16 non-trivial real-world probabilistic programs.

References

  1. Y. Bachrach, T. Graepel, T. Minka, and J. Guiver. How to grade a test without knowing the answers—a bayesian graphical model for adaptive crowdsourcing and aptitude testing. arXiv preprint arXiv:1206.6386, 2012.Google ScholarGoogle Scholar
  2. S. Bhat, J. Borgström, A. D. Gordon, and C. V. Russo. Deriving probability density functions from probabilistic functional programs. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS), pages 508–522, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Chib and E. Greenberg. Understanding the Metropolis-Hastings algorithm. American Statistician, 49(4):327–335, 1995.Google ScholarGoogle Scholar
  4. A. Gelman, J. B. Carlin, H. S. Stern, D. B. Dunson, A. Vehtari, and D. B. Rubin. Bayesian data analysis. CRC press, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  5. R. Gens and P. Domingos. Learning the structure of sum-product networks. In International Conference on Machine Learning (ICML), pages 873–880, 2013.Google ScholarGoogle Scholar
  6. W. R. Gilks, A. Thomas, and D. J. Spiegelhalter. A language and program for complex Bayesian modelling. The Statistician, 43(1):169– 177, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  7. V. Gogate, W. A. Webb, and P. Domingos. Learning efficient markov networks. In Neural Information Processing Systems (NIPS), pages 748–756, 2010.Google ScholarGoogle Scholar
  8. N. D. Goodman, V. K. Mansinghka, D. M. Roy, K. Bonawitz, and J. B. Tenenbaum. Church: a language for generative models. In Uncertainty in Artificial Intelligence (UAI), pages 220–229, 2008.Google ScholarGoogle Scholar
  9. A. D. Gordon, T. A. Henzinger, A. V. Nori, and S. K. Rajamani. Probabilistic programming. In Future of Software Engineering, FOSE 2014, pages 167–181, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. D. Gordon, T. A. Henzinger, A. V. Nori, and S. K. Rajamani. Probabilistic programming. In Future of Software Engineering (FOSE), pages 167–181, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Gulwani. Dimensions in program synthesis. In Principles and Practice of Declarative Programming (PPDP), 2010. http://research.microsoft.com/˜sumitg/pubs/ppdp10-synthesis.pdf. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Herbrich, T. Minka, and T. Graepel. TrueSkill: A Bayesian skill rating system. In Neural Information Processing Systems (NIPS), pages 569–576, 2006.Google ScholarGoogle Scholar
  13. M. D. Hoffman and A. Gelman. The no-U-turn sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, in press, 2013.Google ScholarGoogle Scholar
  14. J. H. Kim and J. Pearl. A computational model for causal and diagnostic reasoning in inference systems. In IJCAI, volume 83, pages 190–193. Citeseer, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Kok, M. Sumner, M. Richardson, P. Singla, H. Poon, D. Lowd, and P. Domingos. The Alchemy system for Statistical Relational AI. Technical report, University of Washington, 2007.Google ScholarGoogle Scholar
  16. D. Koller, D. A. McAllester, and A. Pfeffer. Effective Bayesian inference for stochastic programs. In National Conference on Artificial Intelligence (AAAI), pages 740–747, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Kozen. Semantics of probabilistic programs. Journal of Computer and System Science (JCSS), 22:328–350, 1981.Google ScholarGoogle Scholar
  18. P. Liang, M. I. Jordan, and D. Klein. Learning programs: A hierarchical bayesian approach. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), June 21-24, 2010, Haifa, Israel, pages 639–646, 2010.Google ScholarGoogle Scholar
  19. D. Lowd and P. Domingos. Learning arithmetic circuits. In Uncertainty in Artificial Intelligence (UAI), pages 383–392, 2008.Google ScholarGoogle Scholar
  20. D. J. C. MacKay. Information Theory, Inference & Learning Algorithms. Cambridge University Press, New York, NY, USA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C. J. Maddison and D. Tarlow. Structured generative models of natural source code. In International Conference on Machine Learning (ICML), pages 649–657, 2014.Google ScholarGoogle Scholar
  22. V. Maz’ya and G. Schmidt. On approximate approximations using gaussian kernels. IMA Journal of Numerical Analysis, 16:13–29, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  23. T. Minka, J. Winn, J. Guiver, and A. Kannan. Infer.NET 2.3, 2009.Google ScholarGoogle Scholar
  24. A. V. Nori, C.-K. Hur, S. K. Rajamani, and S. Samuel. R2: An efficient mcmc sampler for probabilistic programs. In AAAI Conference on Artificial Intelligence. AAAI Press, July 2014.Google ScholarGoogle Scholar
  25. A. Pfeffer. The design and implementation of IBAL: A generalpurpose probabilistic language. In Statistical Relational Learning, pages 399–432, 2007.Google ScholarGoogle Scholar
  26. J. Pfeffer. Probabilistic Reasoning in Intelligence Systems. Morgan Kaufmann, 1996.Google ScholarGoogle Scholar
  27. E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 305–316, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. Solar-Lezama, R. M. Rabbah, R. Bod´ık, and K. Ebcioglu. Programming by sketching for bit-streaming programs. In Programming Language Design and Implementation (PLDI), pages 281–294, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Srivastava, S. Gulwani, and J. Foster. From program verification to program synthesis. In Principles of Programming Languages (POPL), pages 313–326, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 50, Issue 6
    PLDI '15
    June 2015
    630 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2813885
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
    • cover image ACM Conferences
      PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2015
      630 pages
      ISBN:9781450334686
      DOI:10.1145/2737924

    Copyright © 2015 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 3 June 2015

    Check for updates

    Qualifiers

    • research-article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader