SoupLM: Model Integration in Large Language and Multi-Modal Models

Yue Bai, Zichen Zhang, Jiasen Lu, Yun FuarXiv 2024

Abstract

Training large language models (LLMs) and multimodal LLMs (LMMs) necessitates significant computing resources. Existing models are often pre-trained on diverse, specialized datasets, leading to variants with distinct strengths. In this study, we propose SoupLM, a cost-efficient strategy to assemble these specialized variants into a single, well-generalized multimodal model. By merging the weights of models like Vicuna (conversational specialist) and LLaVA (visual specialist), SoupLM integrates cross-domain knowledge without the need for expensive retraining or increased inference costs.

Introduction

The proliferation of specialized LLMs, often fine-tuned from the same base model (e.g., LLaMA), presents an opportunity for integration. However, traditional multi-task fine-tuning is computationally demanding and risks "modality drift," where new learning degrades existing skills. SoupLM addresses this by utilizing "model souping"—a technique that merges model weights rather than ensembling outputs. This approach aims to provide a "free lunch" for model integration, creating a single model that inherits the best traits of its parents.

Methodology

SoupLM explores three primary weight-merging strategies for models sharing the same architecture:

  1. Vanilla Soup: A simple linear interpolation using a single global weight ($\alpha$) to average all model parameters.
  2. Learnable Soup: The primary contribution of this work. Instead of a global weight, unique, learnable $\alpha$ values are assigned to every functional module (e.g., Attention mappings, MLP layers) across all layers. These weights are optimized using a small development set (approx. 1,000 samples) while the base model weights remain frozen.
  3. Regularized Soup: Adds L1 regularization to the learnable $\alpha$ values to probe layer-specific importance and ensure stability during the merging process.

Experiments and Results

The authors benchmarked SoupLM using Vicuna-7B and LLaVA-7B as base models across several domains, including multi-modal understanding (MMMU, LLaVA-Bench), general academic knowledge (MMLU), and mathematical reasoning (GSM8k).

Performance in the Interpolation Space

The "Vanilla Soup" strategy provides a baseline for understanding how simple weight averaging affects performance. As shown in Figure 1, the optimal ratio for base model weights varies across tasks, but a "souped" model often outperforms both individual parent models.

Performance of Vanilla Soup across various benchmarks (MMMU, LLaVA-Bench, MMLU, GSM8K, and Hellaswag) as a function of the base model weight ratio.

Key Findings

  • Granularity and Specialization: Merging at the module level (Learnable Soup) significantly outperforms global merging. This indicates that different transformer layers specialize in different types of knowledge.
  • Cross-Domain Synergy: Integrating a vision-language model (LLaVA) with a language-only model (Vicuna) improved performance on language-only tasks like MMLU (reaching 51.24 vs Vicuna's 48.75) and GSM8k (reaching 21.15 vs LLaVA's 17.89).
  • Efficiency: SoupLM maintains the same parameter count and inference latency as the original base models, making it a highly efficient integration method.

Conclusion

SoupLM demonstrates that model souping is a powerful, low-cost method for integrating specialized LLMs and LMMs. By optimizing interpolation weights at a fine-grained level, the resulting model captures the strengths of its parents while avoiding the pitfalls of retraining. Future research will focus on scaling this approach to larger models and multi-model integration.

Summary updated

BibTeX
@misc{bai2024souplm,
  author = {Yue Bai and Zichen Zhang and Jiasen Lu and Yun Fu},
  title = {{SoupLM: Model Integration in Large Language and Multi-Modal Models}},
  year = {2024},
  eprint = {2407.08196},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.08196},
}
Figure