Skip to main content
QUICK REVIEW

[论文解读] RLHF Workflow: From Reward Modeling to Online RLHF

Hanze Dong, Wei Xiong|arXiv (Cornell University)|May 13, 2024
Simulation Techniques and ApplicationsDecision Sciences被引用 3
一句话总结

本文提出了一种可复现的、完全开源的在线迭代强化学习人类反馈(RLHF)工作流,使用基于多样化开源数据集训练的代理偏好模型来近似人类反馈。该方法在 AlpacaEval-2、Arena-Hard 和 MT-Bench 等基准测试中达到最先进性能,其中 SFR-Iterative-DPO-LLaMA-3-8B-R 模型通过迭代式在线策略优化和长度惩罚缓解,超越了离线基线模型。

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.

研究动机与目标

  • 通过在资源受限环境中实现在线、迭代式RLHF,弥合闭源与开源RLHF之间的差距。
  • 开发一种实用且可复现的在线迭代RLHF流水线,利用开源数据集作为人类反馈的代理。
  • 通过在奖励建模过程中学习长度惩罚,缓解大语言模型输出中的长度偏差。
  • 通过完全开源的数据和模型,在标准大语言模型基准上实现最先进性能。
  • 提供全面的代码、数据集和超参数指南,降低开源RLHF的入门门槛。

提出的方法

  • 使用一组多样化的开源偏好数据集构建代理偏好模型,以模拟人类反馈。
  • 应用基于在线策略采样的迭代直接偏好优化(DPO),以闭环方式优化策略。
  • 采用KL正则化目标函数来优化策略,平衡奖励最大化与与初始策略的差异。
  • 在奖励函数中引入长度惩罚,以减少冗长输出并提升响应质量。
  • 利用Bradley-Terry模型将偏好信号形式化为概率奖励:$\mathbb{P}(a^1 \succ a^2) = \sigma(r^*(x,a^1) - r^*(x,a^2))$。
  • 通过使用人类反馈代理进行迭代微调,并对奖励质量与长度控制进行消融研究,训练最终模型 SFR-Iterative-DPO-LLaMA-3-8B-R。

实验结果

研究问题

  • RQ1在无直接人类反馈的情况下,是否可在开源环境中有效实现在线迭代RLHF?
  • RQ2使用基于开源数据集训练的代理偏好模型,在对齐质量与模型性能方面,与真实人类反馈相比如何?
  • RQ3在迭代RLHF中,学习到的长度惩罚对响应质量与基准性能有何影响?
  • RQ4奖励模型的选择如何影响收敛速度、响应长度以及在学术基准与对话基准上的表现?
  • RQ5通过代理反馈实现的迭代在线策略RLHF能否达到与闭源模型相当的SOTA结果?

主要发现

  • SFR-Iterative-DPO-LLaMA-3-8B-R 模型在 AlpacaEval-2 上达到 41.9% 的胜率,显著优于无长度惩罚的基线模型。
  • 在 Arena-Hard 基准上,加入长度惩罚的模型将平均响应长度从 656 个 token 降低至 382 个 token,显著改善了长度控制。
  • 使用 UltraRM-13B 训练的模型表现出更高的训练损失和更慢的收敛速度,表明所提出的代理模型包含更复杂的偏好信号。
  • 尽管响应更长,UltraRM-13B 模型在 Arena-Hard 上的胜率更高(29.1 vs. 22.1),表明该基准存在明显的冗长性偏差。
  • 加入长度惩罚的模型在 HumanEval(+66.5)和 TruthfulQA(+65.1)上表现更优,表明其推理能力与事实一致性得到提升。
  • 消融研究证实,奖励模型质量与长度惩罚是影响性能的关键因素,尤其在推理与对齐基准上。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。