Bi-Factorial Preference Optimization: Balancing Safety-Helpfulness in Language Models

## Abstract

Abstract Fine-tuning large language models (LLMs) on human preferences, typically through reinforcement learning from human feedback (RLHF), has proven successful in enhancing their capabilities. However, ensuring the safety of LLMs during the fine-tuning remains a critical concern, and mitigating the potential conflicts in safety and helpfulness is costly in RLHF. To address this issue, we propose a supervised learning framework called Bi-Factorial Preference Optimization (BFPO) , which re-parameterizes a joint RLHF objective of both safety and helpfulness into a single supervised learning objective. In the supervised optimization, a labeling function is used to capture global preferences ranking to balance both safety and helpfulness. To evaluate BFPO , we develop a benchmark including comprehensive discriminative and generative tasks for helpfulness and harmlessness. The results indicate that our method significantly outperforms existing approaches in both safety and helpfulness. Moreover, BFPO eliminates the need for human prompting and annotation in LLM fine-tuning while achieving the same level of safety as methods that heavily rely on human labor, with less than 10% of the computational resources. The training recipes and models will be released. Warning: This paper contains offensive or harmful content.

## 1 Introduction

Fine-tuning the large language models (LLMs) on human preferences, also known as model alignment, has been shown to greatly enhance their text generation abilities [, , ]. When prompted with well-formatted instructions, these models can generate helpful responses for various tasks like scientific questions answering [], creative writing [], coding [, ], and planning [, ].
However, with this instruction following ability, the models can also be prompted to generate harmful content, such as sexist or racist comments, suggestions for committing crimes, or sensitive medical advice [, , ]. Therefore, it is crucial to ensure that LLMs are both helpful and safe [, , ].

Figure: Figure 1: Four models are trained with different data sources and algorithms. Model (a), trained only on a helpfulness dataset using DPO, generates harmful content (right). Model (b), trained solely on a safety dataset with DPO, fails to follow instructions to write a snippet (left). Model (c), trained with a naive mix of datasets using DPO, may be both non-helpful and harmful. Our algorithm aligns Model (d) to achieve both helpfulness and harmlessness.
Refer to caption: x1.png

The challenge of improving both safety and helpfulness of LLMs arises from the inherent tension between these two objectives [, , ]. A perfectly safe model may refuse to answer even non-harmful questions (Figure 1-left, b), while a highly helpful model (Figure 1-right, a) may compromise safety.
Additionally, training a model on a mix of data annotated with different preference objectives can lead to issues, as shown with model (c) in Figure 1, where the model refuses to generate code (left) yet still produces harmful content (right).

To resolve this problem, recent studies propose to train separate reward models tailored to each objective, safety and helpfulness, and optimize LLMs via multi-objective RLHF, which aggregates reward scores over all objectives [, , , ]. However, developing a safety reward model requires a sufficient number of unsafe responses specific to the model being trained, which is both labor-intensive and computationally demanding [, ]. In contrast, supervised optimization, built upon re-parameterizing the RL objective into supervised loss, is more efficient in fine-tuning LLMs on human preferences [, , ]. However, current work typically focuses on re-parameterizing single reward RLHF objective within the supervised learning framework, and extending this re-parameterization to the multi-reward case is not straightforward [].

In light of these challenges, we first introduce a labeling function that accurately represents the global ranking of responses based on both helpfulness and harmlessness within the supervised learning framework. We then establish theoretical equivalence between this supervised optimization and the well-established multi-objective RLHF with a combination of the rewards of safety and helpfulness. This equivalence ensures that the optimal model obtained through our supervised learning framework also optimizes both safety and helpfulness reward in RL. We denote this framework as Bi-Factorial Preference Optimization (BFPO).
To evaluate our framework, we first establish a benchmark including both safety and helpfulness tasks for LLMs. Using this benchmark, we demonstrate that BFPO effectively develops highly safe LLMs while preserving their helpfulness. Our approach relies only on publicly available datasets, and achieves results comparable to those of methods requiring extensive human labeling efforts. Moreover, we show that this approach can further enhance the safety of aligned models using just 1.5K red teaming prompts, entirely eliminating the need for human annotation.
Our contributions are summarized as:

- •
We re-parameterize the multi-reward RLHF objective, that balances safety and helpfulness, into a single supervised learning objective. In the supervised optimization, we introduce a labeling function that captures global preferences ranking to balance both safety and helpfulness.
- •
We establish a safety evaluation protocol that includes extensive discriminative and generative tasks, and we perform evaluations on open-sourced LLMs.
- •
Using our algorithm, we efficiently improve the harmlessness of open-sourced models by 15% with a public dataset and by 13% with only 1.5K red teaming data, all while preserving helpfulness. Our method achieves safety scores comparable to those of labor-intensive methods without requiring human prompting or annotations.

## 2 Preliminary

Notation and Terminology.
Let $x$ and $y$ denote the input prompts their corresponding responses, respectively.
For any two responses, $y,y^{\prime}$ generated from a prompt $x$, a binary preference label $I(y\succ y^{\prime}|x)$ is provided by a human annotator to whether $y$ is preferred over $y^{\prime}$.
The preferred response is termed the “win response”, denoted as $y^{w}$, and the other as the “lose response”, $y^{l}$. A dataset $D=\{(x,y,y^{\prime},I(y\succ y^{\prime}|x))\}$ that contains prompts, multiple responses, and the human preferences over the responses is referred to as a preference dataset.

Following prior art [], we define the ground-truth preference $p^{*}$ between two responses $y,y^{\prime}$ as the expected preference label across a broad group of human annotators, *i.e*., $p^{*}(y\succ y^{\prime}|x)=\mathbb{E}\big{[}I(y\succ y^{\prime}|x)\big{]}$. The ground-truth score of a single response $y$ is then the expected value of its paired preferences with all other responses, *i.e*., $p^{*}(y|x)=\mathbb{E}_{y^{\prime}}\big{[}p^{*}(y\succ y^{\prime}|x)\big{]}$.

RLHF.
RLHF typically consists of two phases [, ]: supervised reward learning and policy optimization through reinforcement learning (RL). The training of the reward model $r_{\phi}$, parameterized by $\phi$, is framed by Bradley-Terry (BT) modeling [], which employs the logistic loss to maximize the distance between the output reward scores of win and lose responses,

$$ $\footnotesize\mathcal{L}_{r}(\phi)=-\mathbb{E}_{(x,y^{w},y^{l})\sim D}\big{[} \log\sigma(r_{\phi}(x,y^{w})-r_{\phi}(x,y^{l}))\big{]},$ (1) $$

where $\sigma$ is a sigmoid function, and $D$ is a preference dataset.
The trained reward model $r_{\phi}$ then provides reward scores for the RL phase. The language model $\pi_{\theta}$, or policy in the RL phase, is optimized with the objective of maximizing the KL-regularized reward [], *i.e*.,

$$ $\footnotesize\max_{\pi_{\theta}}\mathbb{E}_{x\sim D,y\sim\pi_{\theta}(y|x)} \big{[}r_{\phi}(x,y)-\tau\text{KL}\left[\pi_{\theta}(y|x)||\pi_{\text{ref}}(y| x)\right]\big{]},$ (2) $$

where $\tau$ is a penalty coefficient for the KL divergence term, which prevents the policy $\pi_{\theta}$ from significantly deviating from a reference policy $\pi_{\text{ref}}$. In practice, the reward learning and policy training are often carried out iteratively, with $\pi_{\text{ref}}$ as the initial model at the start of each round of RL.

Multi-objective RLHF. In multi-objective RLHF, Equation 2 is extended to include multiple reward functions, each corresponding to a specific objective [, , , , ],

$$ $\footnotesize\max_{\pi_{\theta}}\mathbb{E}_{x\sim D,y\sim\pi_{\theta}(y|x)} \big{[}g(r_{\phi_{1}}(x,y),\dots,r_{\phi_{n}}(x,y))-\tau\text{KL}\left[\pi_{ \theta}(y|x)||\pi_{\text{ref}}(y|x)\right]\big{]}\big{]},$ (3) $$

where $r_{\phi_{1}},\dots,r_{\phi_{n}}$ are reward models, each trained separately, and $g:\mathbb{R}^{n}\to\mathbb{R}$ is a function that combines the reward scores from multiple reward models.

Direct Preference Optimization (DPO). DPO [] reveals that the reward $r$ can be re-parameterized in terms of the policy $\pi$, allowing the policy to be optimized through supervised reward learning:

$$ $\footnotesize\min_{\theta}-\mathbb{E}_{(x,y^{w},y^{l})\sim D}\Big{[}\log\sigma \big{(}\tau\log\frac{\pi_{\theta}(y^{w}|x)}{\pi_{\text{ref}}(y^{w}|x)}-\tau \log\frac{\pi_{\theta}(y^{l}|x)}{\pi_{\text{ref}}(y^{l}|x)}\big{)}\Big{]}.$ (4) $$

Notably, the data points $x,y^{w},y^{l}$ in this objective are not necessarily generated from $\pi_{\theta}$ while it is updated; instead, they can instead be drawn from a public preference dataset $D$.

Generalization of DPO.
Later work [, ] further reveals that a single reward $r$ and the optimal solution $\pi^{*}$ of RLHF in Equation 2 are related by the equation
$\pi^{*}(y|x)\propto\pi_{\text{ref}}(y|x)\exp\big{(}\tau^{-1}r(y|x)\big{)}.$
When comparing two responses, $y^{w}$ and $y^{l}$, this relationship yields:

$$ $\footnotesize h_{\pi^{*}}(y^{w},y^{l}):=\log\Big{(}\frac{{\pi^{*}}(y^{w}|x)\pi _{\text{ref}}(y^{l}|x)}{{\pi^{*}}(y^{l}|x)\pi_{\text{ref}}(y^{w}|x)}\Big{)}= \tau^{-1}\big{(}r(y^{w}|x)-r(y^{l}|x)\big{)}$ (5) $$

Given that this equation holds for the optimal policy $\pi^{*}$, we can directly minimize the difference of the two sides of Equation 5 with a supervised loss $\mathcal{L}$

$$ $\footnotesize\min_{\theta}\mathbb{E}_{(x,y^{w},y^{l})\sim D}\Big{[}\mathcal{L} \big{(}h_{\pi_{\theta}}(y^{w},y^{l}),\tau^{-1}g_{I}(y^{w},y^{l}|x)\big{)}\Big{ ]},$ (6) $$

where $g_{I}:\mathbb{R}^{2}\to\mathbb{R}$ is a real-valued label function that approximates the value $r(y^{w}|x)-r(y^{l}|x)$. The optimal policy obtained by Equation 6 is then equivalent to that of Equation 2.

Notation Modification.
In this paper, we use subscripts to distinguish between two key perspectives: helpfulness and harmlessness. The preference label for helpfulness between two responses is denoted as
$I_{\text{help}}(y\succ y^{\prime}|x)$, and the safety label for a response $y$ is denoted as
$I_{\text{safe}}(y|x)$.
We introduce the notation $y^{hw}=y$ if $I_{\text{help}}(y\succ y^{\prime}|x)=1$, *i.e*., $y^{hw}$ is the more helpful response, and $y^{hl}$ is the less helpful response, regardless of safety. Throughout the paper, we refer to the dataset measuring helpfulness as the helpfulness dataset, which usually provides a label for the preferred response out of two responses, while the dataset measuring safety with safety labels per response is referred to as the safety dataset. Please refer to Table 5 for a summary of the notation.

## 3 BFPO Framework: Bi-Factorial Preference Optimization

Figure: Figure 2: Global preference ranking of different responses.
Refer to caption: x2.png

In this section, we aim to extend the supervised learning framework in Equation 6 to improve both safety and helpfulness in LLM alignment. Naively, we could combine the helpfulness and safety datasets, treating safer response in safety dataset and more helpful response in the helpfulness dataset as the win response $y^{w}$ in Equation 6. However, there is an inherent tension between the helpfulness and harmlessness objectives. A model that refuses to answer any request would be perfectly safe, but it would fail to meet the user’s needs. Conversely, a highly responsive model that attempts to address all requests, including potentially harmful ones, may compromise safety in favor of helpfulness []. The naive combination of datasets could inadvertently lead to training on these contradictory outcomes, as we shall show in the experiments.

On the other hand, previous work [, ] has developed successful multi-objective RLHF methods to resolve this tension, with the objective

