Differentiating Breeding Programs at the Selection Cut

Modern crops descend from a small slice of their wild ancestors. Genes for stress tolerance and disease resistance were lost along the way, and breeders now try to pull them back from wild relatives. The difficulty is that a useful wild gene arrives attached to long stretches of unwanted wild DNA. Removing that baggage takes many generations of crossing and selection. The breeder's real decision is how to weigh "carry the wild gene," "shed the wild baggage," and "keep yield high" at each generation, and that decision is currently tuned by rules of thumb, by greedy one-generation prediction, or by black-box reinforcement learning that needs millions of simulated generations.

We propose to compute the gradient of a whole multi-generation breeding program's final outcome with respect to these per-generation selection weights, directly from simulated breeding runs. The method adapts perturbation analysis from operations research, a family of techniques that obtain derivatives from a single simulated trajectory by tracking how a small change in a control parameter shifts the discrete events along it. The central observation is that in a breeding program, the events a continuous selection weight can actually move are not the crossover positions inside meiosis. They are the moments where two candidates tie at the selection cutoff. Differentiating at those ties gives an unbiased gradient whose cost grows with the number of generations, not with the number of tunable weights. That makes gradient-based design of pre-breeding schemes with hundreds of weights practical.

Core Claim

Consider a breeding program run for $T$ generations. At each generation $t$, every candidate $i$ receives a selection score $s_{i,t}(\theta) = \theta_t^\top f_{i,t} + e_{i,t}$. Here $f_{i,t}$ is a feature vector: predicted breeding value, dosage of the target wild allele, and the fraction of wild DNA in each chromosome bin flanking the target. The vector $\theta_t$ holds the breeder's weights, and $e_{i,t}$ is the evaluation noise, with known density $\phi$. The top $k$ candidates by score become parents.

Hold fixed all the randomness of a run: the crossover positions, the noise draws, and the environmental effects. The terminal objective $J$ is then piecewise constant in $\theta$. It could be, for example, the genetic value of the best line that carries the target allele, minus a penalty for leftover wild DNA. Because $J$ is flat between jumps, naive sample-path differentiation returns zero almost everywhere. This is the textbook failure of perturbation analysis when a parameter change reorders events, noted as the main open limitation of the method in the research file.

Our estimator recovers the missing gradient by conditioning on the noise of the two candidates at the cutoff in each generation, in the spirit of smoothed perturbation analysis:

$$ \widehat{\nabla_{\theta_t} J} \;=\; \phi\!\left(\text{gap}_t\right)\,\bigl(f_{k,t} - f_{k+1,t}\bigr)\,\Delta J_t . $$

The quantities in this formula are defined as follows. The term $\text{gap}_t$ is the noise difference that would make the last-selected candidate $k$ and the first-rejected candidate $k+1$ tie. The term $\Delta J_t$ is the change in terminal outcome when those two candidates are swapped. It is estimated by re-running generations $t+1,\dots,T$ with the same random numbers.

A full gradient over all $T \cdot P$ weights therefore costs $T+1$ simulations, one base run plus one swap re-run per generation, regardless of the number of weights $P$. Finite differences need $TP+1$ runs. We expect variance to be governed by the swap outcome $\Delta J_t$ rather than by a score-function weight. The reason is that the estimator is a conditional expectation of the policy-gradient integrand over the boundary noise, and conditioning cannot increase variance.

This is also where we depart from the research file's framing. Its first gap proposes differentiating through meiotic crossover breakpoints. Those positions do not depend on anything the breeder sets continuously, so there is nothing there to differentiate. The breeder's control enters only through who crosses the selection cut.

Relation to Prior Work

Two lines of work motivate the proposal.

