Many plant genomes carry the traces of ancient whole-genome doubling or tripling. A basic question about each such event is still often unsettled. Did it come from one lineage copying its own genome (autopolyploidy), or from two different lineages hybridizing and then doubling (allopolyploidy)? Answering it is hard because millions of years of gene loss and rearrangement blur the evidence, and because the diploid parents are often extinct. Bioinformaticians currently respond by hand-deriving statistical models of gene duplication and loss. Those models become intractable as histories get more complex. They also can be wrong in ways nobody notices, because real genomes almost never come with known answers.
We propose to borrow the central move of execution-guided code refinement, where a language model writes a program, runs it, reads the failure, and repairs it, but to replace the compiler with a genome-evolution simulator whose true histories are known. A language model proposes inference programs that read syntenic gene data and output "auto," "allo," the sequence of duplication and tripling events, or "cannot tell." A second agent plays adversary: it writes simulator settings, within biologically plausible ranges, under which the current program gives a wrong answer. Repairs are driven by these counterexamples rather than by a fixed test set. Two outputs come out of this. The first is a readable inference procedure that has been stress-tested against its own worst cases. The second, which may matter more, is a map of where auto and allo origins are genuinely indistinguishable from the data. That map turns the vague notion of "genomic camouflage" into a measured boundary.
Core Claim
The open problem on the genomics side is not a shortage of statistics. It is the lack of any check on whether a given statistic still works when the assumptions behind it break. The best existing tool, the gene-triplet approach of Distinguishing successive ancient polyploidy levels based on genome-internal syntenic alignment, looks at three-way syntenic alignments within one genome. It uses branching-process models of duplication and fractionation (gene loss after duplication) to separate histories such as two triplings in durian, $(3,3)$, from a tripling then a doubling in poplar, $(3,2)$. The authors note that its multivariate-normal integrals become fragile as events accumulate and divergence peaks overlap. It also says nothing directly about auto versus allo origin.
On the code side, the field's own failure analysis supplies the design constraint. Refinement loops without external ground truth magnify errors. In Do Users Write More Insecure Code with AI Assistants?, AI-assisted users produced vulnerable code on 36% of SQL injection tasks versus 7% for the control group, while rating their own code as secure. Multi-agent loops also drift into false consensus, as shown in Adversarial Review: Cooperative Code Review through Structured Disagreement.
Our claim is that a simulator with known histories can serve as the executable ground truth that polyploidy inference lacks. We further claim that adversarially generated simulation cases, rather than a fixed simulation suite, are what make the resulting programs robust and expose the limits of identifiability. That second claim is the testable novelty.
Research Program
The first component is a forward simulator. It starts from one ancestral gene order (auto) or two lineages that diverge for a time $T$ before merging (allo). It then applies doubling or tripling events, fractionation that can be symmetric or biased toward one subgenome, chromosomal rearrangements, and rate-varying sequence divergence. It emits exactly what a real pipeline would see: syntenic blocks, gene triplets, and synonymous-substitution distances. Every parameter has an explicit plausible range, and those ranges bound what the adversary may propose. A second, independently written simulator with different modeling choices is held out entirely for evaluation. Its purpose is to detect programs that exploit artifacts of the first simulator.
The second component is the program search. We reuse the machinery of A2DEPT, which evolves free-form algorithm code as a tree of candidates using mutation and crossover operators. It includes a self-healing loop that implements missing dependencies before execution, and it reported a 9.8% reduction in normalized optimality gap over ReEvo and MCTS-AHD on combinatorial optimization. A2DEPT scores candidates on a fixed benchmark. We change the scoring signal. The fitness of a program is its accuracy-with-abstention on a pool of simulated genomes that the adversary keeps growing.
The adversary follows the structured-disagreement protocol of Adversarial Review. In that protocol a Critic must back each objection with cited evidence before code is changed, and it beat a five-agent unstructured team (87% versus 82% on LiveCodeBench). In our setting, the adversary's "evidence" is not an argument. It is a concrete simulator configuration plus seed under which the program fails, and the claimed failure is checked by running the program on that simulation. This keeps the debate grounded in execution rather than persuasion.
The third component is the identifiability analysis. Some counterexamples resist every repair across many generations. For each such case we pair the failing auto and allo configurations and run a two-sample test on the simulated data themselves. If the data distributions cannot be told apart at the available genome size, the region is non-identifiable, and the correct program behavior there is to abstain. The accumulated set of such regions, indexed by time since the event, divergence before the merge, and fractionation bias, is a scientific result in its own right.
Baselines
The naive reference point is the conventional reading of synonymous-distance peaks. It counts peaks to infer the number of events and assigns origin by majority class. The file notes that this pairwise approach cannot even separate one tripling from two doublings, so it sets the floor.
The strongest domain baseline is the gene-triplet branching-process method of Zheng et al., reimplemented and given the same simulated inputs. For origin calls it is extended with the most natural hand-built addition, a fractionation-bias statistic computed between inferred subgenomes. No reported result was found on Lacuna for its accuracy on simulated genomes or for any auto-versus-allo classification accuracy. Its only reported outcomes are model selections on real genomes: $(3,3)$ for durian, $(3,2)$ for poplar, and $(3,2,3)$ for cabbage. The strongest learning baseline is a neural classifier trained directly on simulator output. It gets the same total number of simulator calls as our method, the same raw inputs, and its own hyperparameter search under a matched compute budget. It is also given every counterexample the adversary discovers, so it is not starved of hard cases.
The strongest code-refinement baseline is an LLM pipeline written once and then repaired from execution errors and accuracy feedback on a fixed simulation set, in the manner of CAAFE. That paper reported a mean ROC AUC improvement from 0.798 to 0.822 on tabular data using traceback-driven repair. Two ablations isolate our key ingredient. The first is A2DEPT-style evolution on a fixed, uniformly sampled simulation set of equal size, which removes the adversary. The second is the full system with abstention disabled. All LLM-based arms use the same model and token budget.
Beating the baselines means two things at matched budget. First, higher worst-region accuracy over the parameter grid on the held-out independent simulator. Second, accuracy at equal coverage that is no worse on average. Average accuracy on the training simulator alone does not count.
Why not just…?
Why not just train a neural classifier on simulations? This is the real threat. On in-distribution data it may well match or beat evolved programs. We do not argue around this; the experiment decides it. The test that matters is transfer to the independently written simulator and agreement on real genomes with known answers. A classifier can fit artifacts of one simulator. A short program built from named genomic statistics can be inspected, and so can its failure modes. If the classifier also transfers as well, the contribution narrows to readability and the identifiability map, and we will report that. The map does not depend on which learner wins.
Why not just extend the triplet model by hand? Zheng et al. themselves report that the integrals grow fragile with more events. More fundamentally, a hand-extended model is still only checked against its own assumptions. Our triplet baseline arm measures exactly how far careful hand extension gets under adversarial regimes.
Why not just prompt a frontier model once, or run a plain repair loop? One-shot generation lags iterative loops throughout the file. Raw GPT-4 resolved 1.74% of SWE-bench issues versus 13.94% for MAGIS. Compiler-feedback gains plateau after two or three rounds, moving from 48.57% to 52.57% in CodeTransOcean. A plain loop optimized on a fixed set should show a similar plateau. The fixed-set ablation tests whether adversarial cases break it.
Why not just have agents debate the auto-versus-allo evidence directly? Wang et al.'s reanalysis in Ancient allopolyploidy and specific subgenomic evolution drove the radiation of poplars and willows shows that expert consensus on the salicoid event was wrong for years. Debate without an executable check is the setting in which Perry et al. and Qiu and Gill document error magnification and false consensus. In our design, every disagreement must resolve to a runnable simulation.
Proposed Experiments
The main experiment evaluates all arms on a grid over event age, pre-merge divergence, fractionation bias, and rearrangement rate. Origin calls and event-sequence calls are both scored. We report balanced accuracy, the accuracy-coverage curve under abstention, calibration error, and worst-cell accuracy, separately on the training simulator and the held-out one.
The first decisive check compares the adversarial loop with the fixed-set ablation on held-out worst-cell accuracy. If the adversary does not help, the core claim fails. The second decisive check compares evolved programs with the neural classifier on the independent simulator. The third verifies the identifiability map: cells where all methods fail should also be cells where the two-sample test cannot separate auto from allo data. If methods fail in cells that are actually separable, that is a method failure and cannot be explained away as camouflage.
Real-genome agreement is a sanity check rather than a statistical test, because it rests on five cases. These are durian $(3,3)$, poplar $(3,2)$ with allopolyploid origin per Wang et al., cabbage $(3,2,3)$, and Chinese cherry, whose autotetraploid origin was established by in situ hybridization in Autotetraploid Origin of Chinese Cherry Revealed by Chromosomal Karyotype and In Situ Hybridization of Seedling Progenies. The fifth case is Salix as a second allopolyploid lineage. As an exploratory application only, programs that pass all checks will then be run on Echinochloa, where missing progenitors leave origins open. The prediction that matters there is whether the program abstains. The second agent is the Salicaceae lineage tested in Wang et al.
References
- Distinguishing successive ancient polyploidy levels based on genome-internal syntenic alignment
- Do Users Write More Insecure Code with AI Assistants?
- Adversarial Review: Structured Disagreement for Grounded Agentic Code Review
- $A_2$DEPT: Large Language Model–Driven Automated Algorithm Design via Evolutionary Program Trees
- Large Language Models for Automated Data Science: Introducing CAAFE for Context-Aware Automated Feature Engineering
- MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolution
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translation
- Ancient allopolyploidy and specific subgenomic evolution drove the radiation of poplars and willows
- Autotetraploid Origin of Chinese Cherry Revealed by Chromosomal Karyotype and In Situ Hybridization of Seedling Progenies
- Genomic insights into the evolution of Echinochloa species as weed and orphan crop