Automatic Differentiation is no Panacea for Phylogenetic Gradient Computation.

Journal: Genome biology and evolution
Published Date:

Abstract

Gradients of probabilistic model likelihoods with respect to their parameters are essential for modern computational statistics and machine learning. These calculations are readily available for arbitrary models via "automatic differentiation" implemented in general-purpose machine-learning libraries such as TensorFlow and PyTorch. Although these libraries are highly optimized, it is not clear if their general-purpose nature will limit their algorithmic complexity or implementation speed for the phylogenetic case compared to phylogenetics-specific code. In this paper, we compare six gradient implementations of the phylogenetic likelihood functions, in isolation and also as part of a variational inference procedure. We find that although automatic differentiation can scale approximately linearly in tree size, it is much slower than the carefully implemented gradient calculation for tree likelihood and ratio transformation operations. We conclude that a mixed approach combining phylogenetic libraries with machine learning libraries will provide the optimal combination of speed and model flexibility moving forward.

Authors

  • Mathieu Fourment
    Australian Institute for Microbiology and Infection, University of Technology Sydney, Ultimo, NSW, Australia.
  • Christiaan J Swanepoel
    Centre for Computational Evolution, The University of Auckland, Auckland, New Zealand.
  • Jared G Galloway
    Institute of Ecology and Evolution, University of Oregon, Eugene, OR.
  • Xiang Ji
    Shenzhen Prevention and Treatment Center for Occupational Diseases, Shenzhen, Guangdong, China.
  • Karthik Gangavarapu
    Department of Molecular and Experimental Medicine, Scripps Research Institute, La Jolla, California, USA.
  • Marc A Suchard
    Department of Biomathematics, UCLA School of Medicine, CA, USA.
  • Frederick A Matsen Iv
    Public Health Sciences Division, Fred Hutchinson Cancer Research Center, Seattle, Washington, USA.