Abstract
Statistical phylogenetic analysis currently relies on complex, dedicated software packages, making it difficult for evolutionary biologists to explore new models and inference strategies. Recent years have seen more generic solutions based on probabilistic graphical models, but this formalism can only partly express phylogenetic problems. Here, we show that universal probabilistic programming languages (PPLs) solve the expressivity problem, while still supporting automated generation of efficient inference algorithms. To prove the latter point, we develop automated generation of sequential Monte Carlo (SMC) algorithms for PPL descriptions of arbitrary biological diversification (birth-death) models. SMC is a new inference strategy for these problems, supporting both parameter inference and efficient estimation of Bayes factors that are used in model testing. We take advantage of this in automatically generating SMC algorithms for several recent diversification models that have been difficult or impossible to tackle previously. Finally, applying these algorithms to 40 bird phylogenies, we show that models with slowing diversification, constant turnover and many small shifts generally explain the data best. Our work opens up several related problem domains to PPL approaches, and shows that few hurdles remain before these techniques can be effectively applied to the full range of phylogenetic models.
Overcoming the Expressivity Problem
In evolutionary biology, researchers use statistical models to infer how species diversify over time. Traditionally, this has required specialized, monolithic software packages like RevBayes or BAMM. While powerful, these tools are often difficult to modify for new hypotheses. The core challenge is the "expressivity problem": standard Probabilistic Graphical Models (PGMs) work well for fixed structures, but evolutionary trees have variable topology. Because we cannot observe extinct lineages, a model must account for an infinite number of possible "hidden" branches.
Universal Probabilistic Programming Languages (PPLs)—which are Turing-complete—solve this by handling stochastic recursion. This allows complex diversification models that previously required thousands of lines of specialized C++ code to be expressed in roughly 100 lines of PPL code. This shift "liberates" biologists to experiment with new evolutionary hypotheses without needing to write their own inference engines from scratch.
A Unified Framework for Diversification Models
By using PPLs, researchers can define a wide array of models within a single framework. Many popular models in the field are actually nested versions of one another, differing only by specific parameter constraints.
As shown in the figure above, models like the Constant Rate Birth-Death (CRBD) or the Cladogenetic Diversification Rate Shift (ClaDS) models can be related through constraints on parameters like extinction rates (μ) or shift scales (σ). The PPL approach allows for the automated generation of inference algorithms for any model in this hierarchy.
Automated Inference via Sequential Monte Carlo
The researchers utilized two universal PPLs: WebPPL (JavaScript-based) and Birch (C++-based). The key technical contribution is the automated generation of Sequential Monte Carlo (SMC) algorithms. Unlike the standard Markov chain Monte Carlo (MCMC) used in the field, SMC runs many simulations ("particles") in parallel and resamples them based on how well they match observed data. To make this efficient for phylogenetics, the authors introduced techniques such as alignment (synchronizing resampling points), delayed sampling (using mathematical conjugacy), and the alive particle filter (to handle simulations that die out).
Empirical Application to Bird Phylogenies
The authors evaluated their approach using a dataset of 40 bird phylogenies (clades) containing between 54 and 316 species. A major advantage of SMC over MCMC is that it directly estimates the marginal likelihood, allowing researchers to use Bayes factors to rigorously compare which model best explains the data.
Analysis of the bird clades revealed that the ClaDS2 model—which features slowing diversification, constant turnover, and many small, gradual shifts—generally provided the best explanation for the data. There was almost universal support for diversification rates slowing down over time, likely due to niche-filling and competition for resources. Interestingly, models often estimated extinction rates near zero, suggesting that either extinction is rare in these groups or current data struggle to distinguish low extinction from other factors like sampling bias.
Conclusion and Future Directions
This work proves that universal PPLs are no longer just an academic curiosity but a practical tool for high-stakes biological research. While Birch is efficient, universal PPLs are still generally slower than hand-optimized, model-specific code. Furthermore, this study assumed a fixed evolutionary tree. The next major milestone is "joint inference"—estimating the tree structure and diversification parameters simultaneously from raw DNA sequence data. To this end, the authors have launched the TreePPL project to develop a domain-specific PPL tailored for the unique requirements of phylogenetics.
Summary updated