Preserving Diversity in Supervised Fine-Tuning of Large Language Models

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Li, Ziniu, Chen, Congliang, Xu, Tian, Qin, Zeyu, Xiao, Jiancong, Luo, Zhi-Quan, Sun, Ruoyu
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908302055571456
author Li, Ziniu
Chen, Congliang
Xu, Tian
Qin, Zeyu
Xiao, Jiancong
Luo, Zhi-Quan
Sun, Ruoyu
author_facet Li, Ziniu
Chen, Congliang
Xu, Tian
Qin, Zeyu
Xiao, Jiancong
Luo, Zhi-Quan
Sun, Ruoyu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_16673
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Preserving Diversity in Supervised Fine-Tuning of Large Language Models
Li, Ziniu
Chen, Congliang
Xu, Tian
Qin, Zeyu
Xiao, Jiancong
Luo, Zhi-Quan
Sun, Ruoyu
Machine Learning
Artificial Intelligence
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.
title Preserving Diversity in Supervised Fine-Tuning of Large Language Models
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2408.16673