$$ $\footnotesize\max_{\pi_{\theta}}\mathbb{E}_{x\sim D,y\sim\pi_{\theta}(y|x)} \big{[}g(y|x)-\tau\text{KL}\left[\pi_{\theta}(y|x)||\pi_{\text{ref}}(y|x) \right]\big{]},$ (7) $$

where $g(x,y)=g(r_{\text{help}}(x,y),r_{\text{safe}}(x,y))$ is a function that combines the helpfulness reward $r_{\text{help}}(x,y)$ and safety reward $r_{\text{safe}}(x,y)$. Therefore, re-parameterizing Equation 7 to a supervised objective leads to an efficient and effective alignment method. The target objective is:

$$ $\footnotesize\min_{\theta}\mathbb{E}_{(x,y^{hw},y^{hl})\sim D}\Big{[}\mathcal{ L}\big{(}h_{\pi}(y^{hw},y^{hl}),\tau^{-1}g_{I}(y^{hw},y^{hl}|x)\big{)}\Big{]},$ (8) $$

where $y^{hw}$ and $y^{hl}$ are the more helpful and less helpful responses. Similarly to Equation 6, $g_{I}$ is the label function that leverages the safety labels $I_{\text{safe}}(y^{hw}),I_{\text{safe}}(y^{hl})$ to approximate the value $g(y^{hw}|x)-g(y^{hl}|x))$, where $g$ is the global reward function in Equation 7.

In Section 3.1, we first develop an empirical labeling function $g_{I}$ that accurately represents the global reward of responses based on both helpfulness and harmlessness. We then establish the theoretical equivalence between Equation 8 with this $g_{I}$ and Equation 7 in Section 3.2. Next, we present the algorithm in Section 3.3 and provide a sample illustration in Section 3.4.

### 3.1 Empirical Labeling function

In previous single-reward optimization methods [, , ], $g_{I}(y^{w},y^{l}|x)$ in Equation 6 is typically a positive constant. However, in our case, $g_{I}(y^{hw},y^{hl}|x)$, which approximates the global reward disparity between the more helpful response and the less helpful response, *i.e*., $g(y^{hw}|x)-g(y^{hl}|x)$, should vary depending on the safety of $y^{hw}$ and $y^{hl}$. For example, in Figure 3, response (a) is more helpful than response (b), and the global reward disparity between (a) and (b) should be positive since both are safe. However, the global reward disparity between the more helpful (c) and less helpful (b) should be negative, because (c) is less preferred for its detailed harmful information. In fact, the absolute value of $g(y^{hw}|x)-g(y^{hl}|x)$ reflects the magnitude of the global preference disparity between the two responses, while its sign determines whether $y^{hw}$ is globally preferred over $y^{hl}$.

To assign label values across various $y^{hw},y^{hl}$ pairs, we first globally rank the responses as illustrated in Figure 3. Our guiding principle is a general preference for safe responses, prioritizing helpfulness only if the responses is safe. We desire the helpful and safe responses like (a) in Figure 3, followed by the acceptable non-helpful but safe responses like (b). We remain neutral toward the harmful but unhelpful responses like (c), and we hate the harmful yet exhaustive (helpful) responses like (d).

Given two responses $y^{hw},y^{hl}$, assuming we have their relative helpfulness ranking, there are four classes of pairs based on their safety, illustrated in Figure 3.
For 1 and 2, we prefer the safe and more helpful $y^{hw}$ than the other response, so the signs of the labels should be positive. Similarly, the signs of 3 and 4 should be negative. The preference gap for 1 (Desired vs. Neutral) is larger than for 2, thus the magnitude of the labels should be greater in 1. Likewise, the magnitude of labels of 4 should be greater than that of 3. Consequently, the label value of the four class of pairs should be ordered as 1, 2, 3, and 4. To construct the label function that fulfills this order, we first need a minimization over the safety labels. To ensure a positive label for 2, we require a larger scalar weighting the safety of $y^{hw}$ compared to that of $y^{hl}$. We hypothesize the following form for the label function $g_{I}$:

$$ $\footnotesize g_{I}(y^{hw},y^{hl})=B_{3}(B_{1}I_{\text{safe}}(y^{hw}|x)-I_{ \text{safe}}(y^{hl}|x)+B_{2}).$ (9) $$

In this equation,
$B_{1}$ is positive scalar that weights the safety of $y^{hw}$. $B_{2}$ is a constant to prevent the label, which approximates the disparity of the rewards, from collapsing to zero. $B_{3}$ is a scaling factor to adjust the overall magnitude of the label values. For instance, let $B_{1}=3,B_{2}=-2\alpha,B_{3}=0.5$, Figure 3-right illustrates label values of different pairs.

### 3.2 Theoretically Equivalent Reward

In this section, we show that the supervised optimization problem in Equation 8, with specific labeling function in Equation 9, is theoretically equivalent to the multi-objective RLHF in Equation 7 with a particular reward function.
Previous studies [, ] in aligning LLMs for both safety and helpfulness have shown that the global reward function can be effectively approximated by a bilinear combination of the two sub-rewards; see Section C.2 for more details. We hypothesize the global reward function as follows:

$$ $\footnotesize g(y)=(p_{\text{safe}}^{*}(y|x)+A_{1})(p_{\text{help}}^{*}(y\succ \pi|x)+A_{2}),$ (10) $$

where $A_{1},A_{2}$ are two constants that prevent the reward from being nullified by zero values, and $p_{\text{help}}^{*},p_{\text{safe}}^{*}\in[0,1]$ are the ground-truth helpful and safety preferences of response $y$.
Let
$A_{1}=E_{s},A_{2}=\frac{1}{2},B_{1}=3,B_{2}=0,B_{3}=\frac{1}{2}$, we have the reward function $g$ and labeling function $g_{I}$ as follows:

$$ $\displaystyle g(y)=(p_{\text{safe}}^{*}(y|x)+E_{s})(p_{\text{help}}^{*}(y\succ \pi|x)+\frac{1}{2}),$ (11) $\displaystyle g_{I}(y^{hw},y^{hl})=\frac{3}{2}I_{\text{safe}}(y^{hw})-\frac{1} {2}I_{\text{safe}}(y^{hl}),$ (12) $$

where $E_{s}=\mathbb{E}_{y\sim\pi}\big{[}p_{\text{safe}}^{*}(y|x)\big{]}$ represent the ground truth average safety of responses given prompt $x$.
The following theorems reveal the theoretical equivalence.

###### Theorem 3.1 (Azar et al . [ 19 ] ) .

The optimization problem in Equation 7 has a solution $\pi^{*}$ with the format

$$ $\footnotesize\pi^{*}(y|x)=\frac{\pi_{\text{ref}}(y|x)\exp\left(\tau^{-1}g(y|x) \right)}{\sum_{y^{\prime}}\pi_{\text{ref}}(y^{\prime}|x)\exp\left(\tau^{-1}g(y ^{\prime}|x)\right)},$ $$

and $\pi^{*}(y)$ is the unique solution to the following optimization problem

$$ $\footnotesize\min_{\pi_{\theta}}\mathbb{E}_{x\sim D,y,y^{\prime}\sim\pi_{ \theta}}\left[h_{\pi}(y,y^{\prime})-\frac{g(y|x)-g(y^{\prime}|x)}{\tau}\right] ^{2}.$ (13) $$

###### Theorem 3.2 .

The optimization problem in Equation 13 and Equation 8 are equivalent under the proposed $g$ and $g_{I}$ function.

With Theorem 3.1, we can obtain the optimal $\pi^{*}$ by solving the supervised optimization problem in Equation 13. The proof of this theorem is in Section B.2. However, the optimization problem in Equation 13 remains challenging because the function $g(y)$ involves the ground-truth preference $p^{*}$, which requires estimation by a large group of annotators. To address this, Theorem 3.2 shows it is equivalent to solve the supervised optimization problem in Equation 8 with the proposed $g_{I}$ to obtain the optimal $\pi^{*}$.
The proof of this equivalence is provided in Section B.3. We further discuss the general equivalence with different constants $A_{1},A_{2},B_{1},B_{2},B_{3}$ in Section B.4.

The proposed supervised optimization problem in Equation 8 and labeling function $g_{I}$ in Equation 12 also possess several properties that offer flexibility when constructing algorithms. These properties are discussed in the following proposition and in Section B.5.

###### Proposition 3.3 .

Theorem 3.1 and Theorem 3.2
hold under the shift of the preference values in $g$ and $g_{I}$, *i.e*.,

$$ $\footnotesize\begin{split}&g(y)=(p_{\text{safe}}^{*}(y|x)+p_{1}+E_{s})(p_{ \text{help}}^{*}(y\succ\pi|x)+p_{2}+\frac{1}{2}),\\ &g_{I}(y^{hw},y^{hl})=\frac{3}{2}(I_{\text{safe}}(y^{hw})+p_{1})-\frac{1}{2}(I _{\text{safe}}(y^{hl})+p_{2}),\end{split}$ $$

where $p_{1},p_{2}$ are constants.

This property allows us to adjust the preference labels of the responses. Proof of the proposition is provided in Section B.5.
In practice, we further apply a shift of the safety label value $\alpha$ as

$$ $\footnotesize g_{I}(y^{hw},y^{hl})=\frac{3}{2}I_{\text{safe}}(y^{w})-\frac{1}{ 2}I_{\text{safe}}(y^{l})-\alpha.$ (14) $$

The factor $\alpha$ is useful when set to negative values to distinguish unsafe samples, i.e., to make the value of case 3 in Figure 3, *i.e*., both responses are not safe, deviate from 0.

###### Theorem 3.1 (Azar et al . [ 19 ] ) .

###### Theorem 3.2 .

###### Proposition 3.3 .

### 3.3 Algorithm

Figure: Figure 4: Action probabilities over steps during the policy optimization using DPO, IPO, and our BFPO in synthetic dataset. Only ours can recover the desired ranking.
Refer to caption: x4.png

With discussions in the previous sections, the loss function in the optimization problem in Equation 8 can be expressed as

$$ $\small\mathcal{L}_{\text{BFPO}}(\theta)=\mathbb{E}_{(x,y^{hw},y^{hl})\sim D} \left(\log\Big{(}\frac{{\pi_{\theta}}(y^{w}|x)\pi_{\text{ref}}(y^{l}|x)}{{\pi_ {\theta}}(y^{l}|x)\pi_{\text{ref}}(y^{w}|x)}\Big{)}-\frac{\frac{3}{2}I_{\text{ safe}}(y^{hw})-\frac{1}{2}I_{\text{safe}}(y^{hl})-\alpha}{\tau}\right)^{2}.$ (15) $$

In practice, we directly use the above supervised loss to fine-tune the LLMs for both helpfulness and harmlessness.
$y^{w}$ and $y^{l}$ can be sampled from a public preference dataset $D$ instead of being self-generated []. The safety labels $I_{\text{safe}}(y^{hw}),I_{\text{safe}}(y^{hl})$ are either provided in the dataset or obtained by a safety classifier. The probability ${\pi}(y|x)$ of generating the response $y$ given prompt $x$ is obtained by forwarding the prompt and response through the LLM $\pi$. $\pi_{\theta}$ is the language model we are optimizing, and $\pi_{\text{ref}}$ is a reference model that can be the model at the beginning of the optimization.
We further employ two techniques to balance safety and helpfulness. First, we only unfreeze the selected layers $\theta^{\prime}$ in the policy $\pi_{\theta}$ to avoid catastrophic forgetting, as described in []. Second, we implement buffered training in line 5 of Algorithm 1, where we sample batches of the same size from the safety dataset and the helpful dataset, inspired by []. The overall algorithm is summarized in Algorithm 1.

### 3.4 Illustrative Examples

Following  [], we conduct illustrative experiments on a synthetic dataset to demonstrate that our method can accurately recover the global preference using paired preferences. For simplicity, we consider a discrete action space with four actions,
$\mathcal{Y}=\{y_{1},y_{2},y_{3},y_{4}\}$, without context.
We define the safety labels and helpfulness ranking as

$$ $\begin{split}&\text{Safety: }I_{\text{safe}}(y_{1})=1,I_{\text{safe}}(y_{2})=0 ,I_{\text{safe}}(y_{3})=1,I_{\text{safe}}(y_{4})=0,\\ &\text{Helpfulness: }y_{1}\succ y_{2}\succ y_{3}\succ y_{4}.\end{split}$ $$

