Forget-to-Focus: Can unlearning Improve Domain Specialization in LLMs?

Chaitali Bhattacharyya, Yeseong KimOpenReview 2026 · Submission to ICLR 2026 · Rejected

TL;DR

Researchers have developed Forget-to-Focus (F2F), a two-stage training protocol that improves LLM domain specialization by first strategically "unlearning" irrelevant general knowledge. By clearing out the "mental clutter" of pre-training before fine-tuning, models achieve massive performance gains (up to 32% in coding) and become significantly more reliable and better calibrated.

What Problem Does This Paper Address?

Large Language Models (LLMs) are the ultimate generalists, trained on massive swaths of the internet. However, when we try to turn them into specialists—like a medical assistant or a senior software engineer—this general knowledge can actually get in the way.

This is known as negative transfer. For example, a model trained on casual web chat might struggle to adopt the precise, formal terminology required for medical diagnosis because its "brain" is still anchored to informal language patterns. Standard fine-tuning (SFT) tries to overwrite these patterns, but it often fails to fully suppress them, leading to slower learning, "spurious correlations" (learning the wrong reasons for an answer), and overconfidence in incorrect predictions.

Methods

The authors propose Forget-to-Focus (F2F), a two-stage protocol:

  1. The Unlearning Stage: Before the model ever sees the specialized domain data, it undergoes a "preparatory unlearning" phase. Using a forget set (general data like fiction or web text), the model uses Gradient Ascent (GA) to actively move its parameters away from that knowledge. To keep the model from breaking entirely, they often use a retain set (a small slice of useful data) with standard Gradient Descent to maintain basic linguistic stability.
  2. The Focus (Fine-tuning) Stage: Once the irrelevant priors are suppressed, the model is fine-tuned on the target domain (e.g., medical QA or Python code) using standard methods like SFT or LoRA.

The researchers tested several unlearning algorithms, including GA+GD (Gradient Ascent + Gradient Descent), Negative Preference Optimization (NPO), and KL-divergence-based methods to find the best balance between forgetting and stability.

Datasets

The study evaluated F2F across three high-stakes domains:

  • Coding: Trained on OpenCoder; evaluated on HumanEval and MBPP.
  • Medical: Trained on PubMedQA, PubMed Guidelines, and MedMCQA; evaluated on their respective test sets.
  • Mathematics: Trained on OpenMathInstruct-1; evaluated on Hendrycks MATH and GSM8K.

To create the "forget sets," they used subsets of BookCorpus, sometimes using cosine similarity to automatically pick text that was most "different" from the target domain. They also monitored "broad-skill retention" using benchmarks like ARC, HellaSwag, and MMLU to ensure the models didn't lose their general common sense.

Key Insights and Ideas

  • Capacity Reallocation: Unlearning isn't just about deleting data; it’s about "clearing the optimization landscape." By suppressing irrelevant features, the model reallocates its internal representational space, making it much easier to learn complex, domain-specific structures.
  • Representational Geometry: Using tools like Centered Kernel Alignment (CKA), the authors showed that F2F actually reshapes how the model "sees" data. It pushes the model's internal representations further away from the generalist starting point than standard fine-tuning ever could.
  • The Calibration Cure: One of the most striking findings is in medicine. Standard fine-tuned models are often "confidently wrong." F2F significantly improves calibration, meaning the model’s confidence levels actually align with its accuracy. This makes the models much safer for sensitive applications.
  • Stability requires an Anchor: For smaller models (like Qwen-0.6B), aggressive unlearning without a "retain set" can lead to catastrophic failure. The "retain set" acts as a stabilizer that preserves the model's ability to speak while it's busy forgetting.

Key Results

The F2F protocol consistently crushed standard fine-tuning baselines across all model sizes (from 0.6B to 72B parameters):

  • Coding Gains: On the HumanEval benchmark, F2F improved the pass@1 score of Qwen3-0.6B by 32.5% and the massive Qwen-72B by 11.95% compared to standard fine-tuning.
  • Medical Reliability: In medical QA, F2F reduced the Expected Calibration Error (ECE) from 0.277 (standard tuning) to a mere 0.050.
  • Efficiency: F2F proved to be more "low-rank efficient." When using LoRA (a popular parameter-efficient tuning method), unlearned models reached higher accuracy with fewer parameters because the underlying "base" was less cluttered.

Limitations and Future Work

While powerful, F2F isn't a "set it and forget it" solution yet:

  • Forget Set Sensitivity: The results depend heavily on the quality and composition of the forget set. If you pick the wrong things to forget, you might accidentally damage the model's reasoning capabilities.
  • The "Art" of Hyperparameters: Balancing the weights of the forget set ($\lambda$) and the retain set ($\sigma$) requires careful tuning, which varies by model size and architecture.
  • Future Directions: The authors suggest exploring more automated ways to identify "interfering" knowledge and testing the protocol on even more diverse tasks like legal reasoning or creative writing.

For more details, the code is available at the anonymous GitHub repository.

Summary updated

Abstract

Standard fine-tuning of Large Language Models for domain-specific tasks is often suboptimal due to interference from vast, pre-existing general knowledge from pretraining, leading to issues like negative knowledge transfer and the reinforcement of spurious correlations. We study whether removing parts of a pretrained model’s pre-existing general knowledge before adaptation can make downstream learning easier. We propose and analyze Forget-to-Focus: a two-stage protocol that first performs targeted unlearning on a “forget” set (with an optional retain set for stability, then fine-tunes on a domain-specific dataset. Through rigorous experiments on different domains such as medical, mathematics, and coding benchmarks, we analyze whether this preparatory unlearning can lead to improved domain specialization. Our findings show that this protocol consistently outperforms standard fine-tuning e.g., it improves HumanEval pass@1 by 32.5\% on Qwen3-0.6B and 11.95\% on Qwen 72B model compared to standard fine-tuning. Beyond accuracy, we observe that F2F reshapes representational geometry as measured by centered kernel alignment, shifting models away from generalist initialization toward structures more conducive to in-domain specialization. Furthermore, unlearning prior fine-tuning helps improved calibration on medical QA tasks, reducing overconfidence and mitigating reliability issues that persist under standard fine-tuning. These findings establish unlearning not merely as a privacy tool but as a principled intervention for domain adaptation. By strategically suppressing irrelevant pretraining knowledge, Forget-to-Focus helps more stable optimization dynamics, better calibrated predictions, and consistently stronger downstream performance. The code is available at anonymous github : \href{https://anonymous.4open.science/r/D-1545/README.md}{https://anonymous.4open.science/r/D-1545/README.md}
BibTeX
@misc{bhattacharyya2026forget,
  author = {Chaitali Bhattacharyya and Yeseong Kim},
  title = {{Forget-to-Focus: Can unlearning Improve Domain Specialization in LLMs?}},
  year = {2026},
  url = {https://openreview.net/forum?id=vGkXf8nvt9},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure