To Forget or Not? Towards Practical Knowledge Unlearning for Large Language Models

Bozhong Tian, Xiaozhuan Liang, Siyuan Cheng, Qingbin Liu, Mengru Wang, Dianbo Sui, Xi Chen, Huajun Chen, Ningyu Zhang

Introduction

Large Language Models (LLMs) are trained on vast datasets, often inadvertently memorizing sensitive information such as personally identifiable information (PII) and copyrighted content. While "knowledge unlearning" aims to remove this data post-training, existing methods frequently suffer from "excessive unlearning." This occurs when attempts to erase sensitive data (e.g., a private address) unintentionally destroy useful public knowledge (e.g., an author's bibliography).

This paper addresses the "vague forgetting boundary" problem, where models lose the ability to answer any questions about a subject once unlearning is applied. The authors propose a shift from "indiscriminate forgetting" to "differentiated unlearning"—erasing the Unlearn Scope (sensitive/private) while preserving the Retention Scope (public/essential).

The KnowUnDo Benchmark

To evaluate this differentiated approach, the authors introduced the KnowUnDo benchmark. It categorizes knowledge into two primary domains:

  • Copyrighted Content: Distinguishes between unauthorized revisions (Unlearn Scope) and meta-information or reviews (Retention Scope, aligned with "fair use").
  • User Privacy: Uses a dataset of fictitious authors where private details like home addresses are in the Unlearn Scope, while public facts like names and awards are in the Retention Scope.

The benchmark includes 2,649 question-answer pairs and evaluates models on Unlearn Success, Retention Success, and general task performance.

MemFlex: Surgical Unlearning via Localization

The core technical contribution is MemFlex, a framework designed for precise parameter localization. Unlike traditional methods that update all model weights—often leading to "catastrophic interference"—MemFlex identifies and updates only the specific parameters most responsible for sensitive knowledge.

The MemFlex framework vs. traditional unlearning, highlighting the knowledge localization process.

The MemFlex process involves three key steps:

  1. Gradient Localization: It calculates an Unlearn Gradient ($G_{UL}$) by substituting sensitive labels with random ones and a Retention Gradient ($G_{RT}$) from knowledge that must be kept.
  2. Directional Analysis: By analyzing the cosine similarity between these gradients, MemFlex identifies "pivotal" parameters where the unlearn gradient direction diverges significantly from the retention gradient.
  3. Selective Update: Only these localized parameters are updated, while the rest of the model remains frozen. This ensures that the model's general capabilities and linguistic stability are preserved.

Key Results and Insights

Experiments on LLaMA-2-7B demonstrate that MemFlex achieves a superior balance between forgetting and retaining information.

Comparison of Retention and Unlearning Success across different methods.
  • Performance Balance: MemFlex achieved a "Success" score (averaging unlearning and retention) of 82.37% on privacy tasks, far outperforming standard Gradient Ascent (~49%).
  • Retention Mastery: While traditional methods often saw retention success drop to near zero, MemFlex maintained scores above 80%.
  • Stability and Efficiency: MemFlex maintains a stable perplexity curve, avoiding the "hallucinations" or gibberish often produced by blunt unlearning methods. Additionally, by updating only a fraction of parameters, it achieved an 11.76% reduction in training time per step.

Conclusion and Future Work

MemFlex represents a significant step toward practical LLM unlearning by aligning technical methods with legal frameworks like GDPR and the US Copyright Act. While currently focused on text and 7B-parameter models, future work aims to scale this localization to larger models and explore unlearning in multimodal contexts. By moving toward more granular control—potentially down to individual neurons—researchers can ensure LLMs remain both safe and useful.

Summary updated

BibTeX
@inproceedings{tian2024forget,
  author = {Bozhong Tian and Xiaozhuan Liang and Siyuan Cheng and Qingbin Liu and Mengru Wang and Dianbo Sui and Xi Chen and Huajun Chen and Ningyu Zhang},
  title = {{To Forget or Not? Towards Practical Knowledge Unlearning for Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.82},
}
Figure