语言模型是Homer Simpson!通过任务算术实现微调语言模型的安全重新对齐
Language Models are Homer Simpson! Safety Re-Alignment of Fine-tuned Language Models through Task Arithmetic
AI总结:
针对微调导致语言模型安全性受损的问题,提出通过任务算术将安全向量加至模型权重的RESTA方法,有效降低有害性并保持任务性能。
摘要:
对齐的语言模型面临一个重大局限,即其微调通常会导致安全性受损。为了解决这一问题,我们提出了一种简单的方法RESTA,用于执行LLM安全重新对齐。RESTA代表通过任务算术恢复安全。其核心涉及将安全向量简单算术加到受损模型的权重上。我们展示了RESTA在参数高效和完全微调中的有效性,涵盖了广泛的下游任务,包括中文、英文和印地语的指令遵循,以及代码和数学的解题能力。我们还展示了RESTA在三个现有安全评估基准和作为本研究一部分提出的一个多语言基准数据集上的泛化能力,该数据集包含550个有害问题,涵盖11个类别,每个类别有5个伤害子类别。总体而言,RESTA将受损模型的有害性从18.6%降低到5.1%,在参数高效和完全微调中分别从9.2%降低到1.5%,同时保持了模型在任务上的大部分性能。我们在以下网址发布源代码:https://github.com/declare-lab/resta。
英文摘要:
Aligned language models face a significant limitation as their fine-tuning often results in compromised safety. To tackle this, we propose a simple method RESTA that performs LLM safety realignment. RESTA stands for REstoring Safety through Task Arithmetic. At its core, it involves a simple arithmetic addition of a safety vector to the weights of the compromised model. We demonstrate the effectiveness of RESTA in both parameter-efficient and full fine-tuning, covering a wide range of downstream tasks, including instruction following in Chinese, English, and Hindi, as well as problem-solving capabilities in Code and Math. We also showcase the generalizability of RESTA on three existing safety evaluation benchmarks and a multilingual benchmark dataset proposed as a part of this work, consisting of 550 harmful questions covering 11 categories, each with 5 sub-categories of harm. Overall, RESTA decreases the harmfulness of the compromised model from 18.6% to 5.1% and from 9.2% to 1.5% in parameter-efficient and full fine-tuning, respectively, while maintaining most of the model's performance on the task. We release the source codes at: https://github.com/declare-lab/resta.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。