Abstract
Machine unlearning aims to remove specific information from a trained model while preserving its general utility. Traditional fine-tuning methods often struggle with the delicate balance between forgetting target data and retaining general knowledge, frequently suffering from high sensitivity to learning rates. This paper reframes unlearning as a multi-task optimization (MTO) problem and introduces NGDiff, a method employing normalized gradients and an automatic learning rate (AutoLR). NGDiff achieves a superior trade-off between forgetting and retention without requiring extensive hyperparameter tuning. Experimental results across various benchmarks, including TOFU and CIFAR-10, demonstrate that NGDiff provides enhanced stability and significantly higher model utility compared to existing baselines.
Introduction
Large Language Models (LLMs) often inadvertently memorize sensitive, copyrighted, or outdated data during training. Deleting this information via full retraining is computationally and environmentally prohibitive. Current unlearning techniques, such as Gradient Ascent (GA) or Gradient Difference (GDiff), treat unlearning as a single-objective fine-tuning task. However, these methods face two primary challenges: the difficulty of balancing the "forgetting" objective against the "retaining" objective—especially when the forget set is small—and extreme sensitivity to the learning rate, which can lead to catastrophic model collapse.
Methodology
We propose the NGDiff (Normalized Gradient Difference) framework, which treats unlearning as a dual-task optimization problem: maximizing loss on the "forget" set ($L_F$) while minimizing loss on the "retain" set ($L_R$).
A core innovation is Gradient Normalization. In standard GDiff, the gradient of one task can easily overwhelm the other. NGDiff addresses this by normalizing both gradients: $$g_{NGDiff} = \frac{g_R}{\|g_R\|} - \frac{g_F}{\|g_F\|}$$
This ensures the update direction remains within a "green zone" in the gradient space, where utility is preserved as information is erased.
Furthermore, we integrate AutoLR, an adaptive learning rate mechanism based on the Generalized Newton’s method (GeN). By utilizing Hessian-based information, AutoLR automatically selects the optimal learning rate at each step, eliminating the need for manual grid searches and preventing the catastrophic collapse often seen with static learning rates.
Experimental Results
NGDiff was evaluated on benchmarks including TOFU (fictitious biographies), MUSE-NEWS (real-world news), and CIFAR-10/100 (image classification) across architectures from Phi-1.5 to Llama2-7B.
On the TOFU benchmark using Llama2-7B, NGDiff demonstrated a significant advantage, achieving 40% higher model utility (measured by ROUGE scores on the retain set) than state-of-the-art baselines while maintaining equivalent forgetting performance. Unlike vanilla GDiff, which showed wild fluctuations in performance based on the learning rate, NGDiff with AutoLR remained stable across different settings.
In computer vision tasks (CIFAR-10), NGDiff successfully reduced forget set accuracy to 0% while maintaining a retain accuracy of 93.1%, far surpassing methods like LossNorm (75.3%). The method's theoretical grounding in dynamic scalarization ensures Pareto optimality, meaning forgetting performance cannot be improved without hurting utility.
Conclusion
By formalizing unlearning as a multi-task optimization problem, NGDiff provides a theoretically grounded and practically robust solution to the challenges of data removal in machine learning. The combination of gradient normalization and adaptive learning rates allows for stable, high-utility unlearning across modalities. While the method introduces a minor computational overhead (~6.6% increase in FLOPs due to AutoLR), the benefits in stability and performance outweigh the costs. Future work will explore the scalability of NGDiff to models beyond 7B parameters and more complex data modalities.
Summary updated