Tuning-Free Variational Phylogenetics for Gene Families Built from De Novo Transcriptomes

Phylogenetic inference reconstructs the branching history that relates a set of sequences. Increasingly it is run as continuous optimization: variational Bayesian phylogenetics fits a tractable distribution over trees and branch lengths by stochastic gradient ascent, and the rate-matrix estimator CherryML fits substitution models with the Adam optimizer. Each of these methods comes with a learning rate that someone has to pick. That is tolerable on a handful of curated benchmark alignments. It is not tolerable in phylotranscriptomics, where thousands of gene-family trees are inferred from sequences that a de novo assembler reconstructed from short RNA reads. Those inputs vary widely in length and in how much assembly damage they carry, such as chimeric contigs and 5′-truncated transcripts. A step size tuned on one family can stall or diverge on the next, and tuning per family multiplies the cost of the whole study.

We propose a step-size rule that needs no tuning for variational phylogenetic inference. It rests on a simple observation: the phylogenetic likelihood saturates. Beyond a branch length set by the alphabet and substitution model, the likelihood barely changes. Below a length set by alignment resolution, the data cannot tell branches apart. Both bounds can be computed from the alignment before optimization starts. Working in log-branch-length space, they turn the nominally unbounded branch-length domain into a bounded box derived from the data. A bounded domain is exactly the condition under which tuning-free stochastic optimization is known to be possible. We test whether a single configuration of a projected AdaGrad-norm method, with no learning rate to set, matches per-family-tuned Adam across thousands of assembly-derived gene families.

Core Claim

Tuning-Free Stochastic Optimization constrains our design. It proves that no tuning-free method can match tuned SGD within polylogarithmic factors on general convex problems over unbounded domains under general noise. Tuning-free optimization becomes possible only when the domain is bounded or the gradient noise is benign. Branch lengths live on $[0,\infty)$, so a naive application of parameter-free methods to phylogenetics falls on the wrong side of this result.

Our claim is that phylogenetics supplies the missing bound for free. Let $\theta_e = \log b_e$ be the log length of branch $e$. We restrict the variational location parameters to the interval

$$\theta_e \in \left[\log \tfrac{1}{cM},\ \log b_{\text{sat}}(Q)\right].$$

Here $M$ is the alignment length, $c$ is a small constant, and $b_{\text{sat}}(Q)$ is the branch length at which the transition matrix $e^{Qb}$ of rate matrix $Q$ is within a tolerance of its stationary distribution. The lower end follows from the fact that lengths shorter than roughly one substitution across the whole alignment are statistically indistinguishable. The upper end follows from saturation.

Inside this box we run projected AdaGrad-norm. This is the cumulative-gradient step size analyzed by SGD with AdaGrad Stepsizes: Full Adaptivity with High Probability to Unknown Parameters, Unbounded Gradients and Affine Variance. That paper shows the method adapts to unknown smoothness and affine-variance noise with high probability, and it supplies our update rule. The initial scale is set to the box diameter rather than tuned. The tree-topology parameters are logits of a subsplit Bayesian network, which are not naturally bounded. For them we use a separate AdaGrad-norm accumulator, and we monitor the gradient signal-to-noise ratio that Khaled and Jin identify as the other escape condition.

What is new is not the optimizer. It is the argument that phylogenetic likelihood geometry places variational phylogenetics in the regime where tuning-free optimization is provably achievable. The empirical test of that argument is the hardest realistic input regime: gene families whose sequences come out of imperfect de novo assemblies.

Relation to Prior Work

Two papers supply the phylogenetic machinery. Variational Bayesian Phylogenetic Inference parameterizes tree topologies with subsplit Bayesian networks and branch lengths with log-normal distributions. It trains both by stochastic gradient ascent, using the multi-sample VIMCO estimator for topologies and the reparameterization trick for branch lengths. It reports posteriors matching very long MrBayes runs on the DS1–DS8 benchmarks. We reuse its model unchanged and replace only the optimizer. Its experiments use Jukes–Cantor and curated alignments, and it does not study learning-rate sensitivity. CherryML: scalable maximum likelihood estimation of phylogenetic models showed that gradient methods in PyTorch with Adam make rate-matrix estimation roughly 1,000 times faster than expectation-maximization. That result motivates the move to gradient-based phylogenetics. However, its objective is deterministic once the count matrices are built, and it fixes the tree. Our target is the stochastic variational setting, where step-size choice matters most.

