arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.02207cs.LG
收藏

(几乎)零成本的安全微调:视觉大型语言模型的基线

Safety Fine-Tuning at (Almost) No Cost: A Baseline for Vision Large Language Models

EPFL(洛桑联邦理工学院)

Yongshuo Zong, Ondrej Bohdal, Tingyang Yu, Yongxin Yang, Timothy Hospedales

AI总结:

针对视觉大型语言模型因有害微调数据及安全对齐遗忘而产生的风险,论文构建 VLGuard 安全指令数据集,并通过标准或事后微调在几乎不损失有用性的情况下显著增强安全性。

摘要:

当前的视觉大型语言模型(VLLM)展现出卓越能力,却容易生成有害内容,并且即便面对最简单的越狱攻击也很脆弱。我们的初步分析发现,其原因在于视觉-语言指令微调过程中存在有害数据,而且 VLLM 微调会导致模型遗忘底层 LLM 此前学到的安全对齐。为解决这一问题,我们首先构建了覆盖多种有害类别的视觉-语言安全指令遵循数据集 VLGuard。实验表明,将该数据集整合进标准视觉-语言微调,或用其进行事后微调,都能有效实现 VLLM 的安全对齐。这种对齐对模型有用性的影响极小,甚至还能提升有用性。我们的安全微调数据集具有多用途性,可作为安全测试现有 VLLM、训练新模型或保护预训练 VLLM 的宝贵资源。实证结果显示,经过微调的 VLLM 能有效拒绝不安全指令,并显著降低多种黑盒对抗攻击的成功率,在许多情况下成功率趋近于零。代码和数据集可在 https://github.com/ys-zong/VLGuard 获取。

英文摘要:

Current vision large language models (VLLMs) exhibit remarkable capabilities yet are prone to generate harmful content and are vulnerable to even the simplest jailbreaking attacks. Our initial analysis finds that this is due to the presence of harmful data during vision-language instruction fine-tuning, and that VLLM fine-tuning can cause forgetting of safety alignment previously learned by the underpinning LLM. To address this issue, we first curate a vision-language safe instruction-following dataset VLGuard covering various harmful categories. Our experiments demonstrate that integrating this dataset into standard vision-language fine-tuning or utilizing it for post-hoc fine-tuning effectively safety aligns VLLMs. This alignment is achieved with minimal impact on, or even enhancement of, the models' helpfulness. The versatility of our safety fine-tuning dataset makes it a valuable resource for safety-testing existing VLLMs, training new models or safeguarding pre-trained VLLMs. Empirical results demonstrate that fine-tuned VLLMs effectively reject unsafe instructions and substantially reduce the success rates of several black-box adversarial attacks, which approach zero in many cases. The code and dataset are available at https://github.com/ys-zong/VLGuard.

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

↑