不依赖额外安全数据,通过模型合并保护微调后的大模型安全性能。
Safeguard Fine-Tuned LLMs Through Pre- and Post-Tuning Model Merging
- 将微调前后的模型权重直接合并,实现安全与性能的平衡。
- 在多个任务和模型上验证,既提升性能又缓解安全退化。
- 适合需要保持安全性的工业级模型微调场景。
为下游任务微调大语言模型常导致灾难性遗忘,显著降低原模型的安全性。现有方法虽尝试通过引入额外安全数据恢复安全,但此类数据质量通常不及原始对齐阶段使用的数据,且高质量数据集往往不可获取,难以完全恢复模型原始安全性。本文提出:能否在不依赖额外安全数据的前提下,同时提升下游任务性能并保留安全性?研究发现,仅将微调前后模型的权重进行合并,即可有效缓解安全退化问题,并提升性能。在多种下游任务和模型上的实验验证了该方法的实用性和有效性。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。