kth.sePublications KTH
Change search
Link to record
Permanent link

Direct link
Publications (6 of 6) Show all publications
Çaylak, G. (2024). Automated Optimizations for Inference in Probabilistic Programming Languages. (Licentiate dissertation). Stockholm: KTH Royal Institute of Technology
Open this publication in new window or tab >>Automated Optimizations for Inference in Probabilistic Programming Languages
2024 (English)Licentiate thesis, comprehensive summary (Other academic)
Abstract [en]

Probabilistic programming languages (PPLs) provide users with an interface to write probabilistic models and leave the statistical inference to the compiler and runtime systems. Ideally, the purpose of PPLs is to provide a seamless inference interface that makes the model and the inference parts modular. Yet, the structure of the user-defined model affects inference accuracy and execution time. Users can utilize certain structures, such as conjugate prior relations or tree structures within a given model, to improve inference efficiency; however, manually utilizing these structures in a model is time-consuming and error-prone. Especially as the PPL's expressiveness increases, the models may become too complex to rewrite. This thesis tackles the problems related to the automation of optimizations, improving the execution time and the accuracy of the inference based on the structure of the model. Further, it aims to make these optimizations expressive enough to handle complex models written in universal PPLs. 

The scope of this thesis is to optimize Bayesian inference in universal PPLs. The three contributions presented propose automated optimization approaches to improving the inference accuracy and execution time while preserving the expressiveness of the optimized program. The first contribution considers dynamic delayed sampling, a runtime algorithm to reduce inference variance through analytical relationships between random variables. We develop a compile-time version of the delayed sampling algorithm to reduce execution overhead. The second contribution regards the design and implementation of dynamic delayed sampling in a statically typed universal PPL, Miking CorePPL. Integrating delayed sampling into a statically typed PPL requires introducing additional constructs to the language. The third contribution is related to the forward pass of belief propagation algorithm, an efficient inference algorithm on tree graphs. We propose an approach automating this forward pass of belief propagation in statically typed universal PPLs to optimize likelihood calculations by utilizing the tree structures in a model. We evaluate the proposed approaches on real-world problems, such as topic modeling and phylogenetic problems.

Abstract [sv]

Probabilistiska programmeringsspråk (PPS) ger användare ett gränssnitt för att skriva probabilistiska modeller och överlåta den statistiska inferensen till kompilatorn och runtime-systemen. Idealiskt sett är syftet med PPS att erbjuda ett sömlöst inferencesgränssnitt som gör modell- och inferensdelarna modulära. Dock påverkas inferensens noggrannhet och exekveringstid av strukturen hos den användardefinierade modellen. Användare kan utnyttja vissa strukturer, såsom konjugerade prior-relationer eller trädsstrukturer inom en given modell, för att förbättra inferensens effektivitet; men att manuellt använda dessa strukturer i en modell är tidskrävande och felbenäget. Speciellt när PPL uttrycksförmåga ökar, kan modellerna bli för komplexa för att skrivas om på detta sätt. Denna avhandling tar itu med problemen relaterade till automatisering av optimeringar, förbättring av exekveringstid och noggrannheten hos inferens baserat på modellens struktur. Vidare fokuseras hur dessa optimeringar kan göras tillräckligt uttrycksfulla för att hantera komplexa modeller skrivna i universella PPS.

Omfattningen av denna avhandling är att optimera Bayesiansk inferens i universella PPS. De tre bidragen som presenteras föreslår automatiserade optimeringsmetoder för att förbättra inferensens noggrannhet och exekveringstid samtidigt som uttrycksfullheten hos det optimerade programmet bevaras. Det första bidraget behandlar dynamisk fördröjd sampling, en runtime-algoritm för att minska inferensens varians genom att använda analytiska relationer mellan slumpmässiga variabler. Vi utvecklar en kompileringstid-version av den fördröjda samplingalgoritmen för att minska exekveringsomkostnad. Det andra bidraget gäller design och implementering av dynamisk fördröjd sampling i Miking CorePPL, som är ett statiskt typat universellt PPS. Att integrera fördröjd sampling i ett statiskt typat PPS kräver införande av ytterligare konstruktioner i språket. Det tredje bidraget är relaterat till framåtpasset av belief propagation-algoritmen, en effektiv inferensalgoritm på trädgrafer. Vi föreslår en metod för att automatisera detta framåtpass av belief propagation i statiskt typade universella PPS för att optimera sannolikhetsberäkningar genom att utnyttja trädsstrukturer i en modell. Vi utvärderar de föreslagna metoderna på verkliga problem, såsom ämnesmodellering och fylogenetiska problem.

