2025-01-30 · 专家 · 机器学习

Virus: Harmful Fine-tuning Attack for Large Language Models Bypassing Guardrail Moderation

本文提出了一种名为“Virus”的攻击方法,可以绕过大型语言模型(LLM)的防护措施,对LLM进行有害微调攻击。

更新于 2025-01-30。作者:Tiansheng Huang、Sihao Hu、Fatih Ilhan、Selim Furkan Tekin、Ling Liu。

中文摘要

最近的研究表明,大型语言模型(LLMs)容易受到有害微调攻击的影响——模型在经过少量有害样本的微调后,会失去其安全对齐能力。为了降低风险,通常会在微调前使用防线来过滤掉有害样本。在这篇论文中,我们通过设计一种新的红队方法,表明仅依赖防线进行数据过滤并不可靠。我们提出的攻击方法被称为“病毒”,它通过轻微修改有害数据就能轻松绕过防线审查。实验结果表明,由“病毒”优化后的有害数据无法被防线检测到,且攻击性能优越。最后,我们通过这篇论文想要传达的关键信息是:将防线审查视为对抗有害微调攻击的救命稻草是不负责任的,因为它无法解决预训练LLMs的固有安全问题。我们的代码可在https://github.com/git-disl/Virus上获取。

英文摘要

Recent research shows that Large Language Models (LLMs) are vulnerable to harmful fine-tuning attacks -- models lose their safety alignment ability after fine-tuning on a few harmful samples. For risk mitigation, a guardrail is typically used to filter out harmful samples before fine-tuning. By designing a new red-teaming method, we in this paper show that purely relying on the moderation guardrail for data filtration is not reliable. Our proposed attack method, dubbed Virus, easily bypasses the guardrail moderation by slightly modifying the harmful data. Experimental results show that the harmful data optimized by Virus is not detectable by the guardrail with up to 100\% leakage ratio, and can simultaneously achieve superior attack performance. Finally, the key message we want to convey through this paper is that: it is reckless to consider guardrail moderation as a clutch at straws towards harmful fine-tuning attack, as it cannot solve the inherent safety issue of the pre-trained LLMs. Our code is available at https://github.com/git-disl/Virus

解读

一句话总结

本文提出了一种名为“Virus”的攻击方法,可以绕过大型语言模型(LLM)的防护措施,对LLM进行有害微调攻击。

问题1:这篇论文想要解决什么具体问题?

• 问题背景:大型语言模型(LLM)在微调时容易受到有害样本的影响,导致模型的安全性对齐能力下降。 • 现有方案不足:传统的防护措施,如防护栏(guardrail) moderation,虽然可以过滤掉大部分有害样本,但仍然存在被绕过的风险。 • 研究目标:设计一种新的攻击方法,能够绕过防护栏 moderation,同时仍然能够有效降低受害LLM的安全对齐能力。

问题2:论文的核心创新点是什么?

• 技术创新:提出了一种名为“Virus”的攻击方法,通过优化有害数据,实现绕过防护栏 moderation 的同时,保证攻击的有效性。 • 方法改进:通过双目标数据优化,在降低防护栏 jailbreak 损失的同时,保证攻击数据与有害数据的梯度相似性。 • 优势:Virus 可以有效地绕过防护栏 moderation,并达到与有害数据相似的攻击效果。

问题3:实验结果如何验证了方法的有效性?

• 关键实验:在多个攻击场景下对 Virus 进行了测试,包括不同的有害数据比例、微调样本数量和下游任务。 • 性能提升:Virus 可以有效地绕过防护栏 moderation,并将有害分数提高至最高 21.8%。 • 对比结果:与基线方法相比,Virus 在绕过防护栏 moderation 方面表现更优。

问题4:这个研究的实际应用价值是什么?

• 应用场景:Virus 可以用于评估LLM的安全性和防护措施的有效性。 • 实施建议:在实际部署中,应综合考虑多种防护措施,以降低Virus攻击的风险。 • 局限与展望:Virus 的攻击效果依赖于具体的攻击场景和LLM模型,未来需要进一步研究更有效的防御方法。

来源