arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.14968cs.CRcs.CL
收藏

利用后门增强的安全对齐缓解基于微调的越狱攻击

Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignment

University of Wisconsin-Madison(威斯康星大学麦迪逊分校);University of Michigan-Ann Arbor(密歇根大学安娜堡分校);Princeton University(普林斯顿大学);University of California, Davis(加州大学戴维斯分校);University of Chicago(芝加哥大学)

Jiongxiao Wang, Jiazhao Li, Yiquan Li, Xiangyu Qi, Junjie Hu, Yixuan Li, Patrick McDaniel, Muhao Chen, Bo Li, Chaowei Xiao

AI总结:

针对LMaaS场景下基于微调的越狱攻击防御效率低的问题,提出后门增强安全对齐方法,仅需少量带秘密提示前缀的安全样本,即可让恶意微调模型恢复安全性能且不影响良性表现。

摘要:

尽管大语言模型(LLM)具备通用能力,但在满足特定业务需求时,这类模型仍需使用定制化数据进行微调或适配。然而,这一过程不可避免地会带来新的威胁,尤其是在语言模型即服务(LMaaS)场景下的基于微调的越狱攻击(FJAttack):微调用户上传的样本中仅需包含少量有害样本,就会严重损害模型的安全性。虽然已有潜在防御方案提出,服务提供商可将安全样本融入微调数据集以减少安全问题,但这类方法需要掺入大量数据,效率低下。为在LMaaS场景下用有限的安全样本有效防御FJAttack,我们受后门攻击概念的类比启发,提出了后门增强安全对齐方法。具体而言,服务提供商会构建带有秘密提示词(作为“后门触发器”)的带前缀安全样本。通过将带前缀的安全样本融入微调数据集,后续的微调过程实际上起到了“后门攻击”的作用,在秘密提示词与安全生成内容之间建立起强关联。因此,在推理阶段,只要服务提供商在任何用户输入前添加该秘密提示词,就能确保输出安全响应。我们的综合实验表明,通过仅添加11个带前缀安全样本的后门增强安全对齐方法,被恶意微调的LLM将获得与原始对齐模型相近的安全性能,且不会损害良性任务性能。此外,我们还验证了该方法在更贴合实际的场景(微调数据同时包含FJAttack样本和微调任务数据)下的有效性。

英文摘要:

Despite the general capabilities of Large Language Models (LLM), these models still request fine-tuning or adaptation with customized data when meeting specific business demands. However, this process inevitably introduces new threats, particularly against the Fine-tuning based Jailbreak Attack (FJAttack) under the setting of Language-Model-as-a-Service (LMaaS), where the model's safety has been significantly compromised by fine-tuning users' uploaded examples contain just a few harmful examples. Though potential defenses have been proposed that the service providers can integrate safety examples into the fine-tuning dataset to reduce safety issues, such approaches require incorporating a substantial amount of data, making it inefficient. To effectively defend against the FJAttack with limited safety examples under LMaaS, we propose the Backdoor Enhanced Safety Alignment method inspired by an analogy with the concept of backdoor attacks. In particular, service providers will construct prefixed safety examples with a secret prompt, acting as a "backdoor trigger". By integrating prefixed safety examples into the fine-tuning dataset, the subsequent fine-tuning process effectively acts as the "backdoor attack", establishing a strong correlation between the secret prompt and safety generations. Consequently, safe responses are ensured once service providers prepend this secret prompt ahead of any user input during inference. Our comprehensive experiments demonstrate that through the Backdoor Enhanced Safety Alignment with adding as few as 11 prefixed safety examples, the maliciously fine-tuned LLMs will achieve similar safety performance as the original aligned models without harming the benign performance. Furthermore, we also present the effectiveness of our method in a more practical setting where the fine-tuning data consists of both FJAttack examples and the fine-tuning task data.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