Tumors are almost always sequenced once, at diagnosis or at relapse. Yet oncologists want to know the order in which the tumor's mutations arose, because early events are the natural targets for early detection and late events often mark resistance. Two kinds of evidence exist. The first is cohort statistics: across thousands of snapshots, which mutations tend to appear without which others. The second is a clock inside each sample: mutations carried by more of the tumor's cells tend to be older. Current tools use one or the other. Cohort models become intractable beyond a few dozen events per tumor. The within-sample clock is distorted whenever copy number changes, meaning gains or losses of stretches of DNA, alter how often a mutation shows up in the reads.
We propose one model that uses both kinds of evidence. A transformer reads the set of mutations a tumor has already acquired and outputs the rate at which each remaining mutation arises next. It is pre-trained across all cancer types on large panel-sequencing cohorts, then adapted to small cohorts. The order of events is treated as a hidden variable. We never trust the observed allele-frequency order. A second network, trained on simulated tumors with realistic copy-number distortion, proposes plausible orders. Those proposals are weighted by how well they explain the cohort-level data. The claim is that this pairing does three things current methods cannot: it scales past the 25–32 active events per tumor where exact hazard models stop working, it transfers ordering structure to rare cancer types with fewer than a hundred samples, and it stays calibrated when allele frequencies are corrupted by copy-number changes.
Core Claim
Mutual Hazard Networks (MHN) describe tumor progression as a continuous-time Markov chain, a random process that jumps between genotypes (the set of mutations present) at event-specific rates. In MHN, the rate of event $j$ is a baseline multiplied by pairwise factors, one for each event already present. The mhn package makes this practical up to more than 100 total events on GPU, but only while each tumor carries at most about 25–32 events. Timed hazard networks add a per-patient progression time and restrict gradient computation to the mutations present in each sample. Both keep the pairwise, log-linear rate form, and both require an exact sum over the tumor's possible histories.
We replace the pairwise rate with a learned function $\lambda_\theta(j \mid S, c)$. Here $S$ is the set of events already present, $c$ is a cancer-type token, and $\theta$ are the parameters of a set transformer: a transformer without positional encodings, so its output does not depend on how the input events are listed. We keep MHN's convention that a tumor is observed at a random time drawn from a unit-rate exponential distribution. Under that convention the probability of observing genotype $x$ is a sum over orderings $\pi$ of its events:
$$p_\theta(x) = \sum_{\pi} \prod_{k=1}^{|x|} \frac{\lambda_\theta(\pi_k \mid S_{k-1})}{1+\Lambda_\theta(S_{k-1})} \cdot \frac{1}{1+\Lambda_\theta(x)}.$$
In this expression, $S_{k-1}$ is the set of the first $k-1$ events of $\pi$, and $\Lambda_\theta(S)$ is the total rate of all events not yet in $S$. The "1" in each denominator is the rate at which the tumor is biopsied, competing against the next mutation. One forward pass returns every rate, so evaluating a single ordering is cheap. The sum over orderings is the hard part, and we do not compute it exactly.
We estimate $p_\theta(x)$ by importance sampling. Orderings are drawn from a proposal network $q_\phi(\pi \mid x, v, \kappa, \rho)$ that sees each mutation's variant allele frequency $v$ (the fraction of reads carrying it), the local copy number $\kappa$, and the tumor purity $\rho$. Training maximizes the importance-weighted lower bound $\mathbb{E}_{q_\phi}\big[\log \frac{1}{K}\sum_{i=1}^K p_\theta(x,\pi^{(i)})/q_\phi(\pi^{(i)})\big]$, where $K$ is the number of sampled orderings and $p_\theta(x,\pi)$ is one term of the sum above. The bound tightens as $K$ grows, because the average of importance weights is an unbiased estimate of $p_\theta(x)$.
The within-sample clock therefore enters only as a proposal. When copy number corrupts the allele frequencies, the cohort-level rate model assigns low weight to the implausible orders the clock suggests. When the clock is informative, it concentrates sampling on the right histories. The observed allele-frequency order is never imposed as a positional encoding, and this is where our design differs from the obvious "language model over VAF-sorted mutations."
Relation to Prior Work
Two lines of work motivate the design. The first shows that cohort structure is real and ordered. Gerstung et al. fit hidden conjunctive Bayesian networks and find pathway-level orders with false-positive rates around 4–10%, but they stall near 12 variables. MILP progression networks reach 28 aberrations in renal carcinoma. Neyshabouri et al. show that such optimization methods fall into a "parsimony trap," absorbing passenger mutations into driver pathways, and that a probabilistic MCMC model with explicit passenger rates avoids it. The second line shows that single samples carry timing information. TrackSig sorts mutations by allele frequency into pseudo-time bins. Salichos et al. read growth dynamics from neutral mutations that hitchhike alongside drivers. The SMC-Het benchmark shows that single-sample reconstruction degrades below about 32 reads per chromosome copy, and that ensembling 31 methods did not beat the best single one. That last result warns against simply averaging clocks. TrackSig and SMC-Het also assume near-diploid backgrounds, which is the confound our proposal network must learn around.
Other work supplies methods we reuse or constrains the design. MHN and TimedHN supply the likelihood we generalize. Our model reduces exactly to MHN when the rate network is restricted to pairwise log-linear terms, and we use that reduction as an ablation. BulkRNABert supplies the idea of pre-training a transformer over a gene-indexed set with gene-identity embeddings instead of positions. It also shows that pre-training on a broad corpus beyond the target cohort (GTEx and ENCODE) helps downstream tasks. It models static prognosis, however, and has no notion of order. We keep its permutation-invariant input but make the output a generative process in time.
Among work at the direct intersection, Woollie and the Medical World Model model progression as radiological change in text or CT scans, with no molecular events. PUR-IRL treats mutation accumulation as sequential decisions but depends on precomputed phylogenies from 27 patients and learns no shared representation. None of these fits a scalable generative model of mutation order across cohorts.
Research Program
The work has three parts.
The first is a simulator used for pre-training. It generates tumor histories from randomly drawn progression processes: MHN-style pairwise hazards, plus higher-order "AND" dependencies of the conjunctive Bayesian network kind, plus type-specific rate offsets. The simulated tumors are then passed through a read-level noise model with purity, subclonal copy-number changes, whole-genome doubling, and depth spanning the 32-reads-per-copy threshold identified by SMC-Het. The proposal network $q_\phi$ is pre-trained with supervision on these simulations, since the true orders are known there. It is then refined jointly with $\lambda_\theta$ on real data through the importance-weighted objective.
The second is pan-cancer pre-training of the rate network on AACR-GENIE panel data. Events are tokens: a gene plus an alteration type, such as SNV, amplification, deletion, or arm-level change. Each sample also carries a cancer-type token. Different sequencing panels assay different genes, so events outside a sample's panel are marginalized out and never scored as absent. Whole-exome and whole-genome samples from TCGA and PCAWG supply the tumors with more than 32 active events.
The third is adaptation to small cohorts, either by fine-tuning or by learning only the cancer-type embedding. Examples are the IntOGen pancreatic cohort (90 samples) and the glioblastoma cohort (78 samples). The central question is whether ordering structure learned in large cancer types transfers.
Interpretation follows directly from the model. We report the rate change on event $j$ caused by adding event $i$, averaged over contexts, which plays the role of MHN's pairwise influence matrix. We also report the most probable histories. We then check whether the known orders are recovered: APC before KRAS and TP53 in colorectal cancer, the TP53/KRAS to EGFR pattern in lung adenocarcinoma, and TP53 as an early independent source in luminal breast cancer.
Baselines
The naive reference is a clonal-precedence count. For every pair of genes, we count the tumors in which one is called clonal (present in all tumor cells) and the other subclonal (present in only some), and order the pair by majority. It uses the same allele-frequency, copy-number and purity inputs our proposal network sees, and it has no cohort model. Beating it shows the cohort likelihood adds something beyond the within-sample clock.
The strongest existing competitor is MHN via the mhn package, fit per cancer type with its cross-validated regularization. It is the most scalable exact cohort model in the file, and it was run on the same GENIE lung adenocarcinoma subset (3,662 samples, 12 genes) that we use. The file reports only qualitative trajectories for that run, so there is no reported result found on Lacuna for MHN's held-out log-likelihood on GENIE LUAD. We will reproduce it on identical splits. TimedHN is run on the 685 TCGA luminal breast tumors. It is reported to beat CAPRESE, CAPRI and MHN in F-score under 5% flipped-mutation noise, but no numeric F-score is found on Lacuna. For driver detection in simulations, the MCMC linear progression model reports F1 above 0.93 under high noise, and we treat that as the bar on its simulation regime.
Every model sees the same splits and gene sets. Every model gets the same hyperparameter-search budget, measured in GPU-hours, with MHN's regularizer searched on the same grid budget as our learning rate and width. We also run a hierarchical MHN, with shared pairwise parameters and type-specific offsets, as a fair pan-cancer version of MHN.
Three ablations isolate the key ingredients. The first restricts the rate network to pairwise log-linear terms (neural MHN), isolating the value of the richer rate function. The second replaces $q_\phi$ with uniformly random orderings, isolating the value of the within-sample clock. The third trains per cancer type without pan-cancer pre-training, isolating transfer. Beating MHN means higher held-out log-likelihood on identical data within the 25–32 event regime. It also means better pairwise-order recovery on simulations with higher-order dependencies, and a clear margin on the small IntOGen cohorts.
Why not just…?
Why not just fit MHN, or a hierarchical MHN, with more compute? This is the real threat. On panels of 12–30 genes where the true process is close to pairwise, MHN may match us. In that case the honest conclusion would be that the neural rate function adds nothing there. The neural-MHN ablation and the hierarchical MHN baseline settle this directly. Our advantage should appear in three places MHN cannot reach: tumors with more than 32 active events, where exact state-space restriction becomes intractable; simulated processes with AND-type dependencies, which a pairwise log-linear model cannot represent; and small cohorts, if pan-cancer sharing helps beyond type offsets. If none of these gains appears, the proposal reduces to a scalable approximate MHN, which is still useful but a smaller claim.
Why not just train an autoregressive language model on mutations sorted by allele frequency? Such a model learns to reproduce the allele-frequency order, including its copy-number artifacts. The TrackSig and SMC-Het analyses both assume diploid backgrounds, and whole-genome doubling is exactly where those clocks fail. We run this model as a baseline on simulations with increasing subclonal copy-number burden. Our prediction is that its ordering accuracy tracks the corruption rate, while our importance-weighted model degrades more slowly.
Why not just fine-tune a general or medical LLM on mutation lists? Evidence from Woollie and MeWM shows general models underperforming domain-trained ones. Their evidence is textual and radiological, however, so it does not settle the molecular question. The deeper problem is that a text LLM defines no likelihood over cross-sectional genotypes and cannot be scored on held-out cohort fit. We include a fine-tuned 8B model prompted to rank event pairs as a pairwise-order baseline only.
Proposed Experiments and Decisive Checks
On simulations with known ground truth, we measure three things: pairwise-order accuracy (the fraction of event pairs placed in the correct order), influence-edge F1, and held-out log-likelihood. We sweep events per tumor from 10 to 150, copy-number burden, and depth across the 32-reads-per-copy threshold. The first decisive check is that above 32 active events our model keeps pairwise-order accuracy near its low-event level, where exact MHN cannot run at all.
On GENIE LUAD and TCGA luminal breast cancer, we compare held-out log-likelihood with MHN and TimedHN, and we check recovery of the reported orders.
The second decisive check is external timing validation. We train on genotypes alone, with the proposal network uniform or with allele frequencies withheld. We then test predicted pair orders against PCAWG samples in which one mutation is confidently clonal and the other subclonal, restricted to diploid, high-depth regions so that this held-out clock is trustworthy.
The third decisive check is transfer. On IntOGen pancreatic and glioblastoma cohorts subsampled to 25, 50 and 90 tumors, pre-trained adaptation should beat both per-type training and hierarchical MHN in held-out likelihood. It should also recover KRAS as the initiating event in pancreatic cancer at smaller sample sizes.
If all three checks fail against hierarchical MHN, we will report that pan-cancer neural pre-training adds no ordering information beyond pairwise hazards.
References
- <tt> mhn </tt> : a Python package for analyzing cancer progression with Mutual Hazard Networks
- Timed hazard networks: Incorporating temporal difference for oncogenetic analysis
- The Temporal Order of Genetic and Pathway Alterations in Tumorigenesis
- Learning Oncogenetic Networks by Reducing to Mixed Integer Linear Programming
- Inferring tumor progression in large datasets
- Reconstructing evolutionary trajectories of mutations in cancer
- Estimating growth patterns and driver effects in tumor evolution from individual samples
- Crowd-sourced benchmarking of single-sample tumor subclonal reconstruction
- BulkRNABert: Cancer prognosis from bulk RNA-seq based language models
- Large language model trained on clinical oncology data predicts cancer progression
- Medical World Model: Generative Simulation of Tumor Evolution for Treatment Planning
- The Unreasonable Effectiveness of Inverse Reinforcement Learning in Advancing Cancer Research