Breeding Programs Optimization with Reinforcement Learning treats a 10-generation program as a sequential decision problem and trains a proximal policy optimization agent over population genotypes. Its results show that greedy genomic selection is myopic and that keeping sub-optimal diversity early pays off later. It reports about 6% higher shoot apical meristem volume than standard genomic selection. The agent, however, needs curriculum learning, permutation-invariant networks, and millions of simulated generations. Its trait model is purely additive with no linkage drag. We keep its insight that non-greedy weighting matters, but replace the black-box policy gradient with a structured estimator over an interpretable selection index.

ChromaX supplies the simulation engine. It is a GPU breeding simulator in JAX that reports 100,000 crosses in 29 ms against 14.8 s for AlphaSimR. Its automatic differentiation covers continuous parental weights within a single cross generation. It does not differentiate through hard, multi-generation truncation selection, which is exactly the object we target.

A third group supplies the method. The Cassandras traffic-light and persistent-monitoring papers, for example Multi-intersection Traffic Light Control Using Infinitesimal Perturbation Analysis and An Optimal Control Approach for the Persistent Monitoring Problem, show the pattern we reuse. They reduce a hard control problem to a finite set of event-defining parameters and run gradient descent on sample-path sensitivities. Sensitivity analysis in HMMs with application to likelihood maximization documents the high variance of output-only score-function estimators, which is our argument against the policy gradient.

The closest biological precedent is Personalized cancer therapy design: Robustness vs. optimality. It applied perturbation analysis to threshold-switching therapy and found that exact optima were fragile: a 15% parameter error caused failure, while slightly sub-optimal settings cut sensitivity by 90–99%. Its thresholds move continuous-state switching times, whereas ours move a discrete ranking. We borrow its robustness analysis as a secondary use of our gradients.

The biology fixes the application regime. Mapping Quantitative Trait Loci for Soybean Seedling Shoot and Root Architecture Traits in an Inter-Specific Genetic Population provides the regime of a wild-favorable locus with elite background. It maps a Williams 82 × wild soybean population of 184 recombinant inbred lines over 2,925 cM, where chromosome 7 wild alleles explain about 16.2% of root variation. Origin and evolution of the bread wheat D genome provides the extreme linkage-drag regime, with wild introgressions up to 135 Mb on chromosome 1D. The wheat–Thinopyrum substitution line in Development and identification of a novel wheat-Thinopyrum ponticum disomic substitution line DS5Ag(5D) needed seven backcross generations and still carries a whole alien chromosome. That is the status quo our method is meant to shorten. Identification of QTNs, QTN-by-environment interactions, and their candidate genes for salt tolerance related traits in soybean found only 10 of 258 loci stable across environments. That result constrains us: marker effects used in selection are unreliable, which motivates the robustness analysis.

Research Program

We will extend ChromaX with a trait model that includes linkage drag. A designated wild target locus carries a benefit. Wild DNA in flanking bins carries a deleterious load proportional to its length, with optional epistatic penalties. Environment-specific marker effects mimic the instability reported in the soybean salt study. Genetic map lengths and effect sizes follow the soybean inter-specific population and the wheat 1D introgression scenario. Marker effects are simulated at these scales; we do not assume access to the original genotype files.

On top of this simulator we implement the boundary-swap estimator. We will prove its unbiasedness for the hard-truncation program under the condition that the evaluation-noise density is bounded and continuous. We will extend it to ties involving more than one boundary pair by summing over near-boundary pairs within a noise window. Variance will be characterized empirically as $k$, the population size, and $T$ vary.

The selection weights $\theta$ are then optimized with stochastic gradient ascent. We consider index parameterizations of increasing dimension: a few global weights, per-generation weights, and per-generation-per-bin weights, reaching several hundred parameters. Finally, we compute gradients of $J$ with respect to the assumed marker effects. This produces a sensitivity map that locates robust but slightly sub-optimal schemes, mirroring the cancer-therapy analysis.

Baselines

The naive reference point is standard truncation genomic selection on predicted breeding value alone, followed by conventional marker-assisted backcrossing with foreground selection for the target allele and background selection for the elite genome. This mirrors how lines like the wheat–Thinopyrum substitution line are actually produced. Any learned scheme must beat it on terminal value at equal wild-DNA leftover, or on wild-DNA leftover at equal generation count.

