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

让大语言模型无法习得有害行为

Making Harmful Behaviors Unlearnable for Large Language Models

Fudan University(复旦大学)

Xin Zhou, Yi Lu, Ruotian Ma, Tao Gui, Qi Zhang, Xuanjing Huang

AI总结:

针对大语言模型微调时易从有害数据中习得不良行为的问题,提出基于可分离安全向量的可控训练框架,仅用少量有害样本生成的安全向量即可阻止模型学习大量有害行为且不影响其学习有用信息。

摘要:

大语言模型(LLMs)作为通用AI助手在各领域展现出巨大潜力。为满足不同应用需求,LLMs常通过进一步微调进行定制。然而,LLMs强大的学习能力不仅使其能掌握新任务,也导致它们易习得不良行为。例如,即便经过安全对齐的LLMs也能被轻易微调为有害助手,因为微调数据往往包含隐含或明确的有害内容。我们能否在有害数据上训练LLMs却不让其习得有害行为?本文提出一种可控训练框架,可在微调过程中让有害行为变得无法被习得。具体而言,我们引入“安全向量(security vectors)”——少量可与LLM分离的新增参数——以确保LLM的响应与有害行为保持一致。微调期间安全向量被激活,这种一致的行为会让LLM认为该行为已被习得,无需再针对有害数据进一步优化。推理阶段,我们可停用安全向量以恢复LLM的正常行为。实验结果表明,由100个有害样本生成的安全向量足以阻止LLM学习1000个有害样本,同时保留其学习其他有用信息的能力。

英文摘要:

Large language models (LLMs) have shown great potential as general-purpose AI assistants in various domains. To meet the requirements of different applications, LLMs are often customized by further fine-tuning. However, the powerful learning ability of LLMs not only enables them to acquire new tasks but also makes them susceptible to learning undesired behaviors. For example, even safety-aligned LLMs can be easily fine-tuned into harmful assistants as the fine-tuning data often contains implicit or explicit harmful content. Can we train LLMs on harmful data without learning harmful behaviors? This paper proposes a controllable training framework that makes harmful behaviors unlearnable during the fine-tuning process. Specifically, we introduce ``security vectors'', a few new parameters that can be separated from the LLM, to ensure LLM's responses are consistent with the harmful behavior. Security vectors are activated during fine-tuning, the consistent behavior makes LLM believe that such behavior has already been learned, there is no need to further optimize for harmful data. During inference, we can deactivate security vectors to restore the LLM's normal behavior. The experimental results show that the security vectors generated by 100 harmful samples are enough to prevent LLM from learning 1000 harmful samples, while preserving the ability to learn other useful information.

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

↑