Evolutionary Optimization of Model Merging Recipes

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

Abstract

We present a novel application of evolutionary algorithms to automate the creation of powerful foundation models. While model merging has emerged as a promising approach for LLM development due to its cost-effectiveness, it currently relies on human intuition and domain knowledge, limiting its potential. Here, we propose an evolutionary approach that overcomes this limitation by automatically discovering effective combinations of diverse open-source models, harnessing their collective intelligence without requiring extensive additional training data or compute. Our approach operates in both parameter space and data flow space, allowing for optimization beyond just the weights of the individual models. This approach even facilitates cross-domain merging, generating models like a Japanese LLM with Math reasoning capabilities. Surprisingly, our Japanese Math LLM achieved state-of-the-art performance on a variety of established Japanese LLM benchmarks, even surpassing models with significantly more parameters, despite not being explicitly trained for such tasks. Furthermore, a culturally-aware Japanese VLM generated through our approach demonstrates its effectiveness in describing Japanese culture-specific content, outperforming previous Japanese VLMs. This work not only contributes new state-of-the-art models back to the open-source community, but also introduces a new paradigm for automated model composition, paving the way for exploring alternative, efficient approaches to foundation model development.

Introduction

In the rapidly evolving landscape of Large Language Models (LLMs), the prevailing trend has been "bigger is better," often necessitating massive investments in computational power and data. However, model merging has emerged as a compelling, low-cost alternative. By combining the strengths of existing models, researchers can create specialized or more capable versions without the overhead of traditional training. Despite its promise, model merging has largely remained a manual "alchemy," relying on human intuition and trial-and-error. This paper introduces an evolutionary framework to transform this process into an automated science.

The Challenge of Manual Merging

Current merging techniques often involve blending models from similar domains. However, merging models from disparate domains—such as an English-centric math model and a Japanese-centric general model—is notoriously difficult. Internal representations often fail to align, leading to "model collapse" where the output becomes gibberish. Navigating the vast search space of possible layer combinations and weight settings requires a systematic approach that transcends human intuition.

Methodology: Evolutionary Model Merging

The proposed framework, Evolutionary Model Merge, optimizes across two distinct but complementary dimensions:

  1. Parameter Space (PS) Merging: This focuses on blending the weights of the models. Using the CMA-ES evolutionary algorithm, the framework discovers optimal mixing coefficients and sparsification rates for every individual layer. This granular optimization allows for a more nuanced blend than global settings.
  2. Data Flow Space (DFS) Merging: This involves "layer kit-bashing," where the algorithm determines the optimal sequence of layers a token should traverse. It can repeat, skip, or reorder layers from different models. To bridge the gap between mismatched layers, the framework evolves scaling matrices that re-scale activations, ensuring smooth data flow.
Overview of the evolutionary merging process in parameter and data flow spaces.

Experimental Results

The researchers evaluated their approach using several benchmarks, including MGSM-JA (Japanese math reasoning) and JP-LMEH (a comprehensive suite of general Japanese proficiency tasks). The results were striking. The evolved 7B-parameter Japanese Math LLM (EvoLLM-JP) achieved a score of 52.0 on MGSM-JA, far exceeding its source models and even outperforming the 70B-parameter Llama-2.

Benchmark results comparing the evolved 7B models against base models and 70B giants.

On the general JP-LMEH benchmark, the merged 7B model scored 70.5, surpassing the previous state-of-the-art 70B Japanese StableLM (68.3). Additionally, an evolved Vision-Language Model (EvoVLM-JP) demonstrated superior performance on Japanese cultural tasks, correctly identifying culture-specific nuances—such as the linguistic convention of referring to green traffic lights as "blue"—that previous models missed.

Discussion and Insights

A key insight from this work is the ability to transfer capabilities across languages. By merging an English math model with a Japanese LLM, the evolutionary process successfully leveraged the reasoning logic of the former and the linguistic proficiency of the latter. Furthermore, the DFS search discovered non-intuitive layer configurations—such as repeating early layers or skipping specific middle layers—that a human designer would likely overlook. These findings underscore the power of automated optimization over manual design and the importance of scaling matrices in maintaining performance across mismatched layers.

Conclusion

By treating model merging as an optimization problem, this research introduces a new paradigm for foundation model development. The ability to create high-performing models through automated composition, without additional training, offers a highly efficient path forward. Future work may involve automating the selection of "ingredient" models from vast libraries like Hugging Face, further streamlining the creation of powerful, specialized LLMs.

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