Black-box Model Merging for Language-Model-as-a-Service with Massive Model Repositories

Shilian Chen, Jie Zhou, Tianyu Huai, Yujiang Lu, Junsong Li, Bihao Zhan, Qianjun Pan, Yutao Yang, Xin Li, Qin Chen, Hang Yan, Liang HearXiv 2025 · DOI

Abstract

The proliferation of Large Language Models (LLMs) served via APIs (LMaaS) has created a need for "black-box" model merging techniques that do not require access to internal weights. Furthermore, the growth of model repositories introduces significant noise when merging hundreds of specialized adapters. We present Evo-Merging, a novel framework that uses evolutionary algorithms and a two-stage "denoise-then-scale" strategy to create superior merged models. By identifying that noise primarily resides in the LoRA-A "concept extraction" layer, Evo-Merging achieves state-of-the-art performance on information extraction tasks, outperforming existing white-box baselines by over 10 points in F1 score on out-of-domain benchmarks.

Introduction

Model merging has emerged as a powerful technique for creating specialized "super-models" by blending the parameters of multiple LLMs. However, the current landscape of Language-Model-as-a-Service (LMaaS) presents two major hurdles: the "black-box" nature of proprietary models (e.g., GPT-4) and the "massive model noise" encountered when attempting to merge hundreds of fine-tuned adapters from repositories like Hugging Face. Existing methods often fail when direct weight access is unavailable or when the pool of source models contains redundant or harmful information for a specific target task.

Methods

The proposed Evo-Merging framework addresses these challenges through a derivative-free optimization approach based on the Covariance Matrix Adaptation Evolution Strategy (CMA-ES). The process requires only inference-time API queries and a small validation set.

Overview of the Evo-Merging framework, illustrating the two-stage process of sparsity-based denoising and sign-aware scaling.

The framework operates in two distinct stages:

  1. Sparsity-Based Denoising: The algorithm identifies and prunes irrelevant parameters within the source models. A key theoretical insight is the asymmetric sparsification of LoRA adapters. The authors demonstrate that the LoRA-A matrix serves as a "concept extractor," while the LoRA-B matrix handles "knowledge mapping." Denoising is most effective when targeting the A matrix.
  2. Sign-Aware Scaling: Following denoising, the algorithm learns an optimal weight ($\beta$) for each model. Unlike traditional averaging, these weights can be negative ("sign-flipping"), allowing the system to subtract conflicting knowledge or suppress unwanted behaviors.

Key Insights and Results

A central discovery of this work is the functional difference between LoRA components. Empirical evidence shows that pruning the concept extraction layer (A) preserves performance far better than pruning the knowledge mapping layer (B).

Performance comparison showing that sparsifying the LoRA-A matrix consistently yields higher scores than sparsifying the LoRA-B matrix across various tasks.

Evo-Merging was evaluated on the InstructUIE benchmark, involving over 100 specialized Information Extraction (IE) models. Key findings include:

  • State-of-the-Art Generalization: Evo-Merging surpassed the best existing baselines by over 10 points in F1 score (52.13 vs. 40.94) on out-of-domain tasks.
  • Resilience to Noise: While traditional methods like DARE and TIES collapse when "distractor" models are added to the pool, Evo-Merging remains stable, effectively filtering out irrelevant source models.
  • Data Efficiency: The framework achieves robust results with as few as 50-300 validation samples, making it highly practical for real-world scenarios where labeled data is scarce.

Conclusion

Evo-Merging represents a significant step forward for black-box model optimization in the LMaaS era. While currently optimized for text-based LoRA adapters, future work aims to reduce the computational cost associated with evolutionary iterations and expand the framework to multi-modal vision-language models.

Summary updated

BibTeX
@misc{chen2025black,
  author = {Shilian Chen and Jie Zhou and Tianyu Huai and Yujiang Lu and Junsong Li and Bihao Zhan and Qianjun Pan and Yutao Yang and Xin Li and Qin Chen and Hang Yan and Liang He},
  title = {{Black-box Model Merging for Language-Model-as-a-Service with Massive Model Repositories}},
  year = {2025},
  eprint = {2509.12951},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.12951},
}
Figure