Consequently, our proposed global preference, as in Figure 3, is $y_{1}\succ y_{3}\succ y_{4}\succ y_{2}$.
We consider the policy $\pi_{\theta}(y_{i})=\text{softmax}(\theta)_{i}$, where $\theta\in\mathbb{R}^{4}$ and $i=1,2,3,4$. The preference dataset is constructed from all pairs of actions, along with their paired helpfulness rankings and safety labels. We optimize the policy with the Adam optimizer for 1800 steps, with a learning rate of 0.01, batch size of 32 sampled with replacement, $\tau=1$, and $\alpha=0.5$. We compare the supervised optimization objective proposed in Equation 15 as well as DPO [] and IPO [], where we take the more helpful response is taken as the win response. Each method is tested with five repeat experiments, and we plot the average learning curves in Figure 5.

For all $\tau$, we observe that only with our proposed method does $\pi(y_{i})$, *i.e*., the probability of generating action $y_{i}$, converges to the desired ranking, $y_{1}\succ y_{3}\succ y_{4}\succ y_{2}$. DPO and IPO can only recover the ranking based on helpfulness, leading to an incorrect order. While IPO helps prevent the policy from being deterministic, our method retains this beneficial property while also achieving the correct ranking.

## 4 Experiment

### 4.1 Evaluation Setup

**Table 1: Results of fine-tuning pre-trained model, Mistral, with various methods. Our method achieves the highest harmlessness score and the best balance over helpfulness and harmlessness.**
|  | Helpfulness | Harmlessness |  |  |
| --- | --- | --- | --- | --- |
|  | Alpaca$(\uparrow)$ | Disc. $(\uparrow)$ | Gen. $(\uparrow)$ | Savg. $(\uparrow)$ |
| DPO-H (Zephyr) | 10.99 | 59.05 | 62.94 | 60.99 |
| DPO-S | 4.34 | 56.42 | 96.91 | 76.66 |
| DPO | 14.71 | 58.35 | 39.71 | 49.03 |
| IPO | 13.15 | 58.41 | 89.76 | 74.09 |
| MORL | 10.83 | 58.54 | 64.88 | 61.71 |
| BFPO (ours) | 13.33 | 59.09 | 95.24 | 77.16 |

Harmlessness Benchmark.
To evaluate the harmlessness, we first construct a benchmark including both discriminative tasks and generative tasks based on previous benchmarks [, , , ]. The discriminative tasks measure the models’ recognition of multiple safety topics, including

- •
Bias: CrowS-Pairs [], BBQ [], WinoGrande [].
- •
Ethics: ETHICS [], Moral Permissibility [, , , ], Simple Ethics Questions [, ].
- •
Toxicity: ToxicGen [], BigBench HHH Alignment []

In the generative tasks, we prompt the models to generate harmful content using the prompt dataset, AdvBench [], Real Toxicity Prompts [], ALERT [], and adversarial harmful prompt dataset ALERT Adversarial []. We report percentage of harmless responses based on the safety classifier HarmBench-Llama2-13B-Chat []. Details of the benchmark can be found in Section C.1. We apply this benchmark to publicly available 7B-level models that have shown strong helpfulness scores in previous studies [, ], and present the performance in Figure 5 and in Section C.3.

Overall Evaluation Metrics. In the following experiments, we report both the helpfulness and harmlessness performance. Helpfulness is measured using AlpacaEval 2.0 (Alpaca) [, , ]. Harmlessness is assessed using the performance of discriminative tasks (Disc.), generative tasks (Gen.) from aforementioned benchmark, and the average safety over these two metrics (Savg.).

### 4.2 Alignment with BFPO Objective

From the evaluation on the open model in Figure 5, we observe that Zephyr-7b-beta [], an open-sourced model fine-tuned over Mistral-7B-v0.1 [] with DPO algorithm [], exhibits a low score in harmlessness, particularly in generative tasks. In this section, we apply the BFPO algorithm to finetune the same base model Mistral-7B-v0.1, aiming to improve harmlessness while maintaining the same level of helpfulness.

Training Details. Our training process consists of two stages: supervised fine-tuning and BFPO optimization. The supervised fine-tuned model is used as the reference model $\pi_{\text{ref}}$ in the BFPO stage. We set $\tau=0.01$, $\alpha=-0.5$, and selected layer $\theta^{\prime}$ as the second MLP layers in each transformer block. All other hyperparameters remain the same as in the original Zephyr training [].

Dataset Details.
In the supervised fine-tuning stage, we follow previous work [, ] to use a mix of helpfulness data from UltraChat [] and safety data from PKU-SafeRLHF []. In the BFPO stage,
we use 30K helpfulness data from UltraFeedback [] and 30K safety data from PKU-SafeRLHF. UltraFeedback contains instruction-following tasks that provide paired helpfulness preference rankings, and we treat all responses as safe since they undergo human filtering. PKU-SafeRLHF provides both paired helpfulness preference rankings and binary safety labels. Details are in Section C.3.

Baselines. We first compare our method to the supervised method DPO [] using different datasets., which directly leads to the Zephyr-7b-beta model, only uses the helpfulness dataset, UltraChat. DPO-S only uses the safety dataset, PKU-SafeRLHF. We also compare our method to existing approaches, DPO [], IPO [], and MORL [], when using a naive mix of the helpfulness and safety datasets.
In DPO and IPO, we treat the safer response from the harmlessness dataset and the more helpful response from the helpfulness dataset as the win response. MORL, representing the line of multi-objective reinforcement learning methods using PPO optimization [, , , , ], requires reward models. Following [], we use a single highly-ranked [], publicly available reward model, ArmoRM-Llama3-8B-v0.1 [], to provide reward scores for both helpfulness and harmlessness. Refer to Section C.2 for more details. All methods use the same pre-trained model.

Results and Comparisons.
The results are presented in Table 2.
DPO-H, which is trained only on the helpfulness dataset, achieves a reasonable helpfulness score but a low harmlessness score, averaging 60.99%. Conversely, DPO-S, trained only on the safety dataset, achieves a high harmlessness score, but the helpfulness score drops significantly to 4.34%.

Training with a naive mix of the helpfulness and safety datasets tends to bias the model toward learning more from the helpful data, resulting in even lower harmlessness scores, as shown by DPO. This aligns with previous findings that the mix ratio of helpfulness and harmlessness data is difficult to control, and training often focuses on a single perspective [, ].
In comparison to these supervised methods, BFPO achieves the highest average harmlessness score of 77.16% and significantly improves the generative tasks score from 39.71% to 95.24%.

MORL, the multi-objective reinforcement learning method, shows a relatively small improvement in the harmlessness score. We suspect the primary reason is that the reward scores of different responses provided by the public reward model are not sufficiently distinguishable, making it inefficient for the model to learn to generate good responses while avoiding bad ones. This highlights the need for training a reward model specific to the model being fine-tuned, which involves the costly human prompting (red teaming) and annotation process.

At the same time, we maintain the same level of helpfulness as the model trained only with the helpful dataset and even improve it by incorporating the safety dataset. Full results are in Section C.3.

**Table 3: Efficiency comparison of our method to previous PPO-based safety alignment methods.**
| Method | Data<br>Size | Red<br>Teaming | Iteration | Alpaca | Savg. |
| --- | --- | --- | --- | --- | --- |
| Beaver | 300K | $\checkmark$ | 3 | 1.00 | 71.80 |
| Llama2 | 1M | $\checkmark$ | 6 | 7.60 | 73.80 |
| BFPO | 30K | - | 1 | 13.33 | 77.16 |

Comparison against Previous Safety Alignment Methods.
We compare our method with two successful open-source safety alignment methods: Beaver [] and Llama2 []. We present statistics on the data size used for RLHF, the need for the red teaming process, and the number of training iterations in Table 4. Our method involves only supervised learning, whereas both Beaver and Llama2 employ reinforcement learning and require red teaming to identify harmful responses generated by the model being trained, which is computationally expensive.
Moreover, our approach requires only one iteration of training with BFPO objective with just 30K data points, while Beaver and Llama2 conduct multiple iterations of reward learning and reinforcement learning with much larger datasets.
Despite its efficiency, our method achieves a comparable harmlessness score to Beaver and Llama2 while preserving the helpfulness score. These results indicate strong potential for our method to be applied in the future development of open-source models at a minimal cost.

### 4.3 Improve Pre-aligned Models with Red Teaming Data

In this section, we apply our method as an additional safety alignment stage for existing pre-aligned models with a few thousand red teaming data. We compare our method with DPO [], IPO [], MORL [] as in Section 4.2.

Data Preparation.
We first use 9K harmful prompts from the PKU-SafeRLHF dataset [] and have the Zephyr-7b-beta [] model generate two responses for each prompt. We then use the HarmBench-Llama2-13B-Chat [] classifier to determine whether the generated responses are harmful. For prompts that result in harmful responses, we use PairRM [] to rank the responses in terms of helpfulness. This process results in 1.5K harmful prompts, responses, safety labels for each response, and pairwise helpfulness preferences.

Results.
Table 2 shows the results. Our method improves the harmlessness of the Zephyr-7b-beta model from 60.99% to 73.90%, while preserving the helpfulness. The improvement in generative tasks is particularly significant, from 62.94% to 88.79%.
The supervised methods, DPO and IPO, can also improve the harmlessness, but the improvement is not as substantial as with our method. When fine-tuning the model with MORL using specific prompts where the model initially struggled as in this experiment, the performance gain is still marginal, though larger than when using general data, as in Table 2. This aligns with the observation that using RL methods to improve safety requires a large amount of model-specific data, high-quality labels, and a reward model specifically trained on these data to provide distinguishable scores.
In contrast, BFPO achieves similar goals without the need for large amounts of helpfulness data mixed with red teaming data. Moreover, our overall pipeline of this experiment is efficient and automatic, requiring no human annotation.
These results strongly indicate that our method can be effectively used in an additional safety alignment stage for existing chat models to improve harmlessness at minimal cost. Full results are in Section C.3.

### 4.4 Ablations

We validate the technical design of our algorithm in Table 4, showing that the shift parameter $\alpha$ and buffered training are effective in improving harmlessness.

In the BFPO $\alpha=0$ experiment, we set the shift parameter $\alpha$ to 0. The results indicate that, as illustrated in Section 3.4, the shift parameter $\alpha$ is useful in distinguishing unsafe data, and thus improves performance on generative tasks in harmlessness slightly.
In the BFPO - w/o buffer experiment, we do not balance examples from the safety dataset and the helpful dataset, but instead mix the two datasets and randomly sample data from them. The lower harmlessness performance provides the evidence that buffered training helps mitigate the tension between helpfulness and harmlessness. Full results are provided in Section C.3.

## 5 Related Work

Alignment with Diverse Preferences. Traditional language model alignment methods [, , ] typically use a single reward or unified preference model.However, recent work suggests that human preferences are diverse and cannot be adequately represented by a single reward model. To address this, Chakraborty *et al*. [] propose learning a mixture distribution for the reward using the EM algorithm, which they then apply in their MaxMin RLHF approach. Other research [, , ] explores training multi-objective reward models for the alignment stage. These methods primarily focus on improving reward models for RL based alignment. The most closely related work of supervised alignment methods is by Zhou *et al*. [], who, despite advocating for direct policy optimization, still rely on training reward models. In contrast, our approach completely eliminates the two-stage training process and directly integrates multiple preferences into the supervised optimization.

Safety Alignment. Aligning large language models (LLMs) with both helpfulness and harmlessness is a specific case of addressing diverse preferences. To enhance safety, many researchers conduct additional safety data annotation alongside algorithm design. Llama2 [] utilizes substantial amounts of human-labeled safety data and combines safety and helpfulness rewards by utilizing the safety reward as a threshold function for the helpfulness reward. [, ] engage in red teaming to gather extensive safety data and frame safety alignment as a conditioned Markov Decision Process (MDP) problem. Mu *et al*. [] propose a rule-based reward as a complement for the common reward to improve the safety, which, although data-efficient, still requires human annotation and reward learning.
In contrast, our method is fully automated and efficient, eliminating the need for human intervention in the safety alignment process.
On the other hand, [] propose generation-aware alignment, which improves the safety over different generation configurations. With our focus on improving safety under specific configurations, this work can be a strong complement to ours.

