Exact and efficient phylodynamic simulation from arbitrarily large populations

Michael Celentano, William S. DeWitt, Sebastian Prillo, Yun S. SongProceedings of the National Academy of Sciences 2025

TL;DR

This paper introduces a novel, highly efficient algorithm for simulating phylogenetic trees from massive populations, overcoming the computational bottleneck of traditional methods. By reformulating the simulation problem, they enable realistic phylodynamic simulations for populations previously too large to analyze, paving the way for more robust inference and machine learning applications in evolutionary biology.

What Problem Does This Paper Address?

Inferring evolutionary history often relies on phylogenetic trees, which represent the ancestral relationships within a sample of individuals. However, these observed trees are typically incomplete, representing only a fraction of the full population due to sampling biases and extinctions. Simulating these "ascertained" trees accurately requires modeling the entire population's history, which becomes computationally prohibitive for large populations (e.g., billions of cells in cancer or millions of flu infections). Current methods simulate the full population tree and then "prune" unobserved lineages, making the computational cost dependent on the massive, unobserved population size rather than the smaller, observed tree. This paper tackles the challenge of simulating realistic phylogenies from arbitrarily large populations by developing a method whose computational cost scales with the size of the observed tree, not the full population.

Methods

The core innovation lies in a theoretical breakthrough: the authors prove that for any partially ascertained birth-death-mutation-sampling (BDMS) process, there exists an equivalent "forward-equivalent" process. This equivalent process has no death and complete sampling at the present time, meaning the full simulated tree is the observed tree. This clever reformulation allows them to bypass the simulation of unobserved lineages entirely.

Their algorithm, "forward-equivalent simulation," leverages this insight. It involves:

  1. Parameter Transformation: Transforming the original BDMS model parameters into parameters for the forward-equivalent model. This transformation is derived from the non-observation probabilities of lineages in the original model.
  2. Forward-Equivalent Simulation: Running a standard "full simulation" algorithm (which they provide as a baseline) but using the transformed parameters. Since the forward-equivalent model has no death and complete sampling, the output of this simulation is directly the desired reconstructed phylogeny.

This approach significantly reduces the number of simulated events and avoids costly retries needed to generate non-empty observed trees in the traditional method.

Datasets

The paper does not describe training datasets. For evaluation, they generate simulated datasets using their proposed method and compare them against simulations from a "full simulation" baseline. They specifically test their method on:

  • Single-type birth-death models (with and without death).
  • Two-type birth-death-mutation-sampling models.
  • A scenario simulating a population in the billions with extremely sparse sampling (ρ = 10⁻⁹).

Key Insights and Ideas

  • The "Push of the Past": The forward-equivalent model naturally captures phenomena like the "push of the past," where diversification rates appear higher in the distant past due to survivorship bias in the observed phylogeny. This is a direct consequence of the model's ability to account for sampling biases.
  • Identifiability and Simulation: The paper highlights a connection between identifiability issues in phylogenetics (where multiple parameter sets can produce the same observed data) and efficient simulation. The fact that the full and forward-equivalent models are indistinguishable from observed data is precisely what makes the forward-equivalent model a powerful simulation tool.
  • Uncoupling Population Size from Computational Cost: The most significant insight is that the computational cost of simulating an observed phylogeny can be made independent of the full population size, a paradigm shift for large-scale phylodynamic studies.

Key Results

  • Massive Speedup: The forward-equivalent simulation achieves substantial computational savings, reducing computation by factors of 1,000 to 10,000 in realistic scenarios. For a single-type birth-death process, the speedup is approximately 1/p, where p is the sampling probability.
  • Feasibility for Large Populations: The method enables simulations from populations with billions of individuals, which were previously computationally infeasible. They demonstrate this with a simulation of a population size in the billions, generating trees with leaf counts in the tens to hundreds in just over a second per tree.
  • Distributional Equivalence: Extensive statistical tests (Mann-Whitney U and Kolmogorov-Smirnov tests) on various tree summary statistics show that the phylogenies generated by the full and forward-equivalent simulations are statistically indistinguishable, validating Theorem 1.

Limitations and Future Work

  • Computational Overhead: While the forward-equivalent simulation avoids simulating unobserved lineages, it can incur a constant factor computational overhead compared to the full simulation when dealing with time-inhomogeneous Poisson processes. However, this overhead is independent of phylogeny size and is overcome by even moderate subsampling.
  • Identifiability Challenges for Inference: The paper notes that while the lack of identifiability is useful for simulation, it poses challenges for parameter inference. Future work will explore how to resolve these identifiability issues for inference.
  • Software Availability: The authors have made their code publicly available on GitHub, enabling reproducible research and further development.
  • Future Directions: The authors suggest future work in training machine learning models for epidemiological parameter estimation and enabling simulation-at-inference-time for methods like Approximate Bayesian Computation. They also plan to further investigate the implications of identifiability for inference.

Summary updated

Abstract

Many biological studies involve inferring the evolutionary history of a sample of individuals from a large population and interpreting the reconstructed tree. Such an ascertained tree typically represents only a small part of a comprehensive population tree and is distorted by survivorship and sampling biases. Inferring evolutionary parameters from ascertained trees requires modeling both the underlying population dynamics and the ascertainment process. A crucial component of this phylodynamic modeling involves tree simulation, which is used to benchmark probabilistic inference methods. To simulate an ascertained tree, one must first simulate the full population tree and then prune unobserved lineages. Consequently, the computational cost is determined not by the size of the final simulated tree, but by the size of the population tree in which it is embedded. In most biological scenarios, simulations of the entire population are prohibitively expensive due to computational demands placed on lineages without sampled descendants. Here, we address this challenge by proving that, for any partially ascertained process from a general multitype birth-death-mutation-sampling model, there exists an equivalent process with complete sampling and no death, a property which we leverage to develop a highly efficient algorithm for simulating trees. Our algorithm scales linearly with the size of the final simulated tree and is independent of the population size, enabling simulations from extremely large populations beyond the reach of current methods but essential for various biological applications. We anticipate that this massive speedup will significantly advance the development of novel inference methods that require extensive training data.
BibTeX
@inproceedings{celentano2025exact,
  author = {Michael Celentano and William S. DeWitt and Sebastian Prillo and Yun S. Song},
  title = {{Exact and efficient phylodynamic simulation from arbitrarily large populations}},
  booktitle = {Proceedings of the National Academy of Sciences},
  year = {2025},
  doi = {10.1073/pnas.2412978122},
}
Figure