直接偏好优化:你的语言模型其实是一个奖励模型

Direct Preference Optimization: Your Language Model is Secretly a Reward Model

拉斐尔·拉法伊洛夫 Rafael Rafailov · Stanford · 2023-05-29 · arXiv:2305.18290 ↗ · 被引 9323

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

尽管大规模无监督语言模型(LM)学习了广泛的世界知识和一些推理技能,但由于其训练完全无监督,难以精确控制其行为。现有方法通过收集人类对模型生成质量的相对偏好标签,并微调无监督 LM 以符合这些偏好,通常使用基于人类反馈的强化学习(RLHF)。然而,RLHF 是一个复杂且往往不稳定的过程,首先拟合一个反映人类偏好的奖励模型,然后使用强化学习微调大型无监督 LM,以最大化这个估计的奖励,同时避免偏离原始模型太远。在本文中,我们引入了 RLHF 中奖励模型的一种新参数化方法,使得能够以封闭形式提取相应的最优策略,从而仅通过一个简单的分类损失就能解决标准的 RLHF 问题。由此产生的算法称为直接偏好优化(DPO),它稳定、高效且计算量轻,消除了在微调期间从 LM 采样或进行大量超参数调整的需要。我们的实验表明,DPO 可以微调 LM 以符合人类偏好,其效果与现有方法相当或更好。值得注意的是,使用 DPO 进行微调在控制生成情感方面超过了基于 PPO 的 RLHF,在摘要和单轮对话中匹配或提高了响应质量,同时实现和训练起来要简单得多。

While large-scale unsupervised language models (LMs) learn broad world knowledge and some reasoning skills, achieving precise control of their behavior is difficult due to the completely unsupervised nature of their training. Existing methods for gaining such steerability collect human labels of the relative quality of model generations and fine-tune the unsupervised LM to align with these preferences, often with reinforcement learning from human feedback (RLHF). However, RLHF is a complex and often unstable procedure, first fitting a reward model that reflects the human preferences, and then fine-tuning the large unsupervised LM using reinforcement learning to maximize this estimated reward without drifting too far from the original model. In this paper we introduce a new parameterization of the reward model in RLHF that enables extraction of the corresponding optimal policy in closed form, allowing us to solve the standard RLHF problem with only a simple classification loss. The resulting algorithm, which we call Direct Preference Optimization (DPO), is stable, performant, and computationally lightweight, eliminating the need for sampling from the LM during fine-tuning or performing significant hyperparameter tuning. Our experiments show that DPO can fine-tune LMs to align with human preferences as well as or better than existing methods. Notably, fine-tuning with DPO exceeds PPO-based RLHF in ability to control sentiment of generations, and matches or improves response quality in summarization and single-turn dialogue while being substantially simpler to implement and train.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 15)

阅读逐段中英对照全文 →