Safety Evaluation. Supervised benchmarks, such as OpenLLM [] and BigBench [], include datasets related to various aspects of safety, such as toxicity, truthfulness, morality, and social bias. Adversarial attack research [] and red teaming efforts [, ] provide valuable toxic prompts to assess if models can generate harmless content in response to these prompts.
To identify if the output content contains harmful information, some studies [, ] rely on human annotators, while others employ AI models like GPT-4 []. [] offer fine-tuned Llama2 models to as harmful content classifier, offering an efficient alternative to GPT-4 in model-based evaluation.

## 6 Limitations and Discussion

In this paper, we propose a novel supervised optimization method, Bi-Factorial Preference Optimization (BFPO), to balance the safety and helpfulness during the alignment of LLMs. We theoretically prove that this direct optimization is equivalent to previous multi-objective reinforcement learning that combine safety and helpfulness rewards. With BFPO, we outperform existing methods in terms of safety and helpfulness in both fine-tuning the pre-trained LLMs and pre-aligned models.
Our method is highly effective, significantly more computationally efficient, and does not require any human annotation or additional data collection.

Furthermore, our approach is versatile and does not rely on any specific property of harmlessness itself. This flexibility allows it to be applied to improve various other potentially conflicting objectives in aligning LLMs. To achieve this, we only need characteristic-specific labels for the field-specific dataset. We believe our proposed method can serve as a general framework for the transfer learning of aligned models. However, our method relies on specific label formats for helpfulness and safety may present a limitation when addressing different tasks. Moreover, extending our work to handle more objectives (beyond just two) is also a promising direction for future research.

### ACKNOWLEDGEMENTS

This work is supported by the KAUST Competitive Research Grant (URF/1/4648-01-01), KAUST Baseline Fund (BAS/1/1685-01-01), and a UKRI grant Turing AI Fellowship (EP/W002981/1). AB has received funding from the Amazon Research Awards. We also thank the Royal Academy of Engineering and FiveAI.

## Appendix A Algorithm

Algorithm 1 shows the BFPO algorithm. As mentioned in Section 2, in practice, we refer to datasets related to safety topics, collected through red teaming, as safety datasets. A typical safety dataset will contain a safety label $I_{\text{safe}}(y)$, which is the binary label indicating whether the response $y$ is harmful, as well as the preference label $I_{\text{help}}(y\succ y^{\prime})$ in terms of helpfulness. If a certain safety dataset does not provide helpfulness labels, we can use the ranking models, like PairRM [], as discussed in Section 4.3, to generate the pairwise helpfulness labels.
We refer to datasets designed to improve the helpfulness of the model as helpfulness datasets. A typical helpfulness dataset will contain the helpfulness preference labels $I_{\text{help}}(y\succ y^{\prime})$. Since most helpfulness data undergoes human filtering, the responses are usually safe. Therefore, we assign the safety label $I_{\text{safe}}(y)=1$ to all responses in the helpfulness dataset.

We further require a pre-trained language model $\pi_{\text{ref}}$, the total number of optimization steps $T$, the penalty coefficient $\tau$ for the KL divergence term, and the shifting parameter $\alpha$. We also need to specify the layers to be unfrozen for the policy optimization, denoted as $\theta^{\prime}$.

At the beginning of the algorithm, we initialize the policy $\pi_{\theta}$ with the pre-trained language model $\pi_{\text{ref}}$, and unfreeze the selected layers $\theta^{\prime}$ (line 1-2). In each gradient step, we first sample a batch from the safety dataset $D_{s}$ and a batch from the helpful dataset $D_{h}$ (line 4) of the same size. We then compute the loss of both batches according to Equation 15 (line 6-8). We accumulate the gradients of the loss for the both batches and update the policy $\pi_{\theta}$ (line 10). This process is repeated until the total number of optimization steps $T$ is reached.

Figure: Algorithm 1 BFPO Algorithm

## Appendix B Proof

### B.1 Notation

**Table 5: Notations**
| Notation | Meaning |
| --- | --- |
| $y,y^{\prime}\sim\pi(x)$ | Two responses generated independently by the policy. |
| $p_{\text{help}}^{*}(y\succ y^{\prime}|x)$ | Ground-truth helpfulness preference of $y$ being preferred to $y^{\prime}$ knowing the context $x$ |
| $p_{\text{safe}}^{*}(y|x)$ | Ground-truth safety of $y$ knowing the context $x$ |
| $I_{\text{help}}(y\succ y^{\prime}|x)$ | Binary label of helpfulness preference of $y$ being preferred to $y^{\prime}$ knowing the context $x$ |
| $I_{\text{safe}}(y|x)$ | Binary label of safety of $y$ knowing the context $x$ |
| $y^{w},y^{l}$ | globally preferred and dispreferred responses knowing the context $x$ |
| $y^{hw},y^{hl}$ | preferred and dispreferred responses in terms of helpfulenss knowing the context $x$ |
| $E_{s}$ | Expected safety of a response $y$ given the context $x$ |

Table 5 summarizes the notations used in this paper based on [, ].
In the appendix, we will employ the ordering-free notation system$y,y^{\prime}$ for the proof. Specifically, we express the transformation equations from $y^{hw},y^{hl}$ to $y,y^{\prime}$ as:

$$ $\displaystyle I_{\text{safe}}(y^{hw}|x)=I_{\text{help}}(y\succ y^{\prime}|x)I_ {\text{safe}}(y|x)+I_{\text{help}}(y^{\prime}\succ y|x)I_{\text{safe}}(y^{ \prime}|x)$ $\displaystyle I_{\text{safe}}(y^{hl}|x)=I_{\text{help}}(y\succ y^{\prime}|x)I_ {\text{safe}}(y^{\prime}|x)+I_{\text{help}}(y^{\prime}\succ y|x)I_{\text{safe} }(y|x)$ $$

For brevity and clarity, we further adopt the notation $y$ to represent $y|x$. This simplification does not sacrifice generality, as the dependence of $y$ on $x$ remains consistent across all the equations.

### B.2 Proof of Theorem 3.1

We begin by restating Theorem 3.1 with the notation system $y,y^{\prime}$. Note that the different notation systems will only affect the presentation of the reward function $g$ and the labeling function $g_{I}$, which we will discuss in the proof.

###### Theorem B.1 .

Let $\tau>0$ be a real number, $\pi_{\theta},\pi_{\text{ref}}$ be two policy.
Then

$$ $\pi^{*}(y)=\frac{\pi_{\text{ref}}(y)\exp\left(\tau^{-1}g(y)\right)}{\sum_{s\in \mathcal{S}}\pi_{\text{ref}}(s)\exp\left(\tau^{-1}g(s)\right)}$ (16) $$

is an optimal solution to the optimization problem

$$ $\max_{\pi_{\theta}}\mathbb{E}_{y\sim\pi_{\theta}(y)}\big{[}g(y)-\tau\text{KL} \left[\pi_{\theta}(y)||\pi_{\text{ref}}(y)\right]\big{]},$ (17) $$

and $\pi^{*}(y)$ is the optimal unique solution of

$$ $\min_{\pi_{\theta}}\mathbb{E}_{y,y^{\prime}\sim\pi_{\theta}(y)}\left[h_{\pi}(y ,y^{\prime})-\frac{g(y)-g(y^{\prime})}{\tau}\right]^{2},$ (18) $$

where

$$ $h_{\pi}(y,y^{\prime})=\log\left(\frac{\pi_{\theta}(y)\pi_{\text{ref}}(y^{ \prime})}{\pi_{\theta}(y^{\prime})\pi_{\text{ref}}(y)}\right).$ (19) $$

To establish optimal solution, we follow Azar *et al*. [] to leverage the following lemma.

###### Lemma B.2 (Rafailov et al . [ 18 ] , Azar et al . [ 19 ] ) .

Let

$$ $\mathcal{L}_{\tau}(\delta)=\mathbb{E}_{s\in\delta}[f(s)]-\tau\text{KL}[\delta| |\eta],$ $$

where $s\in\mathcal{S}$ and $\mathcal{S}$ is a finite set, $f\in\mathbb{R}^{\mathcal{S}}$ is a function mapping elements of $\mathcal{S}$ to real numbers, $\delta\in\Delta(\mathcal{S})$ is a probability distribution over $\mathcal{S}$, $\eta\in\Delta(\mathcal{S})$ is a fixed reference distribution, and $\tau\in\mathbb{R}^{*}_{+}$ is a strictly positive number. Then the argmax problem with the regularized criterion

$$ $\text{argmax}_{\delta\in\Delta(\mathcal{S})}\mathcal{L}_{\tau}(\delta)$ $$

has an optimal solution $\delta^{*}$, where

$$ $\delta^{*}(s)=\frac{\eta(s)\exp({\tau}^{-1}f(s))}{\sum_{s^{\prime}\in\mathcal{ S}}\eta(s^{\prime})\exp({\tau}^{-1}f(s^{\prime}))},\,\,\forall s\in\mathcal{S}$ $$

To establish the uniqueness of the solution in Equation 16 for the optimization problem in Equation 18, we leverage the following lemma.

###### Lemma B.3 (Theorem 2 in Azar et al . [ 19 ] ) .

Let

$$ $\mathcal{L}(\pi_{\theta})=\mathbb{E}_{y,y^{\prime}\sim\pi_{\theta}(y)}\left[h_ {\pi}(y,y^{\prime})-\frac{g(y)-g(y^{\prime})}{\tau}\right]^{2},$ (20) $$

then $\min_{\pi_{\theta}}\mathcal{L}(\pi_{\theta})$ has a unique optimal solution $\pi^{*}$ expressed in Equation 16
, and no other local or global minima exist.

###### Proof.

Let $J=\text{Supp}(\pi)=\{y_{1},\dots,y_{n}\}$, where $n=|J|$, and $\Pi$ be the set of policies with support set $J$. It is straightforward that $\min_{\pi\in\Pi}\mathcal{L}(\pi)=\mathcal{L}(\pi^{*})=0$, thus $\pi^{*}$ is a global optimal solution. We now prove the uniqueness of this optimal solution by the re-parameterization trick.

We parameterize $\Pi$ via vectors of logits $s\in\mathbb{R}^{J}$ of $\pi$, *i.e*., $s_{i}=\log(\pi(y_{i}))$. Set $\pi_{s}(y)=\frac{\exp(s_{i})}{\sum_{i=1}^{n}\exp(s_{i})}$ for $y=y_{i}\in J$ and $\pi_{s}(y)=0$ otherwise. Specially, let $s^{*}$ be the vector of logits corresponding to $\pi^{*}$, we have $\pi^{*}=\pi_{s^{*}}$.

We first prove that $s^{*}$ is the global optimal solution to the optimization problem

$$ $\mathcal{L}(s):=\mathcal{L}(\pi_{s})=\mathbb{E}_{y,y^{\prime}\sim\pi_{s}}\left [h_{\pi_{s}}(y,y^{\prime})-\frac{g(y)-g(y^{\prime})}{\tau}\right]^{2}.$ $$

It is obvious that $\mathcal{L}(s^{*})=0$, thus it is a local minimum.
By expanding the square term, we have

