Preserving Diversity in Supervised Fine-Tuning of Large Language Models

Ziniu Li, Congliang Chen, Tian Xu, Zeyu Qin, Jiancong Xiao +2 more
8/29/2024
cs.LGcs.AI

No official code found. Best implementation: liziniu/GEM (58 stars, last commit 2025-05-12).

Abstract

Large Language Models (LLMs) typically rely on Supervised Fine-Tuning (SFT) to specialize in downstream tasks, with the Cross Entropy (CE) loss being the de facto choice. However, CE maximizes the likelihood of observed data without accounting for alternative possibilities. As such, CE usually leads to reduced diversity in the model's outputs, which hinders further development that requires sampling to explore better responses. To address this limitation, this paper introduces a new game-theoretic formulation for SFT. In this framework, an auxiliary variable is introduced to regulate the learning process. We prove that the proposed game-theoretic approach connects to the problem of reverse KL minimization with entropy regularization. This regularization prevents over-memorization of training data and promotes output diversity. To implement this framework, we develop GEM, a new training algorithm that is computationally efficient as CE by leveraging some unique properties of LLMs. Empirical studies of pre-trained models from 3B to 70B parameters show that GEM achieves comparable downstream performance to CE while significantly enhancing output diversity. This increased diversity translates to performance gains in test-time compute scaling for chat and code generation tasks. Moreover, we observe that preserving output diversity has the added benefit of mitigating forgetting, as maintaining diverse outputs encourages models to retain pre-trained knowledge throughout the training process.

View on arXivView PDF

Code Implementations(1)

liziniu/GEMCommunity66%

Code for Paper (Preserving Diversity in Supervised Fine-tuning of Large Language Models)

586Shell, PythonOct 23, 20241 years ago
cold-startdistribution-matchingdiversitygeneralizationlarge-language-models+3 more

Similar Papers

Cite this paper

@article{li2024preserving,
  title  = {Preserving Diversity in Supervised Fine-Tuning of Large Language Models},
  author = {Ziniu Li and Congliang Chen and Tian Xu and Zeyu Qin and Jiancong Xiao and Zhi-Quan Luo and Ruoyu Sun},
  year   = {2024},
  eprint = {2408.16673},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.16673v2},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.16673.svg)](https://codeofpaper.com/paper/2408.16673)

Discussion