The optimization literature supplies both the method and its limits. Local-curvature methods such as A first-order primal-dual method with adaptivity to local smoothness and Nesterov Finds GRAAL: Optimal and Adaptive Gradient Method for Convex Optimization estimate smoothness from successive gradients. They are attractive, but they are analyzed in deterministic or convex settings. The primal-dual method also enforces constraints only asymptotically. Under VIMCO noise, the ratio of successive gradient differences is itself noisy, which is why we choose the cumulative AdaGrad family. Universality of AdaGrad Stepsizes for Stochastic Optimization: Inexact Oracle, Acceleration and Variance Reduction supports this choice by showing that AdaGrad step sizes adapt across smoothness classes without knowing which class applies. We are honest that the variational objective is nonconvex, so the cited guarantees motivate the design but do not certify it. That is why the empirical program carries the weight.

On the assembly side, Examining De Novo Transcriptome Assemblies via a Quality Assessment Pipeline shows that Trinity, SOAPdenovo-Trans and Trans-ABySS produce quite different assemblies from the same shrimp reads. It also shows that length statistics like N50 mislead. It recommends trusting protein hits shared by at least three assemblers. transXpress: a Snakemake pipeline for streamlined de novo transcriptome assembly and annotation documents a high rate of 5′-partial transcripts and gives a reproducible annotation chain from assembly to Pfam domains. Both papers stop before phylogenetics. They motivate our claim that assembly-derived families are a hard, heterogeneous input distribution for tree inference, and transXpress supplies our pipeline.

The non-research-document direction plays only a small hygiene role. We harvest study metadata and read accessions from a literature index. Records like journal mastheads (IEEE Transactions on Fuzzy Systems publication information) and proceedings front matter (Frontmatter) produce empty or hallucinated extractions, so we screen them out with a simple anchor-absence rule before mining. We do not claim a contribution there.

Research Program

The first component is the bound derivation. For Jukes–Cantor, GTR+Gamma and an LG-type amino-acid model, we compute $b_{\text{sat}}(Q)$ as the smallest length at which the total-variation distance between $e^{Qb}$ and the stationary distribution falls below a fixed tolerance. We then verify empirically that per-site likelihood gradients beyond the bound are negligible. The variational scale parameters get a similar box, derived from the same interval width. We will check how often the box binds on real data. If optimal locations frequently sit on the boundary, that is a known weak point for adaptive acceleration, flagged in Online to Offline Conversions, Universality and Adaptive Minibatch Sizes. We would then widen the tolerance and report the effect.

The second component is the optimizer: projected AdaGrad-norm with one accumulator for branch-length parameters and one for topology logits. It has a single fixed configuration across all experiments and no learning rate. We also log the per-iteration gradient signal-to-noise ratio. This lets us test the prediction that failures concentrate where noise is not benign, as Khaled and Jin's theory implies.

The third component is the assembly-derived benchmark. We use the Litopenaeus vannamei four-tissue RNA-seq data and the Piper longum SRA reads described in the two assembly papers. Each is assembled with Trinity, rnaSPAdes, SOAPdenovo-Trans and Trans-ABySS. Pfam-domain families come from the transXpress chain of TransDecoder and HMMER3. Each family places the assembled sequences from every assembler among Swiss-Prot homologs, plus Daphnia pulex sequences for shrimp. This yields thousands of protein gene families. The same biological gene therefore appears with assembler-specific damage, which lets us measure how assembly artifacts change optimization difficulty while holding the gene fixed.

Baselines

The naive reference point is VBPI's own default: Adam at its standard default learning rate, applied unchanged to every family. This is what a practitioner running thousands of families would actually do, and it mirrors CherryML's use of default Adam. Beating it means fewer stalled or diverged runs and a higher final evidence lower bound at equal gradient evaluations.

