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

Vaccine:针对大语言模型抵御有害微调攻击的扰动感知对齐方法

Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning Attack

School of Computer Science(计算机学院);Georgia Institute of Technology(佐治亚理工学院)

Tiansheng Huang, Sihao Hu, Ling Liu

AI总结:

本文提出扰动感知对齐方法Vaccine,通过对隐藏嵌入逐步添加扰动使其不变,从而在微调阶段抵御有害数据诱导的嵌入漂移,提升LLM对齐鲁棒性并保留良性推理能力。

摘要:

微调即服务的新范式为大语言模型(LLMs)引入了新的攻击面:用户上传的少量有害数据可以轻易欺骗微调过程,从而产生对齐失效的模型。我们进行了实证分析,发现了一种“有害嵌入漂移”现象,揭示了导致对齐失效效应的可能原因。受此发现启发,我们提出了Vaccine,一种扰动感知对齐技术,以降低用户微调带来的安全风险。Vaccine的核心思想是在对齐阶段通过逐步向隐藏嵌入中添加精心设计的扰动,从而生成不变的隐藏嵌入。这使得嵌入能够在微调阶段抵御来自未经净化的用户数据的有害扰动。我们在开源主流LLMs(例如Llama2、Opt、Vicuna)上的实验结果表明,Vaccine能够增强对齐对有害提示所诱导嵌入漂移的鲁棒性,同时保留对良性提示的推理能力。我们的代码可在https://github.com/git-disl/Vaccine获取。

英文摘要:

The new paradigm of finetuning-as-a-service introduces a new attack surface for Large Language Models (LLMs): a few harmful data uploaded by users can easily trick the finetuning to produce an alignment-broken model. We conduct an empirical analysis and uncover a \textit{harmful embedding drift} phenomenon, showing a probable cause of the alignment-broken effect. Inspired by our findings, we propose Vaccine, a perturbation-aware alignment technique to mitigate the security risk of users finetuning. The core idea of Vaccine is to produce invariant hidden embeddings by progressively adding crafted perturbation to them in the alignment phase. This enables the embeddings to withstand harmful perturbation from un-sanitized user data in the finetuning phase. Our results on open source mainstream LLMs (e.g., Llama2, Opt, Vicuna) demonstrate that Vaccine can boost the robustness of alignment against harmful prompts induced embedding drift while reserving reasoning ability towards benign prompts. Our code is available at \url{https://github.com/git-disl/Vaccine}.

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

↑