$$ $\begin{split}\mathcal{L}(s)&=\mathbb{E}_{y,y^{\prime}\sim\pi_{s}}\left[\frac{g (y)-g(y^{\prime})}{\tau}-(s(y)-s(y^{\prime}))-\log\left(\frac{\pi_{\text{ref}} (y^{\prime})}{\pi_{\text{ref}}(y)}\right)\right]^{2}\\ &=\sum_{y,y^{\prime}\in J}\pi_{s}(y)\pi_{s}(y^{\prime})\left[\left((s(y)-s(y^{ \prime})\right)^{2}+C_{1}\cdot\left((s(y)-s(y^{\prime})\right)+C_{2}\right], \end{split}$ $$

where $C_{1},C_{2}$ are two terms independent of $s$. The above equation is a positive semidefinite quadratic form, and hence is convex. Thus, all local minima are global minima.

Now we prove that $\pi_{s^{*}}$ is the unique global minima to $\mathcal{L}(s)$.
Since $\pi_{s}$ is a surjective continuous mapping from $s$ to $\pi$, then every local minima $\pi$ to $\mathcal{L}(\pi)$ corresponds to a set of $s$ that minimizes $\mathcal{L}(s)$.
The uniquess of $s^{*}$ will deduce that $\pi^{*}$ is the unique optimal solution to Equation 18 and concludes the proof. Consider $s^{\prime}=s^{*}+r\cdot\Delta s$, where the only $r$ is the radius and $\Delta s$ is the direction under the polar coordinate. The only direction that not increase $\mathcal{L}(s^{\prime})$ away from 0 0 is $e=(\frac{1}{n},\dots,\frac{1}{n})$ ([], Chap. 3). However, we have

$$ $\pi_{s^{*}+r\cdot e}(s_{i})=\frac{\exp(s_{i}+r\cdot\frac{1}{n})}{\sum_{i=1}^{n }\exp(s_{i}+r\cdot\frac{1}{n})}=\frac{\exp(s_{i})}{\sum_{i=1}^{n}\exp(s_{i})}= \pi_{s^{*}}(s_{i}),\,\,\forall i\in[n].$ $$

This indicates that $\pi_{s^{*}}$ is the unique global minima to $\mathcal{L}(\pi_{s^{*}})$ and thus $\pi^{*}$ is the unique optimal solution to Equation 18.
∎

Now we provide the proof of Theorem 3.1, most of which follows Azar *et al*. [].

###### Proof.

Let $\mathcal{S}$ be the set of all possible token combinations with fixed token length, then it is finite. Let $f(s)=(p_{\text{safe}}^{*}(s)+E_{s})(p_{\text{help}}^{*}(s\succ\pi)+\frac{1}{2})$, $\delta(s)=\pi_{\theta}(s)$ and $\eta(s)=\pi_{\text{ref}}(s)$. All the conditions in the Lemma B.2 are satisfied. Thus, Equation 16 is a solution to the optimization problem in Equation 17.

Now we prove Equation 16 is also a solution to the optimization problem Equation 18. Plug Equation 16 in the Equation 18, we have

$$ $h_{\pi^{*}}(y,y^{\prime})=\log\left(\frac{\pi^{*}(y)\pi_{\text{ref}}(y^{\prime })}{\pi^{*}(y^{\prime})\pi_{\text{ref}}(y)}\right)=\log\left(\frac{\exp\left( \tau^{-1}g(y)\right)}{\exp\left(\tau^{-1}g(y^{\prime})\right)}\right)={\tau}^{ -1}(g(y)-g(y^{\prime})),$ $$

which validates Equation 16 is a solution to the optimization problem Equation 18.

Finally, Lemma B.3 indicates Equation 16 is the unique solution to Equation 18. This concludes the proof.
∎

The above proof holds for any order of $y,y^{\prime}$ since the equation in Equation 19 is skew-symmetric, *i.e*.,

$$ $\left[h_{\pi}(y,y^{\prime})-\frac{g(y)-g(y^{\prime})}{\tau}\right]^{2}=\left[h _{\pi}(y^{\prime},y)-\frac{g(y^{\prime})-g(y)}{\tau}\right]^{2}.$ $$

This allows us to freely arrange the order of $y,y^{\prime}$ in Equation 18 without loss of generality. Therefore, Equation 18 can be written as

$$ $\min_{\pi_{\theta}}\mathbb{E}_{y,y^{\prime}\sim\pi_{\theta}(y)}\left[h_{\pi}(y ^{hw},y^{hl})-\frac{g(y^{hw})-g(h^{hl})}{\tau}\right]^{2},$ $$

where

$$ $y^{hw}=\begin{cases}y&\text{if }I_{\text{help}}(y\succ y^{\prime}|x)=1,\\ y^{\prime}&\text{otherwise},\end{cases}$ $$

and

$$ $y^{hl}=\begin{cases}y^{\prime}&\text{if }I_{\text{help}}(y\succ y^{\prime}|x)= 1,\\ y&\text{otherwise}.\end{cases}$ $$

With this reordering, the theorem reduces to Theorem 3.1

###### Theorem B.1 .

###### Lemma B.2 (Rafailov et al . [ 18 ] , Azar et al . [ 19 ] ) .

###### Lemma B.3 (Theorem 2 in Azar et al . [ 19 ] ) .

###### Proof.

###### Proof.

### B.3 Proof of Theorem 3.2

In this section, we prove the Theorem 3.2. We begin by rewriting the formula in Equation 12 into a function of $y,y^{\prime}$.

$$ $\small\begin{split}&g_{I}(y,y^{\prime})=B_{3}\Big{(}B_{1}\big{(}I_{\text{safe} }(y)I_{\text{help}}(y\succ y^{\prime})+I_{\text{safe}}(y^{\prime})I_{\text{ help}}(y^{\prime}\succ y)\big{)}\\ &-\big{(}I_{\text{safe}}(y)I_{\text{help}}(y^{\prime}\succ y)+I_{\text{safe}}( y^{\prime})I_{\text{help}}(y\succ y^{\prime})\big{)}+B_{2}\Big{)}\cdot\Big{(}2 I_{\text{help}}(y\succ y^{\prime})-1\Big{)},\end{split}$ (21) $$

Here, $I_{\text{help}}(y\succ y^{\prime})$ determines whether $y$ is the win response or lose response. In other words,

$$ $I_{\text{safe}}(y^{hw})=I_{\text{safe}}(y)I_{\text{help}}(y\succ y^{\prime})+I _{\text{safe}}(y^{\prime})I_{\text{help}}(y^{\prime}\succ y),$ $$

and the same applies to $I_{\text{safe}}(y^{hl})$.
To enable the reordering of the variables, we further multiply the formula by $2I_{\text{help}}(y\succ y^{\prime})-1$, since $h_{\pi}(y,y^{\prime})=-h_{\pi}(y^{\prime},y)$
By organizing the terms, we have

$$ $\begin{split}g_{I}(y,y^{\prime})=&(B_{1}B_{3}-B_{3})I_{\text{help}}(y\succ y^{ \prime})I_{\text{safe}}(y)+(B_{1}B_{3}-B_{3})I_{\text{help}}(y\succ y^{\prime} )I_{\text{safe}}(y^{\prime})\\ &-B_{1}B_{3}I_{\text{safe}}(y^{\prime})+B_{3}I_{\text{safe}}(y)+2B_{2}B_{3}I_{ \text{help}}(y\succ y^{\prime})-B_{2}B_{3}\end{split}$ $$

We first establish the equivalence of the two optimization problems in Equation 22 and Equation 23 under the specific choice of constants, and then provide the general relation of constants for the equivalence.

Here, we use the following constants:

$$ $A_{1}=E_{s},A_{2}=\frac{1}{2},B_{1}=3,B_{2}=0,B_{3}=\frac{1}{2}.$ $$

###### Theorem B.4 .

The optimization problem

$$ $\min_{\pi_{\theta}}\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi_{\theta}(y)}\Big{ [}h_{\pi}(y,y^{\prime})-\frac{g\big{(}p_{\text{safe}}^{*}(y),p_{\text{help}}^{ *}(y)\big{)}-g\big{(}p_{\text{safe}}^{*}(y^{\prime}),p_{\text{help}}^{*}(y^{ \prime})\big{)}}{\tau}\Big{]}^{2},$ (22) $$

where $g(y)=(p_{\text{safe}}^{*}(y)+E_{s})(p_{\text{help}}^{*}(y\succ\pi)+\frac{1}{2})$,
is equivalent to the optimization problem

$$ $\min_{\pi_{\theta}}\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi_{\theta}(y),I\sim \text{Bernoulli}}\bigg{[}\Big{(}h_{\pi}(y,y^{\prime})-\frac{g_{I}(y,y^{\prime} )}{\tau}\Big{)}^{2}\bigg{]},$ (23) $$

where

$$ $g_{I}(y,y^{\prime})=I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y)+I_{ \text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{\prime})+\frac{1}{2}I_{\text {safe}}(y)-\frac{3}{2}I_{\text{safe}}(y^{\prime})$ $$

Here, $I\sim\text{Bernoulli}$ denotes the Bernoulli variables $I_{\text{safe}}(y)$ and $I_{\text{safe}}(y^{\prime})$.

###### Proof.

The two minimization problems are both over $\pi_{\theta}$, so we only need to focus on the terms that involve $\pi_{\theta}$. Specifically, the first term and the cross term after expanding the square expression in the two minimization problems. The first term is the same. Here we prove the cross term is also the same.

Let $\pi_{y}=\log(\pi(y))$, $\pi_{y}^{R}=\log(\pi_{\text{ref}}(y))$, then we can write

$$ $h_{\pi}(y,y^{\prime})=\pi_{y}-\pi_{y^{\prime}}+\pi^{R}_{y^{\prime}}-\pi^{R}_{y}$ $$

Let $p_{h}(y)=p_{\text{help}}^{*}(y\succ\pi)$ and $p_{s}(y)=p_{\text{safe}}^{*}(y)$.
The cross term of Equation 22 can be written as

$$ $\begin{split}&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\left[h_{\pi}(y,y^{ \prime})\left(g\big{(}p_{\text{safe}}^{*}(y),p_{\text{help}}^{*}(y\succ\pi) \big{)}-g\big{(}p_{\text{safe}}^{*}(y^{\prime}),p_{\text{help}}^{*}(y^{\prime} \succ\pi)\big{)}\right)\right]\\ =&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\left[(\pi_{y}-\pi_{y^{\prime}}+ \pi^{R}_{y^{\prime}}-\pi^{R}_{y})\left(g\big{(}p_{s}(y),p_{h}(y))-g(p_{s}(y^{ \prime}),p_{h}(y^{\prime})\big{)}\right)\right]\\ =&\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(\pi_{y}-\pi^{R}_{y})\left(g(p_{s}(y),p _{h}(y))-\mathbb{E}_{y^{\prime}\sim\pi}\big{[}g\big{(}p_{s}(y^{\prime}),p_{h}( y^{\prime})\big{)}\big{]}\right)\right]\\ +&\mathbb{E}_{x\sim\rho,y^{\prime}\sim\pi}\left[(-\pi_{y^{\prime}}+\pi^{R}_{y^ {\prime}})\left(\mathbb{E}_{y\sim\pi}\big{[}g\big{(}p_{s}(y),p_{h}(y)\big{)} \big{]}-g\big{(}p_{s}(y^{\prime}),p_{h}(y^{\prime})\big{)}\right)\right]\end{split}$ (24) $$

The third equality is by the independence of $y$ and $y^{\prime}$. By the change of notation, the second term of the last line can be written as

$$ $\begin{split}&\mathbb{E}_{x\sim\rho,y^{\prime}\sim\pi}\left[(-\pi_{y^{\prime}} +\pi^{R}_{y^{\prime}})\left(\mathbb{E}_{y\sim\pi}\big{[}g(p_{s}(y),p_{h}(y)) \big{]}-g(p_{s}(y^{\prime}),p_{h}(y^{\prime}))\right)\right]\\ =&\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(-\pi_{y}+\pi^{R}_{y})\left(\mathbb{E}_ {y^{\prime}\sim\pi}\big{[}g(p_{s}(y^{\prime}),p_{h}(y^{\prime}))\big{]}-g(p_{s }(y),p_{h}(y))\right)\right]\end{split}$ (25) $$

Then Equation 24 can be written as

$$ $(\ref{eq:proofrhs})=\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(\pi_{y}-\pi^{R}_{y}) \cdot 2\left(g(p_{s}(y),p_{h}(y))-\mathbb{E}_{y^{\prime}\sim\pi}\big{[}g(p_{s} (y^{\prime}),p_{h}(y^{\prime}))\big{]}\right)\right]$ (26) $$

Now we plug in $g(p_{s}(y),p_{h}(y))=(p_{s}(y)+E_{s})(p_{h}(y)+\frac{1}{2})$ and use the fact $\mathbb{E}_{y^{\prime}\sim\pi}[p_{h}(y^{\prime}\succ\pi)]=\frac{1}{2}$.
Equation 26 can be expanded as

$$ $\begin{split}(\ref{eq:proofrhs})=&\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(\pi_{y }-\pi^{R}_{y})\cdot 2\left((p_{s}(y)+E_{s})(p_{h}(y)+\frac{1}{2})-\mathbb{E}_{ y^{\prime}\sim\pi}\big{[}(p_{s}(y^{\prime})+E_{s})(p_{h}(y^{\prime})+\frac{1}{ 2})\big{]}\right)\right]\\ =&\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(\pi_{y}-\pi^{R}_{y})\cdot 2\left((p_{s }(y)+E_{s})(p_{h}(y)+\frac{1}{2})-2E_{s}\right)\right]\\ =&\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(\pi_{y}-\pi^{R}_{y})\cdot\left(2p_{s}( y)p_{h}(y)+2E_{s}p_{h}(y)+p_{s}(y)-3E_{s}\right)\right]\end{split}$ (27) $$

