Preserving Diversity in Supervised Fine-Tuning of Large Language Models

Ziniu Li, Congliang Chen, Tian Xu, Zeyu Qin, Jiancong Xiao, Zhi-Quan Luo, Ruoyu Sun

TL;DR

Standard Supervised Fine-Tuning (SFT) using cross-entropy loss inadvertently crushes the natural output diversity of Large Language Models (LLMs), leading to severe knowledge forgetting. This paper introduces GEM (Game-theoretic Entropy Maximization), a novel training framework that preserves output diversity via entropy regularization without sacrificing downstream task performance or training speed.

What Problem Does This Paper Address?

When fine-tuning a pre-trained LLM to follow instructions (the SFT stage), researchers almost universally rely on Cross-Entropy (CE) loss. CE works by maximizing the likelihood of the exact token sequences present in the training data. However, the authors argue that this creates an "all-to-one" probability transfer, forcing the model to suppress alternative, perfectly valid responses.

This distribution collapse severely reduces output diversity, which cripples downstream techniques that rely on sampling multiple answers to find the best one (such as Reinforcement Learning from Human Feedback (RLHF) or test-time compute scaling). Furthermore, it triggers the notorious "alignment tax"—causing the model to catastrophically forget the rich, diverse knowledge it acquired during its massive pre-training phase.

Figure 1: Illustration of diversity preservation in SFT. While pre-trained LLMs produce diverse outputs, these often lack proper formatting. Standard SFT using CE improves readability but reduces diversity. We aim to maintain output diversity while enhancing the readability of LLMs’ responses.

Methods

To fix this, the authors reframe SFT as a distribution matching problem and introduce GEM (Game-theoretic Entropy Maximization). Instead of standard CE, GEM sets up a minimax game between the model distribution and an auxiliary variable $q$ (acting as a meta-controller). They mathematically prove that this game minimizes the reverse KL divergence with maximum entropy regularization.

Crucially, GEM is engineered to be highly practical and scalable:

  • Single-Model Optimization: Unlike Generative Adversarial Networks (GANs), GEM does not require a separate discriminator network. The meta-controller $q$ is computed directly by shifting the model's own logits, keeping the GPU memory footprint and training speed nearly identical to standard CE.
  • Sparse Updates & Adaptive Termination: GEM focuses updates only on the most confident incorrect predictions and adaptively halts the probability transfer once the target token becomes the most probable, preventing distribution collapse.
  • Sequential Data Reset: To handle multi-step sequential text generation, they decompose the optimization problem using a "data reset" trick to maintain stable and accurate gradient estimation.

Datasets

The authors fine-tuned pre-trained models using the UltraFeedback dataset (~61,000 training samples). To validate their approach, they evaluated the models across several standard benchmarks:

  • AlpacaEval: 805 questions to assess open-ended chat capabilities.
  • HumanEval: 164 test questions to evaluate Python code generation.
  • GSM8K: Grade school math problems to test multi-step reasoning.
  • OpenLLM Leaderboard: Six diverse tasks (ARC, GSM8K, HellaSwag, MMLU, TruthfulQA, Winogrande) specifically used to measure knowledge retention and the alignment tax.

Key Insights and Ideas

  • The Flaw of CE: CE penalizes all non-target tokens equally. If the target word is "coffee", CE actively suppresses contextually plausible tokens like "tea", hurting the model's generalization capabilities.
  • Diversity Protects Pre-trained Knowledge: Maintaining output diversity keeps the model closer to its pre-trained state in parameter space (measured via $\ell_2$-norm). Forcing the model to consider alternative plausible answers naturally prevents it from erasing its internal pre-trained knowledge base.
  • Why Standard Entropy Regularizer Fails: Simply adding an entropy penalty to CE causes a massive explosion in tail probabilities, leading to the generation of nonsensical tokens. GEM's joint game-theoretic formulation naturally bounds these tail probabilities, keeping outputs diverse yet coherent.
Figure 2: Comparison of learning schemes: CE v.s. GEM (β = 0). The arrows illustrate the probability movement directions during the learning process, with Token 3 as the target token.

Key Results

  • Test-Time Scaling Boost: When using Best-of-N sampling on Llama-3.1-8B, GEM achieved a 3.1-point win rate improvement on AlpacaEval and a massive 7-point improvement (pass@100) on HumanEval compared to standard CE.
  • 2x Compute Efficiency: To match the performance of CE baselines during inference, GEM required only half the sampling budget, making test-time scaling significantly cheaper.
  • 80% Reduction in Alignment Tax: Across the OpenLLM leaderboard, GEM dramatically mitigated catastrophic forgetting, showing an average performance drop of just 0.3 points from the pre-trained baseline, compared to a 1.5-point drop for CE.
  • Massive Scalability: The benefits consistently held true across model architectures ranging from 3B to 70B parameters (including Qwen-2.5 and Gemma-2 models).

Limitations and Future Work

While GEM provides strong theoretical guarantees for scenarios where the regularization parameter $\beta > 0$, the strict prototype stopping rule ($\beta = 0$) introduces analytical complexities that remain unresolved. Additionally, the authors note that future work should explore integrating GEM into iterative self-improvement loops (where models generate their own synthetic training data) and using it as a cold-start strategy for online reinforcement learning.

Summary updated

BibTeX
@inproceedings{li2025preserving,
  author = {Ziniu Li and Congliang Chen and Tian Xu and Zeyu Qin and Jiancong Xiao and Zhi-Quan Luo and Ruoyu Sun},
  title = {{Preserving Diversity in Supervised Fine-Tuning of Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=NQEe7B7bSw},
}
Figure