# 奖励学习

奖励学习从人类偏好、示范或评分等数据中推断奖励函数，为强化学习智能体提供一个学到的目标，取代手工设计的目标。[基于人类反馈的强化学习](https://www.edgepedia.org/zh/reinforcement-learning-from-human-feedback-rlhf)（RLHF）结合了三个过程：反馈收集、奖励建模，以及针对所学奖励模型的策略优化。<sup>[1](https://arxiv.org/abs/2307.15217)</sup> 该方法最初表明，仅凭不到智能体环境交互量1%的成对人类偏好数据，就能解决Atari游戏和模拟机器人运动任务，<sup>[2](https://papers.neurips.cc/paper_files/paper/2017/file/d5e2c0adad503c91f91df240d0cd4e49-Paper.pdf)</sup> 后来成为[InstructGPT](https://www.edgepedia.org/zh/instructgpt)等指令遵循语言模型背后的微调方法。<sup>[3](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)</sup>

| 关键事实 | 内容 |
|---|---|
| 学习内容 | 一个标量奖励函数，最常见的是在偏好对上通过最大似然训练的Bradley-Terry模型<sup>[4](https://rlhfbook.com/c/05-reward-models)</sup> |
| RLHF流程 | 反馈收集、奖励模型训练，然后进行带KL正则化的策略优化（通常为PPO）<sup>[1](https://arxiv.org/abs/2307.15217)</sup> |
| 人类标注成本（2017年机器人/Atari） | 15分钟至5小时的非专家反馈；一个后空翻行为需要约900比特的反馈和不到一小时的评估者时间<sup>[2](https://papers.neurips.cc/paper_files/paper/2017/file/d5e2c0adad503c91f91df240d0cd4e49-Paper.pdf)</sup><sup> • </sup><sup>[5](https://web.archive.org/web/20230618223746/https:/openai.com/research/learning-from-human-preferences)</sup> |
| 语言模型标志性成果 | 1.3B的InstructGPT输出比175B的GPT-3输出更受偏好，尽管参数量仅为后者的约1/135<sup>[3](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)</sup> |
| 奖励模型准确率上限 | 在既有RLHF验证集上为60-70%，由标注者间分歧决定<sup>[6](https://aclanthology.org/2025.findings-naacl.96.pdf)</sup> |
| 无奖励模型的替代方案 | 直接偏好优化（DPO）在没有显式奖励模型或强化学习的情况下优化相同的KL约束目标<sup>[7](https://proceedings.neurips.cc/paper%5Ffiles/paper/2023/file/a85b405ed65c6477a4fe8302b5e06ce7-Paper-Conference.pdf)</sup> |

## 工作原理

典型的奖励模型是一个从成对比较中训练得到的可学习标量函数 \( r_{\theta} \)。在Bradley-Terry模型下——2017年的深度强化学习工作将其描述为Luce-Shephard选择规则在轨迹片段偏好上的特化形式——人类偏好某个片段的概率指数依赖于在约1-2秒片段上求和的潜在奖励。<sup>[2](https://papers.neurips.cc/paper_files/paper/2017/file/d5e2c0adad503c91f91df240d0cd4e49-Paper.pdf)</sup> 对于语言模型，训练采用最大似然：\[ \theta^{*} = \arg\min_{\theta}\; \mathbb{E}_{(x, y_{\mathrm{c}}, y_{\mathrm{r}}) \sim \mathcal{D}}\bigl[ -\log \sigma\bigl( r_{\theta}(y_{\mathrm{c}} \mid x) - r_{\theta}(y_{\mathrm{r}} \mid x) \bigr) \bigr], \] 其中 \( y_{\mathrm{c}} \) 和 \( y_{\mathrm{r}} \) 分别是被选中和被拒绝的补全；奖励差是一个回复被偏好的对数几率。<sup>[4](https://rlhfbook.com/c/05-reward-models)</sup><sup> • </sup><sup>[3](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)</sup> 可辨识性有一个清晰的条件：由于Bradley-Terry似然仅依赖于分数差，模型仅在相差一个加性常数的意义下可辨识；在诸如和为零的定位约束下，最大似然估计存在且唯一，当且仅当比较图是强连通的；如果图不是强连通的，有限的最大似然估计可能不存在或不唯一，具体取决于图的结构。<sup>[8](https://mlhp.stanford.edu/src/chap2.html)</sup>

## 实施方法

RLHF流程分为三个阶段：监督微调、偏好采样与奖励学习，以及针对奖励模型的强化学习优化，目标为 \[ \max_{\pi_{\theta}}\; \mathbb{E}_{x \sim \mathcal{D},\, y \sim \pi_{\theta}(y \mid x)}\bigl[ r_{\phi}(x,y) \bigr] - \beta\, \mathbb{D}_{\mathrm{KL}}\bigl[ \pi_{\theta} \,\|\, \pi_{\mathrm{ref}} \bigr]. \]<sup>[7](https://proceedings.neurips.cc/paper%5Ffiles/paper/2023/file/a85b405ed65c6477a4fe8302b5e06ce7-Paper-Conference.pdf)</sup> 在InstructGPT中，一个由40名承包商组成的团队标注了示范和比较，对每个提示的 \( K = 9 \) 个回复进行排序，并将每个提示的全部 \( \binom{K}{2} \) 个成对比较作为一个批次元素来训练奖励模型。仅使用了6B的奖励模型，因为175B奖励模型训练不稳定，且不太适合作为强化学习中的价值函数；相对于SFT模型的逐词元KL惩罚缓解了奖励模型的过度优化。<sup>[3](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)</sup> 实践中的做法是在语言模型上附加一个小型线性头以产生标量奖励，并且仅训练1轮以避免过拟合。<sup>[4](https://rlhfbook.com/c/05-reward-models)</sup>

## 起源

从观测行为中恢复目标函数早于现代强化学习：逆强化学习文献将非正式的问题陈述归功于罗素（Russell，1998）。<sup>[9](https://people.eecs.berkeley.edu/%7erussell/papers/ml00-irl.pdf)</sup> 吴（Ng）和罗素（Russell）（2000）在马尔可夫决策过程中形式化了逆强化学习，在给定观测到的最优行为的情况下提取奖励函数，提出了三种算法分别覆盖有限状态空间、线性函数逼近和有限轨迹，并将其转化为线性规划；他们还指出了退化问题——即存在许多与观测策略一致的奖励函数——作为一个关键问题。<sup>[9](https://people.eecs.berkeley.edu/%7erussell/papers/ml00-irl.pdf)</sup> [学徒学习](https://www.edgepedia.org/zh/apprenticeship-learning)保证得到一个在专家未知奖励上与专家表现相当的策略，而不必恢复该奖励，通过在高速公路模拟器中从2分钟示范中模仿五种不同驾驶风格得到了验证。<sup>[10](http://ai.stanford.edu/%7Epabbeel/pubs/AbbeelNg_alvirl_ICML2004.pdf)</sup>

深度强化学习规模的基于偏好的奖励学习由[保罗·克里斯蒂亚诺](https://www.edgepedia.org/zh/paul-christiano)（Paul Christiano）及其同事于2017年在arXiv上提出，<sup>[11](https://doi.org/10.48550/arxiv.1706.03741)</sup> 该论文将奖励模型拟合到人类偏好的同时训练策略（Atari用A2C，机器人用TRPO）；通过监督学习训练单独的奖励模型将交互复杂度降低了约三个数量级。<sup>[2](https://papers.neurips.cc/paper_files/paper/2017/file/d5e2c0adad503c91f91df240d0cd4e49-Paper.pdf)</sup> 2018年博尔哈·伊巴尔兹（Borja Ibarz）及其同事的arXiv后续工作在Atari中结合了示范和轨迹偏好。<sup>[12](https://doi.org/10.48550/arxiv.1811.06521)</sup> 2017年的工作确立了深度强化学习中基于偏好的奖励学习，并影响了后来的语言模型对齐研究——其中基于偏好的对齐随着2022年InstructGPT而受到关注，与Bradley-Terry奖励建模的联系在欧阳龙（Long Ouyang）及其同事的InstructGPT（2022，arXiv）中被明确建立，<sup>[13](https://doi.org/10.48550/arxiv.2203.02155)</sup><sup> • </sup><sup>[8](https://mlhp.stanford.edu/src/chap2.html)</sup> 而拉斐尔·拉法伊洛夫（Rafael Rafailov）及其同事的DPO（2023，arXiv）将RLHF重新表述为Bradley-Terry最大似然，无需单独的奖励模型。<sup>[14](https://doi.org/10.48550/arxiv.2305.18290)</sup><sup> • </sup><sup>[8](https://mlhp.stanford.edu/src/chap2.html)</sup>

## 变体

**逆强化学习（IRL）** 从示范中学习奖励，示范携带丰富信息但更难收集，因为比比较需要更多努力和专业知识。<sup>[1](https://arxiv.org/abs/2307.15217)</sup> 对抗逆强化学习（AIRL），出自贾斯汀·傅（Justin Fu）、凯蒂·罗（Katie Luo）和[谢尔盖·莱文](https://www.edgepedia.org/zh/sergey-levine)（Sergey Levine）2017年的arXiv论文，是一种可扩展的对抗式建模方法，能恢复对环境动态变化鲁棒的奖励，相比之下未修改的IRL方法恢复的奖励较为脆弱；GAIL则根本不恢复奖励函数。<sup>[15](https://users.cs.utah.edu/~dsbrown/readings/airl.pdf)</sup><sup> • </sup><sup>[16](https://doi.org/10.48550/arxiv.1710.11248)</sup>

**RLHF** 使用人类偏好比较；**RLAIF** 用AI反馈替代。在摘要和有益对话任务中，RLAIF相对于SFT基线的人类评判胜率与RLHF相当，且无害率更高。<sup>[17](https://raw.githubusercontent.com/mlresearch/v235/main/assets/lee24t/lee24t.pdf)</sup><sup> • </sup><sup>[18](https://doi.org/10.48550/arxiv.2309.00267)</sup> Direct-RLAIF更进一步，在强化学习过程中直接从现成的LLM获取奖励，绕过了奖励模型训练并解决了奖励模型陈旧问题。<sup>[18](https://doi.org/10.48550/arxiv.2309.00267)</sup>

**直接偏好优化（DPO）** 从离线偏好数据中推导出一个在策略和参考模型上表述的最大似然目标，绕过显式奖励模型训练和强化学习，同时等价于带有隐式奖励 \( r^{*}(y \mid x) = \beta \log \frac{\pi_{\theta}(y \mid x)}{\pi_{\mathrm{ref}}(y \mid x)} \) 的Bradley-Terry模型。<sup>[14](https://doi.org/10.48550/arxiv.2305.18290)</sup><sup> • </sup><sup>[19](https://arxiv.org/html/2410.15595v4)</sup><sup> • </sup><sup>[8](https://mlhp.stanford.edu/src/chap2.html)</sup> DPO衍生了一系列变体，包括[KTO](https://www.edgepedia.org/zh/kahneman-tversky-optimization)、IPO、CPO、ORPO和SimPO，标准离线DPO存在分布差异问题，这促发了在线和迭代变体。<sup>[19](https://arxiv.org/html/2410.15595v4)</sup> **奖励建模**作为一项独立活动也涵盖过程奖励模型（对思维链的每一步打分）和[结果奖励模型](https://www.edgepedia.org/zh/outcome-reward-model)（预测整个补全的正确性）。<sup>[4](https://rlhfbook.com/c/05-reward-models)</sup>

## 应用

InstructGPT通过奖励学习得到的1.3B模型产生的输出比175B GPT-3基线更受偏好，相同的流程构成了指令遵循助手的基础。<sup>[3](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)</sup> 在强化学习本身中，基于偏好的奖励学习解决了Atari游戏和模拟机器人运动任务，包括难以指定的行为如后空翻和随车流驾驶，仅需15分钟至5小时的非专家反馈。<sup>[2](https://papers.neurips.cc/paper_files/paper/2017/file/d5e2c0adad503c91f91df240d0cd4e49-Paper.pdf)</sup> 通过IRL的学徒学习从简短示范中在高速公路驾驶模拟器中复现了五种不同的驾驶风格。<sup>[10](http://ai.stanford.edu/%7Epabbeel/pubs/AbbeelNg_alvirl_ICML2004.pdf)</sup>

## 局限与替代方案

**奖励黑客攻击。** [奖励黑客](https://www.edgepedia.org/zh/reward-hacking)攻击被形式化定义为：优化不完美的代理奖励 \( \tilde{\mathcal{R}} \) 导致在真实奖励 \( \mathcal{R} \) 下性能下降的情况；对于所有随机策略的集合，两个奖励函数只有当其中一个是常数时才可能无法被利用来进行奖励黑客攻击，因此在复杂环境中，基本上无法获得不会被如此利用的代理奖励。<sup>[20](https://dl.acm.org/doi/10.5555/3600270.3600957)</sup> 奖励模型即使在正确标注的数据上也可能错误泛化到劣质代理，且即使有无限数据，许多奖励函数都能拟合同一反馈数据集；没有KL正则化，经过强化学习的LLM会学会输出无意义的文本。<sup>[1](https://arxiv.org/abs/2307.15217)</sup>

**过度优化。** 在一个使用InstructGPT固定的6B黄金奖励模型来标注3M到3B参数代理奖励模型的合成设置中，过度优化代理最终阻碍了真实性能，符合[古德哈特定律](https://www.edgepedia.org/zh/goodharts-law)，强化学习与best-of-n采样具有不同的函数形式。强化学习的KL效率远低于best-of-n采样，KL惩罚的作用类似于早停。<sup>[21](https://proceedings.mlr.press/v202/gao23h.html)</sup><sup> • </sup><sup>[22](https://doi.org/10.48550/arxiv.2210.10760)</sup>

**数据质量上限。** 既有RLHF验证集如Anthropic的有益无害数据和OpenAI的Learning to Summarize，由于标注者间分歧，准确率上限在60%到70%之间，因此奖励模型在此类数据上无法在该范围之外得到验证。<sup>[6](https://aclanthology.org/2025.findings-naacl.96.pdf)</sup> 基准测试也同步成熟：[RewardBench](https://www.edgepedia.org/zh/rewardbench)包含1,755个提示-选中-拒绝三元组，覆盖聊天、推理和安全领域，其中一些子集被小型奖励模型以100%准确率解决，而前10名模型在Chat上超过95%，但在Chat Hard上降至85-91%，暴露出对细微提示不匹配的检测能力较弱。<sup>[6](https://aclanthology.org/2025.findings-naacl.96.pdf)</sup><sup> • </sup><sup>[23](https://doi.org/10.48550/arxiv.2403.13787)</sup>

**学习函数估计的是什么。** 如果人类偏好来自遗憾模型而非InstructGPT、ChatGPT、Sparrow和[Llama 2](https://www.edgepedia.org/zh/llama-2)中使用的部分回报模型，则标准基于偏好的奖励学习所学的函数近似于最优优势函数而非奖励函数；将其解释为奖励通常不会对性能造成灾难性影响，这解释了为什么部分回报RLHF在实践中有效。<sup>[24](https://ojs.aaai.org/index.php/AAAI/article/download/28870/29653)</sup>

**奖励学习所替代的方案。** 手工设计的奖励是被取代的基线，它们自身也有失败模式：计算实验和一项受控专家研究表明，奖励函数可能对特定学习算法及其超参数过拟合，且专家短视的逐状态-动作奖励设计导致无效的任务规格。<sup>[25](https://ojs.aaai.org/index.php/AAAI/article/view/25733)</sup> 一项关于手工设计奖励中奖励错误规格的系统性研究记录了跨环境中模型不对齐的情况。<sup>[26](https://doi.org/10.48550/arxiv.2201.03544)</sup>

**奖励建模与直接优化。** 一项在对数线性策略和线性奖励下的理论分析发现，RLHF与其目标的差距为 \( \Theta(\sqrt{d_{R}/n}) \)，而DPO与其目标的差距为 \( \Theta(d_{P}/(\beta n)) \)，因此当 \( n \gg d \) 时DPO渐近占优，但当 \( n < d \)（典型的LLM情形）时RLHF具有更小的次优间隙。<sup>[27](https://ar5iv.labs.arxiv.org/html/2403.01857)</sup> 对于实践中哪种方法在统计上更高效，已发表的比较结果尚未完全一致，争论仍无定论。

## References

1. [Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedback](https://arxiv.org/abs/2307.15217)
2. [Deep Reinforcement Learning from Human Preferences (NeurIPS 2017)](https://papers.neurips.cc/paper_files/paper/2017/file/d5e2c0adad503c91f91df240d0cd4e49-Paper.pdf)
3. [Training language models to follow instructions with human feedback (InstructGPT, NeurIPS 2022)](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)
4. [Reward Modeling, RLHF Book (Nathan Lambert)](https://rlhfbook.com/c/05-reward-models)
5. [Learning from human preferences (OpenAI blog, June 2017)](https://web.archive.org/web/20230618223746/https:/openai.com/research/learning-from-human-preferences)
6. [RewardBench: Evaluating Reward Models for Language Modeling (NAACL 2025 Findings)](https://aclanthology.org/2025.findings-naacl.96.pdf)
7. [Direct Preference Optimization: Your Language Model is Secretly a Reward Model (NeurIPS 2023)](https://proceedings.neurips.cc/paper%5Ffiles/paper/2023/file/a85b405ed65c6477a4fe8302b5e06ce7-Paper-Conference.pdf)
8. [Machine Learning from Human Preferences, Chapter 2: Learning](https://mlhp.stanford.edu/src/chap2.html)
9. [Algorithms for Inverse Reinforcement Learning (Ng & Russell, ICML 2000)](https://people.eecs.berkeley.edu/%7erussell/papers/ml00-irl.pdf)
10. [Apprenticeship Learning via Inverse Reinforcement Learning (Abbeel & Ng, ICML 2004)](http://ai.stanford.edu/%7Epabbeel/pubs/AbbeelNg_alvirl_ICML2004.pdf)
11. [Christiano, Paul and colleagues (2017). Deep reinforcement learning from human preferences. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1706.03741)
12. [Ibarz, Borja and colleagues (2018). Reward learning from human preferences and demonstrations in Atari. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1811.06521)
13. [Ouyang, Long and colleagues (2022). Training language models to follow instructions with human feedback. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2203.02155)
14. [Rafailov, Rafael and colleagues (2023). Direct Preference Optimization: Your Language Model is Secretly a Reward Model. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2305.18290)
15. [Learning Robust Rewards with Adversarial Inverse Reinforcement Learning (AIRL, ICLR 2018)](https://users.cs.utah.edu/~dsbrown/readings/airl.pdf)
16. [Fu, Justin, Luo, Katie, Levine, Sergey (2017). Learning Robust Rewards with Adversarial Inverse Reinforcement Learning. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1710.11248)
17. [RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback (ICML 2024)](https://raw.githubusercontent.com/mlresearch/v235/main/assets/lee24t/lee24t.pdf)
18. [Lee, Harrison and colleagues (2023). RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2309.00267)
19. [A Survey of Direct Preference Optimization: Datasets, Theories, Variants, and Applications](https://arxiv.org/html/2410.15595v4)
20. [Defining and characterizing reward hacking (Skalse et al., NeurIPS 2023)](https://dl.acm.org/doi/10.5555/3600270.3600957)
21. [Scaling Laws for Reward Model Overoptimization (Gao, Schulman, Hilton, ICML 2023)](https://proceedings.mlr.press/v202/gao23h.html)
22. [Gao, Leo, Schulman, John, Hilton, Jacob (2022). Scaling Laws for Reward Model Overoptimization. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2210.10760)
23. [Lambert, Nathan and colleagues (2024). RewardBench: Evaluating Reward Models for Language Modeling. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2403.13787)
24. [Learning Optimal Advantage from Preferences and Mistaking It for Reward (AAAI 2024)](https://ojs.aaai.org/index.php/AAAI/article/download/28870/29653)
25. [The Perils of Trial-and-Error Reward Design: Misdesign through Overfitting and Invalid Task Specifications (AAAI 2023)](https://ojs.aaai.org/index.php/AAAI/article/view/25733)
26. [Pan, Alexander, Bhatia, Kush, Steinhardt, Jacob (2022). The Effects of Reward Misspecification: Mapping and Mitigating Misaligned Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2201.03544)
27. [Reward Model Learning vs. Direct Policy Optimization: A Comparative Analysis of Learning from Human Preferences](https://ar5iv.labs.arxiv.org/html/2403.01857)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/reward-learning

English original: https://www.edgepedia.org/reward-learning
