RLHF Workflow: From Reward Modeling to Online RLHF

Hanze Dong, Wei Xiong, Bo Pang, Haoxiang Wang, Han Zhao +5 more
5/13/2024
cs.LGcs.AIcs.CL

Official code: RLHFlow/RLHF-Reward-Modeling (1,541 stars, Apache-2.0, last commit 2025-04-24). 1 more implementation below.

Abstract

We present the workflow of Online Iterative Reinforcement Learning from Human Feedback (RLHF) in this technical report, which is widely reported to outperform its offline counterpart by a large margin in the recent large language model (LLM) literature. However, existing open-source RLHF projects are still largely confined to the offline learning setting. In this technical report, we aim to fill in this gap and provide a detailed recipe that is easy to reproduce for online iterative RLHF. In particular, since online human feedback is usually infeasible for open-source communities with limited resources, we start by constructing preference models using a diverse set of open-source datasets and use the constructed proxy preference model to approximate human feedback. Then, we discuss the theoretical insights and algorithmic principles behind online iterative RLHF, followed by a detailed practical implementation. Our trained LLM achieves impressive performance on LLM chatbot benchmarks, including AlpacaEval-2, Arena-Hard, and MT-Bench, as well as other academic benchmarks such as HumanEval and TruthfulQA. We have shown that supervised fine-tuning (SFT) and iterative RLHF can obtain state-of-the-art performance with fully open-source datasets. Further, we have made our models, curated datasets, and comprehensive step-by-step code guidebooks publicly available. Please refer to https://github.com/RLHFlow/RLHF-Reward-Modeling and https://github.com/RLHFlow/Online-RLHF for more detailed information.

View on arXivView PDF

Code Implementations(2)

Apache-2.0

Recipes to train reward model for RLHF.

1,541110PythonMar 21, 20241 years agoApache-2.0
llama3llmreward-modelsrlhf

A recipe for online RLHF and online iterative DPO.

54448Shell, PythonMay 10, 20241 years ago
llama3llmrlhf

Similar Papers

Cite this paper

@article{dong2024rlhf,
  title  = {RLHF Workflow: From Reward Modeling to Online RLHF},
  author = {Hanze Dong and Wei Xiong and Bo Pang and Haoxiang Wang and Han Zhao and Yingbo Zhou and Nan Jiang and Doyen Sahoo and Caiming Xiong and Tong Zhang},
  year   = {2024},
  eprint = {2405.07863},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.07863v3}
}

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

Discussion