The strongest existing method on the long-horizon question is the proximal policy optimization agent of Breeding Programs Optimization with Reinforcement Learning. On its maize shoot apical meristem benchmark it reports "~6% higher SAM volume than standard genomic selection over 10 generations." We will reproduce that benchmark in ChromaX with its additive trait model and 10-generation horizon. Our optimized index must match or exceed the 6% gain over standard genomic selection using no more simulated generations than PPO consumes. We will also report the budget at which we reach it. On the linkage-drag scenarios no reported result was found on Lacuna, so we will train PPO ourselves with the same reward, simulator, and budget.

The strongest generic competitors are derivative-free optimizers over the same index: simultaneous-perturbation stochastic approximation and CMA-ES, both with common random numbers. They get the same simulation budget and the same hyperparameter search budget. We beat them if we reach a higher objective at equal simulations once the index has more than a few dozen weights. We expect them to tie or win at very low dimension, and will report that honestly.

The key ablation removes the swap term, leaving pure sample-path differentiation. It should give zero gradient and no progress, isolating that the selection-boundary events carry all the signal.

A second ablation replaces the estimator with a temperature-relaxed soft selection differentiated by JAX. It measures how much bias relaxation introduces when evaluated on the true hard-selection program.

Why not just…?

Why not just relax truncation into a soft top-k and backpropagate through ChromaX? This is the most serious threat, because it is easy and uses existing tooling. Its weakness is that it optimizes a different program: one where every candidate contributes fractional offspring. Its gradients are biased for the real hard-selection program, with a bias-variance trade-off set by the temperature. Our second ablation runs exactly this comparison at several temperatures, evaluating the hard program. If a well-tuned relaxation matches our results, the contribution shrinks to the unbiasedness proof and the robustness analysis, and we will say so.

Why not just use Bayesian optimization or CMA-ES over a few index weights? If the useful index really has five weights, these methods will likely do as well, and we expect them to win there. The case for gradients rests on per-generation, per-bin weighting. That granularity is what lets a scheme first tolerate wild DNA and then strip it bin by bin. The dimension sweep in our experiments decides whether that granularity buys any gain at all.

Why not just use reinforcement learning, which already solved myopia? It did, at the cost of millions of generations and an opaque policy, as reported in Breeding Programs Optimization with Reinforcement Learning. Its policy gradient weights whole trajectories by score terms, while ours attributes credit only to marginal selection decisions. The sample-efficiency curves on the maize benchmark test directly whether this matters.

Why not differentiate through crossover positions, as the file's first gap suggests? Crossover positions are not functions of the breeder's continuous parameters. There is no sensitivity to extract there, and any apparent one would come from a modeling artifact.

Proposed Experiments

We run three scenario families in ChromaX. The first is the maize shoot apical meristem benchmark, where the reported 6% PPO gain is available for comparison. The second is a soybean-like inter-specific introgression of a wild root-architecture locus on a 2,925 cM map. The third is a wheat-like scenario with a 135 Mb wild segment and a single resistance target.

The metrics are terminal genetic value of the best line carrying the target allele, remaining wild DNA in centimorgans around the target, retained allelic diversity, gradient variance per simulation, and simulations needed to reach a fixed fraction of the best found objective.

The decisive checks are four. First, on small problems with $P \le 4$, our gradient must agree with brute-force finite differences averaged over many common-random-number replicates. Second, the no-swap ablation must stall. Third, at $P$ in the hundreds, our method must beat SPSA and CMA-ES per simulation. Fourth, on the maize benchmark it must match the reported PPO gain with far fewer simulated generations.

For robustness, we perturb marker effects by environment-specific noise matching the soybean instability. We then test whether schemes chosen by low sensitivity lose little terminal value while degrading much less than the nominal optimum, the analogue of the therapy paper's 90–99% sensitivity reduction.