Fine-tuning large language models (LLMs) improves performance but introduces critical safety vulnerabilities: even minimal harmful data can severely compromise safety measures. We observe that perturbations orthogonal to the alignment direction - defined by weight differences between aligned (safe) and unaligned models - rapidly compromise model safety. In contrast, updates along the alignment direction largely preserve it, revealing the parameter space as a "narrow safety basin". To address this, we propose AsFT (Anchoring Safety in Fine-Tuning) to maintain safety by explicitly constraining update directions during fine-tuning. By penalizing updates orthogonal to the alignment direction, AsFT effectively constrains the model within the "narrow safety basin," thus preserving its inherent safety. Extensive experiments on multiple datasets and models show that AsFT reduces harmful behaviors by up to 7.60%, improves task performance by 3.44%, and consistently outperforms existing methods across multiple tasks.


翻译:微调大语言模型(LLMs)能提升性能,但会引入关键的安全漏洞:即使是最小量的有害数据也可能严重破坏安全措施。我们观察到,与对齐方向正交的扰动——该方向由对齐(安全)模型与未对齐模型之间的权重差异定义——会迅速损害模型安全性。相比之下,沿对齐方向的更新在很大程度上能保持安全性,这揭示了参数空间呈现为“狭窄安全盆地”。为解决此问题,我们提出AsFT(微调中的安全锚定)方法,通过在微调过程中显式约束更新方向来维持安全性。通过惩罚与对齐方向正交的更新,AsFT有效地将模型约束在“狭窄安全盆地”内,从而保持其内在安全性。在多个数据集和模型上的大量实验表明,AsFT能将有害行为降低达7.60%,将任务性能提升3.44%,并在多项任务中持续优于现有方法。

0
下载
关闭预览

相关内容

综述:面向移动端大语言模型的隐私与安全
专知会员服务
19+阅读 · 2025年9月7日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
49+阅读 · 2024年12月24日
【新书】大规模语言模型的隐私与安全,
专知会员服务
29+阅读 · 2024年12月4日
生成式人工智能大型语言模型的安全性:概述
专知会员服务
35+阅读 · 2024年7月30日
【ACL2024】语言模型对齐的不确定性感知学习
专知会员服务
25+阅读 · 2024年6月10日
大型语言模型网络安全综述
专知会员服务
67+阅读 · 2024年5月12日
Spooftooph - 用于欺骗或克隆蓝牙设备的自动工具
黑白之道
17+阅读 · 2019年2月27日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员