Abstract
Despite the strong capabilities of Large Language Models (LLMs) to acquire knowledge from their training corpora, the memorization of sensitive information in the corpora such as copyrighted, biased, and private content has led to ethical and legal concerns. In response to these challenges, unlearning has emerged as a potential remedy for LLMs affected by problematic training data. However, previous unlearning techniques are either not applicable to black-box LLMs due to required access to model internal weights, or violate data protection principles by retaining sensitive data for inference-time correction. We propose $\delta$-unlearning, an offset unlearning framework for black-box LLMs. Instead of tuning the black-box LLM itself, $\delta$-unlearning learns the logit offset needed for unlearning by contrasting the logits from a pair of smaller models. Experiments demonstrate that $\delta$-unlearning can effectively unlearn target data while maintaining similar or even stronger performance on general out-of-forget-scope tasks. $\delta$-unlearning also effectively incorporates different unlearning algorithms, making our approach a versatile solution to adapting various existing unlearning algorithms to black-box LLMs.
Introduction
As Large Language Models (LLMs) grow more powerful, they increasingly memorize sensitive training data, ranging from copyrighted literature to private personally identifiable information (PII). Machine unlearning aims to surgically remove this specific knowledge without the prohibitive cost of retraining from scratch.
However, existing methods typically require "white-box" access to model weights for fine-tuning, which is unavailable for proprietary models like GPT-4. Alternative "in-context" unlearning methods require including sensitive data in the prompt to instruct the model on what to avoid, creating significant privacy risks and consuming context window space. This paper introduces $\delta$-unlearning, a framework designed to perform effective, privacy-preserving unlearning on models where only output probabilities (logits) are accessible.
Methods: The $\delta$-Unlearning Framework
The authors propose $\delta$-Unlearning, a framework based on the "product-of-experts" principle. Rather than updating the massive black-box model ($M$), the system utilizes two smaller, identical white-box "offset models" ($M_o$ and $M'_o$).
The process involves three main steps:
- Initialization: Two identical small models are initialized.
- Training: One model ($M'_o$) is fine-tuned using a standard unlearning algorithm (e.g., Gradient Ascent) to "forget" the target data, while the other ($M_o$) remains unchanged.
- Inference: For any query, the system calculates a "logit offset"—the difference between the outputs of the two small models. This offset is added to the logits of the large black-box model to steer its output: $$Logits_{final} = Logits_M + \alpha(Logits_{M'_o} - Logits_{M_o})$$
This "steering committee" approach allows the large model to avoid sensitive information without altering its original weights. The framework is modular and compatible with various unlearning algorithms like KL Minimization or Data Relabeling.
Experimental Setup
The method was evaluated using the TOFU (Task of Fictitious Unlearning) benchmark, which contains fictitious author profiles. This allows for precise tracking of "forgotten" content (Forget Set) versus "retained" content (Retain Set, Real Authors, and World Facts). General intelligence was monitored using standard NLP benchmarks including ARC, HellaSwag, WinoGrande, and OpenBookQA.
The primary experiments used Llama2-13b-chat as the black-box model and Llama2-7b-chat as the offset models. Further tests demonstrated that even smaller models, such as Qwen (0.5B to 3B), could serve as effective offset models.
Key Results
$\delta$-Unlearning achieved unlearning quality comparable to direct fine-tuning while demonstrating superior preservation of general knowledge. By leaving the base model's weights "pristine," the framework avoids the catastrophic forgetting often associated with fine-tuning.
On the TOFU "Retain" tasks, $\delta$-Unlearning significantly outperformed direct fine-tuning. For instance, using Gradient Ascent, the Model Utility (MU) reached 48.6 for $\delta$-Unlearning compared to 32.7 for direct fine-tuning. Furthermore, the approach proved scale-agnostic; a 0.5B parameter model could effectively steer a 7B parameter model, minimizing the computational overhead of the extra forward passes.
Discussion and Limitations
While $\delta$-unlearning offers a flexible solution for black-box models, it introduces inference latency due to the additional forward passes required for the offset models. Additionally, the offset strength ($\alpha$) is a critical hyperparameter; improper tuning can lead to degraded output quality. Future research is needed to automate hyperparameter selection and to test the framework on more "entangled" real-world data where sensitive information is closely integrated with general knowledge.
Summary updated