Meridia Insight Science Breakthroughs Knowledge

How to make evolution models tractable when the state space explodes

A method that avoids building huge transition matrices could make biologically richer evolutionary models practical—especially when the data are sparse too.

3,721 states: a duplicated-gene model that standard likelihood calculations can make painfully expensive.

A model of two duplicated genes can require tracking 3,721 possible paired codon states at every point in an evolutionary tree. That is a far cry from the four DNA letters in a basic model—and it is exactly the kind of biological complexity that can make standard likelihood calculations grind to a halt. Redelings and colleagues introduce a way to compute the needed probabilities without first building the enormous transition matrix, preserving the useful sparsity in the underlying evolutionary process (Redelings et al., 2026).

The advance is computational rather than biological: the paper does not report a new discovery about gene conversion or a revised account of evolution. It tackles a bottleneck that can keep more realistic questions from being asked. The authors say their method enables fast, scalable inference, but the materials supplied here include no benchmark tables or numerical speedups. So the central promise is clear; exactly how large the gains are in each setting cannot be assessed from the excerpt.

The Science

Phylogenetic inference asks how observed sequences or traits could have arisen along a branching tree of ancestry. To compare possible trees and evolutionary histories, researchers calculate the likelihood of the observed data under a model of change. At each branch, the model must account for every possible state the character could have changed from and into.

For DNA, the state space is just four nucleotides. Protein models commonly use 20 amino acids, while codon models use the 61 triplets that encode amino acids (excluding stop codons). But some biological questions call for compound or hidden states. A model might track both a codon and an unobserved selective regime, or the codons present at two related genes. In those cases, the number of states grows rapidly.

The paper examines two examples. Markov-modulated codon models let selection vary among hidden regimes, representing changes in selective pressure over evolutionary time; with M regimes, there are 61 times M possible states. The other example models interlocus gene conversion between two paralogs—related gene copies in the same genome. Its states are pairs of codons, for 61 squared, or 3,721, possibilities. Gene conversion can copy sequence from one paralog to the other, tending to make the pair more similar.

A standard pruning algorithm calculates likelihoods efficiently by moving information from the tips of a phylogenetic tree toward its root. At a branch, it transforms a vector of conditional likelihoods: the probability of the observations below that branch, conditional on each possible state at its top. The transformation is governed by a continuous-time Markov chain, a mathematical model in which changes can happen at any moment and each state has specified rates of moving to other states.

The branch transformation is the matrix exponential of the rate matrix multiplied by the branch length. A matrix exponential is the matrix-valued analogue of the ordinary exponential function; here it encodes the probability of all possible state changes during that stretch of evolutionary time. Conventional implementations often calculate the full transition matrix, then multiply it by the likelihood vectors.

That can be wasteful. A rate matrix may be sparse: each state can transition directly to only a small fraction of all possible states. Yet the full transition matrix is generally dense, because indirect paths allow probability to spread among many states over time. Building it—or decomposing the rate matrix into eigenvectors to represent it—can discard the original sparsity. For a large state space, the calculation may spend most of its effort constructing probabilities that the pruning step does not need individually.

The alternative is to calculate the action of the matrix exponential directly: apply the exponential to the likelihood vectors, without constructing the entire transition matrix. Redelings and colleagues implement this approach as a CPU extension to BEAGLE, a widely used library for high-performance phylogenetic likelihood calculations. Their implementation uses the Al-Mohy–Higham algorithm, which approximates the exponential action through a sequence of scaled, truncated Taylor expansions (Al-Mohy and Higham, 2011).

In intuitive terms, the algorithm takes a large evolutionary step and breaks it into smaller ones. For each smaller step, it adds a finite series of terms involving repeated multiplications of the sparse rate matrix by the likelihood vectors. Crucially, it does not form powers of the rate matrix as full matrices. This is what allows the computation to retain sparsity.

The right strategy depends on more than the number of states. It also depends on how many distinct site patterns need to be processed. If there are only a few, constructing a full state-by-state transition matrix may be overkill. If there are many, the upfront cost of making that matrix can be spread over more data, and optimized dense matrix multiplication may compete well. The density of the rate matrix, branch length, and efficiency of the computer’s sparse and dense operations matter too.

State spaces in the paper's molecular examples

Reported number of states for a single-codon model and a codon-pair model. These are model dimensions, not runtime measurements.

State spaces in the paper's molecular examples
LabelValue
Single codon61 states
Codon pair (two paralogs)3,721 states

The scale difference is striking: the gene-conversion model has 3,721 paired states, compared with 61 states for a single codon. The chart shows state counts reported in the paper, not measured runtime. The excerpt gives the formula for models with multiple selection regimes but no tested values of M, so those are not plotted.

What They Found

The main result reported in the abstract is that action-based likelihood computation can make inference practical for large, sparse molecular models, and that its performance advantage depends on the problem’s structure. The paper specifically evaluates a hidden-regime codon model and the 3,721-state codon-pair model. But the supplied text stops during the methods section, before the Results. It therefore does not provide the timings, accuracy comparisons, data-set sizes, or parameter settings needed to quantify the benefit.

