概述
It can improve agreement with collected preferences, but does not guarantee truthful, safe, or universally preferred answers.
深入探讨
A pretrained language model predicts plausible text, but plausible is not the same as helpful, honest, or safe. A common RLHF pipeline addresses these goals in stages. First, supervised fine-tuning teaches the model to follow instructions using human-written example answers. Next, humans compare pairs of model responses to the same prompt and pick the better one; these comparisons train a separate reward model that scores any response. Finally, the language model is optimized with reinforcement learning to produce responses the reward model rates highly. A penalty regularizes deviation from a reference policy; it does not eliminate exploitation of reward-model errors. RLHF was central to making ChatGPT-style assistants usable.
现实世界的实施
调整聊天助手,使其拒绝有害的请求,并提供有用的、结构良好的答案,而不仅仅是看似合理的文本。
根据人们的偏好对摘要对进行排名,以训练一个模型,该模型可以编写人们实际上认为有用的摘要。
通过奖励人类评估者认为尊重和安全的反应来减少有毒或有偏见的输出。
在首选答案与拒绝答案的数据集上使用 DPO 来调整开源模型,而无需运行完整的 PPO 循环。
根据人类反馈强化学习的未来
RLHF 正在简化并部分自动化。 DPO 和相关的直接偏好方法正在取代许多团队繁重的 PPO 流程,而 RLAIF 使用人工智能生成的反馈(如宪法人工智能)来降低标签成本。研究正在通过过程监督和辩论等技术来解决奖励黑客、注释者偏见以及判断长篇或专家回复的困难。期望能够融合人类和人工智能的反馈,获得比单一竖起大拇指更丰富的奖励信号,以及对谁提供偏好以及他们编码的价值进行日益严格的审查。
付诸实践
为什么这很重要
- 成本与预算. 多年来,架构决策决定着性能和运营成本。
- 更清晰的判决. 技术教育帮助团队选择正确的堆栈,而不仅仅是最新的堆栈。
- 质量控制. 更好的工程选择可以减少生产中的可靠性事故。
留意
- 优化一项基准测试可以隐藏更广泛的系统弱点。
- 基础设施和维护成本常常被低估。
- 随着系统变得更加复杂,安全性和可观察性差距可能会扩大。
后续步骤
- 在实施之前定义延迟、质量和成本目标。
- 在实际负载和数据条件下进行基准测试。
- 仪器监控错误、漂移和用户影响。
- 在扩展之前准备回滚和事件响应路径。
不断探索
常见问题
什么是根据人类反馈进行强化学习?
Reinforcement learning from human feedback uses human judgments to construct a training signal for a model’s behavior. It can improve agreement with collected preferences, but does not guarantee truthful, safe, or universally preferred answers.
RLHF 对于语言模型的主要目的是什么?
RLHF 引导模型朝着人类喜欢的反应方向发展,使其更加有用、诚实和安全,而不仅仅是看似合理。
RLHF 中的奖励模型实际上是用来做什么的?
奖励模型根据人类偏好比较进行训练,以对响应进行评分,从而提供策略优化的信号。
在 RLHF 目标中,针对参考策略的 KL 散庥惩罚旨在正则化什么?
The penalty discourages large policy shifts. It is not proof that the reward model cannot be exploited or that generated answers are correct.
通常如何为奖励模型收集偏好数据?
注释者在成对比较中选择首选响应,通过 Bradley-Terry 式损失来训练奖励模型。
与经典的 RLHF 管道相比,DPO(直接偏好优化)有何优势?
DPO 直接从偏好中得出目标,避免了单独的奖励模型和繁琐的强化学习步骤。