PhyloTune: An efficient method to accelerate phylogenetic updates using a pretrained DNA language model

Danruo Deng, Wuqin Xu, Bian Wu, Hans Peter Comes, Yu Feng, Pan Li, Jinfang Zheng, Guangyong Chen, Pheng‐Ann HengNature Communications 2025 · DOI

Abstract

Understanding the phylogenetic relationships among species is crucial for comprehending major evolutionary transitions. Despite the ever-growing volume of sequence data, constructing reliable phylogenetic trees effectively becomes more challenging for current analytical methods. In this study, we introduce a new solution to accelerate the integration of novel taxa into an existing phylogenetic tree using a pretrained DNA language model. Our approach identifies the taxonomic unit of a newly collected sequence using existing taxonomic classification systems and updates the corresponding subtree. Specifically, we leverage a pretrained BERT network to obtain high-dimensional sequence representations, which are used not only to determine the subtree to be updated, but also identify potentially valuable regions for subtree construction. We demonstrate the effectiveness of our method, named PhyloTune, through experiments on simulated datasets, as well as our curated Plant (focusing on Embryophyta) and microbial (focusing on Bordetella genus) datasets. Our findings provide evidence that phylogenetic trees can be constructed by automatically selecting the most informative regions of sequences, without manual selection of molecular markers. This discovery offers a guide for further research into the functional aspects of different regions of DNA sequences, enriching our understanding of biology.

Introduction

Building the "Tree of Life" is a cornerstone of biological research, mapping the evolutionary relationships that define biodiversity. However, the rapid advancement of sequencing technology has created a data deluge. Traditional phylogenetic construction methods, such as Maximum Likelihood or Bayesian inference, are computationally intensive, with costs scaling quadratically or worse as the number ($N$) and length ($L$) of sequences increase.

Currently, integrating a small number of new sequences into a large existing tree often necessitates a complete re-alignment and global reconstruction. This "standard pipeline" is increasingly unsustainable for massive datasets. While phylogenetic placement tools exist, they often struggle with scalability or require manual, expert-driven selection of molecular markers. PhyloTune addresses these bottlenecks by automating marker selection and localizing tree updates.

Comparison of the standard global reconstruction pipeline versus the PhyloTune local update pipeline.

Methods

PhyloTune replaces global reconstruction with targeted subtree updates, powered by a Transformer-based DNA language model. The framework operates in three primary stages:

1. Taxonomic Identification and Novelty Detection

PhyloTune utilizes a fine-tuned BERT model integrated with Hierarchical Linear Probes (HLPs). These probes are trained to classify input sequences across multiple taxonomic ranks (Class, Order, Family, and Genus). A key feature is the "novelty detection" mechanism, which determines if a sequence belongs to a known taxonomic group or represents a previously uncharacterized lineage.

2. High-Attention Region Extraction

The Transformer architecture's "attention" mechanism is used to identify the most evolutionarily informative regions of a sequence. By analyzing attention scores from the model's final layer, PhyloTune extracts "high-attention" regions that capture critical phylogenetic signals.

The BERT architecture combined with Hierarchical Linear Probes for taxonomic classification and high-attention region identification.

3. Local Subtree Refinement

Once the target subtree is identified and informative regions are extracted, the system performs a local update using standard tools: MAFFT for alignment and RAxML for tree inference. By operating on a small subset of the total data ($n \ll N$ and $l \ll L$), the computational complexity is drastically reduced.

Experimental Validation

The performance of PhyloTune was evaluated across three diverse datasets:

  • Simulated Datasets: Used to establish ground truth and test scalability across varying sequence parameters.
  • Plant Dataset (Embryophyta): A large-scale dataset comprising over 157,000 sequences from nearly 20,000 species, focusing on established molecular markers like atpB and rbcL.
  • Microbial Dataset (Bordetella): Tested the model's applicability to prokaryotic genomes, which exhibit distinct evolutionary patterns compared to eukaryotes.

Key Results

Efficiency and Speed

PhyloTune achieves massive computational speedups. In tests on the Plant dataset, updating a subtree required only 4 minutes, whereas a full global reconstruction took over 20 hours. This represents a reduction in processing time to just 0.33% of the traditional approach.

Accuracy and Biological Relevance

Despite using only a fraction of the sequence data (often ~1/3), trees constructed using "high-attention" regions maintained high topological accuracy, showing very low Robinson-Foulds (RF) distances compared to full-sequence trees. Furthermore, the model's mathematical attention correlated strongly with biological features like high substitution rates and heterozygosity—the same markers traditionally selected by human experts.

Superior Classification

PhyloTune outperformed established alignment-based tools such as BLAST and MMseqs2 in taxonomic classification. It demonstrated particularly strong performance in novelty detection, achieving a 38.6% higher AUROC than baseline models when training data was sparse.

Discussion and Limitations

PhyloTune demonstrates that DNA language models can effectively automate "molecular biology" tasks like marker selection. However, some limitations remain. The method assumes that new taxa primarily affect their local neighborhood; it may not capture deep, global topological shifts. Additionally, performance is dependent on the quality of the underlying pretrained model (e.g., DNABERT) and can be affected by extreme class imbalances in taxonomic data.

Future research will explore unsupervised clustering techniques to identify novel evolutionary patterns in datasets lacking predefined taxonomic structures, further enhancing the autonomy of phylogenetic discovery.

Summary updated

Abstract

Understanding the phylogenetic relationships among species is crucial for comprehending major evolutionary transitions. Despite the ever-growing volume of sequence data, constructing reliable phylogenetic trees effectively becomes more challenging for current analytical methods. In this study, we introduce a new solution to accelerate the integration of novel taxa into an existing phylogenetic tree using a pretrained DNA language model. Our approach identifies the taxonomic unit of a newly collected sequence using existing taxonomic classification systems and updates the corresponding subtree. Specifically, we leverage a pretrained BERT network to obtain high-dimensional sequence representations, which are used not only to determine the subtree to be updated, but also identify potentially valuable regions for subtree construction. We demonstrate the effectiveness of our method, named PhyloTune, through experiments on simulated datasets, as well as our curated Plant (focusing on Embryophyta) and microbial (focusing on Bordetella genus) datasets. Our findings provide evidence that phylogenetic trees can be constructed by automatically selecting the most informative regions of sequences, without manual selection of molecular markers. This discovery offers a guide for further research into the functional aspects of different regions of DNA sequences, enriching our understanding of biology.
BibTeX
@inproceedings{deng2025phylotune,
  author = {Danruo Deng and Wuqin Xu and Bian Wu and Hans Peter Comes and Yu Feng and Pan Li and Jinfang Zheng and Guangyong Chen and Pheng‐Ann Heng},
  title = {{PhyloTune: An efficient method to accelerate phylogenetic updates using a pretrained DNA language model}},
  booktitle = {Nature Communications},
  year = {2025},
  doi = {10.1038/s41467-025-61684-3},
}
Figure