That absence matters. “Faster” is not a single property: a technique can win for one state-space size and number of site patterns, yet lose when the alignment grows or the matrix becomes less sparse. The authors explicitly frame their evaluation around this tradeoff and compare the method both with BEAGLE’s standard CPU implementation and with a dense-multiplication implementation using Eigen. That second comparison is important: a sparse method should be measured against a competent dense baseline, not merely against a poorly optimized one.

The algorithm’s computational appeal follows from what it does not do. A dense eigendecomposition can cost roughly the cube of the number of states, while multiplying a dense transition matrix by L likelihood columns costs roughly the square of the state count times L. The action method instead performs repeated sparse-matrix-by-dense-matrix products. Its advantage grows when the rate matrix has relatively few nonzero entries and the number of likelihood columns is small enough that building a complete transition matrix cannot be amortized.

But sparsity is no guarantee of a speedup. Sparse multiplication carries overhead: the program must read index information and access rows of the likelihood matrix in a less regular pattern. Those operations can reduce cache efficiency, the ability of a processor to reuse recently accessed data quickly. At sufficiently high matrix density, dense multiplication can be faster despite doing more arithmetic. The paper’s framing is appropriately conditional: its purpose is to identify when the action approach pays off, not to claim it universally replaces transition matrices.

For accuracy, the method uses a specified approximation tolerance and chooses the number of Taylor terms and the number of scaling steps to meet it efficiently. The excerpt describes how these parameters are estimated, including a method for estimating matrix norms without forming dense matrix powers. It does not provide the final error measurements or tolerance values used in the experiments, so no numerical accuracy claim beyond the algorithm’s stated design can be made here.

The text supplied also contains no paper figures. The model-size chart above is based on the reported state counts; it is not a figure reproduced from the study. Likewise, there are no empirical result tables in the provided material from which to make a responsible runtime chart. Those omissions prevent a fuller visual comparison, but they do not obscure the core methodological idea.

Why This Changes Things

Large state spaces are not an abstract nuisance. They often encode the biological feature a researcher wants to understand. A hidden selective regime can represent the possibility that a gene’s evolutionary constraints changed over time. A paired-codon model can represent interactions between duplicated genes, including conversion that copies sequence between them. If computation forces such models to be simplified, researchers may be pushed toward a less faithful picture of the process.

This bottleneck can be especially severe in trait evolution. A model of geographic range may have a state for each combination of occupied regions, and chromosome evolution may track a broad set of counts and transitions. Some such studies have only one or a handful of characters. When there are few observations, the cost of constructing a large transition matrix has very little data over which to spread. The same feature that makes the biological question interesting—many possible states but few observed characters—also makes conventional computation inefficient.

BEAGLE’s role is significant because a numerical method becomes useful to evolutionary biologists only when it can fit into inference software they already use. The authors present the work as a CPU-based extension to an existing library, with the likelihood interface adapted so branch propagation can use the action of the exponential. This is a practical bridge from numerical linear algebra to routine phylogenetic analysis, rather than a proposal that requires every researcher to build a custom solver.

There are also reasons not to treat the method as a universal fix. It is a CPU implementation, and the excerpt does not describe GPU support or comparisons across hardware. Nor does the method remove the cost of all parts of inference: large state vectors still take memory, and likelihood calculations must be repeated as trees and model parameters change. Sparse action chiefly addresses the branch-propagation calculation. Its value will depend on real model structure, alignment compression, branch lengths, and implementation details.

The broader lesson is that computational limits shape scientific imagination. A model may be biologically attractive yet practically unusable if its likelihood takes too long to calculate repeatedly. Making sparse, large-state calculations more accessible could let investigators test richer hypotheses—not just about molecular evolution, but about traits and processes where the state space is large by nature. The paper’s contribution is to widen that feasible set, though the excerpt does not let us measure by how much.

What's Next

The next essential step is a close look at the complete benchmark results. Readers need the tested state-space sizes, number of unique site patterns, matrix densities, branch-length conditions, runtime and memory measurements, and error relative to a trusted reference. Those comparisons would reveal where action-based calculation delivers a meaningful practical gain and where dense methods remain preferable.

A second question is how the implementation behaves inside full inference, not just in an isolated branch calculation. Phylogenetic analyses repeatedly evaluate likelihoods while exploring trees and parameter values. End-to-end performance can differ from kernel-level speed, especially if other operations become the new bottleneck or if a model’s rate matrix changes frequently.

Further work could also test additional sparse models, larger alignments, and different hardware. The method’s logic extends beyond the two molecular examples, but transfer is not automatic: another model may have a less sparse generator, different structure, or only a few states. The authors’ emphasis on the relationship between sparsity and pattern count is therefore a useful guide for deciding where to look next.

The immediate promise is modest in the best sense: not a new biological conclusion, but a tool that may make more ambitious conclusions computable. If the full benchmarks bear out the abstract’s claim, evolutionary researchers will gain a more flexible way to ask what happens when selection changes, genes exchange sequence, or biological traits have many possible forms. Better computation does not answer those questions by itself. It can, however, make them testable.

Comments (0)

No comments yet. Be the first to share your thoughts.