Inference of phylogenetic trees from sequences plays a central role in understanding evolutionary relationships, with applications ranging from tracking pathogen spread to reconstructing the history of life. Conventionally, practitioners obtain posteriors over trees using likelihood-based methods like MCMC. However, likelihoods are only available for simple evolutionary models with restrictive assumptions. For realistic evolutionary models, inference using conventional methods is prohibitively expensive, inaccurate, or even impossible. In practice, practitioners settle for using as flexible a conventional method as possible, even though they expect it is misspecified. In principle, we could use simulation-based inference: simulate tree and sequence data from an evolutionary model and train a neural network to predict the posterior over trees given sequences. However it is a mathematical challenge to represent and train complex posterior distributions over trees. Here we present a flexible family of conditional generative models over trees. Our models iteratively build trees using three natural paradigms -- top-down, middle-out, or bottom-up -- and are trained using a discrete diffusion framework. For real and synthetic datasets of up to 65 taxa and >105 tokens, our models recover MCMC posteriors much more accurately than the previous state-of-the-art simulation-based method Phyloformer 2. Finally, we compare to IQ-Tree, a popular flexible-but-misspecified conventional method. Our models match its tree estimates on simple data, but on more realistic data, our method is reliably more accurate.
Figures & tables
Figure 1: Illustration of three generative paradigms for trees. Each colored circle represents one taxon. For bottom-up , we start with each taxon as a separate subtree and repeatedly merge two subtrees until a single bifurcating tree is formed. Dark edges indicate which subtrees were merged in each step. For middle-out , we start with a tree containing two taxa and add one taxon at a time. The gray circle depicts the “pseudo-taxon” representing the root of the tree, and dark edges show which taxon was added in each step. For top-down , we start with all taxa at the root and percolate them downwards one step at a time until we reach a full bifurcating tree.
Figure 2: Illustration of sample model predictions for the three generative paradigms. For bottom-up , the dashed edges indicate the valid merges consistent with T0 , corresponding to the highlighted cells in the matrix of model predictions. For middle-out , the dashed edges indicate the correct attachment edges consistent with T0 , corresponding to the highlighted cells in the matrix of model predictions. For top-down , the arrows indicate the correct percolation directions consistent with T0 , corresponding to the highlighted cells in the matrix of t predictions. Taxon A is constrained to percolate right as T0 is a bifurcating tree.
Figure 3: Our closed form losses are crucial for training. On the “complex” dataset described below we train models with or without Rao-Blackwellizing the KL estimate in Eqn. 3 .
Figure 4: Our strategies for conditioning on the graph and covariance pooling are crucial for training. We ablate (Top) our graph conditioning strategies and (Bottom) our covariance pooling. Each is shown on an example paradigm: top-down and bottom-up .
Figure 5: (Left) Our models obtain substantially better negative ELBOs than Phyloformer 2. The ELBO of a trivial model that scores all trees uniformly is 157 nats. (Right) Our models reconstruct MCMC posteriors on real datasets more accurately than Phyloformer 2.
Figure 6: Our models make more accurate predictions than IQ-Tree for the complex and intractable evolutionary models. (Left) We hold N fixed and vary the sequence length L . (Right) We hold L fixed and vary the number of taxa N . The normalized RF distance of a random tree is roughly 1 .
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Approach
Status or challenge
Splits and edge contractions
analogous to top-down
Leaf delete-regraft
analogous to middle-out
Add one leaf at a time and quarter puzzling
analogous to middle-out
Coalescents
analogous to bottom-up
Dyck paths and permutations
models planar, unlabeled trees
Hyperbolic embeddings
models planar trees
Appendix
Table A1 : Summary of alternative generative modeling approaches for trees and their limitations.
Figure 7: The bespoke mutual information schedules do not make much of a difference when training. On the “complex” data, with the same architecture and training parameters we train models for 24 hours on 2 A100s. We train models either with our derived mutual information schedule or by sampling the sampling step m uniformly between 1 and M .
Figure 8: The prior corrected outputs do not make much of a difference when training. On the “complex” data, with the same architecture and training parameters we train models for 24 hours on 2 A100s. We train top-down or bottom-up models either by multiplying outputs by logpPDA(Tm−1∣Tm) or leaving them biased at initialization..
Figure 9: Our improvements over Phyloformer 2 came from our improved objectives and the flexibility of our models. We ablate the architectural improvements we’ve made and the form of the canonicalized objective. These changes don’t make a large change, while Rao-Blackwellize does, but not enough to close the gap to our model.
Figure 10: Our model matches the MrBayes posterior distribution. We plot MMDs on DS1-8 between 1000 samples from each model and MrBayes. The top row is a reproduction of Fig. 5(b) included for comparison.
Figure 11: Our models have accurate posterior split probabilities. We plot posterior probabilities of observed splits on all of DS1-8 between 1000 samples from each model and MrBayes.
Figure 12: Consensus and inferred trees on DS3. We plot the consensus over 500 sequences. We colour branches that don’t appear in the MrBayes consensus black. We root trees by picking a fixed random out-group among the nodes. Clades are shaded grey to help in comparing trees. Species are ordered to allow us to show the MrBayes consensus tree as a planar tree.
Figure 13: Consensus and inferred trees on a synthetic DS3. We plot the consensus over 500 sequences. We colour branches that don’t appear in the MrBayes consensus black. We root trees by picking a fixed random out-group among the nodes. Clades are shaded grey to help in comparing trees.
Figure 14: Comparison of sampling runtimes for our models and baselines on an A100 GPU.
Phylogenetic inference reconstructs evolutionary relationships and divergence histories from genetic, morphological, linguistic, or other inherited traits.
Phylogenetics is a branch of computational biology that studies the evolutionary relationships among biological entities. Its long history and numerous applications notwithstanding, inference of phylogenetic trees from sequence data remains challenging: the high complexity of tree space poses a significant obstacle for the current combinatorial and probabilistic techniques. In this paper, we adopt the framework of generative flow networks (GFlowNets) to tackle two core problems in phylogenetics: parsimony-based and Bayesian phylogenetic inference. Because GFlowNets are well-suited for sampling complex combinatorial structures, they are a natural choice for exploring and sampling from the multimodal posterior distribution over tree topologies and evolutionary distances. We demonstrate that our amortized posterior sampler, PhyloGFN, produces diverse and high-quality evolutionary hypotheses on real benchmark datasets. PhyloGFN is competitive with prior works in marginal likelihood estimation and achieves a closer fit to the target distribution than state-of-the-art variational inference methods. Our code is available at https://github.com/zmy1116/phylogfn.
Mingyang Zhou, Zichao Yan, Elliot Layne +5
McGill University · McGill University, Mila · Universit´e de Montr´eal, Mila
In this work, we introduce a Tropical Axial Attention neural reasoning architecture that replaces vanilla softmax dot-product attention with max-plus operators, inducing a piecewise-linear structure aligned with dynamic programming formulations. From multi-species sequence alignments, our model learns all possible pairwise distances and is trained using a combination of ℓ1 and tropical symmetric distance metric losses with an ultrametric violation penalty. We leverage the well known isomorphic relationship between the space of all phylogenetic trees with n species and tropical Grassmannian to show that tropical attention provides a natural geometric framework for phylogenetic inference. On empirical DS1−DS11 alignments, where true trees are unknown, the tropical model produces distance matrices that are substantially closer to their BME-induced tree metrics than the baseline models. These results suggest that tropical attention is a useful geometric inductive bias for neural phylogenetic inference, especially under distribution shift and when tree-metric consistency is important.
Chris Teska, Kurt Pasque, Ruriko Yoshida +1
In this work, we introduce a Tropical Axial Attention neural reasoning architecture...
Phylogenetic trees are hybrid objects: branch lengths vary continuously, while topologies change discretely through edge contractions and expansions. Billera-Holmes-Vogtmann (BHV) tree space provides a canonical geometry for this structure, representing each resolved topology as a Euclidean orthant and topological changes as motion across shared lower-dimensional boundaries. We introduce PhylaFlow, a hybrid flow-matching model that learns posterior-basin transport in BHV tree space. PhylaFlow is trained on BHV geodesic paths from random starting trees to short-run posterior samples, coupling continuous branch-length motion within orthants with learned boundary events and discrete topology transitions. We evaluate the learned geometry operationally: if the flow reaches posterior-relevant regions, finite-budget Bayesian refinement initialized from, or guided by, its terminal trees should recover posterior-supported topologies more efficiently. Across DS1-DS8 phylogenetic posterior benchmarks, PhylaFlow substantially reduces initial Tree-KL relative to classical initializers. After finite-budget MrBayes refinement, direct PhylaFlow improves early and intermediate topology-recovery trajectories on most datasets, while split-guided PhylaFlow-MCMC obtains the strongest hard-case results. The best PhylaFlow variant outperforms short-warmup on seven of eight datasets and PhyloGFN on five of eight under the same refinement budget. In a joint sequence-conditioned experiment, sequence embeddings steer posterior split recovery, although exact posterior topology recovery remains preliminary. These results show that hybrid flow matching can learn actionable transport in BHV tree space and provide a geometry-aware proposal mechanism for Bayesian phylogenetic inference.
Yasha Ektefaie, Leo Cui, Shrey Jain +2
Eric and Wendy Schmidt Center, Broad Institute of MIT and Harvard · Department of Biomedical Informatics, Harvard Medical School · Centennial High School +1