Revisiting Who's Harry Potter: Towards Targeted Unlearning from a Causal Intervention Perspective

Yujian Liu, Yang Zhang, Tommi S. Jaakkola, Shiyu Chang

Introduction

Large Language Models (LLMs) are often trained on datasets containing copyrighted, private, or sensitive information. Machine unlearning seeks to remove this specific knowledge without the prohibitive cost of retraining. However, standard unlearning often suffers from a "scorched earth" effect, where removing one fact inadvertently destroys related but safe context or leads to hallucinations. This paper introduces a formal causal framework for targeted unlearning, ensuring that while a specific entity is forgotten, the surrounding general knowledge remains intact.

Targeted unlearning aims to forget specific biographical details (Wilhelm Wattenbach) while retaining general geographic knowledge (Rantzau).

The Problem: Beyond "Scorched Earth" Unlearning

The authors identify a critical gap in existing methods like Who’s Harry Potter (WHP). While WHP successfully suppresses specific names, it often fails to maintain the model's internal consistency. For instance, if a document states "Wilhelm Wattenbach was born in Rantzau," a naive unlearning algorithm might either delete the entire sentence (losing the fact that Rantzau is a town) or replace Wattenbach with a hallucinated biography. Targeted unlearning requires a surgical approach: forget the person, but remember the place.

Methodology: A Causal Intervention Approach

The core contribution of this work is grounding unlearning in Causal Intervention. The relationship between an LLM input ($X$) and its output ($Y$) is modeled as being influenced by a "confounder" ($E$), which represents the knowledge of the target entity to be forgotten.

The causal graph models target knowledge as a confounder E. Intervention on X using multiple replacement entities E helps deconfound the output distribution.

To break the causal link between the target and the output, the authors apply the backdoor theorem. This theoretical foundation leads to a refined teacher-student training pipeline:

  1. Teacher Construction via Intervention: Instead of a single name swap, the target entity is replaced with $N$ different entities (e.g., "Harry Potter" becomes "Jon," "Paul," etc.). This "power of many" flattens the output distribution, encouraging the model to provide generic "I don't know" responses rather than specific hallucinations.
  2. Name-Back Mapping: To prevent the model from switching topics mid-sentence, the teacher's output distribution maps the probability mass of replacement names back to the original target's name. This ensures the model learns to discuss the subject without accessing the forbidden facts.
  3. Counter-factual Prompting: The teacher LLM is explicitly prompted to use the knowledge of the replacement entity, ensuring the counter-factual distribution is distinct and informative.
  4. Student Fine-tuning: A student model is trained to minimize the KL divergence between its output and this aggregated, deconfounded teacher distribution.

Evaluation and Results

The framework was evaluated on the Wikipedia Person Unlearning (WPU) benchmark and the TOFU synthetic dataset. The proposed method, OURS, demonstrated significant improvements over baselines:

  • Hallucination Suppression: OURS responded with "information unavailable" for over 90% of "forget" queries, a stark contrast to baselines that frequently fabricated biographies.
  • Context Retention: The model maintained high utility on "Hard-retain" tasks (facts related to the target but not about the target) and "General-retain" tasks.
  • Adversarial Robustness: The method proved resilient against "jailbreak" attacks, such as many-shot prompting and GCG attacks, which typically cause other unlearned models to leak forbidden information.

Conclusion

By framing unlearning as a causal deconfounding problem, this research moves beyond ad-hoc fine-tuning hacks. The resulting method provides a more robust and surgical way to remove sensitive information from LLMs while preserving their general utility. Future work will explore weight-space modifications to further minimize utility degradation.

Summary updated

Abstract

This paper investigates Who's Harry Potter (WHP), a pioneering yet insufficiently understood method for LLM unlearning. We explore it in two steps. First, we introduce a new task of LLM targeted unlearning, where given an unlearning target (e.g., a person) and some unlearning documents, we aim to unlearn only the information about the target, rather than everything in the unlearning documents. We further argue that a successful unlearning should satisfy criteria such as not outputting gibberish, not fabricating facts about the unlearning target, and not releasing factual information under jailbreak attacks. Second, we construct a causal intervention framework for targeted unlearning, where the knowledge of the unlearning target is modeled as a confounder between LLM input and output, and the unlearning process as a deconfounding process. This framework justifies and extends WHP, deriving a simple unlearning algorithm that includes WHP as a special case. Experiments on existing and new datasets show that our approach, without explicitly optimizing for the aforementioned criteria, achieves competitive performance in all of them. Our code is available at https://github.com/UCSB-NLP-Chang/causal_unlearn.git.
BibTeX
@inproceedings{liu2024revisiting,
  author = {Yujian Liu and Yang Zhang and Tommi S. Jaakkola and Shiyu Chang},
  title = {{Revisiting Who's Harry Potter: Towards Targeted Unlearning from a Causal Intervention Perspective}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.495},
}
Figure