Hyperiax and Phylogenetic Inference from Shape Data
Gefan Yang, Marcus Teller, Christy Hipsley, Rasmus Nielsen, Stefan Sommer · 2026
Read Hyperiax and Phylogenetic Inference from Shape Data by Gefan Yang, Marcus Teller, Christy Hipsley, Rasmus Nielsen, Stefan Sommer (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-26974.txt.
Introduction
Gefan Yang, Marcus Teller, Christy Hipsley, Rasmus Nielsen, and Stefan Sommer present Hyperiax, a software library for inferring evolution from shape data. Species' shapes, like wing or beak landmarks, evolve along a family tree. Inference must respect both the tree and the curved geometry of shape space. A smoothing framework exists for such nonlinear processes on trees, but efficient implementations were lacking.
Hyperiax supplies fast tree traversal and message passing built on the JAX numerical library. Paired with the smoothing framework's operations, it supports parameter inference and ancestral state reconstruction. Demonstrations use butterfly wing shapes from two-dimensional landmarks on a large tree. A second case analyses bird beaks in three dimensions on another large tree. Both trees hold far more nodes and finer shape data than earlier applications managed.
Catalog record
| CREATOR | Gefan Yang, Marcus Teller, Christy Hipsley, Rasmus Nielsen, Stefan Sommer |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 17 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.26974
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Hyperiax and Phylogenetic Inference from Shape Data Gefan Yang, Marcus Teller, Christy Hipsley, Rasmus Nielsen, Stefan Sommer Abstract Summary: Phylogenetic inference on high-dimensional morphological traits requires algorithms that account for both the nonlinear geometry of the shape data and the phylogenetic tree structure. The Backward Filtering Forward Guiding (BFFG) framework provides smoothing for nonlinear stochastic processes on trees and enables inference of parameters and ancestral states. As practical adoption has been limited by a lack of efficient implementations, we present Hyperiax , an open-source library for tree traversal algorithms and message passing using JAX , designed particularly to support operations needed for BFFG. Hyperiax enables efficient execution of operations on trees with large numbers of nodes and, coupled with the BFFG-specific operations, this allows efficient inference in both discrete-time and stochastic differential equation models. Concretely, we demonstrate that Hyperiax enables parameter inference and ancestral reconstruction for butterfly wing shapes represented by landmarks in two dimensions, and analyses of avian beaks from landmarks in three dimensions. Both cases demonstrate application of BFFG on two substantially larger phylogenetic trees with 850 and 696 nodes with higher resolution shape data (118 two-dimensional landmarks and 79 three-dimensional landmarks, specifically) than previously possible. Availability and Implementation: Hyperiax source code and documentation are available at GitHub and GitHub Pages . Analysis scripts and configuration files are available separately at hyperiax-phylo . Contact: [email protected] 1 Introduction Understanding the evolution of morphological shape requires joint inference of ancestral traits, evolutionary parameters, and their uncertainties on phylogenetic trees. Landmark-based representations capture biologically meaningful geometry but induce strong correlations that challenge classical parsimony or low-dimensional projections ( Stroustrup et al. 2026 ) , making it nontrivial to perform statistical inference in the resulting nonlinear stochastic process models. The Backward Filtering Forward Guiding (BFFG) framework ( van der Meulen and Sommer 2025 ) overcomes these challenges by combining backward information filters with guided forward simulation. From a broad perspective, the backward passes correspond to the classical Felsenstein tree-pruning algorithm ( Felsenstein 1985 ) , while the forward sampling accounts for the nonlinearity that distinguishes the model from a linear Gaussian model. Practical adoption of BFFG in phylogenetic inference requires efficient numerical schemes and implementations that scale with both tree size and the resolution of the shape data. The Hyperiax library addresses the above issues. Developed for algorithms requiring tree traversals but specifically optimised for evolutionary shape analysis, the library provides a framework for tree traversal algorithms using Python and JAX ( Bradbury et al. 2018 ) for efficient execution. In this application note, we summarise the architecture of Hyperiax and how it supports the BFFG operations; exemplify the framework with inference from shape data in two and three dimensions; and demonstrate the scalability of the framework by applying it to much larger trees than previously possible. As an example, the posterior distribution of the ancestral root shape of butterfly wings from a phylogenetic tree with 425 observed leaf values is shown in Figure 1 . We start with a brief overview of phylogenetic inference from shape data and the BFFG method, before describing Hyperiax and presenting examples. Figure 1: Bayesian inference of the phylogenetic root shape for the butterfly dataset described in the Experiments section. The tree has 425 shape observations at the leaves, each represented by 118 landmarks in 2D. Pale blue curves show posterior MCMC samples of the ancestral root shape, while dark points show the posterior mean landmark positions. Inference is performed by repeated Hyperiax tree traversals implementing the BFFG backward-filtering and forward-guiding operations. 2 Phylogenetic inference from morphological data and BFFG Shape data can be represented discretely in the form of landmark configurations. For fixed n>0 , configurations of n distinct landmarks in \mathbb{R}^{d} , d=2 or 3 , are represented as points in \mathbb{R}^{dn} . This is the case both for Kendall’s shape spaces ( Kendall 1984 ) and for diffeomorphism-based landmark models ( Joshi and Miller 2000 ) . Close landmarks will exhibit correlated changes, and, to model this explicitly, in particular with many closely distributed landmarks on the shape, stochastic shape models ( Stroustrup et al. 2026 ; Sommer et al. 2026 ) evolve landmarks with a diffusion process whose covariance depends on the current distances between landmarks. The displacement of nearby landmarks is therefore strongly coupled, while distant landmarks can move more independently. Since the diffusion is generated by stochastic deformations of the ambient coordinate system, the evolution is diffeomorphic: non-crossing curves or surfaces remain non-crossing under the process. This gives a parametric evolutionary model for shape, where the amplitude of the covariance kernel controls evolutionary rate and the kernel width controls the spatial scale of morphological integration. In a phylogenetic context, the stochastic changes over time are governed by the underlying phylogenetic tree, and morphological observations are often at leaves of the tree corresponding to current time. If the transition kernels for subtrees were available in closed form as in the constant-covariance Gaussian case, the likelihood and the conditional process could be computed by a Felsenstein-style backward recursion. However, for general stochastic processes, in particular nonlinear stochastic processes modelling shape evolution, both transition densities and exact backward messages are intractable. BFFG ( van der Meulen and Sommer 2025 ) replaces these messages by tractable approximations, typically Gaussian messages obtained from simplified local dynamics. A backward pass propagates the messages up along edges from leaves towards the root and fuses the information at internal nodes, forming the upward tree traversal 1 1 1 The naming refers to the computer science convention of the root at the top of the tree and leaves at the bottom of the tree. . A forward pass then simulates a guided process from the root towards the leaves, obtained by adding a drift term depending on the approximate backward information. This downward traversal is defined by down operations at each edge. The resulting paths are weighted by a Radon-Nikodym correction, so they can be used in importance sampling or Metropolis-Hastings updates for ancestral shapes and model parameters. Thus, the fundamental operations of the method are a repeated sequence of tree traversals governed by up and down operations and local message fusion , which exactly corresponds to the operations implemented in Hyperiax . BFFG supports both discrete- and continuous-time transitions. 3 Hyperiax Hyperiax treats tree algorithms as JAX transformations: users compose them from local up , down , and fusion operations, while the library handles traversal order, ragged child sets, batching, just-in-time (JIT) compilation, automatic differentiation, and accelerator execution. For phylogenetic shape analysis, this makes the repeated BFFG backward-filtering and forward-guiding passes executable as compiled tree sweeps rather than as hand-written Python loops. 3.1 Library architecture Hyperiax is organized around a small set of abstractions. A Topology stores the rooted tree itself, including parent-child relationships, traversal order, and level structure; a Tree stores typed arrays attached to the nodes of that topology. This separation mirrors the distinction between a phylogenetic tree and the quantities propagated over it, such as shape states, likelihoods, and correction weights. Computations are written as local message updates and lifted to whole-tree traversals through the @up and @down decorators. An up-sweep corresponds to a postorder pass from the tips to the root, while a down-sweep