The cross term of Equation 23 can be written as

$$ $\begin{split}&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text {Bernoulli}}\left[h_{\pi}(y,y^{\prime})g_{I}(y,y^{\prime})\right]\\ =&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \left[(\pi_{y}-\pi_{y^{\prime}}+\pi^{R}_{y^{\prime}}-\pi^{R}_{y})g_{I}(y,y^{ \prime})\right]\\ \end{split}$ (28) $$

Now we plug in $g_{I}=I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y)+I_{\text{help}}(y
\succ y^{\prime})I_{\text{safe}}(y^{\prime})+\frac{1}{2}I_{\text{safe}}(y)-
\frac{3}{2}I_{\text{safe}}(y^{\prime})$,

$$ $\begin{split}(\ref{eq:prooflhs})=&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi} \mathbb{E}_{I\sim\text{Bernoulli}}\Big{[}(\pi_{y}-\pi_{y^{\prime}}+\pi^{R}_{y^ {\prime}}-\pi^{R}_{y})\big{(}I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}} (y)\\ &\hskip 142.26378pt+I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{ \prime})+\frac{1}{2}I_{\text{safe}}(y)-\frac{3}{2}I_{\text{safe}}(y^{\prime}) \big{)}\Big{]}\\ =&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \Big{[}(\pi_{y}-\pi^{R}_{y})\big{(}I_{\text{help}}(y\succ y^{\prime})I_{\text{ safe}}(y)\\ &\hskip 142.26378pt+I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{ \prime})+\frac{1}{2}I_{\text{safe}}(y)-\frac{3}{2}I_{\text{safe}}(y^{\prime}) \big{)}\Big{]}\\ &+\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \Big{[}(-\pi_{y^{\prime}}+\pi^{R}_{y^{\prime}})\big{(}I_{\text{help}}(y\succ y ^{\prime})I_{\text{safe}}(y)\\ &\hskip 142.26378pt+I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{ \prime})+\frac{1}{2}I_{\text{safe}}(y)-\frac{3}{2}I_{\text{safe}}(y^{\prime}) \big{)}\Big{]}\\ \end{split}$ $$

With the similar change of notation as Equation 25, as well as the fact that $1-I_{\text{help}}(y\succ y^{\prime})=I_{\text{help}}(y^{\prime}\succ y)$, the last line can be written as

$$ $\begin{split}&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text {Bernoulli}}\Big{[}(-\pi_{y^{\prime}}+\pi^{R}_{y^{\prime}})\big{(}I_{\text{ help}}(y\succ y^{\prime})I_{\text{safe}}(y)\\ &\hskip 142.26378pt+I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{ \prime})+\frac{1}{2}I_{\text{safe}}(y)-\frac{3}{2}I_{\text{safe}}(y^{\prime}) \big{)}\Big{]}\\ =&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \Big{[}(-\pi_{y}+\pi^{R}_{y})\big{(}I_{\text{help}}(y^{\prime}\succ y)I_{\text {safe}}(y^{\prime})\\ &\hskip 142.26378pt+I_{\text{help}}(y^{\prime}\succ y)I_{\text{safe}}(y)+\frac {1}{2}I_{\text{safe}}(y^{\prime})-\frac{3}{2}I_{\text{safe}}(y)\big{)}\Big{]} \\ =&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \Big{[}(-\pi_{y}+\pi^{R}_{y})\big{(}(1-I_{\text{help}}(y\succ y^{\prime}))I_{ \text{safe}}(y^{\prime})\\ &\hskip 142.26378pt+(1-I_{\text{help}}(y\succ y^{\prime}))I_{\text{safe}}(y)+ \frac{1}{2}I_{\text{safe}}(y^{\prime})-\frac{3}{2}I_{\text{safe}}(y)\big{)} \Big{]}\end{split}$ $$

Then we further expand Equation 28 as

$$ $\begin{split}(\ref{eq:prooflhs})=&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi} \mathbb{E}_{I\sim\text{Bernoulli}}\Big{[}(\pi_{y}-\pi^{R}_{y})\big{(}I_{\text{ help}}(y\succ y^{\prime})I_{\text{safe}}(y)\\ &\hskip 142.26378pt+I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{ \prime})+\frac{1}{2}I_{\text{safe}}(y)-\frac{3}{2}I_{\text{safe}}(y^{\prime}) \big{)}\Big{]}\\ &+\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \Big{[}(-\pi_{y}+\pi^{R}_{y})\big{(}(1-I_{\text{help}}(y\succ y^{\prime}))I_{ \text{safe}}(y^{\prime})\\ &\hskip 142.26378pt+(1-I_{\text{help}}(y\succ y^{\prime}))I_{\text{safe}}(y)+ \frac{1}{2}I_{\text{safe}}(y^{\prime})-\frac{3}{2}I_{\text{safe}}(y)\big{)} \Big{]}\\ =&\mathbb{E}_{x\sim\rho,y,y^{\prime}\sim\pi}\mathbb{E}_{I\sim\text{Bernoulli}} \Big{[}(\pi_{y}-\pi^{R}_{y})\big{(}2I_{\text{help}}(y\succ y^{\prime})I_{\text {safe}}(y)\\ &\hskip 142.26378pt+2I_{\text{help}}(y\succ y^{\prime})I_{\text{safe}}(y^{ \prime})+I_{\text{safe}}(y)-3I_{\text{safe}}(y^{\prime})\big{)}\Big{]}\end{split}$ (29) $$

Taking the expectation over $y^{\prime}$ and the Bernoulli variables, we have

$$ $(\ref{eq:prooflhs})=\mathbb{E}_{x\sim\rho,y\sim\pi}\Big{[}(\pi_{y}-\pi^{R}_{y} )\big{(}2p_{h}(y)p_{s}(y)+2E_{s}p_{h}(y)+p_{s}(y)-3E_{s}\big{)}\Big{]}$ (30) $$

This equation is the same as Equation 27, which ends the proof that Equation 22 and Equation 23 are equivalent!
∎

As discussed in Section B.2, we can freely change the order of $y$ and $y^{\prime}$ in Equation 22 and Equation 23. Thus, the proof of Theorem B.4 also applies to Theorem 3.2.

###### Theorem B.4 .

###### Proof.

### B.4 Relation of the Constants

In this section, we derive a more general form of Theorem B.4, where, with specific relations between the constants in $g$ and $g_{I}$, the optimization problem in Equation 22 is equivalent to the optimization problem in Equation 23.

We restate $g$ and $g_{I}$ here with the notations used in the Appendix for convenience.

$$ $g=(p_{s}(y)+A_{1})(p_{h}(y)+A_{2}),$ $$

and

$$ $\begin{split}g_{I}(y,y^{\prime})=&(B_{1}B_{3}-B_{3})I_{\text{help}}(y\succ y^{ \prime})I_{\text{safe}}(y)+(B_{1}B_{3}-B_{3})I_{\text{help}}(y\succ y^{\prime} )I_{\text{safe}}(y^{\prime})\\ &-B_{1}B_{3}I_{\text{safe}}(y^{\prime})+B_{3}I_{\text{safe}}(y)+2B_{2}B_{3}I_{ \text{help}}(y\succ y^{\prime})-B_{2}B_{3}\end{split}$ $$

As discussed in the proof of Theorem B.4, we only need to find the relationship such that the cross terms of the two optimization problems are identical. We first expand the cross term of the optimization problem in Equation 22. As in Equation 26, it can be written as

$$ $(\ref{eq:proofrhs})=\mathbb{E}_{x\sim\rho,y\sim\pi}\left[(\pi_{y}-\pi^{R}_{y}) \cdot 2\left(g(p_{s}(y),p_{h}(y))-\mathbb{E}_{y^{\prime}\sim\pi}\big{[}g(p_{s} (y^{\prime}),p_{h}(y^{\prime}))\big{]}\right)\right]$ (31) $$

Using the same strategy of obtaining Equation 29,
we have

$$ $(\ref{eq:prooflhs})=\mathbb{E}_{x\sim\rho,y\sim\pi}\Big{[}(\pi_{y}-\pi^{R}_{y} )\big{(}2B_{3}(B_{1}-1)p_{s}(y)p_{h}(y)\\ +2B_{3}((B_{1}-1)E_{s}+2B_{2})p_{h}(y)+2B_{3}p_{s}(y)-2B_{1}B_{3}E_{s}-2B_{2}B _{3}\big{)}\Big{]}$ (32) $$

Aligning the coefficients of each term in Equation 31 and Equation 32, we derive the following set of equations:

$$ $\begin{split}B_{3}(B_{1}-1)&=1,\\ E_{s}+2B_{3}B_{3}&=A_{1},\\ B_{3}&=A_{2}.\end{split}$ (33) $$

Solving these equations gives us the specific forms of $g$ and $g_{I}$. Here $B_{2}$ is a shifting value that we define to align with our intuition. $B_{3}$ is a scaling factor that is related to the penalty $\tau$.

### B.5 Discussion of the Property of g I subscript 𝑔 𝐼 g_{I} italic_g start_POSTSUBSCRIPT italic_I end_POSTSUBSCRIPT

In this section, we discuss the two beneficial properties of $g_{I}$ that we proposed in Section 3.2.

Skew-Symmetric Property.
First, we examine the skew-symmetric property of $g_{I}$. When combined with the skew-symmetric property of $h$, this implies:

$$ $\left(h_{\pi}(y,y^{\prime})-\tau^{-1}g_{I}(y,y^{\prime})\right)^{2}=\left(h_{ \pi}(y^{\prime},y)-\tau^{-1}g_{I}(y^{\prime},y)\right)^{2}.$ $$

This means that for the same data point, regardless of the order of $y$ and $y^{\prime}$, we are always driving $h_{\pi}(y,y^{\prime})$ to the same value. In contrast, in IPO [], different orders will push $h_{\pi}(y,y^{\prime})$ to different values, i.e., they form two different optimization problems:

$$ $(h_{\pi}(y,y^{\prime})-\tau^{-1}g_{I}(y,y^{\prime}))^{2}\quad\text{and}\quad(h _{\pi}(y^{\prime},y))^{2}.$ $$

Their final optimization problem, $(h_{\pi}(y,y^{\prime})-\frac{1}{2}\tau^{-1}g_{I}(y,y^{\prime}))^{2}$, tries to find a middle point of $h$ that optimizes both. However, this point is neither the optimal solution of the first problem nor the second problem.

Shifting Property.
Second, we discuss the shifting properties of $g_{I}$. Since Theorem 3.2 holds based on the equality of Equation 30 and Equation 27, and all the operations to derive these two equations are valid under linear transformations of $p_{\text{safe}}^{*},p_{\text{help}}^{*}$ and $I_{\text{safe}},I_{\text{help}}$, respectively. It implies that Theorem 3.2 also holds under the same linear transformations of $p_{\text{safe}}^{*},p_{\text{help}}^{*}$ and $I_{\text{safe}},I_{\text{help}}$.

This property is useful when we want to manually design the values of $g_{I}$, as shown in Figure 3.

## Appendix C Experiment

### C.1 Details of Harmlessness Benchmark

The following are the details of the datasets used in the benchmark:

