Harmful fine-tuning attacks pose a major threat to the security of large language models (LLMs), allowing adversaries to compromise safety guardrails with minimal harmful data. While existing defenses attempt to reinforce LLM alignment, they fail to address models' inherent "trainability" on harmful data, leaving them vulnerable to stronger attacks with increased learning rates or larger harmful datasets. To overcome this critical limitation, we introduce SEAM, a novel alignment-enhancing defense that transforms LLMs into self-destructive models with intrinsic resilience to misalignment attempts. Specifically, these models retain their capabilities for legitimate tasks while exhibiting substantial performance degradation when fine-tuned on harmful data. The protection is achieved through a novel loss function that couples the optimization trajectories of benign and harmful data, enhanced with adversarial gradient ascent to amplify the self-destructive effect. To enable practical training, we develop an efficient Hessian-free gradient estimate with theoretical error bounds. Extensive evaluation across LLMs and datasets demonstrates that SEAM creates a no-win situation for adversaries: the self-destructive models achieve state-of-the-art robustness against low-intensity attacks and undergo catastrophic performance collapse under high-intensity attacks, rendering them effectively unusable. The code is available: https://github.com/ZJUWYH/seam. (Warning: this paper contains potentially harmful content generated by LLMs.)


翻译:有害微调攻击对大型语言模型(LLMs)的安全性构成重大威胁,攻击者仅需少量有害数据即可破坏其安全防护机制。现有防御方法试图强化LLM的对齐性,但未能解决模型对有害数据固有的“可训练性”问题,导致在面对更高学习率或更大规模有害数据集的增强攻击时依然脆弱。为克服这一关键局限,我们提出SEAM——一种创新的对齐增强防御方法,可将LLMs转化为具有内在抗错配能力的自毁模型。具体而言,这些模型在保持正常任务能力的同时,在对有害数据进行微调时会表现出显著的性能退化。该保护机制通过新型损失函数实现,该函数耦合了良性数据与有害数据的优化轨迹,并结合对抗性梯度上升技术以增强自毁效应。为实现高效训练,我们开发了具有理论误差界的高效无Hessian梯度估计方法。跨LLM和数据集的大规模评估表明,SEAM为攻击者创造了无利可图的局面:自毁模型在低强度攻击下达到最先进的鲁棒性,而在高强度攻击下会发生灾难性性能崩溃,使其实际失效。代码已开源:https://github.com/ZJUWYH/seam。(警告:本文包含LLM生成的可能有害内容。)

0
下载
关闭预览

相关内容

大语言模型机器遗忘综述
专知会员服务
18+阅读 · 2025年11月2日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
49+阅读 · 2024年12月24日
【新书】大规模语言模型的隐私与安全,
专知会员服务
29+阅读 · 2024年12月4日
大型语言模型网络安全综述
专知会员服务
67+阅读 · 2024年5月12日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
通信网络中大型语言模型的后门攻击的综述
专知会员服务
30+阅读 · 2023年9月5日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月13日
VIP会员
最新内容
大语言模型溯因推理的统一分类学与综述
专知会员服务
0+阅读 · 今天12:07
美/以-伊战争:停火与后续情景与影响分析
专知会员服务
3+阅读 · 4月11日
美国-以色列-伊朗战争:是否会动用地面部队?
美国协同作战飞机项目新型无人机发动机
专知会员服务
2+阅读 · 4月11日
相关VIP内容
大语言模型机器遗忘综述
专知会员服务
18+阅读 · 2025年11月2日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
49+阅读 · 2024年12月24日
【新书】大规模语言模型的隐私与安全,
专知会员服务
29+阅读 · 2024年12月4日
大型语言模型网络安全综述
专知会员服务
67+阅读 · 2024年5月12日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
通信网络中大型语言模型的后门攻击的综述
专知会员服务
30+阅读 · 2023年9月5日
相关基金
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员