arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.06057cs.CLcs.AIcs.LG
收藏

变分 Best-of-N 对齐

Variational Best-of-N Alignment

ETH Zürich(苏黎世联邦理工学院)

Afra Amini, Tim Vieira, Elliott Ash, Ryan Cotterell

AI总结:

本文提出变分 Best-of-N (vBoN) 方法,通过微调语言模型最小化与 BoN 分布的反向 KL 散度来模仿其推理过程,在保持接近 BoN 性能的同时将推理成本降低 N 倍。

摘要:

Best-of-N (BoN) 是一种流行且有效的算法,用于将语言模型与人类偏好进行对齐。该算法的工作原理如下:在推理时,从语言模型中抽取 N 个样本,并由奖励模型判断,将具有最高奖励的样本作为输出返回。尽管 BoN 很有效,但它在计算上很昂贵;它将采样吞吐量降低了 N 倍。为了使 BoN 在推理时更高效,一种策略是微调语言模型以模仿 BoN 在推理期间的行为。为了实现这一点,我们推导了由 BoN 算法诱导的分布。然后,我们提出微调语言模型,以最小化与 BoN 分布之间的反向 KL 散度。我们的方法类似于平均场变分推断,因此我们将其称为变分 BoN (vBoN)。在微调成功并获得良好近似的程度上,我们将推理成本降低了 N 倍。我们在受控生成和摘要任务上的实验表明,BoN 是最有效的对齐方法,而我们对 BoN 的变分近似实现了与 BoN 最接近的性能,并超越了使用标准 KL 约束 RL 目标微调的模型。在受控生成任务中,与其他对齐方法相比,vBoN 更频繁地出现在奖励和 KL 散度的 Pareto 前沿上。在摘要任务中,vBoN 在各种采样温度下均实现了高奖励值。

英文摘要:

Best-of-N (BoN) is a popular and effective algorithm for aligning language models to human preferences. The algorithm works as follows: at inference time, N samples are drawn from the language model, and the sample with the highest reward, as judged by a reward model, is returned as the output. Despite its effectiveness, BoN is computationally expensive; it reduces sampling throughput by a factor of N. To make BoN more efficient at inference time, one strategy is to fine-tune the language model to mimic what BoN does during inference. To achieve this, we derive the distribution induced by the BoN algorithm. We then propose to fine-tune the language model to minimize backward KL divergence to the BoN distribution. Our approach is analogous to mean-field variational inference and, thus, we term it variational BoN (vBoN). To the extent this fine-tuning is successful and we end up with a good approximation, we have reduced the inference cost by a factor of N. Our experiments on controlled generation and summarization tasks show that BoN is the most effective alignment method, and our variational approximation to BoN achieves the closest performance to BoN and surpasses models fine-tuned using the standard KL-constrained RL objective. In the controlled generation task, vBoN appears more frequently on the Pareto frontier of reward and KL divergence compared to other alignment methods. In the summarization task, vBoN achieves high reward values across various sampling temperatures.

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

↑