GRU: Mitigating the Trade-off between Unlearning and Retention for LLMs

Yue Wang, Qizhou Wang, Feng Liu, Wei Huang, Yali Du, Xiaojiang Du, Bo Han

Large Language Model (LLM) unlearning—the process of removing sensitive or copyrighted data—often inadvertently "lobotomizes" the model, degrading its general performance. This paper introduces Gradient Rectified Unlearning (GRU), a geometric framework that projects unlearning updates onto directions that do not conflict with general knowledge retention, effectively breaking the notorious trade-off between forgetting and functioning.

The Unlearning vs. Retention Trade-off

As LLMs scale, they act as "sponges" for their training data, often memorizing sensitive Personally Identifiable Information (PII) or copyrighted text. While removing this data is crucial for legal and safety reasons, the process of "unlearning" is notoriously destructive.

The standard approach, Gradient Ascent (GA), essentially forces the model to "stop predicting" specific text. However, because LLM parameters are highly interconnected, these updates often point in directions that also damage unrelated, useful knowledge. This creates a zero-sum game: the more effectively you unlearn, the more the model’s general reasoning and utility suffer. Existing solutions like Gradient Difference (GD) try to balance these goals using a weighted loss function, but the unlearning signal often overwhelms the retention signal, leading to inconsistent results.

Gradient Rectified Unlearning (GRU)

The authors propose a geometric solution rather than a purely functional one. Instead of simply adding losses together, they focus on the direction of the gradient updates.

Conceptual diagram of Gradient Rectified Unlearning
  1. Gradient Rectification (GRU): At each training step, the algorithm calculates two gradients: one for the data to be forgotten ($g_u$) and one for a set of "retain" data ($g_r$). If these two vectors point in conflicting directions (i.e., their cosine similarity is negative), GRU "rectifies" the unlearning gradient. It projects $g_u$ onto a direction orthogonal to $g_r$, ensuring the update doesn't increase the loss on the retain data.
  2. Stable Estimation: To avoid the noise of small batches, they use an Exponential Moving Average (EMA) to maintain a stable estimate of the retention gradient direction throughout the process.
  3. Task Vector Rectified Unlearning (TRU): Recognizing that a perfect "retain" dataset is not always available, the authors introduced TRU. This variant uses the unlearning dataset itself as a reference; to unlearn one point, it uses the rest of the unlearning set as a proxy for the "knowledge to be kept," creating a "rectified task vector."

Evaluation Benchmarks

The framework was evaluated on three major unlearning benchmarks across several model backbones, including Llama-2-7B, Phi-1.5, and Zephyr-7B:

  • TOFU (Training on Forgotten User): A synthetic dataset of 200 author profiles used to test the removal of specific personal facts.
  • WMDP (Weaponized AI Model Development): A benchmark focused on removing hazardous knowledge related to biosecurity, cybersecurity, and chemical weapons.
  • MUSE (Machine Unlearning Six-way Evaluation): A dataset targeting copyright-protected content like news articles and books.

Key Insights

  • The Geometry of Conflict: The authors observed that in standard unlearning, the cosine similarity between "forget" and "retain" gradients drops sharply. This confirms that the model is actively fighting itself during the update process.
Cosine similarity and risk across unlearning steps
  • Surgical Precision: By enforcing orthogonality, GRU acts like a surgical tool. It allows the model to move away from sensitive data points without "stepping on" the weights that represent general linguistic capabilities.
  • Plug-and-Play Generality: GRU isn't a new unlearning objective; it’s a wrapper. It can be applied to Gradient Ascent, Negative Preference Optimization (NPO), or Gradient Difference, consistently improving their performance across the board.
  • Internal Reference: The TRU method provides a clever "data-free" alternative, showing that the internal consistency of the unlearning set can be used to protect the model even when external "retain" data is unavailable.

Experimental Results

The experimental results show that GRU consistently moves the needle on both unlearning efficacy (Forget Quality, FQ) and performance preservation (Model Utility, MU).

  • TOFU Benchmark: On Llama-2-7B (5% setup), standard Gradient Ascent had a dismal FQ of -16.93. Adding GRU boosted this to -3.52 (higher is better in their log-scale) while simultaneously increasing the Model Utility (MU) from 0.00 to 0.35.
  • WMDP Benchmark: GRU improved retention on the MMLU benchmark (a proxy for general knowledge) while maintaining or even improving the removal of hazardous biological/cyber knowledge.
  • MUSE Benchmark: In copyright removal tasks, GRU-enhanced methods showed significantly higher retention of non-targeted data (KnowMem-R) compared to baseline unlearning methods.

Limitations and Future Directions

While GRU is highly effective, the authors acknowledge a few hurdles:

  • Quality of Retain Data: GRU’s performance is tied to how well the "retain" dataset represents the model's overall knowledge. If the retain set is biased, the rectification might be suboptimal.
  • Computational Overhead: Calculating two sets of gradients (forget and retain) at each step increases the computational cost per iteration, though the authors argue this is a worthwhile trade-off for model safety.
  • Future Work: The authors suggest exploring ways to achieve reliable unlearning without relying on any retain data or surrogates at all, potentially by identifying "unlearning-safe" subspaces within the model's architecture.

Summary updated

BibTeX
@inproceedings{wang2025gru,
  author = {Yue Wang and Qizhou Wang and Feng Liu and Wei Huang and Yali Du and Xiaojiang Du and Bo Han},
  title = {{GRU: Mitigating the Trade-off between Unlearning and Retention for LLMs}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=EAjhGr1Oeo},
}
Figure