EvoGM: Learning to Merge LLMs via Evolutionary Generative Optimization
Authors: Tao Jiang, Xinmeng Yu, Chenhao Yi, Yiling Wu, Yan Li, Ran Cheng, Dongmei Jiang, Jianguo Zhang
Abstract
Evolutionary model merging provides a powerful framework for the automated, training-free composition of LLMs through parameter-space search. However, existing methods predominantly rely on stochastic, hand-crafted operators that overlook the underlying performance landscape of the coefficient space. We propose Evolutionary Generative Merging (EvoGM), a framework that transcends manual heuristics by employing learnable generative modeling to optimize merging coefficients. Specifically, EvoGM features a dual-generator architecture with cycle-consistent learning to adaptively sample and refine promising merging candidates. By constructing winner-loser pairs from historical search trajectories, our framework effectively captures high-performance parameter distributions and maximizes data efficiency. This generative process is seamlessly integrated into a multi-round evolutionary pipeline, where elite merged models iteratively serve as new expert foundations. Extensive experiments across diverse benchmarks demonstrate that EvoGM significantly outperforms state-of-the-art baselines, exhibiting robust performance on both seen and unseen tasks. Code and data are available at https://github.com/JiangTao97/evogm.
Model merging integrates the capabilities of multiple expert models to create strong models for multiple tasks without additional training, thereby reducing computational resource requirements. However, existing methods operate within the convex combination space of expert models, failing to explore high-performance regions outside this space. This paper proposes the MERGEvolve framework, which unifies model merging and evolution within an evolution strategy by treating the merged model as the initialization for evolutionary exploration of the parameter space. During the merging phase, expert models act as deterministic sources to build a strong initial point. The evolution phase then explores the parameter space using random noise. Theoretical analysis shows that MERGEvolve explores regions outside the convex combination space. Extensive experiments on single-task and multi-task benchmarks demonstrate that MERGEvolve consistently achieves performance competitive with advanced model merging baselines. Ablation studies confirm that a high-quality initial point is critical for efficient exploration of the parameter space.
Model merging has emerged as a cost-effective alternative to training large language models (LLMs) from scratch, enabling researchers to combine pre-trained models into more capable systems without full retraining. Evolutionary approaches to model merging have shown particular promise, automatically searching for optimal merging configurations across both parameter space (PS) and data flow space (DFS). However, the optimization challenges underlying these approaches -- particularly in DFS merging -- remain poorly understood and formally underspecified in the literature. This paper makes two contributions. First, we provide a structured survey of evolutionary model merging techniques, organizing them into three categories: parameter-space merging, data flow space merging, and hybrid approaches. Second, we formally characterize the DFS merging problem as a black-box optimization problem involving mixed binary-continuous variables, high-dimensional search spaces, and conditional dependencies between variable types -- challenges that standard optimization methods such as CMA-ES are not designed to handle. We provide preliminary empirical validation using real pre-trained language models, demonstrating that a structured approach respecting the binary-continuous conditional dependency outperforms an unstructured approach by 6.7% accuracy while reducing the effective search space by 51.4%. By connecting the model merging community with the broader evolutionary computation and black-box optimization literature, we identify concrete open problems and propose research directions to address them.
LLM services need to offer a family of models spanning different capability--cost trade-offs to accommodate diverse user preferences. Model merging offers a practical way to construct such a model family by combining a reasoning-enhanced model with an instruction-tuned model. Compared with model-level merging, layer-wise merging offers finer control over the capability--cost trade-off by assigning different merge weights to individual layers. However, it introduces two practical challenges: the layer-wise search space is high-dimensional, and existing methods rarely exploit informative signals from the source models; moreover, the highly variable runtime of LLM evaluations makes synchronous batch optimization inefficient by leaving GPU resources idle while waiting for slow evaluations. To address these challenges, we propose Asynchronous Prior-Guided Bayesian Model Merging (AP-BMM), which formulates layer-wise merging as a multi-objective optimization problem to approximate a Pareto set of merged LLMs, yielding a family of Pareto-optimal merged models with diverse capability--cost trade-offs. AP-BMM leverages parameter and activation discrepancies between the source models to guide the early layer-wise search, employs asynchronous pending-aware Bayesian optimization to maximize GPU utilization through asynchronous evaluations and to select high-quality candidates via pending awareness, and applies lightweight ranking over an oversized candidate pool to improve Pareto-front coverage. Under fixed evaluation budgets, AP-BMM achieves higher hypervolume (HV) and broader Pareto-front coverage than synchronous layer-wise and representative model-level merging methods, while reducing wall-clock time through higher GPU utilization.