AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedback

Yann Dubois, Xuechen Li, Rohan Taori, Tianyi Zhang, Ishaan Gulrajani +4 more
5/1/2023
977 citations
rlrlhf-rlvr-dpo

Official code: tatsu-lab/alpaca_eval (2,023 stars, Jupyter Notebook, Apache-2.0, last commit 2025-08-09). 1 more implementation below.

Abstract

Large language models (LLMs) such as ChatGPT have seen widespread adoption due to their strong instruction-following abilities. Developing these LLMs involves a complex yet poorly understood workflow requiring training with human feedback.

Show full abstract

Replicating and understanding this instruction-following requires tackling three major challenges: the high cost of data collection, the lack of trustworthy evaluation, and the absence of reference method implementations. We address these challenges with AlpacaFarm, a simulator that enables research and development for learning from feedback at a low cost. First, we design LLM prompts to simulate human feedback that are 50x cheaper than crowdworkers and display high agreement with humans. Second, we propose an automatic evaluation and validate it against human instructions obtained on real-world interactions. Third, we contribute reference implementations for several methods (PPO, DPO, best-of-n, expert iteration, and more) that learn from pairwise feedback. Finally, as an end-to-end validation of AlpacaFarm, we train and evaluate eleven models on 10k pairs of real human feedback and show that rankings of models trained in AlpacaFarm match rankings of models trained on human data. As a demonstration of the research possible in AlpacaFarm, we find that methods that use a reward model can substantially improve over supervised fine-tuning and that our reference PPO implementation leads to a +10% improvement in win-rate against Davinci003. We release all components of AlpacaFarm at https://github.com/tatsu-lab/alpaca_farm.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
tatsu-lab/alpaca_evalOfficial2,023Jupyter NotebookApache-2.02025-08-09
tatsu-lab/alpaca_farmOfficial844PythonApache-2.02024-07-01
Apache-2.0

An automatic evaluator for instruction-following language models. Human-validated, high-quality, cheap, and fast.

2,023315Jupyter Notebook, PythonMay 25, 20231 years agoApache-2.0
deep-learningevaluationfoundation-modelsinstruction-followinglarge-language-models+3 more
Apache-2.0

A simulation framework for RLHF and alternatives. Develop your RLHF method without collecting human data.

84466Python, JavaScriptMay 3, 20232 years agoApache-2.0
deep-learninginstruction-followinglarge-language-modelsnatural-language-processingreinforcement-learning-from-human-feedback

Similar Papers

Cite this paper

@article{dubois2023alpacafarm,
  title  = {AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedback},
  author = {Yann Dubois and Xuechen Li and Rohan Taori and Tianyi Zhang and Ishaan Gulrajani and Jimmy Ba and Carlos Guestrin and Percy Liang and Tatsunori Hashimoto},
  year   = {2023},
  eprint = {2305.14387},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2305.14387},
  journal = {NEURIPS 2023 2023}
}

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/2305.14387.svg)](https://codeofpaper.com/paper/2305.14387)

Discussion