Model Merging and Safety Alignment: One Bad Model Spoils the Bunch

Hasan Abed Al Kader Hammoud, Umberto Michieli, Fabio Pizzati, Philip Torr, Adel Bibi +2 more
6/20/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: hammoudhasan/MergeAlign (3 stars, last commit 2025-01-06).

Abstract

Merging Large Language Models (LLMs) is a cost-effective technique for combining multiple expert LLMs into a single versatile model, retaining the expertise of the original ones. However, current approaches often overlook the importance of safety alignment during merging, leading to highly misaligned models. This work investigates the effects of model merging on alignment. We evaluate several popular model merging techniques, demonstrating that existing methods do not only transfer domain expertise but also propagate misalignment. We propose a simple two-step approach to address this problem: (i) generating synthetic safety and domain-specific data, and (ii) incorporating these generated data into the optimization process of existing data-aware model merging techniques. This allows us to treat alignment as a skill that can be maximized in the resulting merged LLM. Our experiments illustrate the effectiveness of integrating alignment-related data during merging, resulting in models that excel in both domain expertise and alignment.

View on arXivView PDF

Code Implementations(1)

Official implementation of Model Merging and Safety Alignment: One Bad Model Spoils the Bunch (EMNLP 2024)

30Shell, PythonJan 5, 20251 years agoNOASSERTION

Similar Papers

Cite this paper

@article{hammoud2024model,
  title  = {Model Merging and Safety Alignment: One Bad Model Spoils the Bunch},
  author = {Hasan Abed Al Kader Hammoud and Umberto Michieli and Fabio Pizzati and Philip Torr and Adel Bibi and Bernard Ghanem and Mete Ozay},
  year   = {2024},
  eprint = {2406.14563},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.14563v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.14563.svg)](https://codeofpaper.com/paper/2406.14563)

Discussion