Abstract
Current machine unlearning techniques for Large Language Models (LLMs) often fail to truly remove harmful knowledge, instead merely suppressing observable behavior. This leaves latent capabilities that can be easily reactivated through adversarial finetuning. We present UNDO (Unlearn-Noise-Distill-on-Outputs), a scalable framework that robustifies unlearning by distilling a behaviorally-suppressed teacher model into a student network. By injecting noise into the student's weights before distillation, UNDO effectively strips away hidden memory traces. Our results demonstrate that UNDO achieves near-perfect robustness, matching the security of retraining from scratch while requiring significantly less compute.
Introduction
As LLMs are trained on increasingly vast datasets, they inevitably acquire hazardous capabilities, such as knowledge related to cyberattacks or biological weapons. Developers attempt to mitigate these risks using "machine unlearning"—post-training procedures designed to make the model "forget" specific domains. However, recent evaluations reveal a critical flaw: standard unlearning methods are superficial. They modify the model's output distribution to hide the knowledge, but the underlying neural circuits remain largely intact.
This residual knowledge enables "relearning attacks," where a malicious actor can restore the forbidden capabilities with minimal finetuning. Currently, the only robust solution is to retrain the model from scratch on a perfectly filtered dataset—a process that is prohibitively expensive for frontier models.
The UNDO Framework
The core insight of this work is that knowledge distillation can act as a "capability filter." A student model trained via distillation only learns the explicit behaviors demonstrated by its teacher. If the teacher has been unlearned to suppress harmful outputs, the student will learn the safe behavior without inheriting the teacher's latent, hidden circuitry.
The authors propose UNDO (Unlearn-Noise-Distill-on-Outputs), which consists of three stages:
- Unlearn: A pretrained model undergoes standard, low-cost unlearning (such as Gradient Difference or MaxEnt) to suppress undesired behaviors.
- Noise: To avoid the high cost of training a student from scratch, the unlearned model's weights are injected with controlled random noise. This "damages" the latent memory traces while preserving a useful initialization for general capabilities.
- Distill: The "noised" model is trained to match the outputs of the unlearned teacher. This process reconstructs general knowledge while leaving the harmful latent traces behind.
Experimental Results
The effectiveness of UNDO was evaluated across synthetic arithmetic tasks, language translation (FineWebEdu/FineWeb2), and realistic hazardous knowledge benchmarks (WMDP).
Robustness Against Relearning
The primary metric for success is resilience to relearning attacks. As shown in the resilience comparison (Figure 5, right), standard methods like GradDiff, MaxEnt, and RMU fail quickly; their cross-entropy loss on the "forget" domain drops rapidly during finetuning, indicating the model is "remembering" the data. In contrast, UNDO maintains a high loss, signifying that the knowledge has been genuinely removed. At its most robust setting, UNDO matches the performance of a "Gold Standard" model retrained from scratch.
Efficiency and Scalability
UNDO is significantly more efficient than full retraining, achieving comparable robustness using only 60-80% of the compute. Furthermore, it requires labels for only a tiny fraction (0.01%) of the original pretraining data. The method was successfully scaled to the Gemma-2-2B model, where it robustly removed hazardous biological and cybersecurity knowledge from the WMDP benchmark.
Discussion and Future Work
While UNDO represents a major step toward robust unlearning, it does involve a trade-off. Distillation is more compute-intensive than simple finetuning-based unlearning. Additionally, in large-scale experiments (WMDP), a slight decrease (~4.88%) in general MMLU performance was observed, likely due to the limited distillation data used in the academic setting.
Future applications are promising. Since many AI labs already use distillation to create smaller, production-ready models, integrating an unlearning step into the existing distillation pipeline could provide robust safety guarantees at almost no additional cost.
Summary updated