Evolutionary Optimization of Model Merging Recipes

Takuya Akiba, Makoto Shing, Yujin Tang, Qi Sun, David Ha · DOI

TL;DR

Researchers at Sakana AI have introduced Evolutionary Model Merge, a framework that uses evolutionary algorithms to automatically discover optimal "recipes" for combining open-source models. By optimizing both the parameter weights and the inference path (layer stacking), they created 7B-parameter models that outperform 70B-parameter giants on complex cross-domain tasks like Japanese mathematical reasoning and culturally-aware vision-language processing.

What Problem Does This Paper Address?

Model merging has recently exploded in popularity as a "zero-training" way to create powerful new models. Instead of expensive gradient-based fine-tuning, developers combine the weights of existing models (like Mistral or Llama) to inherit their capabilities.

However, model merging is currently considered a "black art" or "alchemy." It relies heavily on human intuition to decide which models to mix and what ratios to use. As the library of open-source models grows, the number of possible combinations becomes astronomical, far exceeding what humans can test manually. The authors aim to replace this trial-and-error approach with a systematic, automated evolutionary search to find non-intuitive combinations that humans would likely miss.

Methods

The authors propose a dual-space optimization strategy using the CMA-ES (Covariance Matrix Adaptation Evolution Strategy) algorithm:

  1. Parameter Space (PS) Merging: This focuses on how to blend the weights of multiple models into a single architecture. The authors build upon techniques like TIES-Merging and DARE, using evolution to find the best layer-wise mixing weights and sparsification (density) parameters.
  2. Data Flow Space (DFS) Merging: Also known as "Frankenmerging," this optimizes the inference path. Instead of being restricted to a standard 32-layer stack, the algorithm can pick and choose layers from different models, repeat them, or skip them entirely. To handle the distribution shifts that occur when jumping between different models' layers, they evolve a scaling matrix ($W$) to normalize the data as it flows through the new "Franken-architecture."
  3. Hybrid Merging: The most powerful results came from first evolving a merged model in the parameter space and then using that model as an "ingredient" for a second round of evolution in the data flow space.
Figure 1: Overview of Evolutionary Model Merge. Our approach encompasses (1) evolving the weights for mixing parameters at each layer in the parameter space (PS); (2) evolving layer permutations in the data flow space (DFS); and (3) an integrated strategy that combines both methods for merging in both PS and DFS. Notice that merging in the PS is not simple copying and stitching of the layers parameters, but also mixes the weights. This merging is akin to blending colors as illustrated here (e.g., red and blue becomes purple). Note that we translated the questions to English for the reader; the models operate on Japanese text.

Datasets

The models were evolved and evaluated using several key benchmarks:

  • MGSM-JA: A Japanese translation of the Multilingual Grade School Math dataset.
  • JP-LMEH: The Japanese Language Model Evaluation Harness, a suite of nine tasks measuring general linguistic proficiency.
  • JA-VG-VQA-500: A subset of the Visual Genome VQA dataset translated into Japanese.
  • JA-VLM-Bench-In-the-Wild: A newly introduced benchmark consisting of 42 images and 50 questions focused on Japanese cultural elements (e.g., Koi-nobori or specific traffic light nuances) to test the cultural awareness of Vision-Language Models (VLMs).

Key Insights and Ideas

  • Cross-Domain Emergence: By merging a Japanese general-purpose LLM with an English Math LLM, the evolutionary process created a model that could solve math problems in Japanese—a capability neither parent model possessed effectively on its own.
  • Efficiency Over Scale: Their evolved 7B model (EvoLLM-JP) surpassed the performance of several 70B models on Japanese benchmarks. This suggests that how we compose existing knowledge is just as important as the raw number of parameters.
  • The Power of Skipping: In the DFS experiments, the algorithm discovered that skipping specific layers (like layer 30 of a math model) actually improved performance. This suggests that certain layers in specialized models might actually be "harmful" or redundant when applied to new domains.
  • Non-Intuitive Blending: The evolved weights often summed to nearly 2.0 rather than 1.0, suggesting that "amplifying" the differences between models is more effective than simple interpolation.
Figure 2: Performance Overview. The figure depicts the success of various models on the MGSM-JA task, with each of the 250 test problems represented along the x-axis by problem ID. Correct answers are indicated by colored markers at the corresponding positions.

Key Results

The authors demonstrated significant jumps in performance across the board:

  • Mathematical Reasoning: On the MGSM-JA task, the source models scored at or below 30.0% accuracy. The evolved PS-merged model hit 52.0%, and the hybrid (PS+DFS) model reached 55.2%.
  • General Proficiency: The 7B EvoLLM-JP achieved a score of 70.5 on the JP-LMEH benchmark, outperforming the 70B Llama-2 (64.5) and the 70B Japanese StableLM (68.3).
  • Vision-Language: The evolved VLM (EvoVLM-JP) significantly outperformed baselines on culturally specific tasks, correctly identifying Japanese nuances (like calling a green traffic light "blue" in Japanese) that standard models missed.
Table 1: Performance Comparison of the LLMs. Models 1–3 are source models, Models 4–6 are our optimized merge models, and Models 7–11 are provided for reference. MGSM-JA measures math ability in Japanese, and JP-LMEH evaluates general Japanese language capabilities, with a detailed breakdown provided in Table 2.

Limitations and Future Work

While highly effective, the authors note several limitations:

  • Inherited Flaws: Merged models inherit the biases and logical inconsistencies of their parents.
  • Lack of Alignment: The current process doesn't include safety alignment or instruction tuning, meaning the models might still produce factually flawed or unaligned outputs.
  • Manual Selection: The user still has to manually select the "pool" of source models to be merged. Future work could involve using evolution to search the entire HuggingFace ecosystem for the best "ingredients" automatically.
  • Computational Cost of Evaluation: While merging is cheap, evaluating thousands of candidates during the evolutionary search still requires significant GPU time, though still far less than full training.

Summary updated

BibTeX
@inproceedings{akiba2025evolutionary,
  author = {Takuya Akiba and Makoto Shing and Yujin Tang and Qi Sun and David Ha},
  title = {{Evolutionary Optimization of Model Merging Recipes}},
  booktitle = {Nat. Mac. Intell},
  year = {2025},
  url = {https://openreview.net/forum?id=KMPL8Huf1Z},
}
Figure