# Phylograd: fast column-specific calculation of substitution model gradients

**Authors:** Benjamin Lieser, Georgy Belousov, Johannes Söding

PMC · DOI: 10.1186/s12859-025-06353-4 · BMC Bioinformatics · 2025-12-23

## TL;DR

PhyloGrad is a fast tool for calculating gradients in phylogenetic tree models, enabling efficient exploration of site-specific substitution models.

## Contribution

PhyloGrad introduces a highly efficient reverse-mode differentiation method for phylogenetic likelihoods, enabling faster and more memory-efficient model optimization.

## Key findings

- PhyloGrad is 30-100 times faster than PyTorch for gradient calculations in phylogenetic models.
- It uses 10-100 times less memory than automatic differentiation methods.
- PhyloGrad is at least 10 times faster than IQ-TREE3 for fitting global substitution models.

## Abstract

Most popular tools for reconstructing phylogenetic trees from multiple sequence alignments use a model of molecular evolution in which a single substitution matrix or a small set of fixed matrices are shared between all columns. Models with column-specific rate matrices can in principle be fit by automatic differentiation methods, but in practice the heavy computational burden associated with computing the gradients of the many matrix exponentials has hindered exploration of such models.

Here, we present a highly efficient approach for reverse-mode differentiation of the log likelihood computed with Felsenstein’s algorithm under any time-reversible substitution model. PhyloGrad is implemented in Rust and has Python bindings to easily combine it with automatic differentiation tools.

Depending on the tree size, PhyloGrad is 30-100 times faster than automatic differentiation in Pytorch and uses 10-100 times less memory. Even in the task of fitting one global model it is still at least 10 times faster than IQ-TREE3. PhyloGrad accelerates current model optimizations and enables the field to easily explore and implement novel site-specific models.

The online version contains supplementary material available at 10.1186/s12859-025-06353-4.

## Full-text entities

- **Diseases:** CTMC (MESH:D000377)
- **Chemicals:** GPU (-), amino acids (MESH:D000596)

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12836810/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12836810/full.md

## References

1 references — full list in the complete paper: https://tomesphere.com/paper/PMC12836810/full.md

---
Source: https://tomesphere.com/paper/PMC12836810