Clear Minds Think Alike: What Makes LLM Fine-tuning Robust? A Study of Token Perplexity

Chao-Chung Wu, Zhi Rui Tam, Chieh-Yen Lin, Hung-yi Lee, Yun-Nung Chen · OpenReview

Abstract

Maintaining consistent model performance across domains is a fundamental challenge in machine learning. While recent work has explored using LLM-generated data for fine-tuning, its impact on cross-domain generalization remains poorly understood. In this paper, we present a systematic analysis revealing that fine-tuning with LLM-generated data not only improves target task performance but also reduces out-of-domain (OOD) degradation compared to fine-tuning with ground truth data. Through analyzing the data sequence in tasks of various domains, we demonstrate that this enhanced OOD robustness stems from a reduced prevalence of high perplexity tokens in LLM-generated sequences. Following this hypothesis we showed that masking high perplexity tokens in ground truth training data also achieves similar OOD preservation comparable to using LLM-generated data. Extensive experiments across diverse model architectures and scales, including Gemma2-2B, Mistral-7B and Llama3-8B, corroborate the consistency of our findings. To the best of our knowledge, this work provides the first mechanistic explanation for the superior OOD robustness conferred by LLM-generated training data, offering valuable insights for developing more robust fine-tuning strategies.

Introduction

Supervised Fine-Tuning (SFT) is the standard paradigm for specializing Large Language Models (LLMs) for specific tasks like coding or mathematics. However, this process often incurs a significant cost: "catastrophic forgetting," where the model loses its general-purpose capabilities and safety alignments. Recent empirical evidence suggests that fine-tuning on synthetic data generated by the model itself (Self-Output) or rephrased by another LLM mitigates this forgetting more effectively than using human-annotated ground truth (GT) data. This paper investigates the underlying mechanism of this phenomenon, identifying token perplexity as the key driver of robustness.

The Perplexity Hypothesis

We hypothesize that the robustness of LLM-generated data stems from its lower token perplexity (PPL). High-perplexity tokens—those the model finds highly unpredictable—induce large gradients during backpropagation. These gradients result in massive weight updates ($\Delta W$) that overwrite the pre-existing knowledge encoded in the model's parameters.

Correlation between perplexity and forgetting (left) and PPL distributions across data types (right).

As illustrated in the analysis above, human-written ground truth data contains numerous high-perplexity "spikes." In contrast, LLM-generated data (Self-Output) is inherently more aligned with the model's existing probability distribution, resulting in a smoother, lower-perplexity profile. Our analysis reveals a strong negative correlation between the average perplexity of the training set and the model's Backward Transfer (BWT) score, a metric for knowledge retention.

Selective Token Masking (STM)

Based on these findings, we propose Selective Token Masking (STM), a computationally efficient alternative to generating synthetic datasets. STM involves three steps:

  1. Perplexity Calculation: Before training, the model performs a single forward pass over the training data to calculate the perplexity of every token.
  2. Thresholding: Any token with a perplexity higher than a specific threshold (empirically optimized at $\tau = 2.5$) is masked out.
  3. Low-Perplexity Training: The model is fine-tuned only on the remaining "familiar" tokens.

The logic is elegant: by masking high-PPL tokens, STM ensures weight updates remain subtle and non-disruptive. While generating synthetic data for a dataset like MBPP can take 12–18 GPU hours, STM achieves the same robustness in just 4–8 minutes.

Experimental Results

We evaluated STM across several domains (MBPP, MATH) and architectures, including Gemma 2, Llama 3, and Mistral.

Knowledge Preservation

STM consistently achieved Backward Transfer (BWT) scores near 0% or even positive, indicating successful mitigation of catastrophic forgetting. For instance, on Gemma 2 2B, standard SFT on human data led to a -38.19% drop in general performance, whereas STM resulted in a +0.42% improvement. Crucially, this robustness did not come at the expense of task performance; Task Improvement (TI) scores for STM remained comparable to standard SFT despite masking 20-25% of the training tokens.

Weight Stability

Our analysis confirms that STM maintains model stability by limiting the magnitude of weight updates. On Llama 3 8B, the L2 norm of $\Delta W$ for standard training was 17.75, while for STM it was reduced to a mere 0.55. This minimal shift in parameter space explains why the model retains its original capabilities.

Conclusion

This work identifies token perplexity as a critical factor in the robustness of LLM fine-tuning. By masking high-perplexity tokens, Selective Token Masking provides a simple, model-agnostic, and highly efficient method to prevent catastrophic forgetting. Our results suggest that for effective specialization, models should learn from "familiar" data that allows for subtle refinement rather than disruptive overhauls.

Summary updated

BibTeX
@inproceedings{wu2025clear,
  author = {Chao-Chung Wu and Zhi Rui Tam and Chieh-Yen Lin and Hung-yi Lee and Yun-Nung Chen},
  title = {{Clear Minds Think Alike: What Makes LLM Fine-tuning Robust? A Study of Token Perplexity}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=1ktdvp1EYI},
}
Figure