Nested Birth-Death Processes and Neural Transducers as Models of Time-Dependent Protein Evolution
Abstract
The evolution of biomolecular sequences is typically modeled as two types of events: point substitutions, which change individual residues, and short insertions and deletions (indels), which add or remove consecutive residues. TKF92 [1] is the gold-standard model of molecular evolution that accounts for both. It describes sequence evolution with nested stochastic processes. An outer birth-death process models indels (and, therefore, changes in sequence length), while an inner Markov chain models substitutions at individual sites. Although TKF92 is mathematically tractable and easy to interpret, it assumes that the rates of substitutions and indels are independent of the surrounding sequence context. This is biologically unrealistic; whether a mutation can occur often depends on the local structural and biochemical environment. We introduce context-dependent substitution and indel rates into the TKF92 framework using two complementary strategies: 1. classical machine learning, via hierarchically nested latent class mixtures; and 2. modern deep learning, via a modified neural transducer [2]. We curate approximately 1.2 million pairwise protein sequence alignments from nearly 20,000 protein families in Pfam [3], a large database of protein alignments across all kingdoms of life. We use this dataset to train and evaluate two models. “Mixture of Domain Classes” (MixDom) extends TKF92 with latent classes at the domain, fragment, and site levels. Each domain class coordinates its own indel rates and substitution parameters, effectively giving the model a short window of sequence context. “Neural TKF” is a neural transducer that calculates the same TKF92 likelihood but replaces fixed parameters with values predicted from neural sequence embeddings. All models are trained with the Adam optimizer and evaluated using per-column perplexity on held-out alignments. Neural TKF provides the best overall fit to the pairwise alignment dataset, consistently outperforming neural networks that lack the inductive bias of evolutionary modeling. Despite having only approximately 29,000 parameters, MixDom achieves likelihoods competitive with Neural TKF models containing tens of millions of parameters. MixDom also performs particularly well on challenging alignments, including those with many gaps or substantial evolutionary divergence. These results suggest that incorporating evolutionary structure into machine learning models can provide improvement over purely neural approaches. MixDom and Neural TK provide complementary approaches to modeling protein evolution. Both produce interpretable substitution and indel rates, which makes them useful for predicting possible future mutations. They are also directly compatible with standard dynamic programming algorithms, including Forward-Backward and Viterbi. In addition, both models can simulate realistic evolutionary trajectories, providing useful benchmarks for phylogenetic methods. Neural TKF has an additional advantage: it can incorporate embeddings from modern protein language models (autoregressive or otherwise) by combining those embeddings with the model's existing representations. MixDom can likewise be extended to capture coevolutionary dependencies in a statistically principled way, similar to Potts models [4]. More broadly, these results demonstrate that biological inductive biases and modern machine learning can be combined to build models that are both expressive and interpretable. Future work will extend these AI-based evolutionary models to applications in statistical phylogenetics and bioengineering. [1] Thorne, J. L., Kishino, H., and Felsenstein, J. 1992. https://doi.org/10.1007/BF00163848. [2] Graves, A. 2012. https://doi.org/10.48550/arXiv.1211.3711. [3] Sonnhammer, E. L., Eddy, S. R., and Durbin, R. 1997. https://doi.org/10.1002/(SICI)1097-0134(199707)28:3<405::AID-PROT10>3.0.CO;2-L. [4] Levy, R. M., Haldane, A., and Flynn, W. F. 2017. https://doi.org/10.1016/j.sbi.2016.11.004.