Probabilistic Programming
Schedule
| Type | Day | Time | Room | Start | Lecturer |
|---|---|---|---|---|---|
| Lecture | monday | - | AH II | Joost-Pieter Katoen | |
| thursday | - | AH III | Joost-Pieter Katoen | ||
| Exercise | tuesday | - | AH I | Emma Ahrens, Christina Gehnen |
Course Information
- Lecture on RWTHonline
- Exercise class on RWTHonline
- Moodle course
- Contact: probprog@moves.rwth-aachen.de
Motivation and Background
Probabilistic programs support random choices like “execute program P with probability 1/3 and program Q with probability 2/3″. Probabilistic programs are typically normal-looking sequential programs describing posterior probability distributions. Describing randomized algorithms has been the classical application of these programs. Applications in biology, machine learning, quantum computing, security, and so on, have led to a rapidly growing interest in probabilistic programs in the last decade. For almost all programming languages, such as C, C#, Prolog, Haskell, Scala, LISP, a probabilistic variant does exist; and even a variant of Microsoft’s Excel has been developed.
A simple probabilistic program that models a random walk.
Most of these languages feature, in addition to sampling from probability distributions, the ability to condition values of variables in a program. Conditioning allows for adding information about observed events into the program that may influence the posterior distribution. It is one of the key features in Bayesian networks that rely on Bayes’ rule as the basis for updating information. It is this feature that distinguishes modern probabilistic programming languages from those in the early days describing randomized algorithms.
What is special about probabilistic programs? Although probabilistic programs are normal-looking programs, reasoning about their correctness is intricate. They do not generate a single output but a distribution over outputs. The key property of program termination exemplifies this. Whereas a classical program terminates or not, this is no longer true for probabilistic programs. They can diverge, but this may happen with probability zero. That is, even if programs terminate with probability one, they may have non-terminating runs! In addition, in contrast to classical programs that either do not terminate at all or terminate in finitely many steps, a probabilistic program may take infinitely many steps on average to terminate, even if its termination probability is one.
Establishing correctness of probabilistic programs needs — even more so than ordinary programs — formal reasoning.
Lecture Contents
This lecture series will introduce the probabilistic programming language webppl, a functional language based on JavaScript with a simple web interface. Subsequently, we will go into elementary questions such as:
- What do probabilistic programs mean, exactly?
- What does it mean for a program to not terminate with some likelihood?
- How to analyze that a probabilistic program does what it is supposed to do?
- How to prove that a probabilistic program is (more) efficient?
- What are Bayesian networks and how are they related to probabilistic programs?
We will also use the new deductive verification infrastructure Caesar to verify probabilistic programs. It is being developed in our group and we will use it in the exercises to check our formal proofs. This is particularly useful for checking the correctness of own calculations and understanding simple examples.
Prerequisites
Basic knowledge of programming and probability theory.
Exercises
- There will be (approx.) 2-weekly mandatory E-tests (via Moodle). You need 50% of the total points for exam admission. The first one will be published on 26.10.
- There will be homework sheets published every week on Monday (solutions will be uploaded). You cannot submit your solutions and working on them is optional but we highly recommend it. The first one will be uploaded on 19.10. (with corresponding exercise class on 27.10.). There will be some tasks involving our tool Caesar.
- In the exercise class, we will explain some homework sheet solutions. Additionally, we will also present one old exam task, give you time to work on it and then talk about its solution (these tasks will not be uploaded).
- You can volunteer to present one task (from the homework sheets) in the exercise class. This will increase your final exam grade by one level (i.e. from 2.0 to 1.7; does not apply to 5.0!). If you volunteer to present, you should send us your solution until Sunday (2 days before presenting), we will correct it and send it back to you. Presenting (and getting bonus points) can only be done at most once per student in the semester and is optional. Details on how to volunteer will follow.
Exam
- There will be a written exam in the end of the semester.
- 1st exam: Friday, 19.02.2027 from 09:00 - 11:00 in BS II (Sammelbau Bauingenieurwesen) and 004 (Soziologie)
- 2nd exam: Monday, 15.03.2027 from 12:00 - 14:00 on BS II (Sammelbau Bauingenieurwesen)
Further Information
- Language: English
- Credits: 6 ECTS (upon passing the final exam)
Literature
The course is based several research papers and material from several books:
- Annabelle McIver and Carroll Morgan: Abstraction, Refinement and Proof for Probabilistic Systems. Springer, 2005.
- Noah Goodman and Andreas Stuhlmüller (electronic): The Design and Implementation of Probabilistic Programming Languages. 2018.
- Benjamin Lucien Kaminski: Advanced Weakest Precondition Calculi for Probabilistic Programs. Ph.D. thesis, 2019.
- Gilles Barthe, Alexandra Silva and Joost-Pieter Katoen (Eds.): Foundations of Probabilistic Programming. Cambridge University Press, 2020.
Research
Several of our researchers are working on formal semantics and verification of probabilistic programs. This includes all lecturers of this lecture and the exercise classes. If you’re interested in doing research on probabilistic programming (e.g. doing your thesis) with us, contact us!