arXiv:2409.15361cs.CLcs.AI2024-09被引 9

微调大模型时,代码生成和翻译任务最易引发安全漏洞,新数据集可有效缓解。

Multitask Mayhem: Unveiling and Mitigating Safety Gaps in LLMs Fine-tuning

  • 针对代码生成与翻译等任务设计多任务安全微调数据集
  • 微调后73%-92%的有害请求被响应,安全防护显著下降
  • 现有安全方案缺乏跨任务鲁棒性,需通用对齐机制

大型语言模型(LLMs)在代码生成、机器翻译和情感分析等任务中取得突破,但红队测试表明,在无害数据上微调可能损害安全性。本文研究了在摘要、代码生成、翻译和分类等下游任务中微调导致的安全性退化,发现:1)代码生成与翻译任务的微调使安全防护机制退化最严重;2)模型在翻译与分类任务中普遍较弱,73%-92%的有害提示会被回答,属于两类主要风险;3)当前的防护措施(如安全守卫和训练数据集)缺乏跨任务鲁棒性。为此,我们构建了一个新的多任务安全数据集,能有效降低多种任务下的攻击成功率,且不影响模型整体帮助性。本工作强调需要更通用的对齐方法以确保模型安全可靠。

原文摘要 · Abstract (English)

Recent breakthroughs in Large Language Models (LLMs) have led to their adoption across a wide range of tasks, ranging from code generation to machine translation and sentiment analysis, etc. Red teaming/Safety alignment efforts show that fine-tuning models on benign (non-harmful) data could compromise safety. However, it remains unclear to what extent this phenomenon is influenced by different variables, including fine-tuning task, model calibrations, etc. This paper explores the task-wise safety degradation due to fine-tuning on downstream tasks such as summarization, code generation, translation, and classification across various calibration. Our results reveal that: 1) Fine-tuning LLMs for code generation and translation leads to the highest degradation in safety guardrails. 2) LLMs generally have weaker guardrails for translation and classification, with 73-92% of harmful prompts answered, across baseline and other calibrations, falling into one of two concern categories. 3) Current solutions, including guards and safety tuning datasets, lack cross-task robustness. To address these issues, we developed a new multitask safety dataset effectively reducing attack success rates across a range of tasks without compromising the model's overall helpfulness. Our work underscores the need for generalized alignment measures to ensure safer and more robust models.

大模型安全微调风险多任务对齐

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。