NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PhylaFlow: Hybrid Flow Matching in Billera-Holmes-Vogtmann Tree Space for Phylogenetic Inference

Yasha Ektefaie, Leo Cui, Shrey Jain, Marinka Zitnik, Pardis SabetiarXiv 2026

TL;DR

PhylaFlow introduces a hybrid flow-matching framework designed specifically for the complex, geometric space of phylogenetic trees. By learning to transport random initial trees directly into high-probability posterior basins, it drastically reduces the time traditional Markov chain Monte Carlo (MCMC) samplers spend searching in the dark, outperforming both classical and state-of-the-art neural baselines.

What Problem Does This Paper Address?

Reconstructing evolutionary trees (phylogenetics) from genetic sequences is a foundational task in biology, crucial for tracking pathogen outbreaks or understanding species diversification. However, finding the right tree is notoriously difficult because trees are "hybrid" mathematical objects: branch lengths vary continuously, but the branching structure (the topology) changes discretely.

This creates a massive, rugged search space. Traditional Bayesian methods like MCMC spend a huge amount of compute simply trying to find the right neighborhood—the posterior basin—before they can start fine-tuning. This is known as the "burn-in" phase. While existing machine learning approaches try to replace MCMC entirely or optimize a single best tree, they often struggle to capture full posterior uncertainty or scale efficiently.

Figure 1: Overview of PhylaFlow initialization in tree space. Traditional MCMC/MrBayes chains initialized from shared random starts follow long exploratory trajectories before entering the posterior basin. PhylaFlow maps the same starts into BHV tree space and transports them to diverse candidate basin-entry proposals. In contrast, maximum likeli- hood and maximum parsimony provide single-point initializations. Distinct regions of the posterior basin correspond to different high-posterior tree topologies.

Methods

The authors introduce PhylaFlow, which reframes phylogenetic inference as an optimal transport problem within Billera–Holmes–Vogtmann (BHV) tree space. In BHV space, each distinct tree topology is represented as a continuous Euclidean quadrant (an orthant). Changing a topology means moving to the edge of an orthant (where an internal branch length shrinks to zero) and crossing the boundary into a neighboring one.

To navigate this hybrid space, PhylaFlow uses a Graph Transformer architecture equipped with three specialized prediction heads:

  1. Velocity head: Controls continuous branch-length movement within a single topology orthant.
  2. First-hit head: Predicts which internal branches will collapse to zero first, signaling an impending topological change.
  3. Topology head: Autoregressively determines how to resolve the tree structure (the polytomy) once a boundary is crossed.

PhylaFlow is trained on geometric paths (geodesics) connecting random starting trees to high-quality posterior samples from a short MCMC run. At inference time, it acts as an intelligent initializer or a proposal guide (PhylaFlow-MCMC) for standard tools like MrBayes.

Figure 2: Motion in BHV tree space. Each orthant represents a fixed tree topology, with coordinates given by internal branch lengths. Moving within an orthant changes branch lengths without changing topology. When an internal branch contracts to zero, the path reaches a boundary corresponding to an unresolved tree; resolving that boundary in a different way moves the sample into a new topology. PHYLAFLOW uses this geometry to combine continuous branch-length transport with learned discrete topology transitions.

Datasets

The model was evaluated on the standard DS1 through DS8 phylogenetic benchmarks (from Lakner et al., 2008). These datasets represent a diverse set of real-world evolutionary problems, ranging from 27 to 50 taxa (species), presenting varied topological difficulties and posterior landscapes.

Key Insights and Ideas

  • Geometry-Aware Transport: Instead of treating tree topology changes as random discrete moves, PhylaFlow leverages the continuous-discrete hybrid geometry of BHV space, making tree space navigable via flow matching.
  • "Front-Loaded" Learning Strategy: Trajectory analysis revealed that PhylaFlow naturally learns a highly efficient strategy: it collapses many internal branches simultaneously early in the flow to make a massive "large jump" across topologies, followed by smaller, localized refinements in later phases.
Figure 3: Partial representative topology trajectories learned by PHYLAFLOW. Each phase shows a legal BHV transition from orthant start to boundary to rebuilt tree. The highlighted phase 1 shows the typical large collapse–rebuild step, followed by smaller refinements. RF denotes Robinson–Foulds distance to the reference tree.
  • Sequence-Conditioned Routing: The authors demonstrated that PhylaFlow can be conditioned on sequence embeddings. A cross-conditioning stress test proved that the model actively routes its transport based on the genetic data provided, rather than just memorizing a generic prior over trees.

Key Results

  • Drastic Burn-In Reduction: Before any MCMC refinement, PhylaFlow achieved the lowest Tree-KL divergence (closer agreement with the true posterior distribution) across all eight datasets compared to classical initializers like Maximum Parsimony or Maximum Likelihood.
  • Superior Hard-Case Performance: When paired with MrBayes as a proposal guide (PhylaFlow-MCMC), it obtained the strongest results on the hardest benchmark datasets (DS3, DS5, DS6, DS7), outperforming the state-of-the-art likelihood-guided neural sampler, PhyloGFN.
  • Computational Efficiency: PhylaFlow's total setup and training time across all datasets was 140.23 hours—significantly lower than PhyloGFN's 235.92 hours, which scales poorly on larger datasets (taking up to 47+ hours for DS8 alone).

Limitations and Future Work

  • Sampling Speed: The autoregressive nature of the topology head requires repeated model calls during boundary transitions, which can slow down inference when many complex tree rearrangements are needed.
  • Generalization Gaps: While sequence conditioning works conceptually, a single model trained jointly across all datasets still performs worse than dataset-specific models, indicating room for improvement in cross-dataset generalization.
  • End-to-End Optimization: The sequence embeddings used in this study were frozen. The authors suggest that training the sequence encoder and the tree transport model end-to-end could yield better-aligned representations and sharper posterior resolution.

Summary updated

BibTeX
@misc{ektefaie2026phylaflow,
  author = {Yasha Ektefaie and Leo Cui and Shrey Jain and Marinka Zitnik and Pardis Sabeti},
  title = {{PhylaFlow: Hybrid Flow Matching in Billera-Holmes-Vogtmann Tree Space for Phylogenetic Inference}},
  year = {2026},
  eprint = {2605.21859},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.21859},
}
Figure