TL;DR
This paper introduces "Learning With Forgetting" (LWF), a novel framework to improve generative language model fine-tuning by selectively "forgetting" irrelevant pre-trained knowledge. LWF addresses the issue of "negative transfer," where some pre-trained knowledge can hinder downstream task performance, by identifying and unlearning potentially conflicting information without access to the original pre-training data.
What Problem Does This Paper Address?
The dominant pretrain-finetune paradigm in NLP, while powerful, suffers from "negative transfer." This occurs when knowledge acquired during large-scale pre-training actually harms performance on a specific downstream task. Traditional fine-tuning treats all pre-trained knowledge equally, which isn't always optimal. This paper tackles the challenge of how to selectively remove this detrimental knowledge from generative language models (like GPT) during fine-tuning, especially since the original pre-training data is usually inaccessible. Existing "graceful forgetting" methods are often designed for other domains (like vision) or non-autoregressive models, making them difficult to adapt to the unique challenges of language generation.
Methods
LWF introduces a three-pronged approach:
- Eliciting Self-Knowledge: Since the original pre-training data is unavailable, LWF leverages the generative capabilities of the model itself. It uses prompts from the "forgetting task" (the knowledge to be unlearned) to generate its own dataset of relevant information. This allows the model to "talk about" the knowledge it needs to forget.
- Evaluating Forgetting Confidence: Not all forgotten knowledge is beneficial. LWF proposes a metric to estimate how much forgetting a specific piece of self-generated knowledge would help the target "learning task." This metric, based on the Fisher Information Matrix (FIM) and a single-step parameter update, quantifies the conflict between the self-generated knowledge and the learning task. Data points with high "forgetting confidence" are prioritized for unlearning.
- Periodically Unlearning: To avoid instability and performance degradation, LWF integrates unlearning into the fine-tuning process. Instead of unlearning all at once, it interleaves learning new data with unlearning the identified high-confidence "forgetting" data at regular intervals. This "periodically unlearning" strategy aims to balance plasticity enhancement with stable learning.
Datasets
The paper evaluates LWF on five domain-specific question-answering datasets:
- gsm8k: Mathematical reasoning.
- qasc: Elementary science.
- sst5: Sentiment classification.
- dental: A subset of MedMCQA focusing on dental knowledge.
- psychol: A subset of MMLU covering psychology.
These datasets were chosen for their established evaluation metrics and clear knowledge boundaries, facilitating the study of inter-task knowledge transfer.
Key Insights and Ideas
- Generative Models Can "Self-Forget": The ability of LLMs to generate text is repurposed to create a dataset for unlearning, overcoming the inaccessibility of pre-training data.
- Confidence is Key: Simply forgetting isn't enough; forgetting the right things is crucial. LWF's confidence metric helps identify knowledge that is most likely to be detrimental to the target task.
- Interleaving is Better Than All-or-Nothing: Periodically unlearning during fine-tuning is more effective and stable than unlearning all at once before or after training.
- Task Specificity Matters: The effectiveness of forgetting can vary significantly depending on the specific learning and forgetting tasks, especially when there are superficial format differences.
Key Results
- LWF consistently improves fine-tuning performance across various domain-specific question-answering tasks, often by several percentage points compared to vanilla fine-tuning. For example, when fine-tuning on
gsm8kand forgettingqasc, LWF achieved a +5.38% improvement. - The "mixed" forgetting scenario (unlearning a combination of datasets) generally yielded the most stable and significant improvements across all learning tasks.
- LWF demonstrated architectural transferability, showing performance gains even on larger models like Qwen2.5-1.5B, though the relative improvement was smaller.
- Analysis of forgetting confidence showed that unlearning data with high confidence leads to more consistent and robust performance gains compared to unlearning low-confidence data.
- While accuracy on forgetting tasks generally declined, the semantic shift (measured by cosine similarity) indicated that LWF effectively altered the model's responses, especially for more complex domains.
Limitations and Future Work
- Forgetting Confidence Metric: The current metric relies on approximations and can be sensitive to the size of the forgetting dataset. Future work could explore more precise and robust metrics.
- Computational Overhead: Calculating forgetting confidence incurs some computational cost, though it's deemed acceptable for fine-tuning.
- Superficial Forgetting: LWF can sometimes lead to "superficial forgetting" when there are significant format differences between learning and forgetting tasks (e.g., free-form vs. multiple-choice QA). Future work should ensure better alignment between task formats.
- Inter-Task Interactions: Fully understanding the complex mechanisms of inter-task interactions remains a challenge. The authors hope their work inspires further research in this area.
Summary updated