Antibody: 通过削弱有害梯度影响来加强对抗有害微调的防御
Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence
AI总结:
Antibody通过削弱有害梯度影响,提升大型语言模型对有害微调攻击的防御能力,并增强微调性能。
摘要:
微调作为服务引入了当服务提供者在被污染的用户提交数据集上微调其模型时对大型语言模型安全性的威胁,这一过程称为有害微调攻击。在本工作中,我们展示了通过正则化微调过程中遇到的有害样本的梯度贡献,可以有效缓解有害微调攻击的影响。为此,我们引入了Antibody防御策略,首先在微调前确保模型的稳健安全性对齐,然后在微调过程中应用安全保护学习算法。具体来说,在微调前的对齐阶段,我们提出优化模型使其相对于有害样本处于平坦损失区域,这使安全性对齐更 resilient 于后续的有害微调。然后,在微调阶段,我们设计了一种微调算法,对每个训练批次中的所有样本应用加权方案,以抑制模型从有害样本中学习,同时鼓励从良性样本中学习。实验结果表明,Antibody成功缓解了有害微调攻击,同时在用户提交的数据集上提升了微调性能。
英文摘要:
Fine-tuning-as-a-service introduces a threat to Large Language Models' safety when service providers fine-tune their models on poisoned user-submitted datasets, a process known as harmful fine-tuning attacks. In this work, we show that by regularizing the gradient contribution of harmful samples encountered during fine-tuning, we can effectively mitigate the impact of harmful fine-tuning attacks. To this end, we introduce Antibody, a defense strategy that first ensures robust safety alignment for the model before fine-tuning, and then applies a safety-preservation learning algorithm during fine-tuning. Specifically, in the alignment stage before fine-tuning, we propose optimizing the model to be in a flat loss region with respect to harmful samples, which makes the safety alignment more resilient to subsequent harmful fine-tuning. Then, in the fine-tuning stage, we design a fine-tuning algorithm that applies a weighting scheme to all samples in each training batch to inhibit the model from learning from harmful samples while encouraging learning from benign samples. Experimental results demonstrate that Antibody successfully mitigates harmful fine-tuning attacks while boosting fine-tuning performance on the user-submitted dataset.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。