arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2606.07970cs.CLcs.AI
收藏

通过扩展训练时对抗攻击防御恶意微调

Defending Against Malicious Finetuning by Scaling Train-time Adversarial Attacks

Xiongan AI Institute(雄安人工智能研究院);Institute for Interdisciplinary Information Sciences, Tsinghua University(清华大学交叉信息研究院);Shanghai Qi Zhi Institute(上海期智研究院)

Haoming Wen, Shi Chen, Qingyu Shi, Siyuan Liu, Minrui Luo, Jingzhao Zhang, Tianxing He

AI总结:

针对全参数微调的安全威胁,提出基于对抗训练和双层优化的Patcher方法,通过扩展对抗循环中的优化步数增强防御,并设计并行算法提升效率。

摘要:

当前的开源大型语言模型(LLMs)容易受到恶意微调攻击,这些攻击只需在中毒数据集上进行几步监督微调(SFT)即可破坏LLMs的安全对齐。现有的对齐阶段防御主要设计用于防御使用参数高效微调方法的攻击。然而,它们无法防御使用全参数微调的更强攻击。在本文中,我们提出了Patcher,一种受对抗训练和双层优化启发的方法,以对抗此类攻击。Patcher通过扩展对抗循环中的优化步数来增强模拟攻击,从而迫使防御者找到对更强攻击不敏感的模型参数。此外,我们提出了一种高效的并行算法来实现Patcher,减少了训练的挂钟时间,同时保持了Patcher的性能。大量实验表明,与普通SFT对齐相比,Patcher显著提高了模型的鲁棒性,并且可以迁移到不同的攻击场景和模型大小。代码可在https://github.com/haomingwen/patcher获取。

英文摘要:

Malicious finetuning attacks pose a major safety threat against open-weight large language models (LLMs). However, existing alignment-stage defenses provide limited protection against strong attacks that use full-parameter finetuning. To address this issue, we propose Patcher, a novel and efficient adversarial training algorithm that alternates between an attack stage and a defense stage: the attack stage simulates many-step malicious finetuning and computes the resulting parameter displacement as an "attack vector", while the defense stage aims to preserve safe behavior under such perturbations. Compared with other adversarial training methods, a key feature of Patcher is that the attack vector can be reused across multiple defense updates, substantially reducing training costs. Theoretically, we characterize how the relative gradient estimation error is influenced by the number of attack steps during training and reuse-duration of attack vectors. Empirically, experiment results show that Patcher reduces Attack Success Rate by 67.5%, 53.4% and 54.8% on three benchmarks compared to the second-best method while preserving the model's utility. Moreover, Patcher remains effective under diverse model sizes and attack scenarios, and generalizes to prompt-based jailbreak attacks. Code is available at https://github.com/haomingwen/patcher

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

↑