Place, publisher, year, edition, pages
Stockholm: KTH Royal Institute of Technology, 2024. p. vii, 29
Series
TRITA-EECS-AVL ; 2024:73
Keywords
PPL, Bayesian, Inference, Efficiency, PPS, Bayesian, Inferensen, Effektiv
National Category
Computer and Information Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-353310 (URN)978-91-8106-061-4 (ISBN)
Presentation
2024-10-14, https://kth-se.zoom.us/j/66846620144, Room Ada, Electrum, Kistagangen 16, Stockholm, 13:00 (English)
Opponent
Supervisors
Funder
Wallenberg AI, Autonomous Systems and Software Program (WASP)
Note

QC 20240918

Available from: 2024-09-18 Created: 2024-09-16 Last updated: 2024-09-23Bibliographically approved
Çaylak, G., Lundén, D., Senderov, V. & Broman, D. (2024). Statically and Dynamically Delayed Sampling for Typed Probabilistic Programming Languages. In: Laemmel, R Pereira, JA Mosses, PD (Ed.), PROCEEDINGS OF THE 17TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING, SLE 2024: . Paper presented at 17th ACM SIGPLAN International Conference on Software Language Engineering (SLE), OCT 20-21, 2024, Pasadena, CA (pp. 157-170). Association for Computing Machinery (ACM)
Open this publication in new window or tab >>Statically and Dynamically Delayed Sampling for Typed Probabilistic Programming Languages
2024 (English)In: PROCEEDINGS OF THE 17TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING, SLE 2024 / [ed] Laemmel, R Pereira, JA Mosses, PD, Association for Computing Machinery (ACM) , 2024, p. 157-170Conference paper, Published paper (Refereed)
Abstract [en]

Probabilistic programming languages (PPLs) make it possible to separate the concerns between probabilistic models and Bayesian inference algorithms. However, to make such inference efficient is technically very challenging, both in terms of execution time performance and inference accuracy. One successful optimization approach is the previously published work on dynamically delayed sampling. This runtime method makes use of analytical relations between random variables to reduce inference variance; however, tracking these relations introduces runtime overhead. Furthermore, implementing the dynamic approach in a statically typed language introduces type problems because delaying the sampling of random variables changes their types. Our work advances the state-of-the-art in two aspects. Firstly, to reduce the runtime overhead, we develop a compile-time version of delayed sampling. By incorporating optimization procedures during compilation, we eliminate the need for runtime relation tracking and consequent overhead. However, the compile-time version may not always be effective due to the program's possible dynamic behavior, such as stochastic branches, or the complexity of handling recursion. Secondly, we introduce constructs to implement dynamically delayed sampling in a statically typed universal PPL. Dynamically delayed sampling in statically typed languages is a viable optimization for complex Bayesian models, whereas simple models ought to be statically optimized. We evaluate both statically and dynamically delayed sampling on real-world examples, such as latent Dirichlet allocation and epidemiology models, and implement the methods in a statically typed PPL, Miking CorePPL.

Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2024
Keywords
Probabilistic Programming, Bayesian Inference, Delayed Sampling, Automation
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-357520 (URN)10.1145/3687997.3695634 (DOI)001344239100013 ()2-s2.0-85210864623 (Scopus ID)
Conference
17th ACM SIGPLAN International Conference on Software Language Engineering (SLE), OCT 20-21, 2024, Pasadena, CA
Note

Part of ISBN 979-8-4007-1180-0

QC 20241209

