arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2412.12497cs.CL
收藏

NLSR:针对有害微调的大语言模型神经元级安全重对齐

NLSR: Neuron-Level Safety Realignment of Large Language Models Against Harmful Fine-Tuning

East China Normal University(华东师范大学);University of Potsdam(波茨坦大学)

Xin Yi, Shunfan Zheng, Linlin Wang, Gerard de Melo, Xiaoling Wang, Liang He

AI总结:

针对微调攻击,提出无需训练的NLSR框架,通过构建安全参考模型识别并移植安全关键神经元,以最小改动恢复大模型安全性,同时保持任务性能。

摘要:

微调即服务的出现揭示了大语言模型(LLMs)的一个新漏洞。用户上传的少量恶意数据即可巧妙操纵微调过程,导致模型对齐被破坏。现有的抵御微调攻击的方法通常需要大量的计算资源。即使采用LoRA等参数高效技术,梯度更新仍然必不可少。为应对这些挑战,我们提出了神经元级安全重对齐(NLSR),这是一个无需训练的框架,基于微调前后安全关键神经元的相似性差异来恢复LLMs的安全性。我们框架的核心是首先从初始对齐模型构建一个安全参考模型,以放大神经元中与安全相关的特征。然后利用该参考模型识别安全关键神经元,并将其准备为补丁。最后,我们通过移植这些准备好的补丁,选择性地仅恢复那些表现出显著相似性差异的神经元,从而最小程度地改变微调后的模型。大量实验表明,在多个下游任务中,微调模型的安全性显著提升,同时任务级准确性得到很大保持。我们的研究结果表明,一些安全关键神经元的区域在微调后表现出明显差异,可以通过从参考模型移植神经元来有效纠正,而无需额外训练。代码将在https://github.com/xinykou/NLSR提供。

英文摘要:

The emergence of finetuning-as-a-service has revealed a new vulnerability in large language models (LLMs). A mere handful of malicious data uploaded by users can subtly manipulate the finetuning process, resulting in an alignment-broken model. Existing methods to counteract fine-tuning attacks typically require substantial computational resources. Even with parameter-efficient techniques like LoRA, gradient updates remain essential. To address these challenges, we propose \textbf{N}euron-\textbf{L}evel \textbf{S}afety \textbf{R}ealignment (\textbf{NLSR}), a training-free framework that restores the safety of LLMs based on the similarity difference of safety-critical neurons before and after fine-tuning. The core of our framework is first to construct a safety reference model from an initially aligned model to amplify safety-related features in neurons. We then utilize this reference model to identify safety-critical neurons, which we prepare as patches. Finally, we selectively restore only those neurons that exhibit significant similarity differences by transplanting these prepared patches, thereby minimally altering the fine-tuned model. Extensive experiments demonstrate significant safety enhancements in fine-tuned models across multiple downstream tasks, while greatly maintaining task-level accuracy. Our findings suggest regions of some safety-critical neurons show noticeable differences after fine-tuning, which can be effectively corrected by transplanting neurons from the reference model without requiring additional training. The code will be available at \url{https://github.com/xinykou/NLSR}

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

↑