Split, Unlearn, Merge: Leveraging Data Attributes for More Effective Unlearning in LLMs

Swanand Ravindra Kadhe, Farhan Ahmed, Dennis Wei, Nathalie Baracaldo, Inkit Padhi · DOI

TL;DR

This paper introduces SPUNGE, a novel framework that enhances machine unlearning in Large Language Models (LLMs) by leveraging data attributes. SPUNGE splits unlearning data into subsets based on attributes, unlearns each subset independently, and then merges the resulting models, leading to significantly improved removal of undesirable behaviors and knowledge while preserving general capabilities.

What Problem Does This Paper Address?

Large Language Models (LLMs) are powerful but can exhibit harmful behaviors like generating toxic content or revealing sensitive knowledge. While machine unlearning offers a way to remove these undesirable traits, existing methods often treat the unlearning data monolithically. This can be inefficient, especially when the data contains diverse types of harmful content. The paper addresses the challenge of making LLM unlearning more effective and targeted by exploiting the inherent attributes within the unlearning data itself, which have been previously overlooked.

Methods

The core contribution is the SPUNGE (SPlit, UNlearn, then MerGE) framework. It operates in three main steps:

  1. Split: The unlearning dataset (D) is partitioned into subsets (D₁, D₂, ..., D<0xE2><0x82><0x99>) based on specific attribute values (e.g., demographic group targeted by toxicity, scientific domain of hazardous knowledge).
  2. Unlearn: Each subset (D<0xE1><0xB5><0xA2>) is used to unlearn the corresponding undesirable behavior or knowledge from the initial LLM (θ<0xE1><0xB5><0xA2><0xE2><0x82><0x99><0xE1><0xB5><0xA2><0xE1><0xB5><0x97>) independently, resulting in multiple partially unlearned models (θ₁, θ₂, ..., θ<0xE2><0x82><0x99>).
  3. Merge: These individual unlearned models are then merged into a single, final unlearned LLM (θ<0xE1><0xB5><0xA3>) using a merging method.

SPUNGE is designed to be model-agnostic and can be used with any existing unlearning method (like RMU or TVN) and merging method (like TIES-Merging). The framework leverages data annotations or classifiers to identify attributes and can incorporate preprocessing steps for the unlearning data.

Datasets

The paper uses the following datasets for evaluation:

  • ToxiGen: A dataset designed to measure implicit toxicity and hate speech across demographic groups. Used for unlearning toxic content.
  • WMDP (Weapons of Mass Destruction Proxy): A benchmark with multiple-choice questions on biosecurity, cybersecurity, and chemistry. Used for unlearning hazardous scientific knowledge.
  • Civil Comments: A dataset containing samples with explicit toxicity. Used in conjunction with ToxiGen for evaluating unlearning of both implicit and explicit toxicity.
  • Real Toxicity Prompts (RTP): Used to evaluate explicit toxicity.
  • 10 standard academic benchmarks: Including those from the Open LLM Leaderboard (e.g., ARC, HellaSwag, MMLU, GSM8K) to assess the general capabilities of the LLMs after unlearning.

Key Insights and Ideas

  • Attribute-aware unlearning is crucial: The paper demonstrates that simply unlearning all harmful data at once is less effective than strategically unlearning based on data attributes. This suggests that different types of harmful content might require tailored unlearning approaches.
  • Decomposition improves unlearning: By splitting the unlearning task into smaller, more focused sub-tasks (one for each attribute subset), SPUNGE allows unlearning methods to concentrate their efforts, leading to more thorough removal of specific undesirable traits.
  • Merging unlearned models is effective: The ability to combine the knowledge from multiple specialized unlearned models into a single, robust model is key to SPUNGE's success. This suggests that a modular approach to unlearning can be highly beneficial.
  • Preserving general capabilities: A significant finding is that SPUNGE not only improves unlearning effectiveness but also maintains the LLM's general performance on standard academic benchmarks, a common challenge in unlearning.

Key Results

SPUNGE significantly improved the performance of two state-of-the-art unlearning methods (RMU and TVN) on LLAMA2-7B and ZEPHYR-7B-BETA models:

  • Toxicity Reduction: SPUNGE boosted RMU's performance by up to 32% in reducing toxic text generation on ToxiGen. For TVN, it achieved reductions of up to 31% on ZEPHYR-7B-BETA and 30% on LLAMA2-7B.
  • Hazardous Knowledge Removal: SPUNGE improved RMU's performance by 11.8% in removing hazardous biosecurity knowledge and by 4% in removing hazardous cybersecurity knowledge.
  • General Capability Preservation: Across all experiments, SPUNGE maintained the general capabilities of the LLMs, with average accuracy on academic benchmarks dropping by at most 1%.

Limitations and Future Work

  • Attribute Identification: The effectiveness of SPUNGE relies on the availability and quality of data attributes. The paper mentions using data annotations or classifiers for this, but the robustness of attribute identification in diverse real-world scenarios is an area for further exploration.
  • Merging Method Sensitivity: While TIES-Merging is used, the paper acknowledges that the choice of merging method could impact the final performance. Investigating optimal merging strategies for SPUNGE is a potential future direction.
  • Broader Applications: The authors suggest exploring SPUNGE for other unlearning tasks, such as removing copyrighted or licensed data, which could be a fruitful avenue for future research.

Summary updated

Abstract

Large language models (LLMs) have shown to pose social and ethical risks such as generating toxic language or facilitating malicious use of hazardous knowledge. Machine unlearning is a promising approach to improve LLM safety by directly removing harmful behaviors and knowledge. In this paper, we propose "SPlit, UNlearn, MerGE" (SPUNGE), a framework that can be used with any unlearning method to amplify its effectiveness. SPUNGE leverages data attributes during unlearning by splitting unlearning data into subsets based on specific attribute values, unlearning each subset separately, and merging the unlearned models. We empirically demonstrate that SPUNGE significantly improves the performance of two recent unlearning methods on state-of-the-art LLMs while maintaining their general capabilities on standard academic benchmarks.
BibTeX
@inproceedings{kadhe2024split,
  author = {Swanand Ravindra Kadhe and Farhan Ahmed and Dennis Wei and Nathalie Baracaldo and Inkit Padhi},
  title = {{Split, Unlearn, Merge: Leveraging Data Attributes for More Effective Unlearning in LLMs}},
  booktitle = {FM-Wild @ ICML},
  year = {2024},
  url = {https://openreview.net/forum?id=BzIySThX9O},
}
Figure