arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.11275cs.LGstat.ML
收藏

带有KL惩罚的RL更好地被视为贝叶斯推理

RL with KL penalties is better viewed as Bayesian inference

University of Sussex(萨塞克斯大学);New York University(纽约大学)

Tomasz Korbak, Ethan Perez, Christopher L Buckley

摘要:

强化学习(RL)经常用于微调大语言模型(LM),如GPT-3,以惩罚它们生成的序列的不良特征,如攻击性,社会偏见,有害或虚假。RL公式涉及将LM视为一种策略,并更新它以最大化奖励函数的期望值,该函数捕获人类偏好,例如非攻击性。在本文中,我们分析了与将语言模型视为RL策略相关的挑战,并展示了如何避免这些挑战需要超越RL范式。我们首先观察到,标准RL方法作为微调LM的目标是有缺陷的,因为它会导致分布崩溃:将LM变成退化分布。然后,我们分析KL正则化RL,一种广泛使用的微调LM的方法,它还限制了微调LM以保持接近其原始分布的Kullback-Leibler(KL)发散。我们表明,KL-正则化RL相当于变分推理:近似贝叶斯后验,指定如何更新先验LM,以符合奖励函数提供的证据。我们认为,这种贝叶斯推理的KL-正则化RL的观点是更有见地比通常采用RL的角度。贝叶斯推理视图解释了KL正则化RL如何避免分布崩溃问题,并为其目标提供了第一原理推导。虽然这个目标恰好等同于RL(具有特定的参数奖励选择),但存在用于微调LM的其他目标,这些目标不再等同于RL。这种观察导致了一个更普遍的观点:RL不是一个适当的正式框架,用于微调语言模型等问题。这些问题最好被视为贝叶斯推理:近似预定义的目标分布。

英文摘要:

Reinforcement learning (RL) is frequently employed in fine-tuning large language models (LMs), such as GPT-3, to penalize them for undesirable features of generated sequences, such as offensiveness, social bias, harmfulness or falsehood. The RL formulation involves treating the LM as a policy and updating it to maximise the expected value of a reward function which captures human preferences, such as non-offensiveness. In this paper, we analyze challenges associated with treating a language model as an RL policy and show how avoiding those challenges requires moving beyond the RL paradigm. We start by observing that the standard RL approach is flawed as an objective for fine-tuning LMs because it leads to distribution collapse: turning the LM into a degenerate distribution. Then, we analyze KL-regularised RL, a widely used recipe for fine-tuning LMs, which additionally constrains the fine-tuned LM to stay close to its original distribution in terms of Kullback-Leibler (KL) divergence. We show that KL-regularised RL is equivalent to variational inference: approximating a Bayesian posterior which specifies how to update a prior LM to conform with evidence provided by the reward function. We argue that this Bayesian inference view of KL-regularised RL is more insightful than the typically employed RL perspective. The Bayesian inference view explains how KL-regularised RL avoids the distribution collapse problem and offers a first-principles derivation for its objective. While this objective happens to be equivalent to RL (with a particular choice of parametric reward), there exist other objectives for fine-tuning LMs which are no longer equivalent to RL. That observation leads to a more general point: RL is not an adequate formal framework for problems such as fine-tuning language models. These problems are best viewed as Bayesian inference: approximating a pre-defined target distribution.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