Available from: 2024-12-09 Created: 2024-12-09 Last updated: 2025-05-27Bibliographically approved
Lundén, D., Çaylak, G., Ronquist, F. & Broman, D. (2023). Automatic Alignment in Higher-Order Probabilistic Programming Languages. In: Programming Languages and Systems: . Paper presented at 32nd European Symposium on Programming, ESOP 2023, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2023, Paris, France, April 22–27, 2023. Springer Nature
Open this publication in new window or tab >>Automatic Alignment in Higher-Order Probabilistic Programming Languages
2023 (English)In: Programming Languages and Systems, Springer Nature , 2023Conference paper, Published paper (Refereed)
Abstract [en]

Probabilistic Programming Languages (PPLs) allow users to encode statistical inference problems and automatically apply an inference algorithm to solve them. Popular inference algorithms for PPLs, such as sequential Monte Carlo (SMC) and Markov chain Monte Carlo (MCMC), are built around checkpoints—relevant events for the inference algorithm during the execution of a probabilistic program. Deciding the location of checkpoints is, in current PPLs, not done optimally. To solve this problem, we present a static analysis technique that automatically determines checkpoints in programs, relieving PPL users of this task. The analysis identifies a set of checkpoints that execute in the same order in every program run—they are aligned. We formalize alignment, prove the correctness of the analysis, and implement the analysis as part of the higher-order functional PPL Miking CorePPL. By utilizing the alignment analysis, we design two novel inference algorithm variants: aligned SMC and aligned lightweight MCMC. We show, through real-world experiments, that they significantly improve inference execution time and accuracy compared to standard PPL versions of SMC and MCMC.

Place, publisher, year, edition, pages
Springer Nature, 2023
Series
Lecture Notes in Computer Science ; 13990
Keywords
Probabilistic programming, Operational semantics, Static analysis
National Category
Computer Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-324293 (URN)10.1007/978-3-031-30044-8_20 (DOI)001284040300020 ()2-s2.0-85161447105 (Scopus ID)
Conference
32nd European Symposium on Programming, ESOP 2023, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2023, Paris, France, April 22–27, 2023
Note

Part of ISBN 9783031300431, 9783031300448

QC 20251002

Available from: 2023-02-24 Created: 2023-02-24 Last updated: 2025-10-02
Çaylak, G. & Çiçek, A. E. (2020). Potpourri: An Epistasis Test Prioritization Algorithm via Diverse SNP Selection. In: 24TH INTERNATIONAL CONFERENCE ON RESEARCH IN COMPUTATIONAL MOLECULAR BIOLOGY, Padova (Italy), May 10-13, 2020.: . Paper presented at RECOMB (pp. 243-244). , 12074
Open this publication in new window or tab >>Potpourri: An Epistasis Test Prioritization Algorithm via Diverse SNP Selection
2020 (English)In: 24TH INTERNATIONAL CONFERENCE ON RESEARCH IN COMPUTATIONAL MOLECULAR BIOLOGY, Padova (Italy), May 10-13, 2020., 2020, Vol. 12074, p. 243-244Conference paper, Oral presentation with published abstract (Refereed)
Abstract [en]

Genome-wide association studies explain a fraction of the underlying heritability of genetic diseases. Investigating epistatic interactions between two or more loci help closing this gap. Unfortunately, sheer number of loci combinations to process and hypotheses to test prohibit the process both computationally and statistically. Epistasis test prioritization algorithms rank likely-epistatic SNP pairs to limit the number of tests. Yet, they still suffer from very low precision. It was shown in the literature that selecting SNPs that are individually correlated with the phenotype and also diverse with respect to genomic location, leads to better phenotype prediction due to genetic complementation. Here, we propose that an algorithm that pairs SNPs from such diverse regions and ranks them can improve prediction power. We propose an epistasis test prioritization algorithm which optimizes a submodular set function to select a diverse and complementary set of genomic regions that span the underlying genome. SNP pairs from these regions are then further ranked w.r.t. their co-coverage of the case cohort. We compare our algorithm with the state-of-the-art on three GWAS and show that (i) we substantially improve precision (from 0.003 to 0.652) while maintaining the significance of selected pairs, (ii) decrease the number of tests by 25 folds, and (iii) decrease the runtime by 4 folds. We also show that promoting SNPs from regulatory/coding regions improves the performance (up to 0.8). Potpourri is available at http:/ciceklab.cs.bilkent.edu.tr/potpourri.

