Minifinetuning: Low-Data Generation Domain Adaptation through Corrective Self-Distillation

Peter Belcak, Greg Heinrich, Jan Kautz, Pavlo Molchanov

Abstract

Finetuning language models for a new domain inevitably leads to the deterioration of their general performance. This becomes more pronounced the more limited the finetuning data resource. We introduce minifinetuning (MFT), a method for language model domain adaptation that considerably reduces the effects of overfitting-induced degeneralization in low-data settings and which does so in the absence of any pre-training data for replay. MFT demonstrates 2-10x more favourable specialization-to-degeneralization ratios than standard finetuning across a wide range of models and domains and exhibits an intrinsic robustness to overfitting when data in the new domain is scarce and down to as little as 500 samples. Employing corrective self-distillation that is individualized on the sample level, MFT outperforms parameter-efficient finetuning methods, demonstrates replay-like degeneralization mitigation properties, and is composable with either for a combined effect.

Introduction

Adapting Large Language Models (LLMs) to specialized domains—such as legal, medical, or mathematical text—is a common requirement for practical applications. However, this process often triggers "degeneralization," a form of catastrophic forgetting where the model loses its ability to perform general reasoning or maintain linguistic fluency. This issue is particularly severe in "low-data" scenarios, where only a few million tokens (or a few hundred samples) of domain-specific text are available.

Existing solutions like data replay require access to original pre-training datasets, which are often unavailable due to size or privacy constraints. Parameter-efficient finetuning (PEFT) methods like LoRA provide some protection by limiting model capacity, but they do not explicitly safeguard existing knowledge. Minifinetuning (MFT) addresses these challenges through a novel distillation approach that requires no external replay data.

Methods: Corrective Self-Distillation

The core innovation of MFT is Corrective Self-Distillation. Unlike standard finetuning that uses "hard labels" from the training text, MFT employs a teacher-student framework. The teacher is a frozen instance of the original base model, while the student is the model undergoing adaptation.

The MFT framework: A frozen teacher model provides a distribution that is corrected based on finetuning data to guide the student model.

MFT applies a Distribution Correction (DC) formula at the token level. If the teacher's prediction for a token is incorrect relative to the ground truth, MFT "nudges" the teacher’s probability distribution toward the correct token by a specific margin. If the teacher is already correct, the probability of that token is boosted. This mechanism allows the model to learn new domain-specific patterns while remaining "anchored" to the general-purpose logic of the original model. Effectively, the soft labels from the teacher serve as a "virtual replay" of the billions of tokens seen during pre-training.

Experimental Setup and Datasets

The efficacy of MFT was evaluated across multiple model families, including OpenELM, Llama 3.1/3.2, Phi, and Gemma. The researchers focused on three specialized domains:

  • PubMed: Medical and biological research.
  • Pile of Law: Legal and court documentation.
  • OpenWebMath: Technical mathematical content.

General domain performance was monitored using OpenWebText. Training budgets were kept intentionally small, ranging from 1M to 8M tokens (approximately 500 to 4,000 samples), to test the limits of low-data adaptation.

Key Results

MFT consistently outperformed standard finetuning (FT) and PEFT methods in balancing specialization with knowledge retention.

Comparison of joint dynamics and degeneralization between standard finetuning (FT) and Minifinetuning (MFT).

Key findings include:

  • Optimal Trade-offs: MFT achieved a 2-10x more favorable specialization-to-degeneralization ratio compared to standard FT.
  • Superiority over PEFT: While methods like LoRA act as a backstop against forgetting, MFT actively protects knowledge. For example, where LoRA might lose 1.7% in general performance for a specific gain, MFT could achieve the same gain with only a 0.3% loss.
  • Robustness to Overfitting: MFT remained stable even in extreme low-data regimes (500 samples) where standard finetuning typically causes immediate performance collapse.
  • Composability: MFT can be combined with LoRA or DoRA, offering a synergistic effect that further improves efficiency and performance.

Conclusion and Future Work

Minifinetuning provides a robust pathway for domain adaptation when data is scarce and original pre-training data is inaccessible. By treating the original model as a source of "virtual replay" through corrective distillation, MFT maintains general capabilities while learning specialized tasks. Future research will explore the application of MFT to instruction-tuned "chat" models and evaluate performance on specific downstream task benchmarks beyond perplexity.

Summary updated

BibTeX
@misc{belcak2025minifinetuning,
  author = {Peter Belcak and Greg Heinrich and Jan Kautz and Pavlo Molchanov},
  title = {{Minifinetuning: Low-Data Generation Domain Adaptation through Corrective Self-Distillation}},
  year = {2025},
  eprint = {2506.15702},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.15702},
}
Figure