Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models

Zixiang Chen, Yihe Deng, Huizhuo Yuan, Kaixuan Ji, Quanquan Gu
1/2/2024
cs.LGcs.AIcs.CL

Official code: uclaml/SPIN (1,254 stars, Apache-2.0, last commit 2024-05-08). 2 more implementations below.

Abstract

Harnessing the power of human-annotated data through Supervised Fine-Tuning (SFT) is pivotal for advancing Large Language Models (LLMs). In this paper, we delve into the prospect of growing a strong LLM out of a weak one without the need for acquiring additional human-annotated data. We propose a new fine-tuning method called Self-Play fIne-tuNing (SPIN), which starts from a supervised fine-tuned model. At the heart of SPIN lies a self-play mechanism, where the LLM refines its capability by playing against instances of itself. More specifically, the LLM generates its own training data from its previous iterations, refining its policy by discerning these self-generated responses from those obtained from human-annotated data. Our method progressively elevates the LLM from a nascent model to a formidable one, unlocking the full potential of human-annotated demonstration data for SFT. Theoretically, we prove that the global optimum to the training objective function of our method is achieved only when the LLM policy aligns with the target data distribution. Empirically, we evaluate our method on several benchmark datasets including the HuggingFace Open LLM Leaderboard, MT-Bench, and datasets from Big-Bench. Our results show that SPIN can significantly improve the LLM's performance across a variety of benchmarks and even outperform models trained through direct preference optimization (DPO) supplemented with extra GPT-4 preference data. This sheds light on the promise of self-play, enabling the achievement of human-level performance in LLMs without the need for expert opponents. Codes are available at https://github.com/uclaml/SPIN.

View on arXivView PDF

Code Implementations(3)

uclaml/SPINOfficial100%
Apache-2.0

The official implementation of Self-Play Fine-Tuning (SPIN)

1,254106Shell, PythonFeb 4, 20242 years agoApache-2.0
deep-learningfine-tuninglarge-language-modelsself-play
MIT

Minimal implementation of the Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models paper (ArXiv 20232401.01335)

292Python, Jupyter NotebookJan 21, 20242 years agoMIT
SeungyounShin/SPINCommunity67%

Unofficial implementation of Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models

70PythonJan 15, 20242 years ago

Similar Papers

Cite this paper

@article{chen2024selfplay,
  title  = {Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models},
  author = {Zixiang Chen and Yihe Deng and Huizhuo Yuan and Kaixuan Ji and Quanquan Gu},
  year   = {2024},
  eprint = {2401.01335},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2401.01335v3},
  journal = {ICML 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/2401.01335.svg)](https://codeofpaper.com/paper/2401.01335)

Discussion