Table of Contents
Fetching ...

Likelihood-free inference of phylogenetic tree posterior distributions

Luc Blassel, Noémie Sauvage, Pierre Barrat-Charlaix, Bastien Boussau, Nicolas Lartillot, Laurent Jacob

TL;DR

This work tackles the computational bottleneck of likelihood-based phylogenetic inference by introducing Phyloformer 2, a likelihood-free neural posterior estimator for phylogenies. It combines evoPF, an expressive sequence encoder, with BayesNJ, a posterior factorization over successive merges, to produce calibrated posteriors over tree topologies and branch lengths given sequence data $x$, operating without explicit likelihoods. PF2 achieves state-of-the-art topological accuracy and orders-of-magnitude speedups under tractable models and remains advantageous under intractable evolutionary models, enabling inference of posterior distributions rather than single point estimates. The approach also demonstrates calibrated posterior sampling and highlights practical considerations such as distribution shift and scalability, suggesting significant impact for phylogenetics under realistic, complex models.

Abstract

Phylogenetic inference, the task of reconstructing how related sequences evolved from common ancestors, is a central objective in evolutionary genomics. The current state-of-the-art methods exploit probabilistic models of sequence evolution along phylogenetic trees, by searching for the tree maximizing the likelihood of observed sequences, or by estimating the posterior of the tree given the sequences in a Bayesian framework. Both approaches typically require to compute likelihoods, which is only feasible under simplifying assumptions such as independence of the evolution at the different positions of the sequence, and even then remains a costly operation. Here we present the first likelihood-free inference method for posterior distributions over phylogenies. It exploits a novel expressive encoding for pairs of sequences, and a parameterized probability distribution factorized over a succession of subtree merges. The resulting network provides well-calibrated estimates of the posterior distribution leading to more accurate tree topologies than existing methods, even under models amenable to likelihood computation. We further show that its edge against likelihood-based methods dramatically increases under models of sequence evolution with intractable likelihoods.

Likelihood-free inference of phylogenetic tree posterior distributions

TL;DR

This work tackles the computational bottleneck of likelihood-based phylogenetic inference by introducing Phyloformer 2, a likelihood-free neural posterior estimator for phylogenies. It combines evoPF, an expressive sequence encoder, with BayesNJ, a posterior factorization over successive merges, to produce calibrated posteriors over tree topologies and branch lengths given sequence data , operating without explicit likelihoods. PF2 achieves state-of-the-art topological accuracy and orders-of-magnitude speedups under tractable models and remains advantageous under intractable evolutionary models, enabling inference of posterior distributions rather than single point estimates. The approach also demonstrates calibrated posterior sampling and highlights practical considerations such as distribution shift and scalability, suggesting significant impact for phylogenetics under realistic, complex models.

Abstract

Phylogenetic inference, the task of reconstructing how related sequences evolved from common ancestors, is a central objective in evolutionary genomics. The current state-of-the-art methods exploit probabilistic models of sequence evolution along phylogenetic trees, by searching for the tree maximizing the likelihood of observed sequences, or by estimating the posterior of the tree given the sequences in a Bayesian framework. Both approaches typically require to compute likelihoods, which is only feasible under simplifying assumptions such as independence of the evolution at the different positions of the sequence, and even then remains a costly operation. Here we present the first likelihood-free inference method for posterior distributions over phylogenies. It exploits a novel expressive encoding for pairs of sequences, and a parameterized probability distribution factorized over a succession of subtree merges. The resulting network provides well-calibrated estimates of the posterior distribution leading to more accurate tree topologies than existing methods, even under models amenable to likelihood computation. We further show that its edge against likelihood-based methods dramatically increases under models of sequence evolution with intractable likelihoods.
Paper Structure (34 sections, 6 equations, 12 figures, 2 tables, 11 algorithms)

This paper contains 34 sections, 6 equations, 12 figures, 2 tables, 11 algorithms.

Figures (12)

  • Figure 1: Architecture of Phyloformer 2. Panel a: evoPF, an EvoFormer-inspired module updating $N\times L$ embeddings for a set of aligned sequences (MSA) $x$ and $N(N-1)/2$ embeddings for pairs of sequences. Each of its blocks applies self-attention within both the MSA and representation, and ensures information sharing between them. After 12 blocks, we extract one embedding for each sequence by averaging the MSA embeddings across sites. Panel b: BayesNJ (Algorithm \ref{['alg:BayesNJ']}) computes the posterior probability of a phylogeny given an MSA represented by the sequence and pair embeddings provided by evoPF. The probability is a product over a recursive operation where two taxa are merged into their parent, and the taxon representation is updated accordingly. Panel c: at inference time, we apply the same succession of operations as for evaluating the probability, but either sampling or taking the modes of the distributions (Algorithm \ref{['alg:BayesNJ_sampling']}).
  • Figure 2: (a) Topological performance for Phyloformer 2, measured by the normalized Robinson-Foulds distance. The alignments for which trees were inferred were taken from the original Phyloformer paper nesterenko2025phyloformer and were simulated under the LG+GC sequence model. (b) Runtime and (c) Memory usage for Phyloformer 2. The same GPU model as the original Phyloformer study was used to run Phyloformer 2 inference. Results for other methods are reported from the original Phyloformer paper nesterenko2025phyloformer.
  • Figure 3: a): Comparison of split frequencies over samples from the posterior of a single 50 sequences MSA, between RevBayes MCMC (x-axis) and PF2 (y-axis). The orange cross marker indicates splits that are present in the tree along which the MSA used for sampling has been simulated. b): simulation-based calibration comparing branch supports, i.e., their frequency in samples from the posterior estimate given by a trained PF2 (x-axis) to the frequency with which splits with a given PF2 support are true, i.e. found in the tree used for simulation (y-axis) Support values are binned by steps of $0.05$.
  • Figure 4: Training setting for all PF2 instances. PF2 instances are shown in rectangles, with a full outline and purple fill if they are final models used for inference in the main results, and a dotted outline and gray fill if they are used as the starting model for fine tuning runs. The loss functions used for each training or fine-tuning runs are shown in ovals. Finally the training (blue) and fine-tuning (yellow) datasets are also shown as cylindrical shapes. For each dataset, the number of training and validation examples is shown in the top section of the cylinder. The simulation priors are shown in the body of each cylinder : (1) the tree topology prior with the training tree size in parentheses, (2) the MSA evolutionary model. The tree priors are either (BD): rescaled Birth-death, described in nesterenko2025phyloformer, or (U+Exp): Uniform tree topology with $\lambda=10$ exponentially distributed branch lengths available in RevBayes hohna2016RevBayes. The number of figure in which the performance of a given model is studied is shown in the bottom right corner of the corresponding rectangle. Datasets are described in \ref{['sec:data']}
  • Figure 5: Topological reconstruction accuracy on empirical datasets. The topological accuracy is measured as the normalized Robinson-Foulds distance between the inferred gene tree, and a reference species tree inferred on the concatenation of all gene MSAs using maximum-likelihood estimation. This experiment is done on a cyanobacteria dataset introduced in szollosiDataEfficientExploration2013 (left), and a set of diverse protein datasets introduced in zhouEvaluatingFastMaximum2018 (right). This follows the same experimental setup as nesterenko2025phyloformer.
  • ...and 7 more figures