- •
CrowS-Pairs: A challenge set for evaluating the tendency of language models (LMs) to generate biased outputs. We evaluate the English subset and [implementation by LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/blob/main/lm_eval/tasks/crows_pairs/README.md) and report the Percentage of Stereotype metric.
- •
Bias Benchmark for QA (BBQ): Measures social biases in the output of multiple-choice question-answering models. We use the Lite version and [implementation by BigBench](https://github.com/google/BIG-bench/tree/main/bigbench/benchmark_tasks/bbq_lite) and report the Accuracy metric.
- •
WinoGrande: A collection of 44K problems inspired by the Winograd Schema Challenge, adjusted to improve scale and robustness against dataset-specific biases. We use the [implementation by LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/winogrande) and report the Accuracy metric.
- •
ETHICS: A benchmark spanning concepts in justice, well-being, duties, virtues, and commonsense morality. We use the [implementation by LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/winogrande) and report the Accuracy for all sub-tasks.
- •
BigBench Moral Permissibility: Tests whether ultra-large language models can read a short story where a moral scenario is presented and answer the question, "Is it morally permissible to do X?" in a manner similar to humans. We use the [implementation by BigBench](https://github.com/google/BIG-bench/blob/main/bigbench/benchmark_tasks/moral_permissibility/README.md) and report the Accuracy metric.
- •
BigBench Simple Ethics Questions: Assesses a language model’s responses to hypothetical, consequential, political, and social questions. We use the [implementation by BigBench](https://github.com/google/BIG-bench/tree/main/bigbench/benchmark_tasks/simple_ethical_questions) and report the Accuracy metric.
- •
ToxicGen: A benchmark for evaluating the ability of language models to classify input text as either hateful or not hateful. We use the [implementation by LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/toxigen) and report the Accuracy metric.
- •
BigBench HHH Alignment: Evaluates language models on alignment, pragmatically broken down into the categories of helpfulness, honesty/accuracy, harmlessness, and other aspects. We use the [implementation by BigBench](https://github.com/google/BIG-bench/tree/main/bigbench/benchmark_tasks/hhh_alignment) and report the Accuracy metric.
- •
AdvBench contains harmful prompts. We use the prompts provided [here](https://github.com/llm-attacks/llm-attacks/blob/main/data/advbench/harmful_behaviors.csv) and generation implementation by LM Evaluation Harness. We report the percentage of harmless responses measured by [HarmBench-Llama-2-13b-cls](https://huggingface.co/cais/HarmBench-Llama-2-13b-cls) model.
- •
RealToxicityPrompts: A benchmark for evaluating the ability of language models to continue a prompt in a non-toxic way. We use the [implementation by LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/toxigen) report the percentage of harmless responses measured by [HarmBench-Llama-2-13b-cls](https://huggingface.co/cais/HarmBench-Llama-2-13b-cls) model.
- •
ALERT: A benchmark to assess the safety of LLMs through red teaming methodologies. We use the prompts provided [here](https://huggingface.co/datasets/Babelscape/ALERT) and generation implementation by LM Evaluation Harness. We report the percentage of harmless responses measured by [HarmBench-Llama-2-13b-cls](https://huggingface.co/cais/HarmBench-Llama-2-13b-cls) model.
- •
ALERT Adversarial: A benchmark to assess the safety of LLMs through red teaming methodologies with adversarial prompts. We use the prompts provided [here](https://huggingface.co/datasets/Babelscape/ALERT/viewer/alert_adversarial) and generation implementation by LM Evaluation Harness. We report the percentage of harmless responses measured by [HarmBench-Llama-2-13b-cls](https://huggingface.co/cais/HarmBench-Llama-2-13b-cls) model.
- •
AlpacaEval Based on the AlpacaFarm evaluation set, which tests the ability of models to follow general user instructions. We employ the [official implementation](https://github.com/tatsu-lab/alpaca_eval) report the LC Win Rate.

### C.2 Details of Baselines

The following are the details of the methods that align LLMs for multiple objectives.

- •
Llama2 [] trains the safety reward $r_{\text{safe}}$ and the helpfulness reward $r_{\text{help}}$ separately, and defines the global reward $g$ as a combination of these rewards, *i.e*.,
$\displaystyle\tilde{g}(y|x)=\begin{cases}r_{\text{safe}}(y|x)\text{ if }\text{
IS_SAFETY}(x),\text{ or }r_{\text{safe}}(y|x)<0.15,\\
r_{\text{help}}(y|x)\text{ otherwise},\end{cases}$
$\displaystyle g(y|x)=\text{WHITEN}(\text{LOGIT}(\tilde{g}(y|x))).$
Here IS_SAFETY$(x)$ indicates whether prompts are tagged as unsafe in their dataset, and the 0.15 threshold is chosen to filter unsafe responses according to the evaluation on Meta Safety test set. Whitening the final linear scores is to increase stability. The global reward is used in the RLHF objective in Equation 3.
- •
Beaver [] trains the safety reward $r_{\text{safe}}$ and the helpfulness reward $r_{\text{help}}$ separately, and defines the final RLHF objective as the dual optimization problem of the conditional RLHF, obtained by Lagrangian dual transformation, *i.e*.,
$\min_{\theta}\max_{\lambda\geq 0}\mathbb{E}_{x\sim D,y\sim\pi_{\theta}}\left[-
r_{\text{help}}(y|x)+\lambda\left(r_{\text{safe}}(y|x)+d\right)\right],$
where $\lambda\geq 0$ is the Lagrange multiplier. In practice, the model parameter $\theta$ and the Lagrange multiplier $\lambda$ are updated iteratively.
- •
RBR [] requires separate reward models, $r_{\phi_{1}},\dots,r_{\phi_{k}}$, for each objective, and propose to learn the weight for each objective, *i.e*.,
- •
$g(y|x)=\sum_{i=1}^{k}\lambda_{i}r_{i}(y|x),$
where $\lambda_{i}$ are learnable parameters. The global reward is used in the RLHF objective in Equation 3.
- •
SteerLM [] trains models to generate response according to a specific reward vector $r=(r_{1},r_{2},r_{3},\dots,r_{k})$. They first train a model to predict the score for each objective in a dataset. Supervised fine-tuning is performed to maximize the probability of generating responses conditioned on the reward vector and the prompt, *i.e*.,
$\max_{\theta}\mathbb{E}_{(x,y,r)\sim D}\log p_{\theta}(y|x,r).$
- •
MORL [] trains reward models for each objective separately, and defines the global reward $g$ as a combination of rewards, *i.e*.,
$g(y|x)=\sum_{i=1}^{k}\lambda_{i}r_{i}(y|x),$
The global reward is used in the RLHF objective in Equation 3.
- •
ArmoRM [] applies the same training strategy as MORL, but uses a single publicly available reward model, ArmoRM-Llama3-8B-v0.1 [], to provide the reward scores for all objectives.
- •
MODPO [] trains margin reward models $r_{i},i=1,\dots,k$ for each objective separately, and performs supervised fine-tuning with the objective,
$\max\mathbb{E}_{(x,y^{w},y^{l})\sim D}\\
\log\sigma\left(\frac{1}{\omega_{k}}\left(\tau\log\frac{\pi_{\theta}(y^{w}|x)}
{\pi_{\text{ref}}(y^{w}|x)}-\tau\log\frac{\pi_{\theta}(y^{l}|x)}{\pi_{\text{
ref}}(y^{l}|x)}-{\omega}_{-k}^{T}(r_{-k}(x,y^{w})-r_{-k}(x,y^{l}))\right)
\right),$
where $\omega_{k}$ is the weight for the objective $k$, $\omega_{-k}$ is the weight vector for all other objectives, and $r_{-k}$ is the reward vector for all other objectives than $k$. This fine-tuning is performed for each objective.
- •
MinMaxRLHF [] addresses the scenario where different annotators $h$ may have preferences for different objectives. The algorithm uses the EM algorithm to learn the distribution of rewards for multiple objectives. In the E step, they find the certain objective $i$ that each human annotator $h$ relates to, *i.e*.,
$\mathcal{I}_{h}=\text{argmax}_{i}\Pi_{x,y,y^{\prime},h}\frac{\exp(r_{\phi_{i}}
(x,y))}{\exp(r_{\phi_{i}}(x,y))+\exp(r_{\phi_{i}}(x,y^{\prime}))},$
where $r_{\phi_{i}}$ is the reward model for the objective $i$. In the M step, each reward model $i$ is updated by the reward learning objective in Equation 1 with the data assigned to objective $i$, *i.e*., the dataset is $D_{i}=\{(x,y,y^{\prime},h),\mathcal{I}_{h}=i\}$. In the RLHF stage, they maximize the minimum reward of all reward scores, *i.e*.,
$\mathbb{E}_{x\sim D,y\sim\pi_{\theta}}\big{[}\min_{i}r_{\phi_{i}}(x,y)-\tau
\text{KL}\left[\pi_{\theta}(y|x)||\pi_{\text{ref}}(y|x)\right]\big{]}.$

Among these methods, MODPO is highly inefficient since it requires separate RLHF for each objective. Other methods typically use a linear combination of reward scores for multiple objectives or one reward as a threshold for others. For the combination of thresholding, the global function can be approximated by the multiplication of rewards for each objective when the reward scores are on the same scale. Maximizing the multiplication of rewards has the same effect as maximizing the minimum reward. Therefore, we hypothesize that the global reward should be a bilinear combination of the reward scores as in Equation 10.

### C.3 Full Experiment Results

Table 6 shows the full results of the open-sourced models, our baselines, and our models on the benchmarks. Here are the details of each open-sourced models:

- •
Zephyr: [https://huggingface.co/HuggingFaceH4/zephyr-7b-beta](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta)
- •
Juanako: [https://huggingface.co/fblgit/juanako-7b-UNA](https://huggingface.co/fblgit/juanako-7b-UNA)
- •
OpenChat: [https://huggingface.co/openchat/openchat_3.5](https://huggingface.co/openchat/openchat_3.5)
- •
Mistral: [https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)
- •
Beaver: [https://huggingface.co/PKU-Alignment/beaver-7b-v3.0](https://huggingface.co/PKU-Alignment/beaver-7b-v3.0)
- •
Llama2: [https://huggingface.co/meta-llama/Llama-2-7b-chat-hf](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf)
- •
Llama3: [https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct)

Table 7 and Table 8 shows the full results of our baselines and our models on the benchmarks. Here are the details of the data used in our model and the baselines

We use 4 Nvidia A100 GPUs for each experiment, and the training time for each experiment is around 6 hours for SFT and 6 hours for BFPO.
For the experiments with red teaming data, we use 1.5K data collected as described in Section 4.3 and only performs the BFPO stage. The training time for this experiment is around 10 minutes with 4 Nvidia A100 GPUs.

**Table 6: Full results of the open-sourced models and safety aligned on the benchmarks.**
|  | Zephyr | Juanako | OpenChat | Mistral | Beaver | Llama2 | Llama3 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Alpaca Eval | 10.99 | 2.88 | 11.08 | 14.72 | 1.00 | 7.60 | 22.90 |
| Crows Pairs | 62.02 | 63.74 | 66.67 | 64.88 | 56.23 | 63.98 | 63.45 |
| BBQ | 39.00 | 84.00 | 61.00 | 61.84 | 31.37 | 32.99 | 60.68 |
| Winogrande | 72.38 | 77.43 | 72.69 | 73.80 | 65.35 | 66.46 | 71.82 |
| Ethics CM | 68.37 | 75.96 | 68.88 | 73.46 | 59.43 | 56.14 | 58.64 |
| Ethics Justice | 69.71 | 76.41 | 77.74 | 71.93 | 64.61 | 50.00 | 70.38 |
| Ethics Deontology | 56.98 | 64.10 | 63.96 | 60.26 | 61.48 | 50.00 | 64.49 |
| Ethics Utilitarianism | 73.59 | 73.79 | 73.48 | 66.78 | 56.01 | 57.97 | 62.92 |
| Ethics Virtue | 91.30 | 89.13 | 88.70 | 90.87 | 61.61 | 72.00 | 81.49 |
| Moral Permissibility | 51.00 | 49.00 | 50.00 | 47.95 | 47.66 | 47.37 | 48.54 |
| Simple Ethical Questions | 33.00 | 82.00 | 91.00 | 53.91 | 45.22 | 24.35 | 54.78 |
| Toxigen | 45.21 | 60.96 | 42.34 | 55.11 | 36.17 | 51.00 | 45.74 |
| HHH Alignment | 46.00 | 49.00 | 46.00 | 47.06 | 43.44 | 44.34 | 45.25 |
| Disc. Avg. | 59.05 | 70.46 | 66.87 | 63.99 | 52.38 | 51.38 | 60.68 |
| AdvBench | 85.82 | 85.90 | 87.82 | 83.74 | 85.07 | 87.91 | 89.49 |
| RealToxicityPrompts | 20.19 | 27.50 | 48.27 | 65.38 | 93.20 | 100.00 | 99.42 |
| ALERT | 79.08 | 80.70 | 75.36 | 90.44 | 91.83 | 98.62 | 95.18 |
| ALERT Adversarial | 66.68 | 72.79 | 73.09 | 77.71 | 94.80 | 98.32 | 95.08 |
| Generative Average | 62.94 | 66.72 | 71.13 | 79.32 | 91.23 | 96.21 | 94.79 |
| Safety Average | 60.99 | 68.59 | 69.00 | 71.65 | 71.80 | 73.80 | 77.74 |

**Table 7: Full results of Table 2**
|  | Mistral<br>+ DPO-H | Mistral<br>+ DPO-S | Mistral<br>+ DPO | Mistral<br>+ IPO | Mistral<br>+ MORL | Mistral<br>+ BFPO |
| --- | --- | --- | --- | --- | --- | --- |
| Alpaca Eval | 10.99 | 4.34 | 14.71 | 13.16 | 10.83 | 13.33 |
| Crows Pairs | 62.02 | 65.65 | 65.59 | 66.25 | 61.66 | 65.77 |
| BBQ | 39.00 | 39.50 | 43.68 | 42.44 | 39.43 | 45.25 |
| Winogrande | 72.38 | 74.03 | 74.27 | 74.66 | 71.51 | 74.98 |
| Ethics CM | 68.37 | 64.22 | 56.47 | 62.03 | 68.01 | 65.25 |
| Ethics Justice | 69.71 | 55.29 | 71.01 | 66.35 | 67.71 | 59.13 |
| Ethics Deontology | 56.98 | 50.86 | 58.20 | 54.67 | 55.70 | 51.97 |
| Ethics Utilitarianism | 73.59 | 60.00 | 57.15 | 67.03 | 72.57 | 70.36 |
| Ethics Virtue | 91.30 | 89.73 | 86.71 | 89.17 | 91.08 | 90.41 |
| Moral Permissibility | 51.00 | 46.78 | 51.17 | 47.37 | 50.58 | 47.37 |
| Simple Ethical Q. | 33.00 | 38.26 | 39.13 | 37.39 | 33.91 | 39.13 |
| Toxigen | 45.21 | 47.45 | 51.06 | 48.72 | 44.15 | 54.15 |
| HHH Alignment | 46.00 | 45.25 | 45.70 | 44.80 | 46.15 | 45.25 |
| Disc. Avg. | 59.05 | 56.42 | 58.35 | 58.41 | 58.54 | 59.09 |
| AdvBench | 85.82 | 87.74 | 82.49 | 86.41 | 87.07 | 87.32 |
| RealToxicityPrompts | 20.19 | 100.00 | 4.23 | 88.65 | 21.15 | 98.65 |
| ALERT | 79.08 | 99.91 | 38.64 | 96.00 | 82.13 | 98.56 |
| ALERT Adversarial | 66.68 | 99.98 | 33.46 | 88.00 | 69.16 | 96.42 |
| Gen. Avg. | 62.94 | 96.91 | 39.71 | 89.76 | 64.88 | 95.24 |
| Safety Avg. | 60.99 | 76.66 | 49.03 | 74.09 | 61.71 | 77.16 |

**Table 8: Full results of Table 2 and Table 4**
|  | DPO | IPO | MORL | BFPO | BFPO<br>w/o buffer | BFPO<br>w/o shift |
| --- | --- | --- | --- | --- | --- | --- |
| Alpaca Eval | 13.07 | 13.74 | 12.56 | 14.41 | 12.76 | 15.59 |
| Crows Pairs | 61.84 | 61.96 | 61.66 | 61.72 | 65.95 | 65.65 |
| BBQ | 38.95 | 38.89 | 38.47 | 39.44 | 44.44 | 44.43 |
| Winogrande | 72.45 | 72.77 | 71.98 | 72.45 | 74.98 | 74.43 |
| Ethics CM | 67.77 | 68.03 | 66.07 | 67.28 | 62.50 | 61.13 |
| Ethics Justice | 69.12 | 69.30 | 69.16 | 68.01 | 59.87 | 69.05 |
| Ethics Deontology | 57.48 | 57.62 | 56.98 | 57.20 | 52.28 | 56.56 |
| Ethics Utilitarianism | 73.63 | 73.54 | 73.02 | 73.46 | 66.64 | 67.08 |
| Ethics Virtue | 91.42 | 91.48 | 91.36 | 91.54 | 88.78 | 89.79 |
| Moral Permissibility | 50.88 | 50.58 | 51.17 | 49.12 | 47.66 | 47.37 |
| Simple Ethical Q. | 36.52 | 36.52 | 33.04 | 37.39 | 50.43 | 46.96 |
| Toxigen | 45.11 | 45.43 | 44.26 | 45.32 | 49.89 | 53.94 |
| HHH Alignment | 46.15 | 45.70 | 45.70 | 45.25 | 45.70 | 45.25 |
| Disc. Avg. | 59.28 | 59.32 | 58.57 | 59.02 | 59.09 | 60.14 |
| AdvBench | 87.99 | 87.91 | 87.66 | 87.82 | 84.32 | 84.82 |
| RealToxicityPrompts | 44.00 | 41.35 | 21.15 | 86.54 | 96.15 | 85.77 |
| ALERT | 89.22 | 87.48 | 82.13 | 86.34 | 96.90 | 95.37 |
| ALERT Adversarial | 76.33 | 74.55 | 69.16 | 94.47 | 94.12 | 89.08 |
| Gen. Avg. | 74.39 | 72.82 | 65.02 | 88.79 | 92.87 | 88.76 |
| Safety Avg. | 66.83 | 66.07 | 61.80 | 73.90 | 75.98 | 74.45 |

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 6
presentation: 2
questions: See the weakness.
soundness: 3
strengths: 1. This paper converts the multi-objective RLHF objective into a direct preference alignment paradigm that balances the safety and helpfulness.
2. Derived from existing findings, this paper used the global reward and safety label functions to effectively fine-tune the model towards safety and helpfulness via a supervised learning form. Though the notations part of the method is not clear enough, the theoretical part is mostly correct.
3. The experiments include various datasets to demonstrate the effectiveness of the proposed method in improving the model's safety and helpfulness.
summary: This paper proposes Bi-Factorial Preference Optimization (BFPO) to address the limitations in balancing the helpfulness and safety. Specifically, this paper converts the multi objective RLHF into a modified direct preference alignment, while considering the factor of safety. Through experiments on several alignment datasets including helpfulness and safety, this paper demonstrates the effectiveness of the proposed method.
weaknesses: 1. This paper overclaims that it does not need human annotations. However, the preference datasets used for BFPO still need the annotations. You can't claim it does not need it only because these datasets are publicly available. Otherwise, nearly all methods can claim they don't need any annotations since there likely existed a prepared dataset before. I hope the authors can revise this part.
2. My major concern is about the writing and annotations of the method section. There are many annotations are not well explained and even confusing. For example, Eq. 5 should have more details instead of citing two papers. L347 is also confusing, $\theta$ is the param of the model, what do you mean be softmax it? How do you define the action space? Also, the term of buffered training is confusing, I don't see the connection between it with buffering in RL. It seems like it just sampled two batches from safety and helpfulness datasets.
3. Question: Why don't the authors adopt LoRA or other existing PEFT methods? Freezing the selected layers of LLM for fine-tuning may be not fair for baseline methods, and often need more validation in the experiments. I hope the authors can validate BFPO with LoRA.
4. Question: what's the difference between your label function and the reward model (including helpfulness and safety) used in Llama? Llama uses piecewise function, and should have similar impacts on training the LLM?

---

confidence: 4
contribution: 3
initial_rating: 8
presentation: 3
questions: Since two hyperparameters, \tau and \alpha, are included in the loss BFPO, could you conduct experiments with a wider range of values for them to test their impact on the final results?
soundness: 3
strengths: 1. This paper proposes an interesting method to fine tune LLM directly on the preference datasets to balance helpfulness and safety. In addition, the justification and theorems provide a solid foundation.

2. Experimental results show superior performance. In the experiment of table 1, results demonstrate better balance between safety and helpfulness.
summary: This paper presents a supervised learning framework called Bi-Factorial Preference Optimization (BFPO) for enhancing both the safety and helpfulness of large language models (LLMs). By re-parameterizing the multi-objective reinforcement learning from human feedback (RLHF) approach, BFPO integrates the objectives of safety and helpfulness into a single supervised learning objective. In addition, this paper establishes a benchmark based on existing datasets. The experiments demonstrate a superior balance over safety and helpfulness.
weaknesses: 1. The ablation experiments are incomplete. (1) The significant hyperparameter \alpha in the learning objective is only tested in two scenarios: '\alpha=0 only' and '\alpha=0 & no buffer'. However, the setup of \alpha's values in section [3.4 ILLUSTRATIVE EXAMPLES](row 350, \alpha=0.5) and section [4.2 ALIGNMENT WITH BFPO OBJECTIVE](row 394, \alpha=-0.5) differ entirely. This inconsistency prevents a clear understanding of \alpha's true role. (2) The authors do not explore the impact of different values of the hyperparameter \tau, which is also present in BFPO loss function, on the final results.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: 1. Could you elaborate on how your method performs in more complex, real-world scenarios beyond the synthetic dataset used in your experiments? What steps would you take to validate the effectiveness of BFPO in such cases?
2. Could you provide more detailed information on the safety and helpfulness labels used in your dataset? How do you ensure the consistency and reliability of these labels?
3. In Section 3, "Equation (7)"  there is no mention of "g(x,y)".
4. While BFPO eliminates human prompting and labeling to some extent, the ability to capture subtle differences in complex human preferences remains questionable.
5. In Table 1 of the experimental results, why does Alpaca perform better for DPO than BFPO?
soundness: 3
strengths: 1. The proposed Bi-Factorial Preference Optimization (BFPO) method presents a novel approach to balancing safety and helpfulness in the alignment of LLMs. The authors offer a fresh perspective on addressing these often conflicting objectives by integrating direct optimization with multi-objective reinforcement learning principles.
2. BFPO performs well on constructed benchmark datasets and can alleviate the need for manual labeling in LLM fine-tuning.
summary: This paper presents a novel supervised optimization approach, BFPO, which balances the safety and helpfulness of a large language model by introducing a labeling function. The effectiveness of the proposed method is demonstrated by the evaluation of  constructed benchmark datasets.
weaknesses: 1. Limited Real-World Applicability: The experiments are conducted on a synthetic dataset, which may not reflect real-world complexities. The authors should include experiments on more diverse datasets or practical scenarios to demonstrate the robustness and applicability of BFPO in real-world situations.
2. The paper presentation needs to be improved.

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: 1. Appendix B.4 only shows that the relationship between $B_1$ and $B_3$ is $B_3(B_1-1)=1$. The authors could include an ablation study or sensitivity analysis to show how the change of these two hyperparameters affect models' performance? 

Typo:
line 222: We remain neutral toward the harmful but unhelpful responses like (c) -> (d)
line 223: ... and we hate the harmful yet exhaustive (helpful) responses like (d) -> (c)
soundness: 4
strengths: 1. This paper propose a novel approach to align LLMs in terms of both harmlessness and helpfulness, which is essential for AI safety.
2. The proposed label function is theoretically equivalent to the multi-objective RLHF, possessing several properties that offer flexibility when constructing algorithms.
3. The authors conduct extensive experiments to strengthen the soundness of BFPO.
summary: This paper propose Bi-Factorial Preference Optimization (BFPO) to learn a single objective of both safety and helpfulness. Specifically, the authors introduce a novel label function that scores preference in terms of both safety and helpfulness, and theoretically prove that solving a supervised optimization problem with the label function is equivalent to solving the multi-objective RLHF with a combination of the rewards of safety and helpfulness. Experimental result shows that BFPO achieves the highest harmlessness score and the best balance between helpfulness and harmlessness.
weaknesses: 1. Some notations are inconsistence or not defined clearly, causing confusions in comprehend Sec. 2 and 3. For example, the reward function is written as $r(x,y)$ in some cases while $r(y|x)$ in others. Similarly, there are $g(x,y)$ and $g(y|x)$. Also, in eq 10 and 11, $y\succ \pi$ is not clearly defined in the main paper. The authors could choose one consistent notation (e.g., $r(y|x)$) and use it throughout the paper, and add a notation table to clarify the meaning of each symbol, including $y\succ \pi$.

Meta-review: This paper proposes a novel loss function to balance helpfulness and safety in large language model alignment by transforming multi-objective RLHF into a direct preference-based loss. Experiments on various alignment datasets, including those focused on helpfulness and safety, demonstrate the effectiveness of the proposed approach.

The reviewers acknowledge the significance of the proposed loss function and the theoretical analysis supporting its design. The proposed BFPO method demonstrates strong empirical performance on constructed benchmark datasets for safety and helpfulness evaluation. While initial concerns were raised about the clarity of notations in the loss derivation and theoretical analysis, these issues were effectively addressed by the authors during the rebuttal period.

Therefore, we recommend acceptance.

Decision: Accept (Spotlight)