KGA: A General Machine Unlearning Framework Based on Knowledge Gap Alignment

Lingzhi Wang, Tong Chen, Wei Yuan, Xingshan Zeng, Kam-Fai Wong, Hongzhi Yin

Abstract

Machine Unlearning (MU) is the process of removing the influence of specific training instances from a trained model, a requirement increasingly mandated by privacy regulations like GDPR. While MU has seen progress in computer vision, its application to Natural Language Processing (NLP) is complicated by the discrete nature of text and the complex architectures of sequence-to-sequence models. We present Knowledge Gap Alignment (KGA), a novel framework that induces forgetfulness by aligning the "knowledge gap" between models. Rather than forcing a model toward a random state, KGA optimizes the model to treat forgotten data as if it were previously unseen. Our results across classification, translation, and dialogue generation tasks demonstrate that KGA achieves unlearning quality comparable to retraining from scratch while maintaining superior computational efficiency and general performance.

Introduction

In the era of the "right to be forgotten," machine learning faces a significant challenge: how to erase specific sensitive data from a model's weights without the prohibitive cost of retraining from scratch. This field, known as Machine Unlearning (MU), is critical for protecting user privacy. However, existing MU techniques often struggle with the unique complexities of NLP, such as explicit personal information in text and the autoregressive nature of generative models.

The Challenge of NLP Unlearning

Standard unlearning methods often rely on gradient-based updates to "undo" training. In NLP, this is difficult because text often contains highly specific identifiers (e.g., addresses, medical records) and models like Transformers use intricate attention mechanisms, making it hard to isolate the influence of specific tokens or sequences. While retraining from scratch is the gold standard, it is increasingly infeasible as model sizes grow to billions of parameters.

Methodology: Knowledge Gap Alignment (KGA)

The core innovation of KGA is the concept of Knowledge Gap Alignment. Instead of trying to force the model to behave like a randomly initialized network on the "forget set" ($D_f$), KGA aims to make the model treat $D_f$ as if it were unseen data.

The Knowledge Gap

A "knowledge gap" is defined as the distance between the prediction distributions of two structurally identical models trained on different data. KGA uses two small auxiliary models: $A_f$ (trained on the data to be forgotten) and $A_n$ (trained on a small set of extra, "unseen" data $D_n$).

Optimization Objective

KGA updates the target model so that the difference between its output and $A_f$'s output on the forget set matches the difference between the original model's output and $A_n$'s output on the unseen data. This is balanced with a Retention Loss, which uses the original model as a teacher to ensure the model retains its general capabilities on the remaining data ($D_r$).

Experimental Evaluation

KGA was evaluated on three diverse tasks: Text Classification (LEDGAR legal provisions), Machine Translation (IWSLT14 German-to-English), and Response Generation (PersonaChat multi-turn dialogues).

Results and Discussion

KGA demonstrates a remarkable ability to balance unlearning quality with performance maintenance.

Performance and Privacy

On the LEDGAR classification task, KGA maintains competitive F1 scores while significantly increasing the False Negative Rate (FNR) in Membership Inference Attacks (MiA). This indicates that an attacker can no longer reliably determine if a specific instance was part of the training set, achieving privacy protection close to the retraining baseline.

Figure 2: Performance and privacy metrics on the LEDGAR dataset, showing KGA's balance of F1 score and False Negative Rate (FNR).

Generative Task Quality

In machine translation (IWSLT), KGA achieved a BLEU score of 28.4, nearly matching the 28.6 score of the "Retrain from Scratch" gold standard. In contrast, other approximate methods like SISA saw significant performance degradation. KGA effectively reduces the BLEU score on the forget set (indicating successful unlearning) while keeping the test set BLEU stable.

Figure 4: BLEU scores on the Forget Set (unlearning quality) and Test Set (performance retention) across different removal rounds (R1-R5).

Semantic Substitution

A key insight from the study is KGA's handling of word-level removal. When forced to forget a specific term, the model often learns to substitute it with semantically similar words, preserving the grammatical and logical coherence of the output while successfully "forgetting" the target term.

Conclusion and Limitations

KGA provides a scalable and effective framework for NLP unlearning. By shifting the goal from "erasure to randomness" to "alignment with unseen data," it achieves high stability across complex generative tasks. However, KGA requires a small set of auxiliary "unseen" data, which may be difficult to source in niche domains. Furthermore, as an approximate method, it does not provide the absolute mathematical guarantees of full retraining, which may be required for certain high-stakes legal compliance scenarios.

Summary updated

BibTeX
@inproceedings{wang2023kga,
  author = {Lingzhi Wang and Tong Chen and Wei Yuan and Xingshan Zeng and Kam-Fai Wong and Hongzhi Yin},
  title = {{KGA: A General Machine Unlearning Framework Based on Knowledge Gap Alignment}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.740},
}
Figure