Large language models (LLMs) such as ChatGPT have seen widespread adoption due to their ability to follow user instructions well. Developing these LLMs involves a complex yet poorly understood workflow requiring training with human feedback. Replicating and understanding this instruction-following process faces 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 45x 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, 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.
翻译:像ChatGPT这样的大型语言模型(LLMs)因其良好的指令遵循能力而得到广泛应用。开发这些LLMs涉及一个复杂且尚未被充分理解的工作流程,需要利用人类反馈进行训练。复现和理解这一指令遵循流程面临三大挑战:数据收集成本高昂、缺乏可信的评估标准、以及缺少参考方法实现。我们提出AlpacaFarm仿真框架来解决这些问题,以低成本支持基于反馈的学习研究。首先,我们设计了模拟人类反馈的LLM提示,其成本仅为众包工人的1/45,且与人类判断高度一致。其次,我们提出了一种自动评估方法,并在真实交互中获得的人类指令上进行了验证。第三,我们提供了多种从成对反馈中学习的方法(包括PPO、最佳采样、专家迭代等)的参考实现。最终,为端到端验证AlpacaFarm,我们基于10k对真实人类反馈训练并评估了11个模型,结果表明:在AlpacaFarm上训练的模型排名与基于人类数据训练的模型排名一致。作为AlpacaFarm研究能力的示范,我们发现使用奖励模型的方法相比监督微调有显著提升,且我们提供的PPO参考实现相较Davinci003在胜率上实现了+10%的提升。我们在 https://github.com/tatsu-lab/alpaca_farm 公开了AlpacaFarm的所有组件。