Phylo2Vec: A vector representation of binary trees

Matthew J Penn, Neil Scheidwasser, Mark Khurana, Christl Ann Donnelly, Samir BhattMLGH @ ICLR 2023

TL;DR

This paper introduces Phylo2Vec, a novel integer vector representation for binary phylogenetic trees. This representation allows for efficient uniform sampling of trees and systematic traversal of the vast tree space, addressing key limitations in current phylogenetic inference methods.

What Problem Does This Paper Address?

Phylogenetic trees are fundamental for understanding evolutionary history, but inferring them is computationally challenging (NP-hard). Existing heuristic methods often struggle with systematically exploring the enormous space of possible tree topologies. This makes it difficult to uniformly sample random trees or efficiently navigate this space during optimization, potentially leading to suboptimal solutions. The paper aims to provide a new representation that overcomes these challenges.

Methods

The core contribution is the Phylo2Vec representation. It maps any binary tree with $n$ leaves to an integer vector of length $n$. The vector $v$ has the constraint $v_0 = 0$ and $v_i \in \{0, 1, \dots, 2(i-1)\}$ for $i \in \{1, \dots, k\}$, where $n=k+1$. The authors prove that this representation is both well-defined and bijective, meaning each unique vector corresponds to a unique tree and vice-versa.

The paper also details an algorithm (Algorithm 1) for reconstructing a tree from its Phylo2Vec vector. This algorithm uses a "view matrix" to track node labellings and merges nodes based on the vector's entries. For optimization, they employ a simple hill-climbing approach on the Phylo2Vec vector, where changes to vector elements correspond to specific tree topology modifications. They also introduce a Hamming distance on Phylo2Vec vectors as a measure of tree dissimilarity.

Datasets

The authors evaluated their method on five real-world biological datasets:

  • Yeast (Fungi)
  • H3N2 (Virus)
  • M501 (Animal)
  • FluA (Virus)
  • Zika (Virus)

These datasets vary in biological entities, taxa count, and genetic sequence length.

Key Insights and Ideas

  • Bijective and Parsimonious Representation: Phylo2Vec provides a mathematically sound (bijective) and compact (vector-based) way to represent phylogenetic trees, which is crucial for machine learning applications.
  • Uniform Sampling: The vector representation naturally facilitates uniform sampling of binary trees, a task that is notoriously difficult with traditional tree formats like Newick.
  • Systematic Tree Traversal: Changes to individual elements in the Phylo2Vec vector correspond to specific, interpretable tree topology modifications (like prune-and-regraft moves), allowing for more controlled exploration of the tree space.
  • Label Asymmetry: The authors highlight that the induced distance (Hamming distance on Phylo2Vec vectors) is label-asymmetric, meaning the distance between two trees can depend on how their leaves are ordered. They propose reordering strategies to mitigate this.
  • Rooted vs. Unrooted Trees: The paper focuses on rooted trees, acknowledging that most phylogenetic inference is done on unrooted trees. They discuss how their rooted tree likelihoods are consistent and how equivalence classes of rooted trees correspond to unrooted trees.

Key Results

  • The Phylo2Vec representation is proven to be bijective and well-defined.
  • A simple hill-climbing optimization using Phylo2Vec successfully found optimal or near-optimal trees for maximum likelihood inference on five real-world datasets, often with a vanishingly small number of steps compared to the vast number of possible trees. For example, on the M501 dataset with 29 taxa (~$8 \times 10^{36}$ trees), only ~105 steps were needed.
  • The Phylo2Vec distance shows a nonlinear correspondence with other common tree distances, indicating it captures different aspects of tree dissimilarity.
  • The implementation of the tree construction algorithm runs in quadratic time and space in its basic form, but can be optimized for performance (milliseconds for 1000 taxa on a modern CPU).

Limitations and Future Work

  • Quadratic Complexity: The basic tree construction algorithm has quadratic complexity in time and memory, though optimizations are possible.
  • Focus on Rooted Trees: The current formulation primarily addresses rooted trees, while much of phylogenetic inference deals with unrooted trees.
  • Label Asymmetry: The induced distance metric is label-asymmetric, which can affect optimization. The paper proposes reordering as a solution but notes that other switching methods might also be effective.
  • Bayesian Inference: The authors suggest that Phylo2Vec could be useful for Bayesian inference, as random walks can be easily implemented.
  • Differentiability: They note that Phylo2Vec could potentially be made differentiable, opening doors for gradient-based optimization frameworks.
  • Monte Carlo Tree Search: The simplicity of Phylo2Vec makes it a candidate for use in Monte Carlo Tree Search (MCTS) frameworks.

Summary updated

BibTeX
@inproceedings{penn2023phylo,
  author = {Matthew J Penn and Neil Scheidwasser and Mark Khurana and Christl Ann Donnelly and Samir Bhatt},
  title = {{Phylo2Vec: A vector representation of binary trees}},
  booktitle = {MLGH @ ICLR},
  year = {2023},
  url = {https://openreview.net/forum?id=YGfN9LHNb3},
}
Figure