Two fine-tunes of one base model, merged by weighted task vectors
Both parents were fine-tuned from the same base model, so their weights are still close to the base. Each parent's difference from the base (its task vector) carries what it learned. We add both task vectors back onto the base, with a separate weight for every layer group.
The chromosome
Group g is the embeddings, one of the 28 transformer layers, or the final norm: 30 groups. Two parents × 30 groups = 60 real-valued genes, each in [0, 2]. A weight above 1 scales a task vector up.
Base model: Qwen/Qwen2.5-1.5B. Math parent: sunblaze-ucb/Qwen2.5-1.5B-GRPO-MATH-1EPOCH.
The fitness function
Build the merged model on the GPU, ask it 64 Hindi GSM8K training problems with greedy decoding (at most 512 new tokens), and count how many final answers match. One evaluation takes about 90 seconds on a Kaggle T4.
Final comparison: 250 held-out test problems, 1024 new tokens.
Written from scratch, compared against CMA-ES and random search
Every optimizer got the same budget of 170 fitness evaluations, with a population of 16. The demo below runs the same GA operators on a 2-gene toy problem (the Rastrigin function), so you can watch selection, crossover and mutation work.
| Component | Our choice |
|---|---|
| Chromosome | 60 real-valued genes in [0, 2] |
| Initial population | Both parents, their 50/50 average, the rest uniform random |
| Selection | 3-way tournament |
| Crossover | BLX-α blend crossover, α = 0.3, rate 0.9 |
| Mutation | Gaussian, per-gene rate 0.15, σ = 0.15 decaying 5% per generation |
| Elitism | Best 2 kept unchanged |
| Budget | 170 fitness evaluations (about 4.5 hours on one T4) |
Live demo: our GA on Rastrigin
Each dot is one individual. Lighter ground is better; the global optimum is the ring at the centre, surrounded by many local optima. With σ-decay on (our setting), the population's diversity collapses and it often settles on a local optimum, as our real run did at generation 9. Turn decay off, or use a population of 48, to compare.
Diversity over generations (mean standard deviation of the genes).
The searches raised fitness from 25% to 33–39%
Each dot is one merged model, scored on the 64-problem search set. Lines show the best fitness found so far. CMA-ES kept improving until the end; our GA found its best at evaluation 36 and stalled.
Dashed line: the 50/50 average scores 25.0% on the same 64 problems. One problem is worth 1.6 points.
Population diversity
Mean per-gene standard deviation within each generation. Dashed: random search, which never converges by design.
The GA's diversity fell from 0.20 to 0.05 at generation 9 (premature convergence). CMA-ES adapts its step size and stayed near 0.18.
Search summary
| Optimizer | Best fitness | Found at eval | Mean, last 40 |
|---|---|---|---|
| GA (ours) | 32.8% | 36 | 29.8% |
| CMA-ES | 39.1% | 139 | 31.3% |
| Random search | 37.5% | 160 | 26.3% |
The GA's generation mean rose from 25.4% to 30.5% while random search stayed near 26%: selection did work, but on a noisy signal.
What each optimizer's best merge looks like, layer by layer
Blue cells take less than the full task vector, white cells take exactly 1, red cells amplify it up to 2×. A uniform 50/50 average would be a flat row of 0.5 for both parents.
Merging beats both parents. Evolved recipes do not beat simple merging.
Whiskers show ±1 standard error (about ±2.7 points at n = 250). The evolved recipes looked best during search and fell furthest on the test set.
Test accuracy
Search set vs test set
Hollow dot: accuracy on the 64 search problems. Solid dot: accuracy on the 250 test problems.
Fixed merges barely move between the two sets. The higher a recipe's search score, the larger its drop: GA −10.4, random −15.9, CMA-ES −17.9 points.
How certain? Exact McNemar test, paired on the same 250 problems
| Comparison | Only first right | Only second right | p |
|---|---|---|---|
| 50/50 average vs Instruct (A) | 35 | 15 | 0.007 |
| 50/50 average vs GRPO-MATH (B) | 25 | 15 | 0.15 |
| 50/50 average vs GA | 26 | 17 | 0.22 |
| 50/50 average vs CMA-ES | 25 | 13 | 0.07 |
| 50/50 average vs random search | 29 | 18 | 0.14 |
| GA vs CMA-ES | 20 | 17 | 0.74 |
Only "merging beats the Instruct parent" is significant at 5%. All three evolved recipes score below the average, but no single gap is significant.
Search fitness carries no information about unseen accuracy
We took each search's 10 best candidates and scored them on 250 fresh validation problems. If the searches had found better recipes, the points would rise to the right. They do not.
Re-picked winners on the test set
| Search | Original pick | Re-picked |
|---|
Re-ranking helped CMA-ES and hurt the other two. No re-picked winner reaches the plain 50/50 average (26.0%). With fitness noise of about ±5.4 points at n = 64, the optimizers were fitting noise: the winner's curse.
Read what each model actually wrote
All 250 test problems, with the raw output of all nine models from our test run. Pick a filter to find the interesting cases.
The official Qwen2.5-Math model moved too far from the base
Our first choice of math parent was Qwen/Qwen2.5-Math-1.5B-Instruct. Every merge with it collapsed into repeated tokens. Measuring each task vector's size relative to the base weights showed why.
Relative task-vector size ‖θk − base‖ / ‖base‖ per parameter group, log scale. The red band is the official Math model's range across layers (0.53–1.41).
Why it fails
A light fine-tune changes about 1% of the weights, so all three models still sit in one low-loss region and interpolating between them is safe. Qwen2.5-Math went through large-scale continued pretraining: its task vector is about as large as the base model itself, and it also uses a different RoPE base (10,000 vs 1,000,000).
| Weights (Instruct, Math) | Correct of 8 |
|---|---|
| (1, 0.1) | 2 |
| (1, 0.25) | 0, repeated tokens |
| (1, 0.5) | 0, repeated tokens |
| (0.5, 1) | 0 |
Lesson: check a pair before searching. python -m evomerge.diagnose reports these sizes for any two models.
What we learned
With zero training, a uniform merge scored 26.0% against 22.0% and 18.0% for the parents. It also solved problems neither parent could, partly by reading the Hindi question and answering in shorter English steps.
A fitness measured on 64 problems has about ±5.4 points of noise. The best of 170 noisy scores is mostly the luckiest candidate. Search gains of +8 to +14 points vanished on unseen data.
Our GA's σ-decay, a population of 16 and elitism of 2 made it collapse at generation 9. CMA-ES keeps adapting its step size, which is why the original paper uses it. On test, the two tie.
Merging needs light fine-tunes of a shared base. A model with heavy continued pretraining cannot be interpolated with its sibling.
Next steps with more compute
- A fitness set of 500+ problems, so its noise is smaller than the effects being searched for
- A lower-dimensional genome, e.g. 2 parents × 4 layer blocks instead of 2 × 30
- A GA without σ-decay, or with restarts when diversity drops
- The paper's data-flow-space merging, which reorders layers instead of mixing them