Safeguard Fine-Tuned LLMs Through Pre- and Post-Tuning Model Merging

Hua Farn, Hsuan Su, Shachi H Kumar, Saurav Sahay, Shang-Tse Chen +1 more
12/27/2024
cs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Fine-tuning large language models (LLMs) for downstream tasks often leads to catastrophic forgetting, notably degrading the safety of originally aligned models. While some existing methods attempt to restore safety by incorporating additional safety data, the quality of such data typically falls short of that used in the original alignment process. Moreover, these high-quality safety datasets are generally inaccessible, making it difficult to fully recover the model's original safety. We ask: How can we preserve safety while improving downstream task performance without additional safety data? We show that simply merging the weights of pre- and post-fine-tuned models effectively mitigates safety degradation while enhancing performance. Experiments across different downstream tasks and models validate the method's practicality and effectiveness.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{farn2024safeguard,
  title  = {Safeguard Fine-Tuned LLMs Through Pre- and Post-Tuning Model Merging},
  author = {Hua Farn and Hsuan Su and Shachi H Kumar and Saurav Sahay and Shang-Tse Chen and Hung-yi Lee},
  year   = {2024},
  eprint = {2412.19512},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.19512v3}
}

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/2412.19512.svg)](https://codeofpaper.com/paper/2412.19512)

Discussion