Catastrophic forgetting remains a fundamental challenge when fine-tuning Large Language Models (LLMs). While Supervised Fine-Tuning (SFT) effectively transforms base models into specialized assistants, this adaptation often comes at a steep cost: as the model masters a new target domain, its performance on unrelated, previously learned tasks plummets.
Recent research has uncovered a fascinating workaround: fine-tuning a model on its own generated synthetic data mitigates this forgetting far better than using high-quality, human-written "ground truth" data. However, generating and filtering thousands of synthetic responses is computationally expensive. This paper investigates why LLMs prefer learning from their own distributions and introduces a highly efficient method to achieve the same benefits without the overhead of synthetic data generation.
The "Familiarity" Factor and Token Perplexity
The authors identify token perplexity as the primary driver of catastrophic forgetting. Human-written text naturally contains complex phrasing, stylistic variability, and expressions that a model finds "surprising" (resulting in high perplexity). During training, these surprising tokens trigger massive gradient updates. These drastic shifts in the model's weights overwrite its original instruction-following and reasoning capabilities.
Conversely, LLM-generated text relies on "familiar" distributions, exhibiting significantly lower average perplexity and fewer spikes. Because the model is learning from text it finds predictable, it can adapt to new tasks with minimal perturbations to its internal parameters.
Selective Token Masking (STM)
To isolate the benefits of low-perplexity learning, the researchers compared three approaches:
- Self-Output: Training on model-generated responses that match the ground truth answer.
- Rephrase: Training on ground truth responses rewritten in the model's own style.
- Selective Token Masking (STM): The paper's novel, highly efficient contribution.
Instead of generating entirely new text, STM performs a single forward pass over the human ground truth data to calculate the perplexity of every token. Any token exceeding a predefined threshold ($\tau$) is simply masked out during training. This forces the model to learn only from the "familiar" parts of the sentence.
The efficiency gains are substantial: while generating Self-Output data for a subset of the MBPP dataset took over 18 GPU hours, calculating perplexity for STM took only 4 minutes. Furthermore, masking these "hard" tokens does not degrade the quality of the training signal; complex stylistic phrasing is rarely necessary for learning the underlying logic of a task.
Experimental Results
The researchers evaluated these methods across demanding target domains (MBPP for Python programming, MATH for high-school math) and measured forgetting on non-target tasks (GSM8K, ARC-Challenge, BIRD). The tests spanned a diverse suite of models, including Llama 3 8B Instruct, Gemma 2 IT 2B/9B, Mistral 7B Instruct, and OLMo 2 7B.
Key findings include:
- Preserving General Skills: STM dramatically reduces non-target task degradation (Backward Transfer or BWT). For instance, on the MBPP task using Gemma 2 2B, standard fine-tuning caused a severe -38.19% drop in non-target performance. STM reduced this degradation to nearly zero (+0.42%).
- Target Task Improvement: Despite masking approximately 24% of the training tokens, STM still achieved positive Task Improvement scores, proving the model successfully learned the new domain.
- Hyperparameter Robustness: STM is significantly less sensitive to learning rate tuning. While baseline models often collapse under high learning rates, STM remains stable.
- Superior to Standard Regularization: STM outperformed traditional regularization techniques like Dropout and Weight Decay, indicating that filtering the content of the learning signal is more effective than merely penalizing weight magnitude.
Limitations and Future Directions
While STM offers a powerful and efficient way to mitigate catastrophic forgetting, the authors note a few limitations. The study primarily focused on models under 10 billion parameters, leaving the perplexity dynamics of frontier models (like Llama 3 70B) as an open question. Additionally, the perplexity threshold $\tau$ is currently a static hyperparameter; future work could explore adaptive masking strategies that adjust based on sample difficulty, or investigate how perplexity thresholds should evolve as a model matures during curriculum learning.
Summary updated