# uclaml/SPIN

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

Repository: https://github.com/uclaml/SPIN
Canonical: https://ross.abutalabs.com/products/uclaml-spin
Homepage: https://uclaml.github.io/SPIN/
Language: Python
License: Apache-2.0
License Family: permissive
Topics: deep-learning, fine-tuning, large-language-models, self-play
Last push: 2024-05-08T05:59:37+00:00

## Health v2 (maintenance only)
Score: 26/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 67
- inputs: {"age_days": 941, "days_push": 847, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1254, forks 106 (observed 2026-08-28T04:04:08.701904+00:00)

## What it is
Official implementation of Self-Play Fine-Tuning (SPIN), a method that improves language models by having them iteratively generate and discriminate their own training data against human-annotated responses. It includes training scripts, data generation pipelines, and released models/datasets for reproducing the ICML 2024 paper results.

## Use cases
- fine-tune an LLM without extra human-annotated data
- reproduce SPIN paper results on Mistral-7B
- improve an SFT model beyond DPO baselines
- generate self-play training data with vLLM
- research iterative self-improvement methods for LLMs

## When to choose
- you have an SFT checkpoint and want to boost it without additional annotations
- you're researching self-play or preference-free fine-tuning methods
- you want the reference implementation of the SPIN algorithm

## When to avoid
- you need a production training framework with broad model support
- you want actively maintained tooling rather than research code
- you lack GPU resources for 7B-scale fine-tuning

## Facets
- artifact type: library
- maturity: maintenance
- function: llm-training, machine-learning, deep-learning
- domain: large-language-models, machine-learning, deep-learning
- platform: python
- tags: self-play, fine-tuning, llm, research-code, icml-2024, huggingface, gpu, linux

## Member repositories
- uclaml/SPIN (main) score 26

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:08.701904+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:07:26.198692+00:00, confidence not recorded.
  - readme: https://github.com/uclaml/SPIN (fetched 2026-08-28T04:04:08.701904+00:00, sha 6e0899e54ded)
  - homepage: https://uclaml.github.io/SPIN/ (fetched 2026-08-29T12:18:07.964385+00:00, sha c4a87d8b0d7b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