Keywords
Artificial intelligence, Computer science, Computers, Molecular biology
National Category
Engineering and Technology
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-267332 (URN)10.1007/978-3-030-45257-5_22 (DOI)001508631100022 ()2-s2.0-85084249742 (Scopus ID)
Conference
RECOMB
Note

Part of proceedings ISBN 978-3-030-45256-8 978-3-030-45257-5

QC 20211207

Available from: 2020-02-06 Created: 2020-02-06 Last updated: 2025-12-08Bibliographically approved
Çaylak, G., Granqvist, E., Ronquist, F. & Broman, D.Dynamically Automated Pruning of Universal Probabilistic Programming Languages.
Open this publication in new window or tab >>Dynamically Automated Pruning of Universal Probabilistic Programming Languages
(English)Manuscript (preprint) (Other academic)
Abstract [en]

Probabilistic programming languages aim to separate the user-specified model from the inference allowing users to focus on model design and leave inference to the compiler and runtime systems. However, the structure of the model affects the inference efficiency. We can utilize specific structures in the model to improve inference efficiency, such as random variables forming trees. In this work, we propose pruning, an approach that automates the forward pass of belief propagation to improve the efficiency of likelihood calculations in statically typed universal probabilistic programming languages (PPLs) by utilizing the tree structures within a model. Specifically, users annotate variables for marginalization, making the likelihood calculation more efficient. We present our method implemented in the probabilistic programming language Miking CorePPL and demonstrate the performance of our approach through a series of case studies in phylogenetics.

National Category
Computer and Information Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-353281 (URN)
Funder
Wallenberg AI, Autonomous Systems and Software Program (WASP)
Note

Submitted for publication

QC 20240918

Available from: 2024-09-15 Created: 2024-09-15 Last updated: 2024-09-18Bibliographically approved
Çaylak, G., Lundén, D., Senderov, V. & Broman, D.Statically and Dynamically Delayed Sampling for Typed Probabilistic Programming Languages.
Open this publication in new window or tab >>Statically and Dynamically Delayed Sampling for Typed Probabilistic Programming Languages
(English)Manuscript (preprint) (Other academic)
Abstract [en]

Probabilistic programming languages (PPLs) make it possible to separate the concerns between probabilistic models and Bayesian inference algorithms. However, to make such inference efficient is technically very challenging, both in terms of execution time performance and inference accuracy. One successful optimization approach is the previously published work on dynamically delayed sampling. This runtime method makes use of analytical relations between random variables to reduce inference variance; however, tracking these relations introduces runtime overhead. Furthermore, implementing the dynamic approach in a statically typed language introduces type problems because delaying the sampling of random variables changes their types. Our work advances the state-of-the-art in two aspects. Firstly, to reduce the runtime overhead, we develop a compile-time version of delayed sampling. By incorporating optimization procedures during compilation, we eliminate the need for runtime relation tracking and consequent overhead. However, the compile-time version may not always be effective due to the program's possible dynamic behavior, such as stochastic branches, or the complexity of handling recursion. Secondly, we introduce constructs to implement dynamically delayed sampling in a statically typed universal PPL. Dynamically delayed sampling in statically typed languages is a viable optimization for complex Bayesian models, whereas simple models ought to be statically optimized. We evaluate both statically and dynamically delayed sampling on real-world examples, such as latent Dirichlet allocation and phylogenetic models, and implement the methods in a statically typed PPL, Miking CorePPL.

National Category
Computer and Information Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-353280 (URN)
Funder
Wallenberg AI, Autonomous Systems and Software Program (WASP)
Note

Accepted to the ACM SIGPLAN International Conference on Software Language Engineering 2024

QC 20240918

Available from: 2024-09-15 Created: 2024-09-15 Last updated: 2024-09-18Bibliographically approved
Organisations
Identifiers
ORCID iD: ORCID iD iconorcid.org/0000-0001-9703-6912

Search in DiVA

Show all publications