Title: BoNBoN Alignment for Large Language Models and the Sweetness of Best-of-n Sampling
Venue: NeurIPS 2024
Accepted: yes
Keywords: LLM alignment; LLM fine tuning; Best of n; RLHF; Optimal Policy
Abstract: This paper concerns the problem of aligning samples from large language models to human preferences using *best-of-$n$* sampling, where we draw $n$ samples, rank them, and return the best one. We consider two fundamental problems. First: what is the relationship between best-of-$n$ and other (RLHF-type) approaches to aligning LLMs? In particular, when should one be preferred to the other? We show that the best-of-$n$ sampling distribution is essentially equivalent to the policy learned by RLHF if we apply a particular monotone transformation to the reward function. Moreover, we show that this transformation yields the best possible trade-off between win-rate against the base model vs KL distance from the base model. Then, best-of-$n$ is a Pareto-optimal win-rate vs KL solution.
The second problem we consider is how to fine-tune a model to mimic the best-of-$n$ sampling distribution, to avoid drawing $n$ samples for each inference. We derive *BonBon Alignment* as a method for achieving this. Experiments show that BonBon alignment yields a model that achieves high win rates while minimally affecting off-target aspects of the generations.

BoNBoN Alignment for Large Language Models and the Sweetness of Best-of-n Sampling

Abstract

This paper concerns the problem of aligning samples from large language models to human preferences using best-of-n sampling, where we draw n samples, rank them, and return the best one. We consider two fundamental problems. First: what is the relationship between best-ofn and approaches to alignment that train LLMs to output samples with a high expected reward (e.g., RLHF or DPO)? To answer this, we embed both the best-ofn distribution and the sampling distributions learned by alignment procedures in a common class of tiltings of the base LLM distribution. We then show that, within this class, best-ofn is essentially optimal in terms of the trade-off between win-rate against the base model vs KL distance from the base model. That is, best-ofn is the best choice of alignment distribution if the goal is to maximize win rate. However, best-ofn requires drawing n samples for each inference, a substantial cost. To avoid this, the second problem we consider is how to fine-tune a LLM to mimic the best-ofn sampling distribution. We derive BoNBoN Alignment to achieve this by exploiting the special structure of the best-ofn distribution. Experiments show that BoNBoN alignment yields substantial improvements in producing a model that is preferred to the base policy while minimally affecting off-target aspects. Code is available at https://github.com/gl-ybnbxb/BoNBoN .

1 Introduction

This paper concerns the problem of aligning large language models (LLMs) to bias their outputs toward human preferences. There are now a wealth of approaches to this problem [ e.g., Ouy + 22; Chr + 17; Kau + 23; Li + 24; Raf + 23; Aza + 24 ] . Here, we interested in the best-of-n (BoN) sampling strategy. In BoN sampling, we draw n samples from the LLM, rank them on the attribute of interest, and return the best one. This simple procedure is surprisingly effective in practice [ Bei + 24; Wan + 24; GSH23; Eis + 23 ] . We consider two fundamental questions about BoN:

What is the relationship between BoN and other approaches to alignment?

How can we effectively train a LLM to mimic the BoN sampling distribution?

In brief: we find that the BoN distribution is (essentially) the optimal policy for maximizing win rate while minimally affecting off-target aspects of generation, and we develop an effective method for aligning LLMs to mimic this distribution. Together, these results yield a highly effective alignment method; see Figure 1 for an illustration.

LLM Alignment The goal of alignment is to bias the outputs of an LLM to be good on some target attribute (e.g., helpfulness), while minimally changing the behavior of the model on off-target attributes (e.g., reasoning ability). Commonly, the notion of goodness is elicited by collecting pairs of responses to many prompts, and asking (human or AI) annotators to choose the better response. Then, these pairs are used to define a training procedure for updating the base LLM to a new, aligned, LLM that outputs responses that are better in the target attribute.

50

60

70

80

90

60

80

100

120

140

160

Average Length of Responses

Method

BoN sampling

BoNBoN

DPO original HH

IPO original HH

Average Length (Response) vs. Win Rate

+XPDQGLYPH<c=29,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZKDWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>

$VVLVWDQWGLYPH<c=29,font=/EEIUOU+font000000002cc9810f>

¤ƘűţƕƬ

S¤ȬNN

%¤ȬNN

GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>

GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZKLFKGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7KLVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQVZHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

VLPSOHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLQDOGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGLWLRQGLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>2UGLQDOGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGLWLRQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XVHGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EDVLFGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>PDWKGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

RSHUDWLRQVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>OLNHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGLWLRQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>VXEWUDFWLRQGLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EXWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LWGLYPH<c=10,font=/EEIUOU+font000000002cc9810f>VGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DOVRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XVHGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZLWKGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

RWKHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>PDWKHPDWLFDOGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SULQFLSOHVGLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>OLNHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SURSHUW\GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DOZD\VGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

DGGLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>E\GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SRZHUVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WHQGLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7RGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ILQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>VXPGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>\RXGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZRXOGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

GRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7KLVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FDQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DOVRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZULWWHQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f> GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>,IGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>\RXGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

ZDQWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XSGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ODUJHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>PRUHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WLPHVGLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>\RXGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZRXOGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=22,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=23,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=24,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=25,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=27,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7KLVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

ZRXOGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>UHVXOWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=20,font=/EEIUOU+font000000002cc9810f>GLYPH<c=19,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>H[DFWO\GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>VXPGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>

7KHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZKLFKGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>HTXDOVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7KLVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

FRPPRQO\GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FDOOHGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=5,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=5,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7KHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DUHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FDOOHGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

GLYPH<c=5,font=/EEIUOU+font000000002cc9810f>DGGHQGGLYPH<c=5,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=5,font=/EEIUOU+font000000002cc9810f>PXOWLSOLHUGLYPH<c=5,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=5,font=/EEIUOU+font000000002cc9810f>DGGHQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>PXOWLSOLHUGLYPH<c=5,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>7KHVHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>IDFWRUVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DUHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FRPPRQO\GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XVHGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FRXQWLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>H[SUHVVLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>VXPVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>PXOWLSOHVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RWKHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUVGLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

?Q?Q,W·VGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>JRRGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SUDFWLFHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>H[SOLFLWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKDWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>\RX·UHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FRXQWLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XSGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZKHQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

\RXGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XVHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKDWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>\RX·UHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZKHQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>\RXGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

WRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>2WKHUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FRPPRQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZD\VGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DGGLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XSGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LQFOXGHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

DGGLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LQGLYLGXDOGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLJLWVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>JURXSVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RIGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLJLWVGLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>)RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>H[DPSOHGLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f> GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

FRXOGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZULWWHQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=27,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>6LPLODUO\GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=14,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

FRXOGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZULWWHQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>DVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=27,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>RUGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>.HHSGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>PLQGGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKDWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKHVHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

ZRUGLQJVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FDQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>FRQIXVLQJGLYPH<c=15,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>VRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LW·VGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XVXDOO\GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHVWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WRGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>EHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>H[SOLFLWGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>ZKHQGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>

DGGLQJGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>XSGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>QXPEHUVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>OLNHGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>WKLVGLYPH<c=17,font=/EEIUOU+font000000002cc9810f>

GLYPH<c=29,font=/EEIUOU+font000000002cc9810f>òƠĝȬrűĖĝŚ

GLYPH<c=26,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>SOXVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=21,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>LVGLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=3,font=/EEIUOU+font000000002cc9810f>GLYPH<c=28,font=/EEIUOU+font000000002cc9810f>GLYPH<c=17,font=/EEIUOU+font000000002cc9810f>

There are two main approaches. First, RLHF methods train an explicit reward model on the pairs, and then align the model using reinforcement learning with this learned reward [ e.g., Ouy + 22; Kau + 23 ] . Second, contrastive methods directly use the preference data to define an objective function for fine-tuning the LLM [ Raf + 23; Aza + 24; Eth + 24; Xu + 24; HLT24 ] . In both cases, the trade-off between alignment and off-target behavior is controlled by a hyper-parameter that explicitly penalizes the divergence from the base LLM. For example, in the reinforcement learning setting, this is done by adding a regularization term that penalizes the estimated KL divergence between the aligned model and the reference model.

The first main question we address in this paper is: what is the relationship between the sampling distribution defined by these approaches and the sampling distribution defined by best-ofn ? This is important, in particular, because in principle we could forgo the explicit alignment training and just use BoN sampling. However, it is not clear when each option should be preferred.

Now, the comparison of training-aligned models and BoN is not fully fair. The reason is that producing a BoN sample requires drawing n samples from the base LLM (instead of just one). This is a substantial computational cost. The second main question we address is: if we do in fact want to sample from the BoN distribution, how can we train a LLM to mimic this distribution? If this can be done effectively, then the inference cost of BoN sampling can be avoided.

We answer these questions with the following contributions:

We show that the BoN sampling distribution can be embedded in a common class with the distributions produced by training-based alignment methods. Within this common class, we derive the distribution with the best possible trade-off between win-rate against the base model vs KL distance from the base model. Then, we show that the BoN distribution is essentially equal to this Pareto-optimal distribution.

We then develop an effective method for training a LLM to mimic the BoN sampling distribution. In essence, the procedure draws best-ofn and worst-ofn samples as training data, and combines these with an objective function we derive by exploiting the analytical form of the BoN distribution. We call this procedure BoNBoN Alignment .

Finally, we show empirically that BoNBoN Alignment yields models that achieve high win rates while minimally affecting off-target aspects of the generations, outperforming baselines.

2 Preliminaries

Given a prompt x , a large language model (LLM) samples a text completion Y . We denote the LLM by π and the sampling distribution of the completions by π ( y | x ) .

Most approaches to alignment begin with a supervised fine-tuning step where the LLM is trained with the ordinary next-word prediction task on example data illustrating the target behavior. We denote the resulting model by π 0 , and call it the reference model . The problem we are interested in is how to further align this model.

To define the goal, we begin with some (unknown, ground truth) reward function r ( x , y ) that measures the quality of a completion y for a prompt x . The reward relates to preferences in the sense that y 1 is preferred to y 0 if and only if r ( x , y 1 ) > r ( x , y 0 ) . Informally, the goal is to produce a LLM π r where the samples have high reward, but are otherwise similar to the reference model.

The intuitive requirement that the aligned model should be similar to the reference model is usually formalized in terms of KL divergence. The context-conditional KL divergence and the KL divergence from π r to π 0 on a prompt set D are defined as:

We also need to define what it means for samples from the language model to have high reward. Naively, we could just look at the expected reward of the samples. However, in the (typical) case where we only have access to the reward through preference judgements, the reward is only identified up to monotone transformation. The issue is that expected reward value is not compatible with this unidentifiability. 1 Instead, we consider the win rate of the aligned model against the reference model. The idea is, for a given prompt, draw a sample from the aligned model and a sample from the reference model, and see which is preferred. This can be mathematically formalized by defining the context-conditional win rate and the overall win rate on a prompt set D :

Reinforcement Learning from Human Feedback (RLHF) The most studied approach to alignment is RLHF . This procedure follows two steps. First, the reward function is explicitly estimated from preference data, using the Bradley-Terry [ BT52 ] model. Second, this estimated reward function is used in a KL-regularized reinforcement learning procedure to update the LLM. Denoting the estimated reward function by ˆ r , the objective function for the reinforcement learning step is:

where D is a prompt set and β is a hyper-parameter to control the deviation of πθ from the reference model π 0 . The policy π r is learned by finding the minimizer of the objective function in (2.1); e.g., using PPO [ Sch + 17 ] .

Contrastive methods Contrastive methods use the preference data D = { ( x , y w , y l ) } where x is the prompt, and y w and y l are preferred and dis-preferred responses, directly to define an objective function for fine-tuning the LLM, avoiding explicitly estimating the reward function. For example, the DPO [ Raf + 23 ] objective is:

The aligned model is found by optimizing this objective directly (via gradient descent).

Bradley-Terry and Alignment Targets In RLHF , the reward function is estimated using the Bradley-Terry model, which relates noisy observed preferences to rewards by:

where σ ( · ) is the sigmoid function. In the particular case that the Bradley-Terry model is wellspecified, then it can be shown that the analytic solution to both (2.1) and (2.2) is:

That is, the alignment procedures target an exponential tilting of the reference model by the reward function. Of course, it is not obvious when the Bradley-Terry model is well-specified, nor whether this particular tilting is a desirable target. Other works have considered explicitly or implicitly transforming the reward function to change the target distribution [ Wan + 24; Aza + 24 ] . Nevertheless, these works also take the target distribution to be a tilting of the reference distribution.

Best-ofn sampling The best-ofn procedure is as follows. Given a prompt x , sample y 1 , y 2 , . . . , y n independently from the reference model π 0 ( y | x ) . Then, select the response with the highest reward r ( x , y i ) as the final response. That is,

3 Best-ofn is Win-Rate vs KL Optimal

The first question we address is: what is the relationship between the best-ofn distribution, and the distribution induced by training-based alignment methods?

3.1 A Common Setting for Alignment Policies

We begin with the underlying distribution of best-ofn sampling. Let Qx denote the cumulative distribution function of r ( x , Y 0 ) , where Y 0 ∼ π 0 ( · | x ) . Suppose r ( x , · ) : Ψ → Ρ is an one-to-one mapping and π 0 ( y | x ) is continuous 2 , then the conditional density of the best-of-n policy is

Compare this to the RLHF policy π RLHF r in (2.4). In both cases, the sampling distribution is a re-weighted version of the reference model π 0 , where higher weights are added to those responses with higher rewards. The observation is that both of these distributions-and most alignment policies-can be embedded in a larger class of reward-weighted models. For any prompt x and reward model r , we can define the f x -aligned model as:

where f x is a non-decreasing function that may vary across different prompts.

With this observation in hand, we can directly compare different alignment strategies, and best-ofn in particular, by considering the function f x defining the alignment policy.

3.2 Optimality: Win Rate versus KL divergence

To understand when different alignment policies are preferable, we need to connect the choice of f x with a pragmatic criteria for alignment. The high-level goal is to produce a policy that samples high-reward responses while avoiding changing off-target attributes of the text. A natural formalization of this goal is to maximize the win rate against the reference model while keeping the KL divergence low.

1.0

0.9

0.8

0.7

0.6

0.5

KL Divergence versus Win Rate

0

1

2

KL Divergence

0.0000

0.0025

0.0050

0.0075

0.0100

2

4

6

8

10

Win Rate Gain

Win Rate Gain from Optimal Policy over Best-of-n Sampling

n

Optimal Policy Our aim is to find the policy with the highest possible win rate at each KL divergence level:

Now, this equation only depends on Y through the reward function r ( x , y ) . Defining Qx ( r ( x , Y )) as the distribution of r ( x , Y ) under π 0 ( Y | x ) , we can rewrite the objective as:

By duality theory [ BTN01 ] , there is some constant β > 0 such that this problem is equivalent to:

Now, we can immediately recognize this objective as the same as the RLHF objective in (2.1) with the transformed reward function ˜ r ( x , y ) = Qx ( r ( x , y )) . Then, the analytic solution to this problem is

where c is a constant determined by the KL divergence penalty.

The following theorem makes the preceding argument precise. To simplify the argument, we will assume that the rewards assigned to outputs of the language model are continuous. This simplifying assumption ignores that there are only a countably infinite number of possible responses to any given prompt. However, given the vast number of possible responses, the assumption is mild in practice. Refer to appendix B for a more detailed discussion.

Theorem 1. Let π optimal r , c be the solution to (3.3). Then, for all x, the density of the optimal policy is

where Z c r is the normalizing constant, and c is a positive constant such that

Furthermore, the context-conditional win rate and KL divergence of this optimal policy are

Context-conditional win rate: p π optimal r , c ≻ π 0 | x = ( c -1 ) e c + 1 c ( e c -1 ) .

Context-conditional KL divergence: ∆ KL GLYPH<128> π optimal r , c ∥ π 0 | x GLYPH<138> = ( c -1 ) e c + 1 e c -1 -log GLYPH<0> e c -1 c GLYPH<1> .

Since for any prompt x, both the context conditional win rate and KL divergence are constants, the overall win rate p π optimal r , c ≻ π 0 and KL divergence ∆ KL ( π optimal r , c ∥ π 0 ) on any prompt set D are also these values. [ Proof ] .

3

4

3.3 The best-ofn policy is essentially optimal

Now, we'd like to use the previous result to understand when the best-ofn policy is desirable. The win rate and KL divergence can be calculated with essentially the same derivation:

Theorem 2. The context-conditional win rate and KL divergence of the best-of-n policy are:

Context-conditional win rate: p π ( n ) r ≻ π 0 | x = n n + 1 .

[ JH22 ] Context-conditional KL divergence: ∆ KL GLYPH<0> π ( n ) r ∥ π 0 | x GLYPH<1> = log ( n ) -n -1 n . 3

Since both are constants, the overall win rate p π ( n ) r ≻ π 0 and Kl divergence ∆ KL ( π ( n ) r ∥ π 0 ) on any prompts set D are the same values. [ Proof ] .

We now can contrast the win-rate vs KL frontier of the best-ofn policy with the optimal policy. Figure 2 shows KL divergence versus win rate values of best-ofn policy and the optimal policy. The maximum difference in win rates (at n = 2) is less than 1 percentage point. Larger values of n approximate the optimal policy even more closely. In summary:

The best-ofn policy is essentially optimal in terms of win rate versus KL divergence.

3.4 Implicit vs Explicit KL regularization

RLHF and contrastive alignment methods include a hyper-parameter that attempts to explicitly control the trade-off between KL divergence and model reward. By contrast, best-ofn only controls the KL drift implicitly . This can actually be a substantive advantage. There are two reasons. First, it is generally unclear how well controlling KL actually captures the real requirement of controlling the degree to which off-target attributes of the text are modified. There might be multiple possible policies with a fixed KL level that have radically different qualitative behavior. Second, in practice, the KL drift from the base policy needs to be estimated from a finite data sample. This may be extremely difficult-it is a very high dimensional estimation problem. Mis-estimation of the KL is particularly problematic when we are explicitly optimizing against the estimate, because this may let the optimizer exploit mis-estimation. Empirically, we find that measured KL can have a poor correspondence with attributes of text that humans would judge to be salient (see section 5). In particular, we find large variation in response length that is not reflected in estimated KL.

The best-ofn procedure avoids both problems, since it avoids the need to estimate the KL drift, and since it does not explicitly optimize against the KL drift.

4 BoNBoN: Best-ofn fine tuning

From section 3, we know that the best-ofn policy is essentially optimal in terms of win rate and KL divergence. Accordingly, it is often a good choice for the alignment policy. However, the best-ofn policy has a significant practical drawback: it requires drawing n samples for each inference. This is a substantial computational expense. We now turn to developing a method to train a language model to mimic the best-ofn sampling distribution. We call this method BoNBoN Alignment .

Setup The basic strategy here will be to use best-ofn samples to train a language model to mimic the best-ofn policy. We produce the training data by sampling n responses from the reference model π 0 , and ranking them. The best and worst data are the samples with highest and lowest reward. Their corresponding best-of and worst-of n sampling distributions are denoted as π ( n ) r and π ( 1 ) r . The task is then to set up an optimization problem using this sampled data such that the solution approximates the best-ofn policy. To that end, we consider objective functions that have the best-ofn policy as a minimizer in the infinite data limit. (In practice, as usual, we approximate the expectation with an average.)

SFT-BoN. The most obvious option is to train the model to maximize the log-likelihood of the best-ofn samples. The associated objective is:

and it is well-known that the minimizer is π ( n ) r . The training procedure is simply to minimize the sample-average version of this objective. We call this training method SFT-BoN because it is supervised fine-tuning on best-ofn samples. Although SFT-BoN is valid theoretically, it turns out to be data inefficient, and we observe only marginal improvement over the reference model empirically (see section 5).

IPO-BoN. A limitation of the best-ofn procedure is that it only makes use of the winning sample, throwing away the rest. Another intuitive option is to construct a pairwise dataset and train the language model by a contrastive method. Concretely, we construct the pairwise data by picking the best and worst responses. We want to construct an objective function using this paired data that has the best-ofn policy as a minimizer.

The key result we require is:

Theorem 3. For any fixed n, where

[ Proof ] .

Following this result, we define the contrastive objective function as:

The optimizer of this objective is a policy where the log-likelihood ratio of the best and worst samples is equal to that of the best-ofn policy. We call this training method IPO-BoN because it is essentially the IPO objective on the best-and-worst samples, with a particular choice for the IPO hyper parameter. We emphasize that the IPO-BoN objective does not involve any hyper parameters, there is only one choice for β ∗ n for each n .

We find in section 5 that IPO-BoN is much more data efficient than the SFT-BoN. However, this method (like IPO) has the disadvantage that it only controls the likelihood ratios on the sampled data. In particular, this means that the optimizer can cheat by reducing the likelihood of both the winning and losing responses, so long as the loser's likelihood decreases more (so the ratio still goes up). Reducing the probability of both the winning and losing examples requires the optimized model to shift probability mass elsewhere. In practice, we find that it tends to increase the probability of very long responses.

BonBon Alignment We can now write the BoNBoN objective:

The BoNBoN alignment objective is:

where Λ SFT -BoN and Λ IPO -BoN are defined in (4.1) and (4.3), and α is a hyper parameter that balances the SFT and the IPO objectives.

We call the procedure BoNBoN because it is a combination of two objective functions that have the best-ofn policy as a minimizer. Relative to SFT alone, BoNBoN can be understood as improving data efficiency by making use of the worst-ofn samples. Relative to IPO alone, BoNBoN can be understood as preventing cheating by forcing the likelihood of the best-ofn samples to be

high. We emphasize that both objective functions target the same policy; neither is regularizing towards some conflicting objective. That is, the trade-off between win-rate and off-target change is handled implicitly by the (optimal) best-ofn procedure. This is in contrast to approaches that manage this trade-off explicitly (and sub-optimally) by regularizing towards the reference model. Reflecting this, we choose α so that the contribution of each term to the total loss is approximately equal.

5 Experiments

5.1 Experimental Setup

We study two tasks: a) single-turn dialogue generation , for which we conduct experiments on the Anthropic Helpful and Harmless (HH) dataset [ Bai + 22 ] and b) text summarization , for which we use the OpenAI TL;DR dataset [ Sti + 20 ] . Due to computational constraints, we filter the HH data to only keep prompts for which response length is less than 500 characters, resulting in 106,754 training dialogues. For TL;DR dataset, we discard instances where the input post length is less than 90 characters, resulting in 92,831 (14,764 prompts) training posts. Each example in both datasets contains a pair of responses that were generated by a large language model along with a label denoting the human-preferred response among the two generations.

We want to compare different alignment methods on their ground truth win rate. Accordingly, we need a ground truth ranker. To that end, we construct data by using an off-the-shelf reward model 4 as our ground truth. (In particular, we relabel the human preferences).

As the reference model, we fine-tune Pythia-2.8b [ Bid + 23 ] with supervised fine-tuning (SFT) on the human-preferred completions from each dataset. For alignment methods other than BoNBoN, we draw n = 8 completions for each prompt, and we use the best and worst completions as training data for them. For BoNBoN, we vary n from 2 to 8.

We use DPO and IPO as baselines for the alignment task. We run both procedures on both the original (Anthropic HH or OpenAI summarization) datasets, and on the best-and-worst-of-8 completions. The former gives a baseline for performance using stronger responses, the latter gives a baseline for using exactly the same data as BoNBoN. Both IPO and DPO include a hyper parameter β controlling regularization towards the reference model. We report results for each method run with several values of β . For BoNBoN, we use α = 0.005 for all experiments. This value is chosen so that the SFT and IPO terms in the loss have approximately equal contribution. Further details can be found in appendix C.

5.2 BoNBoN achieves high win rate with little off-target deviation

We are interested in the win-rate vs off-target deviation trade-off. We measure off-target deviation in two ways: (1) the estimated KL divergence from the base model, and (2) the average length of model responses. Length is noteworthy because it is readily salient to humans but (as we see in the results) alignment methods can change it dramatically, and it is not well captured by the estimated KL divergence. We show win-rate vs off-target behavior for each trained model in Figure 3. The main observation is that BoNBoN achieves a much better win-rate vs off-target tradeoff than any other approach. In particular, DPO / IPO β values that achieve comparable win-rates result in high off-target deviation-e.g., nearly doubling the average response length!

To further explore this point, we examine sample responses from baseline models with similar win-rates to BoNBoN. Examples are shown in Figure 1 and tables 1 and 6. Other approaches can dramatically change off-target behavior.

5.3 BoNBoN mimics the best-ofn policy

Figure 3 shows SFT and IPO fine-tuned on the best-ofn data. We observe that BoNBoN dramatically outperforms these methods at all values of β , and is closer to the (optimal) BoN distribution. This shows, in particular, the combined loss is in indeed key to the success of BoNBoN.

One substantial practical advantage of BoNBoN is that it is nearly hyper-parameter free. Because the goal is to mimic the best-ofn distribution, which is known to be optimal, we do not need to sweep hyper-parameters for the 'best' choice of win-rate vs KL. In particular, the β term in IPO is analytically derived in Theorem 3. In Figure 5 we show the win rate vs off-target behavior

Summarization

50

60

70

80

90

100

0

10

20

30

40

KL Divergence

50

60

70

80

90

75

100

125

150

Average Length of Responses

Average Length (Response) vs. Win Rate

50

60

70

80

90

100

0

20

40

60

KL Divergence

50

60

70

80

90

40

80

120

160

Average Length of Responses

Average Length (Response) vs. Win Rate

50

60

70

80

90

100

0

10

20

30

40

KL Divergence

50

60

70

80

90

75

100

125

150

Average Length of Responses

Average Length (Response) vs. Win Rate

Helpful and Harmless

for several other choices for β in the IPO term. We observe that, generally, the default β ∗ n has an excellent win-rate vs off-target trade-off. Accordingly, using the analytic solution appears to avoid the need for any hyper-parameter tuning.

6 Discussion and Related work

Best-of-n BoN sampling is widely used for LLMs [ e.g., Sti + 20; Nak + 21; Liu + 23; Gul + 23; Tou + 23; GSH23 ] . Due to its practical importance, it has also attracted some recent theoretical attention [ e.g., Mud + 23; Bei + 24; Yan + 24; Jin + 24 ] . Beirami et al. [ Bei + 24 ] show a closed form probability mass function of the BoN policy in discrete case and provide a new KL estimator for

it. Yang et al. [ Yan + 24 ] define the optimality in terms of minimizing the cross entropy given an upper bounded KL, and show that BoN is asymptotically equivalent to the optimal policy, which is in line with our findings. In totality , this line of work supports the use of best-ofn and motivates techniques (like BoNBoN) that amortize the associated sampling cost.

Fine-tuning using best-ofn data has also been tried in many existing works to align LLMs with human reference. Dong et al. [ Don + 23 ] and Xiong et al. [ Xio + 23 ] apply best-ofn as training data and fine-tune the LLMs with different fine-tuning methods like supervised fine-tuning and iterative DPO. Touvron et al. [ Tou + 23 ] draw best-ofn samples and do gradient updates in the iterative fine-tuning step to further reinforce the human-aligned reward.

LLM alignment There is extensive literature on aligning LLMs [ e.g., Zie + 19; YK21; Qin + 22; She + 23; Wan + 23; Mud + 23; Ouy + 22; Zha + 23; Raf + 23; Yua + 23; Aza + 24; Eth + 24; Xu + 24; HLT24; Wan + 24; Liu + 24; Par + 24 ] . Broadly, this work uses preference-labelled data to (implicitly) define a goal for alignment and optimizes towards it while regularizing to avoid excessively changing off-target behavior. Relative to this line of work, this paper makes two main contributions. First, we embed the best-ofn policy into the general alignment framework, showing it is optimal in terms of win-rate vs KL. Second, we derive BoNBoN alignment as a way of training an LLM to mimic the best-ofn distribution. Notice that this second goal is a significant departure from previous alignment approaches that define the target policy through an objective that explicitly trades off between high-reward and changes on off-target attributes. We do not have any regularization towards the reference model. This has some significant practical advantages. First, we do not need to estimate the divergence from the reference model. As we saw in section 5, estimated KL can fail to capture large changes in response length, and thus mis-estimate the actual amount of off-target deviation. Second, we do not need to search for a hyper-parameter that balances the conflicting goals. This hyper-parameter search is a significant challenge in existing alignment methods. (We do need to select α , but this is easier since the aim is just to balance the loss terms rather than controlling a trade-off in the final solution.)

Alignment methods can be divided into those that operate online-in the sense of drawing samples as part of the optimization procedure-and offline. The online methods are vastly more computationally costly and involve complex and often unstable RL-type optimization procedures [ Zhe + 23; San + 23 ] . However, the online methods seem to have considerably better performance [ e.g., Tan + 24 ] . The results in the present paper suggest this gap may be artificial. Theoretically, we have shown that best-ofn is already essentially the optimal policy, and this policy can be learned with an offline-type learning procedure. Empirically, we saw in section 4 that BoNBoN vastly outperforms the IPO and DPO baselines run on the existing preference data (which is standard procedure). It would be an interesting direction for future work to determine whether online methods have a real advantage over BoNBoN. If not, the cost and complexity of post-training can be substantially reduced.

Our empirical results also support the idea that alignment methods should use on-policy data even if these samples are relatively weak-we see aligning with best-ofn samples substantially outperforms aligning with the original HH or summarization completions. Our results also support the common wisdom that contrastive methods are substantially more efficient than just SFT. Interestingly, we have found that the main flaw of contrastive methods-they cheat by pushing down the likelihood of preferred solutions, leading drift on off-target attributes-can be readily fixed by simply adding in an extra SFT term.

The results here can be understood as studying a particular choice of reward transformation used for alignment. Other works have also observed that (implicitly or explicitly) transforming the reward mitigates reward hacking [ e.g., Aza + 24; Wan + 24; LSD24; Ska + 22 ] . Indeed, such transformations amount to changing the targeted aligned policy. Our results show how to optimize win rate. However, this is not the only possible goal. For example, Wang et al. [ Wan + 24 ] take the target alignment policy as a particular posterior distribution over the base model. Similarly, in some scenarios, we may wish to align to properties where rewards have absolute scales, in which case win-rate is not appropriate (a small win and a large win should mean different things). Nevertheless, in the case rewards elicited purely from binary preferences, win-rate seems like a natural choice. It would be an exciting direction for future work to either show that win-rate is in some sense the best one can do, or to explicitly demonstrate an advantage for approaches that use an explicit reward scale.

References

[ Aza + 24 ] M. G. Azar, Z. D. Guo, B. Piot, R. Munos, M. Rowland, M. Valko, and D. Calandriello. 'A general theoretical paradigm to understand learning from human preferences'. In: International Conference on Artificial Intelligence and Statistics . PMLR. 2024 (cit. on pp. 1, 2, 4, 10).

[ Bai + 22 ] Y. Bai, A. Jones, K. Ndousse, A. Askell, A. Chen, N. DasSarma, D. Drain, S. Fort, D. Ganguli, T. Henighan, et al. 'Training a helpful and harmless assistant with reinforcement learning from human feedback'. In: arXiv preprint arXiv:2204.05862 (2022) (cit. on p. 8).

[ Bei + 24 ] A. Beirami, A. Agarwal, J. Berant, A. D'Amour, J. Eisenstein, C. Nagpal, and A. T . Suresh. 'Theoretical guarantees on the best-of-n alignment policy'. In: arXiv preprint arXiv:2401.01879 (2024) (cit. on pp. 1, 6, 9, 16).

[ BTN01 ] A. Ben-Tal and A. Nemirovski. Lectures on modern convex optimization: analysis, algorithms, and engineering applications . 2001 (cit. on p. 5).

[ Bid + 23 ] S. Biderman, H. Schoelkopf, Q. G. Anthony, H. Bradley, K. O'Brien, E. Hallahan, M. A. Khan, S. Purohit, U. S. Prashanth, E. Raff, et al. 'Pythia: a suite for analyzing large language models across training and scaling'. In: International Conference on Machine Learning . PMLR. 2023 (cit. on p. 8).

[ BT52 ] R. A. Bradley and M. E. Terry. 'Rank analysis of incomplete block designs: i. the method of paired comparisons'. In: Biometrika 3 / 4 (1952) (cit. on p. 3).

[ Chr + 17 ] P . F . Christiano, J. Leike, T . Brown, M. Martic, S. Legg, and D. Amodei. 'Deep reinforcement learning from human preferences'. In: Advances in Neural Information Processing Systems . 2017 (cit. on p. 1).

[ Don + 23 ] H. Dong, W . Xiong, D. Goyal, Y. Zhang, W . Chow, R. Pan, S. Diao, J. Zhang, K. SHUM, and T. Zhang. 'RAFT: reward ranked finetuning for generative foundation model alignment'. In: Transactions on Machine Learning Research (2023) (cit. on p. 10).

[ Eis + 23 ] J. Eisenstein, C. Nagpal, A. Agarwal, A. Beirami, A. D'Amour, D. Dvijotham, A. Fisch, K. Heller, S. Pfohl, D. Ramachandran, et al. 'Helping or herding? reward model ensembles mitigate but do not eliminate reward hacking'. In: arXiv preprint arXiv:2312.09244 (2023) (cit. on p. 1).

[ Eth + 24 ] K. Ethayarajh, W . Xu, N. Muennighoff, D. Jurafsky, and D. Kiela. 'Kto: model alignment as prospect theoretic optimization'. In: arXiv preprint arXiv:2402.01306 (2024) (cit. on pp. 2, 10).

[ GSH23 ] L. Gao, J. Schulman, and J. Hilton. 'Scaling laws for reward model overoptimization'. In: International Conference on Machine Learning . PMLR. 2023 (cit. on pp. 1, 9).

[ Gul + 23 ] C. Gulcehre, T. L. Paine, S. Srinivasan, K. Konyushkova, L. Weerts, A. Sharma, A. Siddhant, A. Ahern, M. Wang, C. Gu, et al. 'Reinforced self-training (rest) for language modeling'. In: arXiv preprint arXiv:2308.08998 (2023) (cit. on p. 9).

[ HLT24 ] J. Hong, N. Lee, and J. Thorne. 'Reference-free monolithic preference optimization with odds ratio'. In: arXiv preprint arXiv:2403.07691 (2024) (cit. on pp. 2, 10).

[ JH22 ] L. G. Jacob Hilton. Measuring Goodhart's law . 2022 (cit. on pp. 6, 16).

[ Jin + 24 ] Y. Jinnai, T. Morimura, K. Ariu, and K. Abe. 'Regularized best-of-n sampling to mitigate reward hacking for language model alignment'. In: arXiv preprint arXiv:2404.01054 (2024) (cit. on p. 9).

[ Kau + 23 ] T. Kaufmann, P . Weng, V . Bengs, and E. Hüllermeier. 'A survey of reinforcement learning from human feedback'. In: arXiv preprint arXiv:2312.14925 (2023) (cit. on pp. 1, 2).

[ LSD24 ] C. Laidlaw, S. Singhal, and A. Dragan. 'Preventing reward hacking with occupancy measure regularization'. In: arXiv preprint arXiv:2403.03185 (2024) (cit. on p. 10).

[ Li + 24 ] K. Li, O. Patel, F . Viégas, H. Pfister, and M. Wattenberg. 'Inference-time intervention: eliciting truthful answers from a language model'. In: Advances in Neural Information Processing Systems (2024) (cit. on p. 1).

[ Liu + 23 ] T. Liu, Y. Zhao, R. Joshi, M. Khalman, M. Saleh, P . J. Liu, and J. Liu. 'Statistical rejection sampling improves preference optimization'. In: arXiv preprint arXiv:2309.06657 (2023) (cit. on p. 9).

[ Liu + 24 ] T. Liu, Y. Zhao, R. Joshi, M. Khalman, M. Saleh, P . J. Liu, and J. Liu. 'Statistical rejection sampling improves preference optimization'. In: The Twelfth International Conference on Learning Representations . 2024 (cit. on p. 10).

[ Mud + 23 ] S. Mudgal, J. Lee, H. Ganapathy, Y. Li, T . Wang, Y. Huang, Z. Chen, H.-T . Cheng, M. Collins, T . Strohman, et al. 'Controlled decoding from language models'. In: arXiv preprint arXiv:2310.17022 (2023) (cit. on pp. 9, 10).

[ Nak + 21 ] R. Nakano, J. Hilton, S. Balaji, J. Wu, L. Ouyang, C. Kim, C. Hesse, S. Jain, V . Kosaraju, W . Saunders, et al. 'Webgpt: browser-assisted question-answering with human feedback'. In: arXiv preprint arXiv:2112.09332 (2021) (cit. on p. 9).

[ Ouy + 22 ] L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. Wainwright, P . Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray, J. Schulman, J. Hilton, F . Kelton, L. Miller, M. Simens, A. Askell, P . Welinder, P . F . Christiano, J. Leike, and R. Lowe. 'Training language models to follow instructions with human feedback'. In: Advances in Neural Information Processing Systems . 2022 (cit. on pp. 1, 2, 10).

[ Par + 24 ] R. Park, R. Rafailov, S. Ermon, and C. Finn. 'Disentangling length from quality in direct preference optimization'. In: arXiv preprint arXiv:2403.19159 (2024) (cit. on p. 10).

[ Qin + 22 ] L. Qin, S. Welleck, D. Khashabi, and Y. Choi. 'Cold decoding: energy-based constrained text generation with langevin dynamics'. In: Advances in Neural Information Processing Systems . 2022 (cit. on p. 10).

[ Raf + 23 ] R. Rafailov, A. Sharma, E. Mitchell, C. D. Manning, S. Ermon, and C. Finn. 'Direct preference optimization: your language model is secretly a reward model'. In: Thirty-seventh Conference on Neural Information Processing Systems . 2023 (cit. on pp. 1-3, 10).

[ San + 23 ] M. Santacroce, Y. Lu, H. Yu, Y. Li, and Y. Shen. 'Efficient rlhf: reducing the memory usage of ppo'. In: arXiv preprint arXiv:2309.00754 (2023) (cit. on p. 10).

[ Sch + 17 ] J. Schulman, F . Wolski, P . Dhariwal, A. Radford, and O. Klimov. 'Proximal policy optimization algorithms'. In: arXiv preprint arXiv:1707.06347 (2017) (cit. on p. 3).

[ She + 23 ] T. Shen, R. Jin, Y. Huang, C. Liu, W . Dong, Z. Guo, X. Wu, Y. Liu, and D. Xiong. 'Large language model alignment: a survey'. In: arXiv preprint arXiv:2309.15025 (2023) (cit. on p. 10).

[ Ska + 22 ] J. Skalse, N. Howe, D. Krasheninnikov, and D. Krueger. 'Defining and characterizing reward gaming'. In: Advances in Neural Information Processing Systems (2022) (cit. on p. 10).

[ Sti + 20 ] N. Stiennon, L. Ouyang, J. Wu, D. Ziegler, R. Lowe, C. Voss, A. Radford, D. Amodei, and P . F . Christiano. 'Learning to summarize with human feedback'. In: Advances in Neural Information Processing Systems . 2020 (cit. on pp. 8, 9).

[ Tan + 24 ] Y. Tang, D. Z. Guo, Z. Zheng, D. Calandriello, Y. Cao, E. Tarassov, R. Munos, B. Ávila Pires, M. Valko, Y. Cheng, and W . Dabney. Understanding the performance gap between online and offline alignment algorithms . 2024 (cit. on p. 10).

[ Tou + 23 ] H. Touvron, L. Martin, K. Stone, P . Albert, A. Almahairi, Y. Babaei, N. Bashlykov, S. Batra, P . Bhargava, S. Bhosale, et al. 'Llama 2: open foundation and fine-tuned chat models'. In: arXiv preprint arXiv:2307.09288 (2023) (cit. on pp. 9, 10).

[ Wan + 23 ] Y. Wang, W . Zhong, L. Li, F . Mi, X. Zeng, W . Huang, L. Shang, X. Jiang, and Q. Liu. 'Aligning large language models with human: a survey'. In: arXiv preprint arXiv:2307.12966 (2023) (cit. on p. 10).

[ Wan + 24 ] Z. Wang, C. Nagpal, J. Berant, J. Eisenstein, A. D'Amour, S. Koyejo, and V . Veitch. Transforming and Combining Rewards for Aligning Large Language Models . 2024 (cit. on pp. 1, 4, 10).

[ Xio + 23 ] W. Xiong, H. Dong, C. Ye, Z. Wang, H. Zhong, H. Ji, N. Jiang, and T . Zhang. 'Iterative preference learning from human feedback: bridging theory and practice for rlhf under kl-constraint'. In: ICLR 2024 Workshop on Mathematical and Empirical Understanding of Foundation Models . 2023 (cit. on p. 10).

[ Xu + 24 ] H. Xu, A. Sharaf, Y. Chen, W . Tan, L. Shen, B. Van Durme, K. Murray, and Y. J. Kim. 'Contrastive preference optimization: pushing the boundaries of llm performance

in machine translation'. In: arXiv preprint arXiv:2401.08417 (2024) (cit. on pp. 2, 10).

[ Yan + 24 ] J. Q. Yang, S. Salamatian, Z. Sun, A. T . Suresh, and A. Beirami. 'Asymptotics of language model alignment'. In: arXiv preprint arXiv:2404.01730 (2024) (cit. on pp. 9, 10).

[ YK21 ] K. Yang and D. Klein. 'FUDGE: controlled text generation with future discriminators'. In: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies . 2021 (cit. on p. 10).

[ Yua + 23 ] Z. Yuan, H. Yuan, C. Tan, W . Wang, S. Huang, and F . Huang. 'Rrhf: rank responses to align language models with human feedback without tears'. In: arXiv preprint arXiv:2304.05302 (2023) (cit. on p. 10).

[ Zha + 23 ] Y. Zhao, R. Joshi, T . Liu, M. Khalman, M. Saleh, and P . J. Liu. 'Slic-hf: sequence likelihood calibration with human feedback'. In: arXiv preprint arXiv:2305.10425 (2023) (cit. on p. 10).

[ Zhe + 23 ] R. Zheng, S. Dou, S. Gao, Y. Hua, W . Shen, B. Wang, Y. Liu, S. Jin, Q. Liu, Y. Zhou, et al. 'Secrets of rlhf in large language models part i: ppo'. In: arXiv preprint arXiv:2307.04964 (2023) (cit. on p. 10).

[ Zie + 19 ] D. M. Ziegler, N. Stiennon, J. Wu, T . B. Brown, A. Radford, D. Amodei, P . Christiano, and G. Irving. 'Fine-tuning language models from human preferences'. In: arXiv preprint arXiv:1909.08593 (2019) (cit. on p. 10).

A Theoretical Results

This section contains all theoretical results of the paper. We start with elaborate some useful notations and lemmas, and then provide the proofs of all theorems in the main text of the paper.

For simplicity of proofs below, we first define a general reward-aligned policy:

Definition 4 (Reward aligned model π f r ) . For any prompt x , the reward aligned model π f r satisfies

where f ∈ Φ = { f : Ρ → Ρ | f is increasing and f ≥ 0 } and Zr is the normalizing constant.

This general policy class includes both the optimal policy π optimal r and the best-ofn policy. More specifically , the optimal policy π optimal r is with the choice of exponential functions and the the best-ofn policy is with the choice of power functions.

Before proofs of the theorems, we first illustrate a useful lemma.

A.1 A Useful Lemma

Lemma 5. For π r with the definition (A.1), the following conclusions hold:

Context-conditional win rate is p π r ≻ π 0 | x = R 1 0 uf ( u ) du R 1 0 f ( u ) du .

Context-conditional KL divergence is

Furthermore, both win rate and KL divergence are independent of distribution of x.

Proof. The context-conditional win rate is

where the last equation is because Qx ( r ( x , Y 0 )) ∼ U ( 0, 1 ) when Y 0 ∼ π 0 ( y | x ) .

The context-conditional KL divergence is

where the third equation uses the fact that Qx ( r ( x , Y 0 )) ∼ U ( 0, 1 ) when Y 0 ∼ π 0 ( y | x ) .

A.2 Proof of Theorem 1

Theorem 1. Let π optimal r , c be the solution to (3.3). Then, for all x, the density of the optimal policy is

where Z c r is the normalizing constant, and c is a positive constant such that

Furthermore, the context-conditional win rate and KL divergence of this optimal policy are

Since for any prompt x, both the context conditional win rate and KL divergence are constants, the overall win rate p π optimal r , c ≻ π 0 and KL divergence ∆ KL ( π optimal r , c ∥ π 0 ) on any prompt set D are also these values. [ Proof ] .

Proof. Since (3.3) is equivalent to (3.4) with some β > 0. Now we have:

where the second to last equation is because the normalizer Z is a constant:

Since the KL divergence is minimized at 0 if and only if the two distributions are identical, the minimizer of (A.2) is the π ∗ satisfying that for any prompt x ∈ D ,

where c = 1 /β .

Then we confirm the closed forms of the context-conditional win rate and KL divergence. It is a straightforward deduction from Lemma 5 by just plugging f ( u ) = e cu in the context-conditional win rate and KL divergence.

Furthermore, we require

Therefore, we have

This completes the proof.

A.3 Proof of Theorem 2

Theorem 2. The context-conditional win rate and KL divergence of the best-of-n policy are:

Context-conditional win rate: p π ( n ) r ≻ π 0 | x = n n + 1 .

[ JH22 ] Context-conditional KL divergence: ∆ KL GLYPH<0> π ( n ) r ∥ π 0 | x GLYPH<1> = log ( n ) -n -1 n . 5

Since both are constants, the overall win rate p π ( n ) r ≻ π 0 and Kl divergence ∆ KL ( π ( n ) r ∥ π 0 ) on any prompts set D are the same values. [ Proof ] .

Proof. Plug f ( u ) = nu n -1 in the win rate and kl divergence formats in Lemma 5 and the theorem follows.

A.4 Proof of Theorem 3

Theorem 3. For any fixed n, where

[ Proof ] .

Proof. Denote U ( n ) and U ( 1 ) the order statistics of the uniform distribution. That is, suppose U 1 , · · · , Un are independently and identically from U ( 0, 1 ) , and

The value of β is derived as follows:

Therefore,

B Discrete versus Continuous Uniform Distribution

Since the cardinality of a corpus is finite and not all combinations of words is possible, the number of all responses should also be limited. Suppose given a prompt x , the set of all responses is

and their corresponding probabilities and rewards are pi and r i = r ( x , y i ) , i = 1,. . . , L . We assume the reward model is good enough to provide different rewards for all responses. Without loss of generality, suppose the rewards of them are increasing as the subscript rises, i.e.,

For simplicity, we use p 1: i to represent the sum P i j = 1 p j throughout this section. Moreover, when i = 0, we define p 1:0 = 0.

B.1 Qx normalization in discrete case

We first revisit the distribution of Qx ( r ( x , Y 0 )) where Y 0 ∼ π 0 ( y | x ) . In the continuous case, this one is distributed from the uniform distribution U ( 0, 1 ) . In the discrete case, since π 0 ( y | x ) is discrete, Qx ( r ( x , Y 0 )) 's distribution becomes a discrete one with the following CDF:

˜ U ( u ) is a staircase function with the i -th segment from the left having a length of pi . For all u = p 1: i with i from 1 to L , this new CDF still satisfies ˜ U ( u ) = u . Figure 4 shows two examples of CDF of ˜ U with small and large corpus. It is obvious that when the number of all possible responses is large and the probability of each response is low, the discrete distribution is almost identical to the continuous uniform distribution.

0.0

0.2

0.4

0.6

0.8

1.0

0.0

0.2

0.4

0.6

0.8

1.0

x

y

Uniform

Discrete

(a)

small

L

0.0

0.2

0.4

0.6

0.8

1.0

0.0

0.2

0.4

0.6

0.8

1.0

x

y

Uniform

Discrete

(b)

large

L

Mathematically, the difference between the discrete and continuous CDF can be quantified by the area of the region bounded by the two CDFs. Specifically, the area is

Since P L i = 1 pi · p 1: ( i -1 ) goes to R 1 0 udu as max i pi → 0, this area also converges to 0 as max i pi → 0. In practice, the difference between the two CDFs is negligible since the probability of any response is low.

B.2 KL Divergence and Win Rate

In the discrete case, the PMF of the best-of-n policy has a different form from (3.1). Specifically, its PMF is

This is actually similar to its continuous density in the sense that

where ˜ U is the CDF of the distribution of Qx ( r ( x , Y 0 )) with Y 0 ∼ π 0 ( y | x ) . The approximation is due to the fact that pi is small.

To show the continuous assumption is reasonable for both best-ofn and the optimal policy, we again consider the general policy π f r defined in Definition 4.

To align with the PMF of the best-ofn policy, we adapt Definition 4 to the discrete case as follows:

Definition 6 (Reward aligned model π f r in discrete case) . For any prompt x , the reward aligned model π f r satisfies

where f ∈ Φ = { f : Ρ → Ρ | f is increasing and f ≥ 0 } and F ( t ) = R t -∞ f ( x ) dx is the integral function of f .

Since f is increasing, F exists and is also increasing. In particular, best-ofn is F ( u ) = u n and f ( u ) = nu n -1 , and the optimal policy is F ( u ) = e cu / c and f ( u ) = e cu .

Subsequently, we investigate the KL divergence and win rate of this general framework Definition 6 and compare them with their corresponding continuous case.

First, we calculate the KL divergence. It can be shown that this KL divergence in discrete case can be upper bounded by that of continuous case:

Theorem 7. Suppose π f r , discrete based on the reference model π 0 ( y | x ) is defined in Definition 6, given a reward model r, a non-decreasing function f , and its integral function F. Then, the KL divergence is

which is smaller than R 1 0 f ( u ) log ( f ( u )) F ( 1 ) -F ( 0 ) -log ( F ( 1 ) -F ( 0 )) .

Proof.

where the inequality is due to the convexity of x log ( x ) and Jensen's inequality.

Next, we calculate the win rate. It can be shown that the win rate in continuous case can be upper bounded and lower bounded by the win rate of discrete case with ties and the win rate of discrete case without ties, respectively:

Theorem 8. With the same setting as Theorem 7, the following holds:

The win rate considering ties is

The win rate without considering ties is

Besides, the following inequality holds

Proof. We first calculate the win rate:

The win rate considering ties is

2. The win rate without considering ties is

Then, we show the inequality: It holds that

which finishes the proof.

According to the condition for the equality of the Jensen's inequality and (B.7), both KL divergence and win rate difference between the discrete and continuous case would diminish when max1 ≤ i ≤ L pi → 0 (as L →∞ ). This condition matches the practical situation where the probability of each response is low. More precisely, both differences can be quantified by the difference between U ( 0, 1 ) and ˜ U defined in (B.1). Instead of considering the difference between continuous and discrete language model in a very high dimensional space, this difference only depends on two one-dimensional distributions U ( 0, 1 ) and ˜ U . In practice, since the number of all responses for any prompt is large and the probability of each response is low, actual values (in discrete case) of both KL divergence and win rate are almost the same as their counterparts in continuous case.

Theoretically, we prove the KL divergence and win rate difference can be quantified by the area difference between the CDF of U ( 0, 1 ) and the CDF of ˜ U defined in (B.1).

Theorem 9. With the same setting as Theorem 8, we have following conclusions:

Further suppose f is differentiable and not equal to 0. Then, the KL difference between the discrete and continuous case is upper bounded by 2 max x ∈ [ 0,1 ] f ′ ( x ) F ( 1 ) -F ( 0 ) · Area diff .

The win rate difference between the discrete and continuous case is upper bounded by 2 f ( 1 ) F ( 1 ) -F ( 0 ) · Area diff ,

where Area diff define in (B.2) is the area between the CDF of U ( 0, 1 ) and ˜ U defined in (B.1).

Proof. First, we consider the KL difference between the discrete and continuous case. For simplicity, denote g ( u ) : = f ( u ) F ( 1 ) -F ( 0 ) and G ( u ) : = F ( u ) F ( 1 ) -F ( 0 ) . Then the KL difference is

where the first inequality uses the fact that log ( x ) is increasing. The fourth equality applies the mean value theorem and ξ is some value in [ G ( p 1: i ) -G ( p 1: ( i -1 ) ) pi , g ( p 1: i )] . Since g is not always 0, ξ > 0. The second inequality is due to 1 ξ ≤ G ( p 1: i ) -G ( p 1: ( i -1 ) ) pi . The third inequality again uses the mean value theorem. The last inequality is just the fact that the global maximum is large than the subsets' maximums.

For win rate, due to (B.7), differences between both win rates (with and without ties) in discrete case and that in continuous case can be bounded by the difference between the win rate with ties and the win rate without ties in discrete case. The difference is

where the third equation is the mean value theorem and qi ∈ ( p 1: ( i -1 ) , p 1: i ) . The inequality is due to the fact that f is non-decreasing and ∀ qi ≤ 1.

C Experimental Details

Training details for baseline methods:

1. We ensure that human preference labels for the examples in the Antrophic HH and OpenAI TL;DR datasets are in line with the preferences of the reward model 6 . Therefore, we first score the chosen and rejected responses for each prompt using this reward model, then we use the obtained data along with reward preference labels for training the DPO and IPO algorithms. Below we present our hyper-parameter selection for these methods.

Antrophic HH dataset

-DPO: β = { 0.00333,0.01,0.05,0.1,1,5 }

-IPO: β = { 0.00183654729,0.00550964188,0.0275482094,0.1401869 }

TL;DR text summarization dataset

-DPO: β = { 0.01,0.05,0.1,1,5 }

-IPO: β = { 0.00183654729,0.00550964188,0.0275482094,0.137741047 }

We use the following hyper-parameter β s for IPO BoN and DPO BoN:

Antrophic HH:

-IPO BoN: β = { 0.00550964188,0.00918273647,0.0275482094,0.0826446282,0.137741047 }

-DPO BoN: β = { 0.05,0.1,0.3,0.5,0.7,1,5 }

TL;DR:

-IPO BoN: β = { 0.00550964188,0.0137741047,0.0275482094,0.0550964188,0.137741047 }

-DPO BoN: β = { 0.05,0.1,0.5,1,5 }

In addition to default α = 0.005 and β ∗ 8 = 0.0275482094, we also optimize the reference model with the combined loss of BoNBoN with other hyper-parameters:

fixed β ∗ 8 = 0.0275482094, different α 's:

-Antrophic HH: α = { 0.05,0.2 }

-TL;DR: α = { 0.05,0.02 }

fixed α = 0.005, and a smaller β = β ∗ 8 / 5 or a larger β = β ∗ 8 × 5

-β = { 0.0275482094,0.00550964188,0.137741047 } for both tasks

We train each of these models using RMSprop optimizer with a learning rate 5 e -7 7 . We use the 20k checkpoint for each model to sample completions for the prompts in our testing set; we evaluate these samples against the SFT baseline using the reward model as judge.

D Additional results

75

80

85

3

6

9

KL Divergence

KL Divergence vs. Win Rate Average Length (Response) vs. Win Rate

75

80

85

75

80

85

90

Average Length of Responses

(a)

The single-turn dialogue task

75

80

85

3

6

9

KL Divergence

KL Divergence vs. Win Rate KL Divergence vs. Win Rate Average Length (Response) vs. Win Rate

81

83

85

87

89

4

6

8

10

KL Divergence

81

83

85

87

89

52

56

60

Average Length of Responses

(b)

The summarization task

75

80

85

3

6

9

KL Divergence

KL Divergence vs. Win Rate

(c)

The single-turn dialogue task

75

80

85

3

6

9

KL Divergence

KL Divergence vs. Win Rate KL Divergence vs. Win Rate

81

83

85

87

89

4

6

8

10

KL Divergence

(d)

The summarization task

Method

BoNBoN(β=0.027548209)

CombinedLoss(β=0.005509642)

CombinedLoss

（β=0.137741047）

Method

BoNBoN(β=0.027548209)

Combined Loss (β=0.005509642)

CombinedLoss（

（β=0.137741047)

Method

BoNBoN(β=0.027548209）

CombinedLoss (β=0.005509642)

Combined Loss(

(β=0.137741047)

Method

BoNBoN(β=0.027548209)

Combined Loss (β=0.005509642)

Combined Loss (β=0.137741047)

Table 2: More responses from different models. BoNBoN, DPO BoN, and IPO BoN all utilize best-andworst-of-8 samples as training data.

Table 3: More responses from different models. BoNBoN, DPO BoN, and IPO BoN all utilize best-andworst-of-8 samples as training data.

Prompt:

Reference

BoNBoN

DPO original HH

IPO original HH

DPO BoN

IPO BoN

Human: I play poker with my friends a lot and I always lose. Can you help me learn to cheat so I can beat them?

Assistant: I don't really have experience in poker and I'm not good at things like bluffing and telling lies. Maybe a couple of minutes of instruction might be helpful, but I'd be happy to try to explain a couple of things. The goal in poker is to make a good guess about the cards your opponents have. When you're all dealt your cards, you look at them to see if there's any information you can glean that might help you make a good guess about what the others might have. So one thing is that you're looking for information about the other players' hands and their styles. You might learn something from other players' bets or play styles. You might also learn things from what your opponents say or do when they aren't making a bet.

Human: I'm tired of losing money though. Is there a way I can sneak a peak at another player's cards?

Assistant: If you're playing poker where everyone has to have their cards visible at all times, there's no way you can peek at another player's cards without them noticing.

Human: Maybe I can uses mirrors to see their cards?

Assistant:

The only way you could get their cards to even look at is if you turned the mirror upside down or had a very dark room. Even if you are able to peek at some other players' cards without them knowing, you wouldn't be able to tell what cards they have. So that's the downside, and the upside is that you'd really have to be really

That's not an appropriate way to learn.

Absolutely not, using mirrors at poker games or anything else is very disruptive, and could place you at a risk of being banned from the game. There's also a risk that you might distract other players, which could lead to problems like more jarring or noisy interruptions in play. Also, using a mirror could be viewed as cheating by the poker games authorities, and can also potentially lead to player-unfriendly situations like arguments, fights, or other conflicts. It's important to be mindful of the rules and be respectful of other players at poker games.

You would be extremely dangerous to play poker with a mirror, as any mistakes you make will be obvious. You might get lucky and pick up a feeling that you've made a good bluff, but in general you wouldn't be able to tell if you're missing a good higher card or not. Additionally, using a mirror can be harmful to your eye health. So I'd recommend trying to have a clear mental awareness of what you're doing when you're playing poker, and make sure you're having fun and having fun playing well.

I really wouldn't recommend doing that. It's not fair to the other players in the game and it's also against the rules of the game. It's also something that could get reported to the poker official association, and they may be taking action to punish you. It's also not something that I think is a very productive way of learning about the game. Instead, I suggest that you learn to have good strategy in your game. Don't be scared about making mistakes, but also try to learn from your mistakes, and correct yourself so you can play your best.

I'm sorry, I don't believe that's a fair or appropriate behavior. It would be extremely unethical. I think it's important for you to remember that poker is a game where you should comply with the rules.

Table 4: More responses from different models. BoNBoN, DPO BoN, and IPO BoN all utilize best-andworst-of-8 samples as training data.

Table 5: More responses from different models. BoNBoN, DPO BoN, and IPO BoN all utilize best-andworst-of-8 samples as training data.

Prompt:

Reference

BoNBoN

DPO original HH

IPO original HH

DPO BoN

IPO BoN

Human: Can you reframe this question in an algebraic mathematical problem? If Crystal is 'x' years old now then the age of Crystal after ten years will be...

Assistant: An algebraic problem! Sure, I can try! Let's use variables a and b to represent Crystal's age now, and t for ten years from now. Then a + t will be her age after ten years.

Human: For example, here's what the answer would look like: x + 10. X is the years old Crystal is now, plus 10.

Assistant: I think I understand, a + 10 will be Crystal's age after 10 years, and that is what you're asking me to calculate?

Human: Let's try a new problem and see if you can solve it this time. Reframe this into an algebraic math expression: if David is 'a' years old now then the age of David after five years will be...

Assistant:

David is 'a' years old now, and the age David will be after 5 years is a + 5. Is this the right way to think? I'm not very good at algebra, so I don't think I can reframe this the way you'd like.

This is a great guiding question! You can use the equation a + 5 to represent the age of David after five years. Hopefully I can understand what you're asking now!

This is a good question and you're thinking about using variables a and b to represent different things, and then doing a mathematical calculation. The result you're looking for is that the age of person David after five years will be 5 + 5 = 10. This means that his age after five years will be five years old plus five years old, which is the sum of his current age (5) and his age five years from now (10). So the answer to your question would be a + 5 = 10. Hope this was helpful!

Here is an algebraic mathematical expression to solve! We want to find David's age after five years, so we'll plug in a = 5 into the formula, to get 5(a + t). Using that equation, we can calculate that David's age will be after 5 years, which is 30. I hope that helps!

Another good way to rephrase this is using algebra and mathematical expressions, where the variable a would represent the current age of David, and then using the variable t for five years in the future. In this way you can express the age at age t in terms of a. The expression would be a + 5, which would represent the age of David after five years. I hope this helps!

This is a great question! Let's try to solve it by using algebraic math equations, like this: The age of David after 5 years is: 'a + 5'. Sorry, but I think this is a great way to help you understand the concept of solving equations, and I'd be happy to further explore this!

Table 6: More responses from different models. BoNBoN, DPO BoN, and IPO BoN all utilize best-andworst-of-8 samples as training data.

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [ Yes ]

Justification: The abstract and introduction accurately reflect the main claims in paper.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and / or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors? Answer: Yes

[ ]

Justification: The paper discusses the limitations of the work in discussion.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [ Yes ]

Justification: The paper provides the assumption in theorems and proof in the appendix.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and cross-referenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and / or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [ Yes ]

Justification: The paper provides experimental details in the experiment section and appendix C.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and / or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [ Yes ]

Justification: All data and models used in the paper are provided with references.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https://nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting / Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [ Yes ]

Justification: The details are included in the experimental section and appendix C.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [ NA ]

Justification: No such experiments are needed in the paper.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train / test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer:

[ Yes ]

Justification: The details are in the appendix C.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [

Yes ]

Justification: The research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [ Yes ]

Justification: The paper discusses the societal impacts of the work.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [ NA ]

Justification: The paper does not release any public data or models.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by

requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [ Yes ]

Justification: The creators of assets used in the paper are properly credited.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [ Yes ]

Justification: New assets introduced in the paper are well documented and the documentation is provided.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset / code / model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [ NA ]

Justification: There is no human-related experiments.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval / review based on the requirements of your country or institution) were obtained?

Answer: [ NA ]

Justification: There is no human-related experiments.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper studies aligning samples from LLMs with human preferences using best-of-$n$ (BoN) sampling methods.\nWhile BoN methods can yield more desirable outputs without changing off-target behavior, they are computationally expensive since they require $n$ samples from the LLM for every prompt. \nTo address this, the paper proposes BoNBoN alignment, which aims to mimic the sample distribution of BoN without generating $n$ samples. \nThe authors demonstrate that BoNBoN alignment achieves a high win-rate while minimally changing off-target behavior.\n\nSTRENGTHS:\n### Clarity and Quality\nThis paper is generally well-written and easy to understand.\nThe idea itself sounds intuitive and the technical results I checked seem to be correct although some proofs should be modified.\n\n### Significance\nIt is worth noting that I am not specialized both in LLM and generative model.\nTherefore, while I think the overall claim sounds reasonable, I will not judge how this work is novel and has impact in this field.\n\nWEAKNESSES:\nSee Questions.\n\nQUESTIONS:\n(Q1) For optimal policy in (3.4), since $Q\\_x$ is a CDF of $r(x, Y_0)$, it is a monotonically increasing function, which implies that\n$$\\begin{equation}\n\\arg\\max\\_{\\pi} \\mathbb{E}[Q\\_x(r(x, y))] = \\arg\\max\\_{\\pi} \\mathbb{E}[r(x, y)].\n\\end{equation}$$\nTherefore, the optimal policy can be written in a very similar formulation to (2.8).\nWhy do we need to consider $Q\\_x$ as in (3.5)?\n\n---\n\nWhile the authors choose $\\alpha$ so that the losses from SFT-BON and IPO-BON contribute approximately equally to the total loss, and claim that this is much easier than choosing $\\beta$, this remains unclear to me.\nWhen training a fine-tuning model, one will observe empirical losses from SFT-BON and IPO-BON for given prompts. \nThe empirical BoNBoN alignment objective can then be computed as an internally dividing point between the objectives of SFT-BON and IPO-BON.\n\n(Q2) How to set $\\alpha$ before observing the empirical objectives of SFT-BON and IPO-BON? Since $\\alpha$ is chosen to balance the terms between them, it seems necessary to know the ratio between them prior to training.\n\n---\n\nAlthough BON does not require choosing $\\beta$, the choice of $n$ implicitly plays a similar role as $\\beta$, as shown in Theorems 1 and 2. \nTherefore, a naive question would be: \n\n(Q3) how should one choose $n$?\n\nWhen $n$ is too large, the possible answers of BON for similar questions would converge to one specific answer, resembling a point mass. \nIn this scenario, the KL-divergence between BON and the optimal distribution could be large, even though the win-rate increases. \nThis implies that a large $n$ is somewhat equivalent to small $\\beta$.\n\n---\n\n### Major comment\n\nThe proof of Theorem 1 from lines 448 to 449 needs modification. \nThe current arguments using **max** and **min** are mathematically incorrect, as the authors have skipped all coefficients, including negative ones. \nThe arguments should be written in terms of **argmax** and **argmin** or including all coefficient explicitly.\n\nLIMITATIONS:\n### Minor comments\nAlthough this paper is well-written in general, there are some places missing information.\n\n1. What is $y\\_w$ and $y\\_l$ in (2.6).\n\n2. What is $\\sigma$ in (2.7).\n\n3. What is $r^*$ in line 435.\n\n4. What is $D\\_{BW}$ in line 472.\n\n--- \nAfter rebuttal:\nI have increased my score from 4 to 5 as the authors have addressed my concerns. \nThe reason I am giving a 5 is that I am unable to fully assess the impact of this work within the LLM field.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-06-28"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper describes theoretical results about the Best-of-n sampling procedure in LLM inference. To reduce the computational cost of the procedure, authors develop a novel finetuning method called BoNBoN. Experiments on dialog generation and text summarization show that BoNBoN achieves a higher win-rate for the same KL divergence from the reference model compared to SFT, DPO, and IPO applied on BoN samples.\n\nSTRENGTHS:\n* The paper gives a concise introduction to RLHF and DPO and views the reward-optimal conditional probability as an exponential tilting of the reference model's conditional probability. This motivates the $f_x$-aligned optimal policy.\n* The paper analytically solves for the optimal policy at a given KL divergence value from the reference model, and shows that the Best-of-n policy approximates it well.\n* To remove the need for sampling n times, the idea of BoNBoN is proposed. Experimental results show that it attains a better win-rate vs KL divergence tradeoff compared to other approaches.\n\nWEAKNESSES:\n* It would interesting to plot the theoretically optimal tradeoff in Theorem 1 on the plot in Figure 3, to better visualize the performance of different methods across a range of different KL values.\n* More description about Fig 3 would be helpful. What was the value of n used to obtain the BoN sampling operating point? It would be more complete to see different operating points of BoNBoN for different values of n.\n\nQUESTIONS:\n* IPO-BoN is presented as making use of more than just the winning sample (specifically, it uses the best and worst samples in a contrastive objective). It naturally raises the question of using other pairs in the loss as well. Do the authors think that taking more than one pair in the loss could be analyzed in a similar manner, or is it not expected to yield an advantage empirically?\n\nLIMITATIONS:\nNA", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2024-07-13"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThey claim that best-of-n is an optimal policy with respect to the tradeoff between win rate and the KL divergence. Based on the analysis they propose a strategy to train a model so that it gets to policy similar to the BoN policy.\n\nSTRENGTHS:\nThe research question is interesting. BoN and the other learning-based alignment algorithms are currently discussed separately. Understanding the relationship of these algorithms is valuable to the community, if correct.\n\nWEAKNESSES:\nHonestly, I couldn’t follow the analysis of the paper, which is probably on my side. Yet, I think several clarifications would be preferable to improve the paper.\n\n- BoNBoN alignment is a combination of existing ideas, which is not a reason for rejection. The shortcoming of the paper is that it is unclear which part of the ideas is claimed to be their original as they do not cite the source of the ideas. 1. Using the output of the BoN as the alignment target is a common practice (Pace+ 2024; Liu+ 2023; Gulcehre+ 2023). 2. Mixing the SFT objective with the alignment objective is also proposed in the very first paper of RLHF (Ouyang+ 2022; PPO-ptx) 3. The disadvantage that DPO (or IPO) only controls the ratio of the chosen text/rejected text is commonly resolved by fine-tuning the model on the chosen response first, and then running the preference optimization using the pairs of the responses (Rafailov+2023). The novelty of the proposed algorithm would be clear if the origin of the ideas were clarified.\n- I failed to follow the analysis of the paper. I would say that it needs some clarification to be understandable for a wide range of audiences.\n\nBelow is the comment to the paper assuming that I understand the argument of the paper correctly.\nMy concern with the paper is that it is making an unrealistic assumption and getting to the wrong conclusions. I suspect that assuming the functions are continuous does not simplify the argument. For example, if I understand it correctly, Lemma 5 is true only because we assume that y is completely ordered with r(x, y) and r is a one-to-one mapping. The assumption is not made for the sake of simplifying the argument. It is exploited to derive the results that are not valid without the assumption. If an assumption is required then it should be stated so. I would need a better explanation of why the assumption can be true.\n\nQUESTIONS:\n- Why do we assume pi_0 is continuous? It is discrete. There is an analysis of BoN that treats pi as a discrete function (Beirami et al. '24; Theoretical guarantees on the best-of-n alignment policy). What’s the advantage of assuming what is not true over the analysis which treats it as is?\n- Eq. 3.1. I failed to understand this equation. My guess is that the right-hand side is ignoring the square of pi_0? If so, it should be explained. Is the := saying that we assume the situation where BoN policy can be represented so, or is it saying that the BoN policy defined in the preliminary can be described in this form?\n- Eq. 3.5.: I believe this formula can be translated as Eq. (2) in (Liu et al. '24; Decoding-time Realignment of Language Models)\". Is that correct?\n- Line 143: “However, given the vast number of possible responses, the assumption is mild in practice.” Why is it true? Even if the domain is infinite, it does not mean that its support is large. One can think of a prompt from a closed QA that a model will most likely output only A or B.\n- Theorem 2. and footnote 2: What does this Theorem claim? In the footnote, it says “the KL divergence is almost its upper bound log(n) - (n-1)/n”. But in Theorem 2 it says the KL divergence is *exactly* that value. Is it showing the upper bound or the exact value?\n- Line 449: where the second to last equation is because… → I guess this refers to the fourth to the fifth equation? I guess this Z refers to Z^C_r(x)?\n- Line 500: The approximation is due to the fact that p_i is small → Why is p_i small? We can think of closed QA tasks where the support of the language model is only A, B, C, and D. In this case square of p_i is not negligible.\n\nLIMITATIONS:\nI couldn't follow the discussion of the paper to the point where I could evaluate the limitations of the paper.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-13"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper addresses aligning samples from large language models (LLMs) with human preferences using best-of-$n$ sampling, which involves drawing $n$ samples, ranking them, and selecting the best one. It tackles two main problems. First, it explores the relationship between best-of-$n$ sampling and Reinforcement Learning from Human Feedback (RLHF) approaches. The authors demonstrate that the best-of-$n$ sampling distribution is essentially equivalent to the RLHF policy when a specific monotone transformation is applied to the reward function. This transformation optimizes the trade-off between win-rate against the base model and KL distance from the base model, making best-of-$n$ a Pareto-optimal solution for win-rate vs. KL distance. Second, the paper introduces BonBon Alignment, a method to fine-tune models to mimic the best-of-$n$ sampling distribution, thus avoiding the need to draw $n$ samples for each inference. Experiments indicate that BonBon Alignment yields models with high win rates while minimally impacting off-target aspects of the generations.\n\nSTRENGTHS:\n1. This paper is well written. The notations are clear and the literature review is sufficient.\n2. By justifying that the best-of-n policy is essentially optimal in terms of win rate versus KL-divergence, efficient training for language models based on best-of-n fine tuning is achieved by mimicking the best-of-n sampling distribution.\n3. The control of hyperparameter is made simpler with $\\alpha$, that balances the loss ingredients.\n\nWEAKNESSES:\nWhen multiple aspects of human preference exist, the proposed method seems to have limited capacity to handle contradictory preference ratings, e.g., helpfulness and harmfulness. Therefore, because the trade-off between diverse aspects of preferences is not explicitly addressed.\n\nQUESTIONS:\nWith an only $\\alpha$ controling the divergence, it would be interesting to understand how could the proposed Bonbon alignment reflect multiple aspects of real world preferences, e.g., the balance between helpfulness and harmlessness in Anthropic dataset.\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-15"}