The strongest competitor is Adam with its learning rate tuned per family by grid search, given five times the gradient-evaluation budget of our method. This represents the best achievable result if one pays the full hyperparameter cost. A weaker but more practical variant tunes once on DS1–DS8 and transfers the setting to every assembly-derived family. All methods share the same variational family, the same number of VIMCO samples, the same substitution model and the same stopping budget. On the reported strength of the underlying model, VBPI matched MrBayes runs of 10 billion iterations on DS1–DS8 and gave marginal likelihood estimates competitive with generalized stepping-stone sampling at lower variance. However, no reported result was found on Lacuna for numeric ELBO or marginal-likelihood values on DS1–DS8, so we will regenerate all numbers. Our method beats tuned Adam if its final lower bound is within tuned Adam's seed-to-seed spread on at least 95% of families, at no more than one-fifth of the total compute.

A non-variational reference is IQ-TREE maximum likelihood with ultrafast bootstrap, used in empirical work such as The complete chloroplast genome of Ziziphus mairei Dode 1908 (Rhamnaceae), an endangered perennial plant in Yunnan, China. Its per-branch Newton optimization is already effectively tuning-free. It anchors topology accuracy, measured by comparing split frequencies with bootstrap supports.

The key ablation removes the saturation-derived projection and runs unprojected AdaGrad-norm with the initial scale set by a generic default. This isolates whether the data-derived bound, rather than AdaGrad itself, is what delivers robustness.

Why not just…?

Why not just use default Adam, as VBPI and CherryML do? CherryML's 1,000-fold speedup shows that default Adam works on a deterministic objective with curated Pfam alignments and a fixed tree. It says nothing about stochastic objectives across heterogeneous inputs. Fixed step sizes can fail badly when local smoothness varies: A first-order primal-dual method with adaptivity to local smoothness reports that a fixed-step primal-dual method diverged on 80% of nonconvex phase-retrieval instances where the adaptive method always converged. Whether default Adam fails at a meaningful rate on assembly-derived families is an empirical question. The naive baseline settles it. If default Adam's failure rate is negligible, our contribution shrinks to a convenience, and we will report that.

Why not just tune once on DS1–DS8 and transfer? This is the real threat, because it costs almost nothing. Our hypothesis is that assembly artifacts shift curvature and gradient noise. Chimeric or truncated sequences create long, poorly supported branches near saturation, and gappy columns lower the signal-to-noise ratio. The transferred setting should therefore degrade specifically on families built from the damaged assemblies. Because each gene appears under four assemblers, we can test this directly. If the transferred setting works as well as ours on every assembler's families, the idea fails and we will say so.

Why not just use L-BFGS or Newton line search, which are tuning-free already? For maximum-likelihood point estimates they are, which is why IQ-TREE is a reference rather than a target. Line searches require consistent function values, and the variational objective is available only through noisy multi-sample estimates. A line search on a noisy objective either needs very large sample counts or accepts spurious steps. We include a large-sample L-BFGS variant at matched compute to measure this cost rather than assert it.

Why not just clean the assembly first, keeping only contigs shared by three assemblers? That recommendation from the shrimp assessment paper reduces artifacts, but it also discards families and rare transcripts. It removes the variation without making the optimizer robust to whatever damage remains. We run the intersection-filtered family set as an additional condition. If filtering alone makes default Adam reliable, that is a cheaper solution and will be reported as such.

Proposed Experiments

On DS1–DS8, under both Jukes–Cantor and GTR+Gamma, we compare all optimizers on final lower bound, marginal-likelihood estimate variance, gradient evaluations to reach within one nat of the best observed bound, and agreement of split frequencies with long MrBayes reference runs. This establishes that removing the learning rate costs nothing on curated data.

On the shrimp and Piper longum families, the decisive check compares three quantities per family: the divergence and stall rate of each optimizer, the gap to per-family-tuned Adam, and how both depend on the assembler. For a random subset of about one hundred families, we run long MrBayes chains to obtain reference posteriors.

Two further analyses test the mechanism. The first regresses each optimizer's failures on measured gradient signal-to-noise ratio and on assembly-damage indicators: chimera flags, 5′-partial status, and RSEM-EVAL contig scores. We predict that default and transferred Adam fail on low-signal, high-damage families, and that the projected method does not. The second is the no-projection ablation. If removing the saturation box erases the advantage, the bound is the operative ingredient and the core claim stands. If it does not, the result reduces to the familiar statement that AdaGrad is robust, which is a weaker finding than the one proposed here.