The rapid advancement of Large Language Models (LLMs) has demonstrated their vast potential across various domains, attributed to their extensive pretraining knowledge and exceptional generalizability. However, LLMs often encounter challenges in generating harmful content when faced with problematic prompts. To address this problem, existing work attempted to implement a gradient ascent based approach to prevent LLMs from producing harmful output. While these methods can be effective, they frequently impact the model utility in responding to normal prompts. To address this gap, we introduce Selective Knowledge negation Unlearning (SKU), a novel unlearning framework for LLMs, designed to eliminate harmful knowledge while preserving utility on normal prompts. Specifically, SKU is consisted of two stages: harmful knowledge acquisition stage and knowledge negation stage. The first stage aims to identify and acquire harmful knowledge within the model, whereas the second is dedicated to remove this knowledge. SKU selectively isolates and removes harmful knowledge in model parameters, ensuring the model's performance remains robust on normal prompts. Our experiments conducted across various LLM architectures demonstrate that SKU identifies a good balance point between removing harmful information and preserving utility.
翻译:大型语言模型(LLMs)的快速发展已展现出其在多个领域的巨大潜力,这归功于其广泛的预训练知识和卓越的泛化能力。然而,当面对有害提示时,LLMs常面临生成有害内容的挑战。为解决该问题,现有工作尝试采用基于梯度上升的方法阻止LLMs产生有害输出。尽管这些方法可能有效,但它们通常会影响模型在正常提示下的实用性。为弥补这一不足,我们提出选择性知识否定遗忘(SKU),一种面向LLMs的新型遗忘框架,旨在消除有害知识的同时保留对正常提示的实用性。具体而言,SKU包含两个阶段:有害知识获取阶段和知识否定阶段。第一阶段旨在识别并获取模型中的有害知识,第二阶段则致力于移除这些知识。SKU能选择性地隔离并移除模型参数中的有害知识,确保模型在正常提示下保持稳健性能。我们在多种LLM架构上开展的实验表明,SKU能在消除有害信息与保留实用性之间找到良好平衡点。