arXiv:2412.11041cs.CL2024-12ACL被引 21

修复微调后大模型的安全漏洞,提升抗攻击能力。

Separate the Wheat from the Chaff: A Post-Hoc Approach to Safety Re-Alignment for Fine-Tuned Language Models

  • 通过识别、移除并重校准不安全参数,实现安全再对齐。
  • 在多个数据集上显著提升模型对有害查询和越狱攻击的防御能力。
  • 适用于微调后的模型,兼顾安全性与下游任务表现。

尽管大语言模型在发布时已具备良好安全对齐,但仍面临多种安全挑战。其中关键问题是微调过程常会削弱模型的安全性。为此,我们提出一种名为IRR(Identify, Remove, and Recalibrate for Safety Realignment)的方法,用于对微调后的语言模型进行安全再对齐。其核心是识别并移除微调产生的不安全增量参数,同时对保留参数进行重校准。我们在多个数据集上评估了IRR的有效性,涵盖全量微调与LoRA方法。结果表明,IRR显著提升了微调模型在安全基准测试中的表现,如应对有害查询和越狱攻击的能力,同时保持了其在下游任务上的性能。代码已公开于https://anonymous.4open.science/r/IRR-BD4F。

原文摘要 · Abstract (English)

Although large language models (LLMs) achieve effective safety alignment at the time of release, they still face various safety challenges. A key issue is that fine-tuning often compromises the safety alignment of LLMs. To address this issue, we propose a method named IRR (Identify, Remove, and Recalibrate for Safety Realignment) that performs safety realignment for LLMs. The core of IRR is to identify and remove unsafe delta parameters from the fine-tuned models, while recalibrating the retained ones. We evaluate the effectiveness of IRR across various datasets, including both full fine-tuning and LoRA methods. Our results demonstrate that IRR significantly enhances the safety performance of fine-tuned models on safety benchmarks, such as harmful queries and jailbreak attacks, while maintaining their performance on downstream tasks. The source code is available at: https://anonymous.4open.science/r/IRR-BD4F.

安全对齐微调修复模型鲁棒性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。