Self-Play Preference Optimization for Language Model Alignment

## Abstract

Abstract Standard reinforcement learning from human feedback (RLHF) approaches relying on parametric models like the Bradley-Terry model fall short in capturing the intransitivity and irrationality in human preferences. Recent advancements suggest that directly working with preference probabilities can yield a more accurate reflection of human preferences, enabling more flexible and accurate language model alignment. In this paper, we propose a self-play-based method for language model alignment, which treats the problem as a constant-sum two-player game aimed at identifying the Nash equilibrium policy. Our approach, dubbed Self-Play Preference Optimization (SPPO), utilizes iterative policy updates to provably approximate the Nash equilibrium.
Additionally, we propose a new SPPO objective which is both strongly motivated by theory and is simple and effective in practice.
In our experiments, using only 60k prompts (without responses) from the UltraFeedback dataset and without any prompt augmentation, by leveraging a pre-trained preference model PairRM with only 0.4B parameters, SPPO can obtain a model from fine-tuning Mistral-7B-Instruct-v0.2 that achieves the state-of-the-art length-controlled win-rate of 28.53% against GPT-4-Turbo on AlpacaEval 2.0. It also outperforms the (iterative) DPO and IPO on MT-Bench, Arena-Hard, and the Open LLM Leaderboard.
Starting from a stronger base model Llama-3-8B-Instruct, we are able to achieve a length-controlled win rate of 38.77%.
Notably, the strong performance of SPPO is achieved without additional external supervision (e.g., responses, preferences, etc.) from GPT-4 or other stronger language models. Codes
are available at https://github.com/uclaml/SPPO .

## 1 Introduction

Large Language Models (LLMs) (e.g., Ouyang et al., ; OpenAI et al., ), have shown remarkable capabilities in producing human-like text, fielding questions, and coding. Despite their advancements, these models encounter challenges in tasks requiring high levels of reliability, safety, and ethical alignment. To address these challenges, Reinforcement Learning from Human Feedback (RLHF), also known as Preference-based Reinforcement Learning (PbRL), presents a promising solution. This framework for policy optimization, highlighted in works by Christiano et al. () and recently in Ouyang et al. (), has led to significant empirical success in fine-tuning instruction-following LLMs, making them more aligned with human preferences and thus more helpful.

Most existing approaches to RLHF rely on either explicit or implicit reward models. Taking InstructGPT (Ouyang et al., ) as an example, a reference policy $\pi_{\text{ref}}$ is first established, typically from supervised pre-training or instruction-based (supervised) fine-tuning. An explicit reward function is obtained by training a reward model based on human preference feedback data, employing the Bradley-Terry (BT) model (Bradley and Terry, ). Subsequently, reinforcement learning algorithms such as Proximal Policy Optimization (Schulman et al., , PPO) are used to fine-tune the reference LLM $\pi_{\text{ref}}$ by maximizing the expected reward function. The reward model provides a “reward score” $r(\mathbf{y};\mathbf{x})$ for the given response $\mathbf{y}$ and prompt $\mathbf{x}$, approximately reflecting how humans value these responses.
More recently, methods like Direct Preference Optimization (Rafailov et al., , DPO) have been introduced. These methods forgo the training of a separate reward model
but still fundamentally adhere to the reward maximization objective and are determined by parametric models such as the BT model.

These models presuppose a monotonous and transitive relationship among preferences for different choices. However, empirical evidence suggests otherwise. For instance, Tversky () observed human decisions can be influenced by different factors and exhibit inconsistency. Such observations indicate that human preferences do not always adhere to a single, value-based hierarchy and can even appear irrational, such as exhibiting loops in preference relations. For LLMs, another motivating evidence is that Munos et al. () has empirically shown that directly predicting the pairwise preference can achieve higher accuracy than predicting the preference via a BT-based reward model.

To address the inconsistency in human preference, researchers have proposed to work directly with the preference probability and design algorithms that can more flexibly represent human preferences (Lou et al., ; Wu et al., ) in the ranking or bandit setting.
Recently, an emerging line of work (Wang et al., ; Munos et al., ; Swamy et al., ) also proposed to study RLHF for LLMs under such general preference $\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})$, where $\mathbf{y}$ and $\mathbf{y}^{\prime}$ are two different responses and $\mathbf{x}$ is prompt. The goal is to identify the Nash equilibrium or von Neumann winner of the two-player constant-sum game

$$ $\displaystyle(\pi^{*},\pi^{*})=\arg\max_{\pi}\min_{\pi^{\prime}}\mathbb{E}_{ \mathbf{x}\sim\mathcal{X}}\Big{[}\mathbb{E}_{\mathbf{y}\sim\pi(\cdot|\mathbf{x }),\mathbf{y}^{\prime}\sim\pi^{\prime}(\cdot|\mathbf{x})}\big{[}\mathbb{P}( \mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})\big{]}\Big{]},$ $$

where each player is an LLM that outputs responses and aims to maximize its probability of being preferred over its opponent.

Independent from our work, Swamy et al. () proposed Self-play Preference Optimization (SPO)(^1^11The SPO framework does not pertain to the efficient fine-tuning of LLMs. Our Self-Play Preference Optimization (SPPO) focuses on LLM alignment and was developed independently. To distinguish it from the SPO framework, we use the abbreviation SPPO.) for the same (unregularized) two-player constant-sum game. They provide a general reduction of preference optimization to no-regret online learning for the multi-step Markov Decision Process. When constrained to the bandit setting for LLMs, their proposed algorithmic framework reduces to the famous Hedge algorithm (Freund and Schapire, ), which admits the exponential update rule as described in (4.1). To approximately solve the exponential update, Swamy et al. () then proposed to employ typical policy optimization algorithms such as Proximal Policy Optimization (PPO) (Schulman et al., ) or Soft Actor-Critic (SAC) (Haarnoja et al., ) to maximize the win rate against the reference policy and evaluated the performance of their self-play algorithms in robotic and game tasks. However, it typically requires more effort to apply PPO or SAC to large-scale fine-tuning of LLM and make them work stably. Therefore, it remains unclear how their self-play framework can be applied to large-scale language model alignment efficiently.

In this paper, motivated by these developments mentioned above, we propose a new self-play algorithm that (1) enjoys provable guarantees to solve the two-player constant-sum game; and (2) can scale up to large-scale efficient fine-tuning of large language models.
In detail, we formulate the RLHF problem as a constant-sum two-player game. Our objective is to identify the Nash equilibrium policy, which consistently provides preferred responses over any other policy on average. To identify the Nash equilibrium policy approximately, we adopt the classic online adaptive algorithm with multiplicative weights (Freund and Schapire, ) as a high-level framework that solves the two-player game. Further, each step of the high-level framework can be approximated by a self-play mechanism, where in each round the policy is playing against itself in the previous round by fine-tuning it on synthetic data that are generated by the policy and annotated by the preference model.

Our contributions are highlighted as follows:

- •
Starting from the exponential weight update algorithm which provably converges to the Nash equilibrium of the two-player constant-sum game, we propose the Self-Play Preference Optimization (SPPO) algorithm for large language model alignment. The algorithm converges to an approximate
Nash equilibrium provably and admits a simple form of loss function for easy optimization.
- •
Unlike the symmetric pairwise loss such as DPO and Identity Preference Optimization (IPO) (Azar et al., ), we propose a new optimization objective that does not rely on pairwise comparisons. The new loss objective (4.4), initially driven by game-theoretical concepts, turns out strongly motivated by the policy gradient theory and implicitly encourages the LLM to learn a token-level optimal value function.
- •
Empirically, SPPO significantly enhances the well-aligned Mistral-7B-Instruct-v0.2 and Llama-3-8B-Instruct model, achieving an increase of over 11% on the length-controlled win rate against GPT-4-Turbo on the AlpacaEval 2.0 (Dubois et al., ) test set. Additionally, SPPO exhibits strong generalist abilities across different tasks, including MT-Bench, the Open LLM Leaderboard, and the more recent, more challenging benchmark, Arena-Hard.
Unlike iterative DPO/IPO, which tends to show performance decay on other benchmarks when optimized towards the PairRM score, SPPO’s performance gain is consistent.
Notably, all the strong performances are achieved without external supervision (e.g., responses, preferences, etc.) from GPT-4 or other stronger language models.

Concurrent to our work, several studies, including Direct Nash Optimization (Rosset et al., ) and REBEL (Gao et al., ) have also explored using either cross-entropy loss or square loss minimization to approximate the exponential update. Specifically, they used the same trick proposed in DPO (Rafailov et al., ) to cancel out the log-partition factor and directly regress on the win-rate difference.
However, it is shown theoretically and empirically by Pal et al. () that the pairwise loss may only drive the relative likelihood gap to be large, but may not necessarily drive up the likelihood of the preferred responses. Our method instead has a deeper connection to the policy gradient theory and can effectively match the likelihood of the response to its win rate.

## 2 Related Work

#### RLHF with Explicit/Implicit Reward Model

Originally, reinforcement learning from human feedback (RLHF) was proposed by Christiano et al. () as a methodology that first learns a reward model reflecting human preferences and then uses reinforcement learning algorithms to maximize the reward. This methodology is applied by Ouyang et al. () to fine-tune instruction-following large language models and leads to the popular ChatGPT.

The reward model in the works mentioned above assumes a parametric model such as the Bradley-Terry model (Bradley and Terry, ), which assigns a “score” representing how preferred a given response is.
More recently, Rafailov et al. () proposed to instead directly solve the closed-form solution of such a score implied by the Bradley-Terry model. The Direct Policy Optimization (DPO) method is claimed to be more efficient and stable, yet, still implicitly assumes such a reward model that specifies the “score”. In a similar spirit, Zhao et al. () proposed to calibrate the score so that the score of the winner in comparison has a margin over the score of the loser, and induces a different SLic loss. Similarly, Ethayarajh et al. () derived a different loss function (called KTO) from the Kahneman-Tversky human utility function, which implicitly denotes a score of the given response. Liu et al. () proposed Rejection Sampling Optimization (RSO) which utilizes a preference model to generate preference pairs with candidates sampled from the optimal policy; then preference optimization is applied on the sampled preference pairs.
Hong et al. () proposed Odds Ratio Preference Optimization (ORPO) algorithm that can perform supervised fine-tuning and preference alignment in one training session without maintaining an intermediate reference policy.

#### RLHF with General Preference Model

Often, the human preference is not strictly transitive, and cannot be sufficiently represented by a single numerical score.
Azar et al. () proposed a general preference optimization objective based on the preference probability between a pair of responses instead of a score of a single response. They further propose a learning objective based on identity mapping of the preference probability called IPO (Preference Optimization with Identity mapping), which aims to maximize the current policy’s expected winning probability over a given reference policy. Munos et al. () formulated the RLHF problem with general preference as a two-player, constant-sum game, where each player is one policy that aims to maximize the probability of its response being preferred against its opponent. They aim to identify the Nash equilibrium policy of this game and propose a mirror-descent algorithm that guarantees the last-iterate convergence of a policy with tabular representations(^2^22Due to the tabular representation, computing the normalizing factor is prohibitive and the algorithm is approximately executed by sampling one token instead of a full response.). Wang et al. () proposed to identify the Nash equilibrium policy for
multi-step MDPs when a general preference model is present and shows that the problem can be reduced to a two-player zero-sum Markov game.

#### Theory of RLHF

There is also a line of research to analyze RLHF and provide its theoretical guarantees. Zhu et al. () studied the standard RLHF with separate reward-learning and model-tuning and proposed a pessimistic reward-learning process that provably learns a linear reward model. Wang et al. () proposed a framework to reduce any RLHF problem with a reward model to a reward-based standard RL problem. Additionally, they proposed to identify the Nash equilibrium policy when a general preference model is present and show that the problem can be reduced to a two-player zero-sum Markov game.
Xiong et al. () studied the reverse-KL regularized contextual bandit for RLHF in different settings and proposed efficient algorithms with finite-sample theoretical guarantees.
Ye et al. () studied the theoretical learnability of the KL-regularized Nash-Learning from Human Feedback (NLHF) by considering both offline and online settings and proposed provably efficient algorithms. Ji et al. () proposed an active-query-based proximal policy optimization algorithm with regret bounds and query complexity based on the problem dimension and the sub-optimality gap.

#### Self-Play Fine-Tuning

Most works mentioned above (Rafailov et al., ; Zhao et al., ; Azar et al., ; Ethayarajh et al., ) consider one single optimization procedure starting from some reference policy. The same procedure may be applied repeatedly for multiple rounds in a self-play manner. In each round, new data are generated by the policy obtained in the last round; these new data are then used for training a new policy that can outperform the old policy.

The self-play fine-tuning can be applied to both scenarios with or without human preference data.
For example, Singh et al. () proposed an Expectation-Maximization (EM) framework where in each round, new data are generated and annotated with a reward score; the new policy is obtained by fine-tuning the policy on the data with a high reward.
Chen et al. () proposed a self-play framework to fine-tune the model in a supervised way. In each round, new preference pairs are synthesized by labeling the policy-generated responses as losers and the human-generated responses as winners. Then DPO is applied in each round to fine-tune another policy based on these synthesized preference data.
Yuan et al. () proposed Self-Rewarding Language Models, where the
language model itself is used to annotate preference on its own responses. Iterative DPO is applied to fine-tune language models on these annotated data.
These works show iterative fine-tuning can significantly improve the performance.

Swamy et al. ()
considered a more general multi-step Markov Decision Process (MDP) setting and proposed Self-play Preference Optimization (SPO), an RLHF framework that can utilize any no-regret online learning algorithm for preference-based policy optimization. They then instantiated their framework with Soft Policy Iteration as an idealized variant of their algorithm, which reduces to the exponential weight update rule (4.1) when constrained to the bandit setting.
The main difference is that they focus on the multi-round Markov decision process (MDP) in robotic and game tasks rather than on fine-tuning large language models and approximating the update using policy optimization methods such as PPO.

Concurrent to our work, Rosset et al. () proposed the Direct Nash Optimization (DNO) algorithm based on the cross-entropy between the true and predicted win rate gaps, and provided theoretical guarantees on the error of finite-sample approximation. However, their practical version still utilizes the iterative-DPO framework as in Xu et al. () with the DPO loss instead of their derived DNO loss. Notably, in their experiments, they added the GPT-4 generated responses as their “gold sample” into their fine-tuning data, and used GPT-4 as a judge to assign a numerical score to each response for preference pair construction. In sharp contrast, our work does not require the use of any strong external supervision besides a small-sized reward model. Another concurrent work (Gao et al., ) proposed REBEL, an iterative fine-tuning framework via regressing the relative reward. When applied to the preference setting, it results in a similar algorithm to our algorithm SPPO, except that SPPO approximates the log-partition factor $\log Z_{\pi_{t}}(\mathbf{x})$ with a constant $\eta/2$ while REBEL regresses on the win rate difference (so that $\log Z_{\pi_{t}}(\mathbf{x})$ is canceled). Additionally, Calandriello et al. () pointed out that optimizing the IPO loss (Azar et al., ) iteratively with self-play generated data is equivalent to finding the Nash equilibrium of the two-player game, and they proposed the IPO-MD algorithm based on this observation, which generates data with a mixture policy similar to the Nash-MD algorithm.

## 3 Preliminaries

We consider the preference learning scenario as follows. Given a text sequence (commonly referred to as prompt) $\mathbf{x}=[x_{1},x_{2},\dots]$, two text sequences $\mathbf{y}=[y_{1},y_{2},\dots]$ and $\mathbf{y}^{\prime}$ are generated as responses to the prompt $\mathbf{x}$. An autoregressive language model $\pi$ given the prompt $\mathbf{x}$ can generate responses $\mathbf{y}$ following the probability decomposition

$$ $\displaystyle\pi(\mathbf{y}|\mathbf{x})=\prod_{i=1}^{N}\pi(y_{i}|\mathbf{x}, \mathbf{y}_{<i}).$ $$

Given the prompt $\mathbf{x}$ and two responses $\mathbf{y}$ and $\mathbf{y}^{\prime}$, a preference oracle (either a human annotator or a language model) will provide preference feedback $o(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})\in\{0,1\}$ indicating whether $\mathbf{y}$ is preferred over $\mathbf{y}^{\prime}$. We denote $\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})=\mathbb{E}[o(\mathbf
{y}\succ\mathbf{y}^{\prime}|\mathbf{x})]$ as the probability of $\mathbf{y}$ “winning the duel” over $\mathbf{y}^{\prime}$. The KL divergence of two probability distributions of density $p$ and $q$ is defined as $\mathrm{KL}(p\|q)=\mathbb{E}_{\mathbf{y}\sim p(\mathbf{y})}\Big{[}\log\frac{p(
\mathbf{y})}{q(\mathbf{y})}\Big{]}$.

### 3.1 RLHF with Reward Models

Christiano et al. () first learn a reward function $r(\mathbf{y};\mathbf{x})$ following the Bradley-Terry model (Bradley and Terry, ). For a prompt-response-response triplet $(\mathbf{x},\mathbf{y},\mathbf{y}^{\prime})$, the Bradley-Terry model specifies the probability of $\mathbf{y}$ being chosen over $\mathbf{y}$ as

$$ $\displaystyle\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})$ $\displaystyle=\frac{\exp(r(\mathbf{y};\mathbf{x}))}{\exp(r(\mathbf{y};\mathbf{ x}))+\exp(r(\mathbf{y}^{\prime};\mathbf{x}))}=\sigma\big{(}r(\mathbf{y}; \mathbf{x})-r(\mathbf{y}^{\prime};\mathbf{x})\big{)},$ (3.1) $$

where $\sigma(x)=e^{x}/(e^{x}+1)$ is the logistic function. The reward function associated with the Bradley-Terry model can be estimated by maximizing the log-likelihood $\log\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})$. Suppose the true reward function $r(\mathbf{y};\mathbf{x}))$ is available, Christiano et al. () proposed to solve the following optimization problem with policy optimization algorithms in RL such as PPO (Schulman et al., ):

$$ $\displaystyle\max_{\bm{\theta}}\mathbb{E}_{\mathbf{x}\sim\mathcal{X},\mathbf{y }\sim\pi_{\bm{\theta}}(\cdot|\mathbf{x})}[r(\mathbf{y};\mathbf{x})]-\eta^{-1} \mathbb{E}_{\mathbf{x}\sim\mathcal{X}}[\mathrm{KL}(\pi_{\bm{\theta}}(\cdot| \mathbf{x})\|\pi_{\text{ref}}(\cdot|\mathbf{x}))],$ (3.2) $$

where $\mathcal{X}$ is the prompt distribution.

Rafailov et al. () identified that the optimization problem above has a closed-form solution such that for any $\mathbf{y}$,

$$ $\displaystyle\pi^{*}(\mathbf{y}|\mathbf{x})\propto\pi_{\text{ref}}(\mathbf{y}| \mathbf{x})\exp(\eta r(\mathbf{y};\mathbf{x})),$ $$

which can be further converted to the DPO loss for any triplet $(\mathbf{x},\mathbf{y}_{w},\mathbf{y}_{l})$ where the winner $\mathbf{y}_{w}$ is chosen over the loser $\mathbf{y}_{l}$:

$$ $\displaystyle\ell_{\text{DPO}}(\mathbf{x},\mathbf{y}_{w},\mathbf{y}_{l};\bm{ \theta};\pi_{\text{ref}})$ $\displaystyle:=-\log\sigma\Bigg{(}\eta^{-1}\bigg{[}\log\bigg{(}\frac{\pi_{\bm{ \theta}}(\mathbf{y}_{w}|\mathbf{x})}{\pi_{\text{ref}}(\mathbf{y}_{w}|\mathbf{x })}\bigg{)}-\log\bigg{(}\frac{\pi_{\bm{\theta}}(\mathbf{y}_{l}|\mathbf{x})}{ \pi_{\text{ref}}(\mathbf{y}_{l}|\mathbf{x})}\bigg{)}\bigg{]}\Bigg{)}.$ $$

### 3.2 RLHF with General Preference

Following Wang et al. (); Munos et al. (), we aim to establish RLHF methods without a reward model, as the human preference can be non-transitive (Tversky, ). Under a general preference oracle $\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})$, we follow Dudík et al. () and aim to identify the von Neumann winner. More specifically, the von Neumann winner $\pi^{*}$ is the (symmetric) Nash equilibrium of the following two-player constant-sum game:

$$ $\displaystyle(\pi^{*},\pi^{*})=\arg\max_{\pi}\min_{\pi^{\prime}}\mathbb{E}_{ \mathbf{x}\sim\mathcal{X}}\Big{[}\mathbb{E}_{\mathbf{y}\sim\pi(\cdot|\mathbf{x }),\mathbf{y}^{\prime}\sim\pi^{\prime}(\cdot|\mathbf{x})}\big{[}\mathbb{P}( \mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})\big{]}\Big{]}.$ (3.3) $$

In addition, we define the winning probability of one response $\mathbf{y}$ against a distribution of responses $\pi$ as

$$ $\displaystyle\mathbb{P}(\mathbf{y}\succ\pi|\mathbf{x})=\mathbb{E}_{\mathbf{y}^ {\prime}\sim\pi(\cdot|\mathbf{x})}[\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{ \prime}|\mathbf{x})],$ $$

and the winning probability of one policy $\pi$ against another policy $\pi^{\prime}$ as

$$ $\displaystyle\mathbb{P}(\pi\succ\pi^{\prime}|\mathbf{x})=\mathbb{E}_{\mathbf{y }\sim\pi(\cdot|\mathbf{x})}\mathbb{E}_{\mathbf{y}^{\prime}\sim\pi^{\prime}( \cdot|\mathbf{x})}[\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})].$ $$

Furthermore, we define $\mathbb{P}(\pi\succ\pi^{\prime})=\mathbb{E}_{\mathbf{x}\sim\mathcal{X}}[
\mathbb{P}(\pi\succ\pi^{\prime}|\mathbf{x})]$, where $\mathbf{x}$ is a prompt drawn from the prompt distribution $\mathcal{X}$.
The two-player constant-sum game (3.3) can be simplified as

$$ $\displaystyle(\pi^{*},\pi^{*})=\arg\max_{\pi}\min_{\pi^{\prime}}\mathbb{P}(\pi \succ\pi^{\prime}).$ $$

## 4 Self-Play Preference Optimization (SPPO)

In this section, we introduce the Self-Play Preference Optimization(SPPO) algorithm, derived from the following theoretical framework.

### 4.1 Theoretical Framework

There are well-known algorithms to approximately solve the Nash equilibrium in a constant-sum two-player game. In this work, we follow Freund and Schapire () to establish an iterative framework that can asymptotically converge to the optimal policy on average. We start with a theoretical framework that conceptually solves the two-player game as follows:

$$ $\displaystyle\pi_{t+1}(\mathbf{y}|\mathbf{x})\propto\pi_{t}(\mathbf{y}|\mathbf {x})\exp(\eta\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})),\,\,\text{for $t=1 ,2,\dots$}.$ (4.1) $$

(4.1) is an iterative framework that relies on the multiplicative weight update in each round $t$ and enjoys a clear structure. Initially, we have a base policy $\pi_{1}$ usually from some supervised fine-tuned model. In each round, the updated policy $\pi_{t+1}$ is obtained from the reference policy $\pi_{t}$ following the multiplicative weight update. More specifically, a response $\mathbf{y}$ should have a higher probability weight if it has a higher average advantage over the current policy $\pi_{t}$.

Equivalently, (4.1) can be written as

$$ $\displaystyle\pi_{t+1}(\mathbf{y}|\mathbf{x})=\frac{\pi_{t}(\mathbf{y}|\mathbf {x})\exp\big{(}\eta\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})\big{)}}{Z_{ \pi_{t}}(\mathbf{x})},$ (4.2) $$

where $Z_{\pi_{t}}(\mathbf{x})=\sum_{\mathbf{y}}\pi_{t}(\mathbf{y}|\mathbf{x})\exp
\big{(}\eta\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})\big{)}$ is the normalizing factor (a.k.a., the partition function).
For any fixed $\mathbf{x}$ and $\mathbf{y}$, the ideal update policy $\pi_{t+1}$ should satisfy the following equation:

$$ $\displaystyle\log\bigg{(}\frac{\pi_{t+1}(\mathbf{y}|\mathbf{x})}{\pi_{t}( \mathbf{y}|\mathbf{x})}\bigg{)}$ $\displaystyle=\eta\cdot\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})-\log Z_{ \pi_{t}}(\mathbf{x}).$ (4.3) $$

Unlike the pair-wise design in DPO or IPO that cancels the log normalizing factor $\log Z_{\pi_{t}}(\mathbf{x})$ by differentiating (4.3) between $\mathbf{y}$ and $\mathbf{y}^{\prime}$, we choose to approximate (4.3) directly in terms of $L_{2}$ distance:

$$ $\displaystyle\pi_{t+1}$ $\displaystyle=\mathop{\mathrm{argmin}}_{\pi}\mathbb{E}_{\mathbf{x}\sim\mathcal {X},\mathbf{y}\sim\pi_{t}(\cdot|\mathbf{x})}\bigg{(}\log\bigg{(}\frac{\pi( \mathbf{y}|\mathbf{x})}{\pi_{t}(\mathbf{y}|\mathbf{x})}\bigg{)}-\Big{(}\eta \mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})-\log Z_{\pi_{t}}(\mathbf{x})\Big {)}\bigg{)}^{2}.$ (4.4) $$

#### Estimation of the Probability

The optimization objective (4.4) can be approximated with finite samples. We choose to sample $K$ responses $\mathbf{y}_{1},\mathbf{y}_{2},\dots,\mathbf{y}_{K}\sim\pi_{t}(\cdot|\mathbf{x})$ for each prompt $\mathbf{x}$, and denote the empirical distribution by $\widehat{\pi}_{t}^{K}$. The finite-sample optimization problem can be approximated as

$$ $\displaystyle\pi_{t+1}$ $\displaystyle=\mathop{\mathrm{argmin}}_{\pi}\mathbb{E}_{\mathbf{x}\sim\mathcal {X},\mathbf{y}\sim\pi_{t}(\cdot|\mathbf{x})}\bigg{(}\log\bigg{(}\frac{\pi( \mathbf{y}|\mathbf{x})}{\pi_{t}(\mathbf{y}|\mathbf{x})}\bigg{)}-\Big{(}\eta \mathbb{P}(\mathbf{y}\succ\widehat{\pi}^{K}_{t}|\mathbf{x})-\log Z_{\widehat{ \pi}^{K}_{t}}(\mathbf{x})\Big{)}\bigg{)}^{2}.$ (4.5) $$

Specifically, $\mathbb{P}(\mathbf{y}\succ\widehat{\pi}^{K}_{t}|\mathbf{x})=\sum_{k=1}^{K}
\mathbb{P}(\mathbf{y}\succ\mathbf{y}_{k}|\mathbf{x})/K$ and $Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})=\mathbb{E}_{\mathbf{y}\sim\pi_{t}(\cdot|
\mathbf{x})}[\exp(\eta\mathbb{P}(\mathbf{y}\succ\widehat{\pi}^{K}_{t}|\mathbf{
x}))]$. $Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})$, treated as an expectation, can be further estimated by $B$ new samples with in total $O(KB)$ queries of the preference oracle $\mathbb{P}$.
(4.5) is an efficiently tractable optimization problem. Informally speaking, when $K\rightarrow\infty$, (4.5) will recover (4.4). We have the following guarantee on the convergence of (4.4):

###### Theorem 4.1 .

Assume the optimization problem (4.4) is realizable. Denote $\pi_{t}$ as the policy obtained via (4.4) and the mixture policy $\bar{\pi}_{T}=\frac{1}{T}\sum_{t=1}^{T}\pi_{t}$. By setting $\eta=\Theta(1/\sqrt{T})$, we have that

$$ $\displaystyle\max_{\pi}\big{[}\mathbb{P}(\pi\succ\bar{\pi}_{T})\big{]}-\min_{ \pi}\big{[}\mathbb{P}(\pi\prec\bar{\pi}_{T})\big{]}=O(1/\sqrt{T}).$ $$

Theorem 4.1 characterizes the convergence rate of the average policy across the time horizon $T$ towards the Nash equilibrium, in terms of the duality gap.
The proof is based on Theorem 1 in Freund and Schapire () with slight modification. For completeness, we include the proof in Appendix B.

Alternatively, we can avoid estimating $\log Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})$ by replacing it with a constant based on the human preference model. The choice of the constant is discussed in detail in Appendix A.
Here, we replace $\log Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})$ with $\eta/2$(^3^33Assuming the winning probability between any given pair is either $1$ or 0 0 with equal chance, when $K\rightarrow\infty$, we can show that indeed $Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})\rightarrow e^{\eta/2}$. Also see Appendix A for a complete derivation.) in (4.5) to obtain a more clear objective:

$$ $\displaystyle\pi_{t+1}$ $\displaystyle=\mathop{\mathrm{argmin}}_{\pi}\mathbb{E}_{\mathbf{x}\sim\mathcal {X},\mathbf{y}\sim{\pi}_{t}(\cdot|\mathbf{x})}\bigg{(}\log\bigg{(}\frac{\pi( \mathbf{y}|\mathbf{x})}{\pi_{t}(\mathbf{y}|\mathbf{x})}\bigg{)}-\eta\bigg{(} \mathbb{P}(\mathbf{y}\succ\widehat{\pi}_{t}^{K}|\mathbf{x})-\frac{1}{2}\bigg{) }\bigg{)}^{2}.$ (4.6) $$

Intuitively, if a tie occurs (i.e., $\mathbb{P}(\mathbf{y}\succ\widehat{\pi}_{t}^{K}|\mathbf{x})=1/2$), we prefer the model does not update weight at $\mathbf{y}$. If $\mathbf{y}$ wins over $\widehat{\pi}_{t}^{K}$ on average (i.e., $\mathbb{P}(\mathbf{y}\succ\widehat{\pi}_{t}^{K}|\mathbf{x})>1/2$), then we increase the probability density at $\mathbf{y}$ to employ the advantage of $\mathbf{y}$ over $\widehat{\pi}_{t}^{K}$. In our experiments, we choose to minimize the objective (4.6).

###### Theorem 4.1 .

### 4.2 The SPPO Algorithm

Based on the aformentioned theoretical framework, we propose the Self-Play Preference Optimization algorithm in Algorithm 1.

Figure: Algorithm 1 Self-Play Preference Optimization(SPPO)

In each round $t$, Algorithm 1 will first generate $K$ responses $\mathbf{y}_{1},\mathbf{y}_{2},\dots,\mathbf{y}_{K}$ according to $\pi_{t}(\cdot|\mathbf{x})$ for each prompt $\mathbf{x}$ (Line 3). Then, the preference oracle $\mathbb{P}$ will be queried to calculate the win rate among the $K$ responses (Line 4). At Line 5, certain criteria can be applied to determine which response should be kept in the constructed dataset $\mathcal{D}_{t}$ and construct the prompt-response-probability triplet $(\mathbf{x},\mathbf{y},\widehat{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x}))$. We will discuss the design choices later in Section 5. One straightforward design choice is to include all $K$ responses into $\mathcal{D}_{t}$ and each $\widehat{P}(\mathbf{y}_{i}\succ\pi_{t}|\mathbf{x})$ is estimated by comparing $\mathbf{y}_{i}$ to all $K$ responses. In total, $O(K^{2})$ queries will be made. Then the algorithm will optimize (4.6) on the dataset $\mathcal{D}_{t}$ (Line 6).

### 4.3 Connection to Policy Gradient

While SPPO is derived from the iterative framework (Freund and Schapire, ) for two-player games, the square loss in the SPPO objective (4.4) provides an alternative interpretation for SPPO as a semi-online variant of policy gradient method due to its special loss form. The difference from standard policy gradient is that it collects samples from $\pi_{\bm{\theta}_{t}}$ at the start of iteration $t$, rather than perform on-policy sampling at each gradient step.

Consider a general reward function $r(\mathbf{y};\mathbf{x})$, the RLHF problem (3.2) can be written as:

$$ $\displaystyle\max_{\bm{\theta}}J(\bm{\theta}):=\mathbb{E}_{\mathbf{x}\sim \mathcal{X},\mathbf{y}\sim\pi_{\bm{\theta}}(\cdot|\mathbf{x})}\bigg{[}r( \mathbf{y};\mathbf{x})-\eta^{-1}\log\frac{\pi_{\bm{\theta}}(\mathbf{y}|\mathbf {x})}{\pi_{\text{ref}}(\mathbf{y}|\mathbf{x})}\bigg{]}.$ (4.8) $$

The policy gradient of the objective $J(\bm{\theta})$ is:

$$ $\displaystyle\nabla J(\bm{\theta})$ $\displaystyle=\mathbb{E}_{\mathbf{x}\sim\mathcal{X},\mathbf{y}\sim\pi_{\bm{ \theta}}(\cdot|\mathbf{x})}\bigg{[}\bigg{(}r(\mathbf{y};\mathbf{x})-\eta^{-1} \log\frac{\pi_{\bm{\theta}}(\mathbf{y}|\mathbf{x})}{\pi_{\text{ref}}(\mathbf{y }|\mathbf{x})}-b(\mathbf{x})\bigg{)}\nabla\log\pi_{\bm{\theta}}(\mathbf{y}| \mathbf{x})\bigg{]}$ (4.9) $\displaystyle=\eta\mathbb{E}_{\mathbf{x}\sim\mathcal{X},\mathbf{y}\sim\pi_{\bm {\theta}}(\cdot|\mathbf{x})}\bigg{[}-\nabla\bigg{(}{\color[rgb]{1,0,0} \definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}r(\mathbf{y};\mathbf{x})}-\eta^ {-1}\log\frac{\pi_{\bm{\theta}}(\mathbf{y}|\mathbf{x})}{\pi_{\text{ref}}( \mathbf{y}|\mathbf{x})}-{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor} {rgb}{0,0,1}b(\mathbf{x})}\bigg{)}^{2}\bigg{]},$ (4.10) $$

where the first line follows the policy gradient theorem (Sutton et al., ) and the baseline $b(\mathbf{x})$ is an arbitrary constant relying only on $\mathbf{x}$ used for variance reduction. Comparing the square loss (4.10) with the SPPO objective (4.4) (rewritten below):

$$ $\displaystyle\bm{\theta}_{t+1}$ $\displaystyle=\mathop{\mathrm{argmin}}_{\bm{\theta}}\mathbb{E}_{\mathbf{x}\sim \mathcal{X},\mathbf{y}\sim\pi_{\bm{\theta}_{t}}(\cdot|\mathbf{x})}\bigg{[} \bigg{(}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0} \mathbb{P}(\mathbf{y}\succ{\pi}_{\bm{\theta}_{t}}|\mathbf{x})}-\eta^{-1}\log \bigg{(}\frac{\pi_{\bm{\theta}}(\mathbf{y}|\mathbf{x})}{\pi_{\bm{\theta}_{t}}( \mathbf{y}|\mathbf{x})}\bigg{)}-{\color[rgb]{0,0,1}\definecolor[named]{ pgfstrokecolor}{rgb}{0,0,1}\eta^{-1}\log Z_{{\pi}_{\bm{\theta}_{t}}}(\mathbf{x })}\bigg{)}^{2}\bigg{]},$ $$

one can see that the win rate $\mathbb{P}(\mathbf{y}\succ{\pi}_{\bm{\theta}_{t}}|\mathbf{x})$ is exactly the reward SPPO aims to maximize, and $\eta^{-1}\log Z_{{\pi}_{\bm{\theta}_{t}}}(\mathbf{x})$ is in fact the best possible baseline–the (soft) value function. When the value function is not available in practice, it can be replaced by any constant baseline to reduce the variance of the policy gradient. We choose $1/2$ as a good approximation to $\eta^{-1}\log Z_{{\pi}_{\bm{\theta}_{t}}}(\mathbf{x})$ but the constant can vary depending on the human preference model (see Appendix A).
Equation (4.9) is also discussed in Munos et al. ().

Comparing with the general framework proposed by Swamy et al. (), SPPO can be seen as a new, straightforward variant of policy gradient method without the need of extra modifications such as gradient clipping in PPO, Hessian calculation in TRPO, or maintaining multiple components (Q-critic, V-critic, actor, etc.) in many policy optimization algorithms.

### 4.4 Token-Level Q ∗ superscript 𝑄 Q^{*} italic_Q start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT Learning

Rafailov et al. () showed that under the Max-Entropy RL formulation, the token-level log-ratio $\log\frac{\pi_{\bm{\theta}}(\mathbf{y}|\mathbf{x})}{\pi_{\text{ref}}(\mathbf{y
}|\mathbf{x})}$ can be seen as an implicit token-level reward or advantage function (invariant under reward shaping).
Below we show the square loss in SPPO can also lead to the optimal Max-Entropy policy $\pi^{*}$, with token-level optimal value/advantage function.

We first briefly restate the setting and results in Rafailov et al. (). The token-level MDP defines the state $\mathbf{s}_{h}=(\mathbf{x},y_{1},y_{2},\dots,y_{h-1})$ as the prefix tokens, and the action $\mathbf{a}_{h}=y_{h}$ as the next token. An auto-regressive language model $\pi(\mathbf{y}|\mathbf{x})$ can be viewed as a token-level policy $\pi(\mathbf{a}_{h}|\mathbf{s}_{h})$ and the transition kernel is known and deterministic because it only concatenates the next token to the prefix to form a new token sequence $\mathbf{s}_{h+1}=(\mathbf{x},y_{1},y_{2},\dots,y_{h})$.

The Max-Entropy RL setting again considers the reverse-KL regularized reward maximization problem (3.2):

$$ $\displaystyle\max_{\bm{\theta}}\$ $\displaystyle\mathbb{E}_{\mathbf{x}\sim\mathcal{X},\mathbf{y}\sim\pi_{\bm{ \theta}}(\cdot|\mathbf{x})}[r(\mathbf{y};\mathbf{x})]-\eta^{-1}\mathbb{E}_{ \mathbf{x}\sim\mathcal{X}}[\mathrm{KL}(\pi_{\bm{\theta}}(\cdot|\mathbf{x})\| \pi_{\text{ref}}(\cdot|\mathbf{x}))]$ $\displaystyle=$ $\displaystyle\mathbb{E}_{\mathbf{x}\sim\mathcal{X},\mathbf{y}\sim\pi_{\bm{ \theta}}(\cdot|\mathbf{x})}[r(\mathbf{y};\mathbf{x})+\eta^{-1}\log\pi_{\text{ ref}}(\mathbf{y}|\mathbf{x})]+\eta^{-1}\mathbb{E}_{\mathbf{x}\sim\mathcal{X}}[ \mathcal{H}(\pi_{\bm{\theta}}(\cdot|\mathbf{x}))].$ $$

We denote the optimal solution for the problem above as $\pi^{*}$. Rafailov et al. () showed that the Bradley-Terry preference model (4.13) can be rewritten as:

$$ $\displaystyle\mathbb{P}(\mathbf{y}_{w}\succ\mathbf{y}_{l}|\mathbf{x})=\sigma \bigg{(}\eta^{-1}\sum_{h=1}^{|\mathbf{y}_{w}|}\log\frac{\pi^{*}(\mathbf{a}^{w} _{h}|\mathbf{s}^{w}_{h})}{\pi_{\text{ref}}(\mathbf{a}^{w}_{h}|\mathbf{s}^{w}_{ h})}-\eta^{-1}\sum_{h=1}^{|\mathbf{y}_{l}|}\log\frac{\pi^{*}(\mathbf{a}^{l}_{h }|\mathbf{s}^{l}_{h})}{\pi_{\text{ref}}(\mathbf{a}^{l}_{h}|\mathbf{s}^{l}_{h}) }\bigg{)},$ $$

where the state and action is defined as in the token-level MDP introduced above, with superscription $(\cdot)^{w}$ and $(\cdot)^{l}$ denoting if it is for the winner $\mathbf{y}_{w}$ or the loser $\mathbf{y}_{l}$. And maximizing the log likelihood with $\pi^{*}$ replaced by $\pi_{\bm{\theta}}$ gives the DPO loss.

From now on we assume the horizon is fixed at $H$ for simplicity. The derivation of the Max-Entropy RL formulation relies on the (soft) optimal value function $Q^{*}$ and $V^{*}$ as(^4^44 Here we restated with the sequence-level reward $r(\mathbf{y};\mathbf{x})$. Rafailov et al. () started their derivation from a ground-truth token-level reward $r(\mathbf{s}_{h},\mathbf{a}_{h})$, which is under-specified due to the reward reshaping issue (Ng et al., ): reshaping the reward will not affect the Bradley-Terry preference probability so it is impossible to recover the ground-truth reward from the preference signal (Rafailov et al., , Section 4.2).):

$$ $\displaystyle V^{*}(\mathbf{s}_{H+1})$ $\displaystyle=r(\mathbf{s}_{H+1}):=r(\mathbf{y};\mathbf{x}),\text{ (reward at EOS)}$ $\displaystyle Q^{*}(\mathbf{s}_{h},\mathbf{a}_{h})$ $\displaystyle=\eta^{-1}\log\pi_{\text{ref}}(\mathbf{a}_{h}|\mathbf{s}_{h})+V^{ *}(\mathbf{s}_{h+1}),$ $\displaystyle V^{*}(\mathbf{s}_{h})$ $\displaystyle=\eta^{-1}\log\sum_{\mathbf{a}}\exp\big{(}\eta Q^{*}(\mathbf{s}_{ h},\mathbf{a})\big{)},\text{ when }h\leq H.$ $$

Rafailov et al. () showed that the optimal policy $\pi^{*}$ satisfies:

$$ $\displaystyle\eta^{-1}\log\pi^{*}(\mathbf{a}_{h}|\mathbf{s}_{h})$ $\displaystyle=Q^{*}(\mathbf{s}_{h},\mathbf{a}_{h})-V^{*}(\mathbf{s}_{h})$ $\displaystyle=\eta^{-1}\log\pi_{\text{ref}}(\mathbf{a}_{h}|\mathbf{s}_{h})+V^{ *}(\mathbf{s}_{h+1})-V^{*}(\mathbf{s}_{h}).$ $$

It can be verified that for $\mathbf{s}_{1}=(\mathbf{x})$, we have $\eta V^{*}(\mathbf{s}_{1})=\log\sum_{\mathbf{y}}\pi_{\text{ref}}(\mathbf{y}|
\mathbf{x})\exp\big{(}\eta r(\mathbf{y};\mathbf{x})\big{)}$:

$$ $\displaystyle\exp\big{(}\eta V^{*}(\mathbf{s}_{1})\big{)}$ $\displaystyle=\sum_{\mathbf{a}_{1}}\exp\big{(}\eta Q^{*}(\mathbf{s}_{1}, \mathbf{a}_{1})\big{)}$ $\displaystyle=\sum_{\mathbf{a}_{1}}\pi_{\text{ref}}(\mathbf{a}_{1}|\mathbf{s}_ {1})\exp\big{(}\eta V^{*}(\mathbf{s}_{2})\big{)}$ $\displaystyle=\sum_{\mathbf{a}_{1},\mathbf{a}_{2}}\pi_{\text{ref}}(\mathbf{a}_ {1}|\mathbf{s}_{1})\pi_{\text{ref}}(\mathbf{a}_{2}|\mathbf{s}_{2})\exp\big{(} \eta V^{*}(\mathbf{s}_{3})\big{)}$ $\displaystyle\cdots$ $\displaystyle=\sum_{(\mathbf{a}_{1},\mathbf{a}_{2},\dots,\mathbf{a}_{H})}\prod _{h=1}^{H}\pi_{\text{ref}}(\mathbf{a}_{h}|\mathbf{s}_{h})\exp\big{(}\eta r( \mathbf{s}_{H+1})\big{)}$ $\displaystyle=\sum_{\mathbf{y}}\pi_{\text{ref}}(\mathbf{y}|\mathbf{x})\exp\big {(}\eta r(\mathbf{y};\mathbf{x})\big{)}.$ $$

Going back to the SPPO objective (4.4) at $t$-th iteration, if we set $\pi_{\text{ref}}=\pi_{t}$ and $r(\mathbf{y};\mathbf{x})=\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})$, we have $V^{*}(\mathbf{s}_{1})=\eta^{-1}\log Z_{\pi_{t}}(\mathbf{x})$, and the learning objective at $t$-th iteration becomes:

$$ $\displaystyle\pi_{t+1}$ $\displaystyle=\mathop{\mathrm{argmin}}_{\pi}\mathbb{E}_{\mathbf{x}\sim\mathcal {X},\mathbf{y}\sim\pi_{t}(\cdot|\mathbf{x})}\bigg{(}\log\bigg{(}\frac{\pi( \mathbf{y}|\mathbf{x})}{\pi_{t}(\mathbf{y}|\mathbf{x})}\bigg{)}-\Big{(}\eta \mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})-\log Z_{\pi_{t}}(\mathbf{x})\Big {)}\bigg{)}^{2}$ $\displaystyle=\mathop{\mathrm{argmin}}_{\pi}\mathbb{E}_{\mathbf{s}_{1}\sim \mathcal{X},\mathbf{a}_{h}\sim\pi_{t}(\cdot|\mathbf{s}_{h})}\bigg{(}\sum_{h=1} ^{H}\log\frac{\pi(\mathbf{a}_{h}|\mathbf{s}_{h})}{\pi^{*}(\mathbf{a}_{h}| \mathbf{s}_{h})}\bigg{)}^{2}.$ (4.11) $$

Similar to DPO, SPPO “secretly” encourages the policy $\pi_{\bm{\theta}}$ to converge to the optimal policy $\pi^{*}$ at token level via the square loss form (4.11). Additionally, one may realize that minimizing the square-loss form is related to minimizing the KL divergence $\mathrm{KL}(\pi_{\bm{\theta}}\|\pi^{*})$ via policy gradient:

$$ $\displaystyle\nabla_{\bm{\theta}}\mathrm{KL}(\pi_{\bm{\theta}}\|\pi^{*})$ $\displaystyle=\mathbb{E}_{\mathbf{s}_{1}\sim\mathcal{X},\mathbf{a}_{h}\sim\pi_ {\bm{\theta}}(\cdot|\mathbf{s}_{h})}\bigg{[}\bigg{(}\sum_{h=1}^{H}\log\frac{ \pi_{\bm{\theta}}(\mathbf{a}_{h}|\mathbf{s}_{h})}{\pi^{*}(\mathbf{a}_{h}| \mathbf{s}_{h})}\bigg{)}\sum_{h=1}^{H}\nabla_{\bm{\theta}}\log\pi_{\bm{\theta} }(\mathbf{a}_{h}|\mathbf{s}_{h})\bigg{]}$ $\displaystyle=\mathbb{E}_{\mathbf{s}_{1}\sim\mathcal{X},\mathbf{a}_{h}\sim\pi_ {\bm{\theta}}(\cdot|\mathbf{s}_{h})}\bigg{[}\nabla_{\bm{\theta}}\bigg{(}\sum_{ h=1}^{H}\log\frac{\pi_{\bm{\theta}}(\mathbf{a}_{h}|\mathbf{s}_{h})}{\pi^{*}( \mathbf{a}_{h}|\mathbf{s}_{h})}\bigg{)}^{2}\bigg{]}.$ $$

### 4.5 Comparison with DPO, IPO, and KTO

In practice, we utilize mini-batches of more than $2$ responses to estimate the win rate of a given response, while the DPO and IPO loss focus on a single pair of responses. When only a pair of responses $\mathbf{y}_{w}$ and $\mathbf{y}_{l}$ is available, we have the pair-wise symmetric loss based on the preference triplet $(\mathbf{x},\mathbf{y}_{w},\mathbf{y}_{l})$ defined as:

$$ $\displaystyle\ell_{\textsc{SPPO}}(\mathbf{x},\mathbf{y}_{w},\mathbf{y}_{l};\bm {\theta};\pi_{\text{ref}})$ $\displaystyle:=\bigg{(}\log\bigg{(}\frac{\pi_{\bm{\theta}}(\mathbf{y}_{w}| \mathbf{x})}{\pi_{\text{ref}}(\mathbf{y}_{w}|\mathbf{x})}\bigg{)}-\eta\Big{(} \mathbb{P}(\mathbf{y}_{w}\succ\mathbf{y}_{l}|\mathbf{x})-\frac{1}{2}\Big{)} \bigg{)}^{2}$ $\displaystyle\qquad\qquad+\bigg{(}\log\bigg{(}\frac{\pi_{\bm{\theta}}(\mathbf{ y}_{l}|\mathbf{x})}{\pi_{\text{ref}}(\mathbf{y}_{l}|\mathbf{x})}\bigg{)}-\eta \Big{(}\mathbb{P}(\mathbf{y}_{w}\prec\mathbf{y}_{l}|\mathbf{x})-\frac{1}{2} \Big{)}\bigg{)}^{2},$ (4.12) $$

where $\mathbb{P}(\mathbf{y}_{w}\succ\mathbf{y}_{l}|\mathbf{x})$ can be either a soft probability within $[0,1]$ or a hard label $1$ indicating $\mathbf{y}_{w}\succ\mathbf{y}_{l}$.

We now compare the SPPO loss to other baselines assuming a hard label $\mathbf{y}_{w}\succ\mathbf{y}_{l}$ is given.
For the ease of comparison, let ($\beta=\eta^{-1}$):

$$ $\displaystyle a=\beta\log\bigg{(}\frac{\pi_{\bm{\theta}}(\mathbf{y}_{w}| \mathbf{x})}{\pi_{\text{ref}}(\mathbf{y}_{w}|\mathbf{x})}\bigg{)},b=\beta\log \bigg{(}\frac{\pi_{\bm{\theta}}(\mathbf{y}_{l}|\mathbf{x})}{\pi_{\text{ref}}( \mathbf{y}_{l}|\mathbf{x})}\bigg{)},c=\beta\mathrm{KL}(\pi_{\bm{\theta}}\|\pi_ {\text{ref}}),$ $$

then we have

$$ $\displaystyle\ell_{\text{DPO}}(\mathbf{y}_{w},\mathbf{y}_{l},\mathbf{x})$ $\displaystyle=-\log\sigma(a-b),$ (4.13) $\displaystyle\ell_{\text{IPO}}(\mathbf{y}_{w},\mathbf{y}_{l},\mathbf{x})$ $\displaystyle=[(a-b)-1]^{2},$ (4.14) $\displaystyle\ell_{\text{KTO}}(\mathbf{y}_{w},\mathbf{y}_{l},\mathbf{x})$ $\displaystyle=\sigma(-a+c)+\sigma(b-c)\text{ (simplified)},$ (4.15) $$

where $\sigma(x)=e^{x}/(e^{x}+1)$ and the SPPO loss can be written as

$$ $\displaystyle\ell_{\text{SPPO}}(\mathbf{y}_{w},\mathbf{y}_{l},\mathbf{x})=(a-1 /2)^{2}+(b+1/2)^{2}.$ $$

It can be seen that SPPO not only pushes the gap between $a$ and $b$ to be $1$, but also attempts to push the value of $a$ to be close to $1/2$ and the value of $b$ to be close to $-1/2$ so that $\pi_{\bm{\theta}}(\mathbf{y}_{w}|\mathbf{x})>\pi_{\text{ref}}(\mathbf{y}_{w}|
\mathbf{x})$ and $\pi_{\bm{\theta}}(\mathbf{y}_{l}|\mathbf{x})<\pi_{\text{ref}}(\mathbf{y}_{l}|
\mathbf{x})$. We believe this to be particularly important: when the preference pairs are scarce (e.g., one pair for each prompt), there is no guarantee that the winner log-ratio $a$ will increase and the loser log-ratio $b$ will decrease. Instead, only the gap between the winner and the loser (i.e., $a-b$) will increase. This phenomenon is observed by Pal et al. () that DPO only lowers the loser’s likelihood, but barely change the winner’s likelihood.

As discussed above, fitting $\beta\log\Big{(}\frac{\pi_{t+1}(\mathbf{y}|\mathbf{x})}{\pi_{t}(\mathbf{y}|
\mathbf{x})}\Big{)}$ directly to $\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})-1/2$ under a square loss is closely related to the policy gradient.
This explains why SPPO is more effective than IPO which attempts to fit $\beta\log\Big{(}\frac{\pi_{t+1}(\mathbf{y}_{w}|\mathbf{x})}{\pi_{t}(\mathbf{y}
_{w}|\mathbf{x})}\Big{)}-\beta\log\Big{(}\frac{\pi_{t+1}(\mathbf{y}_{l}|
\mathbf{x})}{\pi_{t}(\mathbf{y}_{l}|\mathbf{x})}\Big{)}$ to $\mathbb{P}(\mathbf{y}_{w}\succ\pi_{t}|\mathbf{x})-\mathbb{P}(\mathbf{y}_{l}
\succ\pi_{t}|\mathbf{x})$. In addition, SPPO shares a similar spirit as KTO. The KTO loss pushes $a$ to be large by minimizing $\sigma(-a+c)$ and pushes $b$ to be small by minimizing $\sigma(b-c)$. In contrast, SPPO pushes $a$ to be as large as $1/2$ and $b$ to be as small as $-1/2$.

On the other hand, we would like to comment that although DPO and KTO can be extended to their iterative variants, they are not by nature iterative algorithms and do not have provable guarantees that they can reach the Nash equilibrium. In contrast, SPPO and IPO are by design capable to solve the Nash equilibrium iteratively. SPPO is superior to IPO because its design explicitly alleviates the data sparsity issue, as discussed above and detailed in Pal et al. ().

## 5 Experiments

### 5.1 Experiment Setup

#### Base Model and Datasets

We follow the experimental setup of Snorkel(^5^55[https://huggingface.co/snorkelai/Snorkel-Mistral-PairRM-DPO](https://huggingface.co/snorkelai/Snorkel-Mistral-PairRM-DPO)), a model that utilizes iterative DPO to achieve state-of-the-art performance on AlpacaEval benchmarks. Specifically, we use Mistral-7B-Instruct-v0.2 as our base model(^6^66[https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)). Mistral-7B-Instruct-v0.2 is an instruction fine-tuned version of Mistral-7B-v0.2 model (Jiang et al., ). We also adopt Ultrafeedback (Cui et al., )
as our source of prompts which includes around 60k prompts from diverse resources.
During generation, we follow the standard chat template of Mistral-7B. To avoid overfitting during the fine-tuning, we split the dataset into three portions and use only one portion per iteration. These settings were also adopted by training the model Snorkel-Mistral-PairRM-DPO(^7^77[https://huggingface.co/snorkelai/Snorkel-Mistral-PairRM-DPO](https://huggingface.co/snorkelai/Snorkel-Mistral-PairRM-DPO)) (Snorkel). We follow the splitting in Snorkel for a fair comparison.
Additionally, we use Llama-3-8B-Instruct(^8^88[https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct)) as a stronger base model along with the same preference dataset and data splitting.

#### Preference Model

We employ PairRM (Jiang et al., ), an efficient pair-wise preference model of size 0.4B.
PairRM is based on DeBERTA-V3 (He et al., ) and trained on high-quality human-preference datasets. Results on benchmarks like Auto-J Pairwise dataset (Li et al., ) show that it outperforms most of the language-model-based reward models and performs comparably with larger reward models like UltraRM-13B (Cui et al., ). We refer the readers to the homepage on Huggingface(^9^99[https://huggingface.co/llm-blender/PairRM](https://huggingface.co/llm-blender/PairRM)) for detailed benchmark results.
We therefore keep PairRM as our ranking model following Snorkel for a balance between accuracy and efficiency.

Specifically, PairRM will output a “relative reward” $s(\mathbf{y},\mathbf{y}^{\prime};\mathbf{x})$ that reflects the strength difference between $\mathbf{y}$ and $\mathbf{y}^{\prime}$,
i.e.,

$$ $\displaystyle\mathbb{P}(\mathbf{y}\succ\mathbf{y}^{\prime}|\mathbf{x})=\frac{ \exp(s(\mathbf{y},\mathbf{y}^{\prime};\mathbf{x}))}{1+\exp(s(\mathbf{y}, \mathbf{y}^{\prime};\mathbf{x}))}.$ $$

Unlike the Bradley-Terry-based reward model, PairRM only assigns the relative reward which is not guaranteed to be transitive (i.e., $s(\mathbf{y}_{1},\mathbf{y}_{2};\mathbf{x})+s(\mathbf{y}_{2},\mathbf{y}_{3};
\mathbf{x})\neq s(\mathbf{y}_{1},\mathbf{y}_{3};\mathbf{x})$). So it indeed models the general preference.

#### Response Generation and Selection

During the generation phase in each iteration, we use top $p=1.0$ and temperature $1.0$ to sample from the current policy. We sample with different random seeds to get $K=5$ different responses for each prompt.
Previous works utilizing Iterative DPO choose $2$ responses to form a pair for each prompt. For a fair comparison, we do not include all $K=5$ responses in the preference data but choose two responses among them.
Following Snorkel, we choose the winner $\mathbf{y}_{w}$ and loser $\mathbf{y}_{l}$ to be the response with the highest and lowest PairRM score, which is defined for each response $\mathbf{y}_{i}$ as:

$$ $\displaystyle s_{\text{PairRM}}(\mathbf{y}_{i};\mathbf{x})$ $\displaystyle:=\frac{1}{K}\sum_{k=1}^{K}s(\mathbf{y}_{i},\mathbf{y}_{k}; \mathbf{x}).$ $$

#### Probability Estimation

We then estimate the win rate over the distribution by the average win rate over all the sampled responses as explained in (4.5):

$$ $\displaystyle\widehat{P}(\mathbf{y}_{i}\succ\pi_{t}|\mathbf{x})=\frac{1}{K} \sum_{k=1}^{K}\mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{k}|\mathbf{x}),\forall i \in[K].$ $$

#### Hyperparameter Tuning

The experiments are conducted on 8 $\times$ Nvidia A100 GPUs. For SPPO, we trained three iterations in total. In each iteration, we selected the model trained on the first epoch of the 20k prompts from UltraFeedback to proceed to the next iteration.
For both Mistral-7B-Instruct-v0.2 and Llama-3-8B-Instruct, the global training batch size is set to 64, and $\eta$ is set to $1e3$. The learning rate schedule is determined by the following hyperparameters: learning rate=5.0e-7, number of total training epochs=18, warmup ratio=0.1, linear schedule.
The best hyper-parameters for each model are selected by the average win rate (judged by PairRM-0.4B) on a hold-out subset of Ultrafeedback as the metric. For more details on the win-rate comparison using PairRM as a judge, please refer to Section 5.2 and Figure 3.

#### Baselines

We evaluate the following base models as well as baseline methods for fine-tuning LLMs:

- •
Mistral-7B-Instruct-v0.2: Mistral-7B-Instruct-v0.2 is an instruction fine-tuned version of Mistral-7B-v0.2 model (Jiang et al., ). It is the starting point of our algorithm.
- •
Snorkel (Mistral-PairRM-DPO): We directly evaluate the uploaded checkpoint on HuggingFace(^10^1010[https://huggingface.co/snorkelai/Snorkel-Mistral-PairRM-DPO](https://huggingface.co/snorkelai/Snorkel-Mistral-PairRM-DPO)). This model is obtained by three rounds of iterative DPO from Mistral-7B-Instruct-v0.2.
- •
(Iterative) DPO: We also implement the iterative DPO algorithm by ourselves. The experimental settings and model selection schemes align with those used for SPPO, except for the adoption of the DPO loss function as defined in (4.13). Hyperparameters are optimized to maximize the average win-rate assessed by PairRM at each iteration. Note that the practical algorithm in Rosset et al. () is essentially the same as iterative DPO.
- •
(Iterative) IPO: We implement the iterative IPO algorithm by ourselves. The experimental setting and the model selection scheme is the same as iterative DPO, except that the loss function is the IPO loss (4.14). For fair comparison, hyperparameters for IPO is also selected by evaluation using the average PairRM win-rate on the hold-out subset of Ultrafeedback.
- •
Self-rewarding LM: Yuan et al. () proposed to prompt the LLM itself as a preference judge to construct new preference pairs and iteratively fine-tune the LLM with the DPO algorithm. We use the AlpacaEval 2.0 win rate reported by Yuan et al. () for comparison. Note that Self-rewarding LM is a trained from Llama 2 70B.
- •
Llama-3-8B-Instruct: Llama-3-8B-Instruct is an instruction-tuned model optimized for dialogue use cases and outperforms many of the available open-source chat models on common industry benchmarks.

#### Benchmarks

Following previous works, we use AlpacaEval 2.0 (Dubois et al., ), Arena-Hard(Li et al., ), MT-Bench (Zheng et al., ), and Open LLM Leaderboard (Beeching et al., ) as our evaluation benchmarks.

- •
AlpacaEval 2.0 is an LLM-based automatic evaluation benchmark. It employs AlpacaFarm (Dubois et al., ) as its prompts set composed of general human instructions. The model responses and the reference response generated by GPT-4-Turbo are fed into a GPT-4-Turbo-based annotator to be judged. We follow the standard approach and report the win rate over the reference responses.
- •
Arena-Hard (Li et al., ) is a high-quality benchmark that claims to be harder and has the highest correlation and separability to Chatbot Arena among popular open-ended LLM benchmarks including AlpacaEval 2.0. We evaluate our models Mistral-PairRM-SPPO and the baseline models.
- •
MT-Bench (Zheng et al., ) is a collection of 80 high-quality multi-turn open-ended questions. The questions cover topics like writing, role-playing, math, coding, etc.. The generated answer is judged by GPT-4 and given a score directly without pairwise comparison.
- •
Open LLM Leaderboard (Beeching et al., ) consists of six datasets, each of which focuses on a facet of language model evaluation. In detail, the evaluation rubric includes math problem-solving, language understanding, human falsehood mimicking, and reasoning. We follow the standard evaluation process and use in-context learning to prompt the language model and compute the average score over six datasets to measure the performance.

**Table 1: AlpacaEval 2.0 evaluation of various models (detailed in Baselines) in terms of both normal and length-controlled (LC) win rates in percentage (%). Mistral-7B-SPPO Iter3 model achieves the highest LC win rate of 28.53% and a normal win rate of 31.02%. SPPO demonstrates steady performance gains across iterations and outperforms other baselines which show a tendency to produce longer responses. Additionally, re-ranking with the PairRM reward model (best-of-16) at test time consistently enhances the performance across all models and SPPO (best-of-16) achieves high win rate without strong external supervision like GPT-4. We additionally include the results obtained from fine-tuning Llama-3-8B-Instruct, which also show steady performance improvement.**
| Model | AlpacaEval 2.0 |  |  |
| --- | --- | --- | --- |
| LC Win Rate | Win Rate | Avg. Len |  |
| Mistral-7B-Instruct-v0.2 | 17.11 | 14.72 | 1676 |
| Mistral-7B-Instruct-v0.2 (best-of-16) | 22.45 | 17.94 | 1529 |
| Snorkel (Mistral-PairRM-DPO) | 26.39 | 30.22 | 2736 |
| Snorkel (Mistral-PairRM-DPO best-of-16) | 29.97 | 34.86 | 2616 |
| Self-Rewarding 70B Iter1 | - | 9.94 | 1092 |
| Self-Rewarding 70B Iter2 | - | 15.38 | 1552 |
| Self-Rewarding 70B Iter3 | - | 20.44 | 2552 |
| Mistral-7B-DPO Iter1 | 23.81 | 20.44 | 1723 |
| Mistral-7B-DPO Iter2 | 24.23 | 24.46 | 2028 |
| Mistral-7B-DPO Iter3 | 22.30 | 23.39 | 2189 |
| Mistral-7B-IPO Iter1 | 23.78 | 20.77 | 1693 |
| Mistral-7B-IPO Iter2 | 21.08 | 23.38 | 2660 |
| Mistral-7B-IPO Iter3 | 20.06 | 22.47 | 2760 |
| Mistral-7B-SPPO Iter1 | $24.79_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+7.69)}}}$ | $23.51_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+8.79)}}}$ | 1855 |
| Mistral-7B-SPPO Iter2 | $26.89_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+2.10)}}}$ | $27.62_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+4.11)}}}$ | 2019 |
| Mistral-7B-SPPO Iter3 | $\textbf{28.53}_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{<br>1,0,0}\textbf{(+1.64)}}}$ | $\textbf{31.02}_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{<br>1,0,0}\textbf{(+3.40)}}}$ | 2163 |
| Mistral-7B-SPPO Iter1 (best-of-16) | $28.71_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+6.26)}}}$ | $27.77_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+9.83)}}}$ | 1901 |
| Mistral-7B-SPPO Iter2 (best-of-16) | $31.23_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+2.52)}}}$ | $32.12_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+4.35)}}}$ | 2035 |
| Mistral-7B-SPPO Iter3 (best-of-16) | $\textbf{32.13}_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{<br>1,0,0}\textbf{(+0.9)}}}$ | $\textbf{34.94}_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{<br>1,0,0}\textbf{(+2.82)}}}$ | 2174 |
| Llama-3-8B-Instruct | 22.92 | 22.57 | 1899 |
| Llama-3-8B-SPPO Iter1 | $31.73_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+8.81)}}}$ | $31.74_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+9.17)}}}$ | 1962 |
| Llama-3-8B-SPPO Iter2 | $35.15_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+3.42)}}}$ | $35.98_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}<br>\textbf{(+4.24)}}}$ | 2021 |
| Llama-3-8B-SPPO Iter3 | $\textbf{38.77}_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{<br>1,0,0}\textbf{(+3.62)}}}$ | $\textbf{39.85}_{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{<br>1,0,0}\textbf{(+3.87)}}}$ | 2066 |

**Table 2: AlpacaEval 2.0 leaderboard results of both normal and length-controlled (LC) win rates in percentage (%). Mistral-7B-SPPO can outperform larger models and Mistral-7B-SPPO (best-of-16) can outperform proprietary models such as GPT-4(6/13). Llama-3-8B-SPPO exhibits even better performance.**
| Model | AlpacaEval 2.0 |  |
| --- | --- | --- |
| LC. Win Rate | Win Rate |  |
| GPT-4 Turbo | 50.0 | 50.0 |
| Claude 3 Opus | 40.5 | 29.1 |
| Llama-3-8B-SPPO Iter3 | 38.8 | 39.9 |
| GPT-4 0314 | 35.3 | 22.1 |
| Llama 3 70B Instruct | 34.4 | 33.2 |
| Mistral-7B-SPPO Iter3 (best-of-16) | 32.1 | 34.9 |
| GPT-4 0613 | 30.2 | 15.8 |
| Snorkel (Mistral-PairRM-DPO best-of-16) | 30.0 | 34.9 |
| Mistral Medium | 28.6 | 21.9 |
| Mistral-7B-SPPO Iter3 | 28.5 | 31.0 |
| Claude 2 | 28.2 | 17.2 |
| Snorkel (Mistral-PairRM-DPO) | 26.4 | 30.2 |
| Gemini Pro | 24.4 | 18.2 |
| Mistral 8$\times$7B v0.1 | 23.7 | 18.1 |
| Llama 3 8B Instruct | 22.9 | 22.6 |

### 5.2 Experimental Results

#### Evaluation using GPT-4 as a judge

Human evaluation remains the benchmark for quality and accuracy (Askell et al., ; Ouyang et al., ). However, due to its limitations in scalability and reproducibility, we explore the alternative approach of using the advanced capabilities of GPT-4 (OpenAI et al., ) as an automatic evaluation tool. We conduct GPT-4-based automatic evaluation on AlpacaEval 2.0 (Li et al., ), MT-Bench (Zheng et al., ), and Arena-Hard (Li et al., ) to measure the chatbot capability of our model.
The results can be found in Table 1 for AlpacaEval 2.0, Figure 2 (left) for MT-Bench, and Figure 2 (right) for Arena-Hard.
We found that the performance of SPPO models consistently improves throughout all iterations.

Table 1 (AlpacaEval 2.0) shows the win rate over the GPT-4-Turbo baseline of different models on 805 prompts. We also include one column indicating the length-controlled win rate, and one column on the average length of each model, to account for the tendency of the LLM-based judge to favor longer sequence outputs — an issue colloquially termed the ”reward hacking” phenomenon. According to the table, Mistral-7B-SPPO Iter3 has the highest win rate, 28.52% for the length-controlled version, and 31.02% for the overall win rate.

Figure: Figure 1: Win Rate against GPT-4-Turbo with (a) and without (b) Length Controlling (LC) on AlpacaEval 2.0. SPPO demonstrates steady improvements on both LC and raw win rates.
Refer to caption: x1.png

The performance gains over previous iterations are 7.69% (Mistral-7B-Instruct $\rightarrow$ Iter1), 2.10% (Iter1 $\rightarrow$ Iter2), and 1.64% (Iter2 $\rightarrow$ Iter3), respectively, indicating steady improvements across iterations, as illustrated in Figure 1.
We also apply SPPO to a stronger baseline model, i.e., Llama-3-8B-Instruct, and the fine-tuned model Llama-3-8B-SPPO has a higher length-controlled win rate 38.77% and overall win rate 39.85%. The performance gains are more significant: 8.81% (Llama-3-8B-Instruct $\rightarrow$ Iter1), 3.42% (Iter1 $\rightarrow$ Iter2), and 3.62% (Iter2 $\rightarrow$ Iter3), summing up to a total gain of 15.85%.

Additionally, the result indicates that SPPO achieves superior performance compared to the iterative variants of DPO and IPO. The length-controlled win rate for SPPO reaches 28.53%, outperforming the DPO’s best rate of 26.39% (by Snorkel) and IPO’s rate of 25.45%.
Notably, while DPO and IPO training tend to significantly increase the average output length—2736 and 2654, respectively—SPPO shows a more moderate length increase, moving from 1676 in the base model to 2163 at the third iteration.
Finally, we present the best-of-16 results for each model, selected using the PairRM reward model.
We find that re-ranking with the preference model at test time can consistently improve the performance of base model (Mistral-7B-Instruct-v0.2), DPO (Snorkel), and SPPO (Iter3) by 5.34%, 3.57%, and 3.6%, respectively.
Notably, this shows that while SPPO significantly enhances model alignment using PairRM-0.4B as the sole external supervision, it has not resulted in over-optimization against the preference model (Gao et al., ).

Figure: Figure 2: MT-Bench & Arena-Hard Evaluation. Left: Mistral-7B-SPPO Iter3 outperforms all baseline models by achieving an average score of 7.59 in MT-Bench. Despite initial drops in performance in the first two iterations, SPPO Iter3 improves upon the base model by the final iteration. Right: Mistral-7B-SPPO Iter3 outperforms the baseline model Snorkel(Mistral-PairRM-DPO) in Arena-Hard. The improvement across different iterations is consistent.

In Table 2, we compare SPPO on the AlpacaEval 2.0 leaderboard with other state-of-the-art AI chatbots. We found our SPPO model outperforms many competing models trained on proprietary alignment data (e.g., Claude 2, Gemini Pro, & Llama 3 8B Instruct). When applied to Llama 3 8B Instruct, our Llama-3-8B-SPPO exhibits an even higher win rate. With test-time reranking, Mistral-7B-SPPO Iter3 (best-of-16) is even competitive to GPT-4 0613 and Llama 3 70B Instruct.

In Figure 2 (left), we evaluate the performance of SPPO on MT-Bench. We can see that Mistral-7B-SPPO Iter3 outperforms all baseline models, achieving an average score of 7.59.
While we are not certain why the MT-Bench performance drops at the first two iterations, the performance of SPPO at the final iteration still improves over the base model.

**Table 3: Open LLM Leaderboard Evaluation. SPPO fine-tuning improves the base model’s performance on different tasks, reaching a state-of-the-art average score of 66.75 for Mistral-7B and 70.29 for Llama-3-8B. For Mistral-7B, subsequent iterations of DPO, IPO, and SPPO see a decline in performance. It is possible that aligning with human preferences (simulated by the PairRM preference model in our study) may not always enhance, and can even detract from, overall performance.**
| Models | Arc | TruthfulQA | WinoGrande | GSM8k | HellaSwag | MMLU | Average |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Mistral-7B-Instruct-v0.2 | 63.65 | 66.85 | 77.98 | 41.93 | 84.89 | 59.15 | 65.74 |
| Snorkel | 66.04 | 70.86 | 77.74 | 36.77 | 85.64 | 60.83 | 66.31 |
| Mistral-7B-DPO Iter1 | 63.14 | 68.39 | 77.19 | 40.33 | 85.25 | 59.41 | 65.62 |
| Mistral-7B-DPO Iter2 | 64.16 | 67.84 | 76.09 | 39.95 | 85.23 | 59.03 | 65.38 |
| Mistral-7B-DPO Iter3 | 65.19 | 67.89 | 77.27 | 32.30 | 85.49 | 59.00 | 64.52 |
| Mistral-7B-IPO Iter1 | 64.68 | 68.60 | 77.98 | 43.75 | 85.08 | 59.04 | 66.52 |
| Mistral-7B-IPO Iter2 | 62.12 | 66.30 | 77.51 | 39.20 | 83.15 | 59.70 | 64.66 |
| Mistral-7B-IPO Iter3 | 62.97 | 67.12 | 77.51 | 37.45 | 83.69 | 59.57 | 64.72 |
| Mistral-7B-SPPO Iter1 | 65.02 | 69.40 | 77.82 | 43.82 | 85.11 | 58.84 | 66.67 |
| Mistral-7B-SPPO Iter2 | 65.53 | 69.55 | 77.03 | 44.35 | 85.29 | 58.72 | 66.75 |
| Mistral-7B-SPPO Iter3 | 65.36 | 69.97 | 76.80 | 42.68 | 85.16 | 58.45 | 66.40 |
| Llama-3-8B-Instruct | 62.29 | 51.65 | 76.09 | 75.89 | 78.73 | 65.59 | 68.37 |
| Llama-3-8B-SPPO Iter1 | 63.82 | 54.96 | 76.40 | 75.44 | 79.80 | 65.65 | 69.35 |
| Llama-3-8B-SPPO Iter2 | 64.93 | 56.48 | 76.87 | 75.13 | 80.39 | 65.67 | 69.91 |
| Llama-3-8B-SPPO Iter3 | 65.19 | 58.04 | 77.11 | 74.91 | 80.86 | 65.60 | 70.29 |

Arena-Hard (Li et al., ) contains 500 challenging user queries and follow the same evaluation method as AlpacaEval 2.0.
In Figure 2 (right), we evaluate the performance of SPPO on Arena-Hard.
We can see that Mistral-7B-SPPO exhibits a steady performance gain across iterations.Mistral-7B-SPPO Iter 3 outperforms the baseline models, achieving an average score of 23.3.

#### Open LLM Leaderboard

We further evaluate the capabilities of SPPO models using Huggingface Open LLM Leaderboard (Beeching et al., ). This leaderboard encompasses 6 different datasets, each focusing on a
specific capability of LLMs: Arc (Clark et al., ), HellaSwag (Zellers et al., ), Winogrande (Sakaguchi et al., ), MMLU (Hendrycks et al., ), TruthfulQA (Lin et al., ), and GSM8k (Cobbe et al., ). The models are prompted with zero or few-shot exemplars.
The results, presented in Table 3, demonstrate that SPPO can enhance the performance of the base model on Arc, TruthfulQA, and GSM8k, and achieve the state-of-the-art performance with an averagte score of 66.75.
However, these improvements do not hold in subsequent alignment iterations: DPO, IPO, and SPPO’s performance declines after the first or second iterations.
This limitation may be attributed to the “alignment tax” phenomenon (Askell et al., ), which suggests that aligning with human preferences (simulated by PairRM preference in our study) might not improve or even hurt the general performance.
Improving language model capabilities through alignment iterations remains a topic for future research, and we posit that incorporating high-quality SFT annotations (Chen et al., ) could play a significant role in this endeavor.

#### Evaluation using PairRM as a judge

Figure: Figure 3: Pairwise win rates among base model (Mistral-7B-Instruct-v0.2), DPO models, IPO models, and SPPO models using PairRM-0.4B as a judge, which may favor models with longer outputs. On benchmarks with more powerful judge models (e.g., GPT-4), such as AlpacaEval 2.0 and MT-Bench, SPPO outperforms other baseline algorithms by a large margin.
Refer to caption: x3.png

As SPPO identifies the von Neumann winner (see (3.3)) in a two-player constant-sum game, we examine the pairwise preferences among SPPO models and other baselines. The pairwise win rates, measured by PairRM, are depicted in Figure 3. We observe that in all algorithms—namely DPO, IPO, and SPPO—the newer model iterations surpass the previous ones. For example, SPPO Iteration 3 outperforms SPPO Iteration 2. Both SPPO and IPO consistently outperform DPO across all iterations. While SPPO is superior to IPO in the first two iterations, IPO exceeds SPPO in performance during the final iteration.
Considering the superior performance of SPPO in standard benchmarks evaluated by GPT-4 or against ground-truth answers (e.g., AlpacaEval 2.0, MT-Bench, and Open LLM Leaderboard), along with IPO’s tendency to produce longer sequence outputs (see Avg. Len in Table 1), we believe this is due to IPO exploiting the length bias in PairRM that favors longer sequences. Conversely, SPPO models benefit from a more robust regularization within a multiplicative weight update framework.

### 5.3 Ablation Study

Figure: Figure 4: AlpacaEval 2.0 evaluation on SPPO of different mini-batch size in terms of both normal and length-controlled (LC) win rates in percentage (%). $K=2,5$ denote different mini-batch sizes when estimating the win rate $\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})$.
Refer to caption: x4.png

We study the effect of mini-batch size when estimating the win rate $\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})$. Specifically, for each prompt, we still generate $5$ responses and choose the winner $\mathbf{y}_{w}$ and loser $\mathbf{y}_{l}$ according to the PairRM score. When estimating the probability, we varies the batch size to be $K=2,3,5$. For $K=2$, we estimate $\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})$ with only $2$ samples $\mathbf{y}_{w}$ and $\mathbf{y}_{l}$:

$$ $\displaystyle\widehat{P}(\mathbf{y}_{w}\succ\pi_{t}|\mathbf{x})=\frac{\mathbb{ P}(\mathbf{y}_{w}\succ\mathbf{y}_{w}|\mathbf{x})+\mathbb{P}(\mathbf{y}_{w} \succ\mathbf{y}_{l}|\mathbf{x})}{2}$ $\displaystyle=\frac{1/2+\mathbb{P}(\mathbf{y}_{w}\succ\mathbf{y}_{l}|\mathbf{x })}{2},$ $$

and $\widehat{P}(\mathbf{y}_{l}\succ\pi_{t}|\mathbf{x})$ similarly. $K=5$ indicates the original setting we use.

We compare the results on AlpacaEval 2.0, as shown in Figure 4.
We find that the performance of SPPO is robust to the noise in estimating $\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})$. While $K=5$ initially outperforms $K=2$ in the first iteration, the difference in their performance diminishes in subsequent iterations. Additionally, we observe that $K=2$ exhibits a reduced tendency to increase output length.

## 6 Conclusions

This paper introduced Self-Play Preference Optimization(SPPO), an approach to fine-tuning Large Language Models (LLMs) from Human/AI Feedback.
SPPO has demonstrated significant improvements over existing methods such as DPO and IPO across multiple benchmarks, including AlpacaEval 2.0, MT-Bench, Arena-Hard, and the Open LLM Leaderboard. By integrating a preference model and employing a new optimization objective, SPPO can align LLMs more closely with human preferences.

Limitations Theoretically, approximating the optimal policy update via regression relies on the assumption that the model class is expressive enough and the generated data well cover the input space.
Approximating the log-partition factor with a constant can help reduce variance only when it is close to the soft value function.
The experiments are run on one dataset UltraFeedback and the models are tested on a few benchmarks due to limited computational resources, but the proposed methods can be further validated on more models, datasets, and benchmarks to have a holistic evaluation given more resources.

## Acknowledgement

We would like to thank Alekh Agarwal for his insightful comments that helped clarify the technical contributions of our work and its connection and distinction from SPO (Swamy et al., ). We would also like to thank Wen Sun for pointing out the concurrent work (Gao et al., ) and for the valuable discussion on the design choice of objective functions.

## Appendix A Approximating the Normalizing Factor

As discussed before, we replace the log-partition factor with a constant to avoid either estimating or predicting the log-partition factor. In hindsight, the approximation of the normalizing factor serves as a baseline for variance reduction, and does not need to be exact. Here we discuss the implicit assumptions and how we obtained an approximation based on different assumptions on human preference behaviour.

We first consider the case where we have $K$ responses and then calculate the limit of $Z_{\widehat{\pi}_{t}^{K}}(\mathbf{x})$ when $K\rightarrow\infty$. We have two extreme cases:

- 1.
The most “disordered” case: any preference is a fair coin flip
- 2.
The most “ordered” case: there is a strict ordering among all responses.

#### The most “disordered” case

Specifically, we have $K$ different responses $\mathbf{y}_{1},\mathbf{y}_{2},\dots,\mathbf{y}_{K}$ for the given prompt $\mathbf{x}$. Since we consider the general preference setting, we assume that the preference probability between $\mathbf{y}_{i}$ and $\mathbf{y}_{j}$ ($i<j$) we observe is a fair coin toss:

$$ $\displaystyle\mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{j}|\mathbf{x})=\begin{ cases}1,\text{ w.p. }1/2,\\ 0,\text{ w.p. }1/2.\end{cases}$ $$

Note that for simplicity, we assumed that the preference probability follows the Bernoulli distribution, not the preference feedback. The preference feedback is deterministic since the preference probability is either 0 0 or $1$. Assuming $\mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{j}|\mathbf{x})$ follows any other $1/2$-mean distribution will yield the same constant.

We define the random variable $p_{i,j}:=2\mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{j}|\mathbf{x})-1$ for convenience. In total, we have $K(K-1)/2$ independent Rademacher random variables for all $i<j$, and then we have $p_{j,i}=-p_{i,j}$ for all $i>j$. For $i=j$, $p_{i,j}=0$. We also define $X_{i}=\sum_{j=1}^{K}p_{i,j}/K$.

Given the setting and notations above, we have

$$ $\mathbb{P}(\mathbf{y}_{i}\succ\widehat{\pi}^{K}_{t}|\mathbf{x})=\sum_{j=1}^{K} \mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{j}|\mathbf{x})/K=1/2+X_{i}.$ $$

Furthermore,

$$ $Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})=\sum_{i=1}^{K}\exp(\eta\mathbb{P}( \mathbf{y}_{i}\succ\widehat{\pi}^{K}_{t}|\mathbf{x}))/K=e^{\eta/2}\cdot\sum_{i =1}^{K}e^{\eta X_{i}}/K.$ $$

For any fixed $i$, we have the expectation as follows:

$$ $\displaystyle\mathbb{E}[e^{\eta X_{i}}]$ $\displaystyle=\mathbb{E}\Bigg{[}\prod_{j=1}^{K}e^{\eta p_{i,j}/K}\Bigg{]}= \prod_{j=1}^{K}\mathbb{E}\Big{[}e^{\eta p_{i,j}/K}\Big{]}=\bigg{(}\frac{e^{ \eta/K}+e^{-\eta/K}}{2}\bigg{)}^{K-1},$ $$

where the last equation comes from the definition of $p_{i,j}$ (note that $p_{i,i}=0$).
The variance is:

$$ $\displaystyle\mathrm{Var}[e^{\eta X_{i}}]$ $\displaystyle=\mathbb{E}[e^{2\eta X_{i}}]-\mathbb{E}[e^{\eta X_{i}}]^{2}=\bigg {(}\frac{e^{2\eta/K}+e^{-2\eta/K}}{2}\bigg{)}^{K-1}-\bigg{(}\frac{e^{\eta/K}+e ^{-\eta/K}}{2}\bigg{)}^{2K-2}.$ $$

Additionally, the covariance between $e^{\eta X_{i}}$ and $e^{\eta X_{j}}$ ($i\neq j$) is:

$$ $\displaystyle\mathrm{Cov}(e^{\eta X_{i}},e^{\eta X_{j}})$ $\displaystyle=\mathbb{E}[e^{\eta X_{i}+\eta X_{j}}]-\mathbb{E}[e^{\eta X_{i}}] \mathbb{E}[e^{\eta X_{j}}]$ $\displaystyle=\mathbb{E}\Bigg{[}\exp\Bigg{(}\eta\sum_{k=1}^{K}p_{i,k}/K+\eta \sum_{l=1}^{K}p_{j,l}/K\Bigg{)}\Bigg{]}-\mathbb{E}[e^{\eta X_{i}}]\mathbb{E}[e ^{\eta X_{j}}]$ $\displaystyle=\bigg{(}\frac{e^{\eta/K}+e^{-\eta/K}}{2}\bigg{)}^{2K-4}-\mathbb{ E}[e^{\eta X_{i}}]\mathbb{E}[e^{\eta X_{j}}]$ $\displaystyle=\bigg{(}\frac{e^{\eta/K}+e^{-\eta/K}}{2}\bigg{)}^{2K-4}-\bigg{(} \frac{e^{\eta/K}+e^{-\eta/K}}{2}\bigg{)}^{2K-2},$ $$

where the third line holds because $p_{i,i}=p_{j,j}=0$, $p_{i,j}+p_{j,i}=0$, and the rest terms are i.i.d..

One can check that when $K\rightarrow\infty$, we have $\mathbb{E}[e^{\eta X_{i}}]\rightarrow 1$, $\mathrm{Var}[e^{\eta X_{i}}]\rightarrow 0$, and $\mathrm{Cov}(e^{\eta X_{i}},e^{\eta X_{j}})\rightarrow 0$. By Chebyshev’s inequality, $\sum_{i=1}^{K}e^{\eta X_{i}}/K$ will converge to $1$ in probability. So we have

$$ $\displaystyle Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})=e^{\eta/2}\cdot\sum_{i=1}^ {K}e^{\eta X_{i}}/K\rightarrow e^{\eta/2},$ $$

and we can approximate $\log Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})$ with $\eta/2$.

#### The most “ordered” case

We assume there is an ordering $\sigma(\cdot)$ among the $K$ different responses $\mathbf{y}_{1},\mathbf{y}_{2},\dots,\mathbf{y}_{K}$ for the given prompt $\mathbf{x}$. The preference probability between $\mathbf{y}_{i}$ and $\mathbf{y}_{j}$ ($i<j$) is:

$$ $\displaystyle\mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{j}|\mathbf{x})=\begin{ cases}1,\text{ if }\sigma(i)<\sigma(j),\\ 0,\text{ if }\sigma(i)>\sigma(j).\end{cases}$ $$

Again, the preference feedback is deterministic: as long as $\mathbf{y}_{i}$ is ranked higher than $\mathbf{y}_{j}$, $\mathbf{y}_{i}$ will always be preferred over $\mathbf{y}_{j}$. The same responses still tie: $\mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{i}|\mathbf{x})=1/2$.

Without loss of generality, we can assume $\mathbf{y}_{1}\prec\mathbf{y}_{2}\prec\mathbf{y}_{3}\prec\cdots\prec\mathbf{y}
_{K}$. Given the setting and notations above, we have

$$ $\mathbb{P}(\mathbf{y}_{i}\succ\widehat{\pi}^{K}_{t}|\mathbf{x})=\sum_{j=1}^{K} \mathbb{P}(\mathbf{y}_{i}\succ\mathbf{y}_{j}|\mathbf{x})/K=\frac{i-1+1/2}{K}= \frac{i-1/2}{K},$ $$

because for $\mathbf{y}_{i}$, there are $i-1$ responses that are strictly worse, and $\mathbf{y}_{i}$ ties with itself.

For the normalizing factor, we have

$$ $\displaystyle\log Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})$ $\displaystyle=\log\bigg{(}\sum_{i=1}^{K}\exp(\eta\mathbb{P}(\mathbf{y}\succ \widehat{\pi}^{K}_{t}|\mathbf{x}))/K\bigg{)}$ $\displaystyle=\log\bigg{(}\sum_{i=1}^{K}\exp\bigg{(}\eta\frac{i-1/2}{K}\bigg{) }/K\bigg{)}$ $\displaystyle\rightarrow\log\bigg{(}\int_{0}^{1}\exp(\eta x)dx\bigg{)}$ $\displaystyle=\log\frac{e^{\eta}-1}{\eta}.$ $$

where the third line (limiting) can be obtained by the squeeze theorem.

For $\eta=1$, $\log\frac{e^{\eta}-1}{\eta}\approx 0.54\eta$. For large $\eta\approx 1e3$ as we used in the experiments, we have $\log\frac{e^{\eta}-1}{\eta}\approx\eta$.

#### Choice of η 𝜂 \eta italic_η

Depending on how “disordered” the preference is, $\eta$ can vary between $\eta/2$ and $\eta$. As this paper is partially motivated by human intransitive and irrational preference behavior, we chose to use $\eta/2$ to approximate $\log Z_{\widehat{\pi}^{K}_{t}}(\mathbf{x})$. Fine-tuning the coefficient of this constant as a hyperparameter is also an option and can help improve performance on given dataset.

## Appendix B Proof of Theorem 4.1

###### Proof of Theorem 4.1 .

Suppose the optimization problem is realizable, we have exactly that

$$ $\displaystyle\pi_{t+1}(\mathbf{y}|\mathbf{x})\propto\pi_{t}(\mathbf{y}|\mathbf {x})\exp(\eta\mathbb{P}(\mathbf{y}\succ\pi_{t}|\mathbf{x})),\,\,\text{for $t=1 ,2,\dots$}.$ (B.1) $$

To prove that the exponential weight update can induce the optimal policy, we directly invoke a restated version of Theorem 1 in Freund and Schapire ():

###### Lemma B.1 (Theorem 1 in Freund and Schapire ( 1999 ) , restated) .

For any oracle $\mathbb{P}$ and for any sequence of mixed policies $\mu_{1},\mu_{2},\dots,\mu_{T}$, the sequence of policies $\pi_{1},\pi_{2},\dots,\pi_{T}$ produced by (B.1) satisfies:

$$ $\displaystyle\sum_{t=1}^{T}\mathbb{P}(\pi_{t}\prec\mu_{t})$ $\displaystyle\leq\min_{\pi}\bigg{[}\frac{\eta}{1-e^{-\eta}}\sum_{t=1}^{T} \mathbb{P}(\pi\prec\mu_{t})+\frac{\mathrm{KL}(\pi\|\pi_{0})}{1-e^{-\eta}}\bigg {]}.$ $$

By setting $\mu_{t}=\pi_{t}$, we have that

$$ $\displaystyle\frac{T}{2}$ $\displaystyle\leq\min_{\pi}\bigg{[}\frac{\eta T}{1-e^{-\eta}}\mathbb{P}(\pi \prec\bar{\pi}_{T})+\frac{\mathrm{KL}(\pi\|\pi_{0})}{1-e^{-\eta}}\bigg{]},$ $$

where the LHS comes from that $\mathbb{P}(\pi_{t}\prec\pi_{t})=1/2$ and the RHS comes from that $\frac{1}{T}\sum_{t=1}^{T}\mathbb{P}(\pi\prec\pi_{t})=\mathbb{P}(\pi\prec\bar{
\pi}_{t})$. Now rearranging terms gives

$$ $\displaystyle\frac{1-e^{-\eta}}{2\eta}$ $\displaystyle\leq\min_{\pi}\bigg{[}\mathbb{P}(\pi\prec\bar{\pi}_{T})+\frac{ \mathrm{KL}(\pi\|\pi_{0})}{\eta T}\bigg{]}.$ $$

Note that $\pi_{0}$ is an autoregressive model that is fully supported on a finite vocabulary ($\pi_{0}(y_{k+1}|\mathbf{x},\mathbf{y}_{1:k})$ has non-zero probability for every token). Because its support is a large but finite set, $|\log\pi_{0}(\cdot)|$ is bounded from above.
So we can naively bound the KL-divergence $\mathrm{KL}(\pi\|\pi_{0})\leq\|\log\pi_{0}(\cdot)\|_{\infty}$, which can be seen as a (large) constant.

By choosing $\eta=\frac{\|\log\pi_{0}(\cdot)\|_{\infty}}{\sqrt{T}}$, we have

$$ $\displaystyle\frac{1}{2}-{\frac{\|\log\pi_{0}(\cdot)\|_{\infty}}{4\sqrt{T}}}+O (T^{-1})$ $\displaystyle\leq\min_{\pi}\big{[}\mathbb{P}(\pi\prec\bar{\pi}_{T})\big{]}+ \sqrt{\frac{\|\log\pi_{0}(\cdot)\|_{\infty}}{T}},$ $$

where the LHS comes from Taylor’s expansion $\frac{1-e^{-\eta}}{2\eta}=\frac{1}{2}-\frac{\eta}{4}+O(\eta^{2})$.
Notice that $1/2$ at the LHS is already the value of the symmetric two-player constant-sum game. This shows that for appropriately chosen $\eta$ and $T$, the mixture policy $\bar{\pi}_{T}$ is close to the minimax optimal policy (Nash equilibrium).

The optimality gap is thus bounded by

$$ $\displaystyle\max_{\pi}\big{[}\mathbb{P}(\pi\succ\bar{\pi}_{T})\big{]}-\min_{ \pi}\big{[}\mathbb{P}(\pi\prec\bar{\pi}_{T})\big{]}$ $\displaystyle=\max_{\pi}\big{[}1-\mathbb{P}(\pi\prec\bar{\pi}_{T})\big{]}-\min _{\pi}\big{[}\mathbb{P}(\pi\prec\bar{\pi}_{T})\big{]}$ $\displaystyle=2\bigg{(}\frac{1}{2}-\min_{\pi}\big{[}\mathbb{P}(\pi\prec\bar{ \pi}_{T})\big{]}\bigg{)}$ $\displaystyle=O\bigg{(}\frac{1}{\sqrt{T}}\bigg{)}.$ $$

∎

###### Proof of Theorem 4.1 .

###### Lemma B.1 (Theorem 1 in Freund and Schapire ( 1999 ) , restated) .

## Appendix C Response Examples in Different Iterations

**Table 4: Generation example of our fine-tuned model by SPPO at different iterations.**
| Prompt | You will be given a definition of a task first, then some input of the task. You are given a dialog between 2 or more individuals. The dialog will include information as to the relationship between 2 of the participants. At the end, you will be asked to provide an answer as to the relationship of those 2 participants. In this scenario, ’0’ will represent a spousal relationship, ’1’ will represent siblings, and ’2’ will represent a child/parent relationship. Speaker 1: I’ll be right with you. Okay? Thanks, Wendy. Speaker 2: Oh my God! How cute is the on-call doctor? Speaker 3: Ooh, so cute, that I’m thinking about jamming this pen in my eye. Speaker 4: Dr. Burke will see you know. Speaker 2: Oh no-no-no, not Dr. Burke. Dr. Burke is out of town. The-the on-call doctor will see me now. Speaker 4: Dr. Richard Burke is out of town. Dr. Timothy Burke, his son, will see you now. Speaker 5: Ready? What is the relationship between Speaker 5 and Richard Burke? Output: |
| --- | --- |
| Mistral-7B | The relationship between Speaker 5 and Richard Burke is that of a parent and child, as Richard Burke is identified as the son of another character in the dialog. |
| Iteration 1 | The relationship between Speaker 5 and Richard Burke is that of a father and child. Based on the dialogue, it was revealed that Dr. Timothy Burke is the on-call doctor and the son of Dr. Richard Burke. |
| Iteration 2 | The relationship between Speaker 5 and Richard Burke is that of a father and child. The conversation reveals that Dr. Timothy Burke is the on-call doctor and he is identified as the son of Dr. Richard Burke. |
| Iteration 3 | Speaker 5 is the individual asking about the relationship, so they are not directly related to Dr. Richard Burke. The information provided in the dialog reveals that Dr. Timothy Burke is the on-call doctor and the son of Dr. Richard Burke. Therefore, the answer is: The relationship between Speaker 5 and Dr. Richard Burke is that of a child (Dr. Timothy Burke) and parent. Speaker 5 is inquiring about the relationship, but they are not themselves a part of it. The specified relationship codes (0 for spousal, 1 for sibling, 2 for child/parent) align with this description: Speaker 5 (0, 1, or 2) and Dr. Richard Burke (2) connect as a parent-child duo. Output: 2 (child/parent relationship) In this scenario, Speaker 5’s role is to determine the relationship between herself and Dr. Richard Burke, but since they are not related (she is an outside inquirer), the correct answer pertains only to the relationship identified within the dialog: Dr. Richard Burke (father) and Dr. Timothy Burke (son). |

**Table 5: Another generation example of our fine-tuned model by SPPO at different iterations.**
| Prompt | Q: Context: Roman Brady is a fictional character from the long running NBC soap opera, Days of Our Lives. The role was originated in 1981 by Wayne Northrop who played the role until 1984, was filled by Drake Hogestyn from 1986 – 1991, again by Northrop from 1991 – 1994, and is currently being portrayed by series veteran Josh Taylor, who stepped into the role in 1997. Question: who is roman brady on days of our lives? Let’s give stream of consciousness below |
| --- | --- |
| Mistral-7B | Roman Brady is a fictional character on the NBC soap opera ”Days of Our Lives.” He was first portrayed by Wayne Northrop from 1981 to 1984. Later, Drake Hogestyn took over the role from 1986 to 1991. Northrop returned to the role from 1991 to 1994. Since 1997, the character is being portrayed by Josh Taylor. Roman Brady is a significant character in the show’s long-running storylines. |
| Iteration 1 | Roman Brady is a fictional character on the NBC soap opera ”Days of Our Lives.” He was first portrayed by Wayne Northrop from 1981 to 1984. Drake Hogestyn took over the role from 1986 to 1991. Northrop returned to play Roman again from 1991 to 1994. Since 1997, the character has been portrayed by Josh Taylor. So, in summary, Roman Brady is a long-standing character on ”Days of Our Lives” who has been played by three different actors over the years: Wayne Northrop (1981-1984, 1991-1994), Drake Hogestyn (1986-1991), and currently by Josh Taylor (1997-present). |
| Iteration 2 | Roman Brady is a fictional character on the NBC soap opera ”Days of Our Lives.” He was first portrayed by Wayne Northrop from 1981 to 1984. Drake Hogestyn took over the role from 1986 to 1991. Northrop returned to play Roman again from 1991 to 1994. Since 1997, the character has been portrayed by Josh Taylor. Overall, Roman Brady is a long-standing and complex figure in the show’s history, with multiple actors bringing their unique interpretations to the role. |
| Iteration 3 | Roman Brady is a fictional character on the NBC soap opera ”Days of Our Lives.” He was originally played by Wayne Northrop from 1981 to 1984. Drake Hogestyn took over the role from 1986 to 1991. Northrop returned to portray Roman once more from 1991 to 1994. Since 1997, the character has been portrayed by Josh Taylor.Roman Brady is a complex and prominent figure in the long-running daytime drama. Initially played by Northrop in the early 1980s, his tenure included involvement in various storylines, such as romantic relationships and business dealings. Hogestyn’s portrayal during the late 1980s and early 1990s introduced new dimensions to the character. Northrop’s second stint, from 1991 to 1994, further developed Roman’s narrative. Since 1997, Josh Taylor has assumed the role, continuing to contribute to the evolving story of Roman Brady on ”Days of Our Lives.” Throughout these different portrayals, Roman has remained a central character, known for his intricate relationships, business ventures, and personal struggles. |

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: Along with some points above, some additional questions are:

**1. Generation length and SPPO?**

In common, DPO and SPPO are leveraging the sum of log ratio between $\pi$ and $\pi_t$ given the prompt and response pair $(x, y)$, which could be sensitive to the length of generation. As SPPO is a single response-based method, length variance in $\mathbf{y}\sim \pi_t(\cdot|\mathbf{x})$ could induce high variance in the SPPO loss, which could lead to spurious length biases during the optimization as in DPO [1]. Regarding SPPO also results in longer generations as in iterative DPO in Table 1, would SPPO also be prone to the length bias?

&nbsp;


**2. Compatibility with classifier RMs?**

As the paper thoroughly shows, PairRM best fits the algorithmic design of SPPO. However, the Bradley-Terry model-based reward models (i.e., classifier RMs) are also applicable to approximate $P(y > \pi_t|x)$ by comparing the scalar values. Furthermore, there are many classifier RMs which are probably better than PairRM on classifying the better/worse response regarding the moment of submission [2]. How would those RMs impact SPPO?


&nbsp;
&nbsp;


**References**

[1] Disentangling Length from Quality in Direct Preference Optimization (Park et al., 2024)

[2] RewardBench: Evaluating Reward Models for Language Modeling (Lambert et al., 2024)
soundness: 3
strengths: 1. SPPO is derived from a solid theoretical background with a theoretical guarantee on the convergence of training policy to the ideal policy.
2. Interpreting SPPO from several different perspectives (e.g., token-level Q-learning and policy gradient) further strengthens its validity.
3. SPPO led to monotonic improvements of both models in majority of tasks, highlighting the effectiveness of SPPO.
summary: The paper proposes a novel self-play alignment method, SPPO, that leverages relative win rates instead of scalar-based reward models. SPPO aligns the language model without external pairwise preference pairs, highlighting its efficiency over pairwise alignment methods. Through iterative training with a theoretical guarantee of converging to the ideal policy, SPPO shows strong performance over previous methods.
weaknesses: **1. Lack of comparisons against relative methods**

As the paper precisely depicts SPPO as a "semi-online" variant of the policy gradient method, SPPO has the potential to be interpreted as an online method by leveraging on-policy generations and having access to a preference model. Moreover, along with the foundational alignment methods like DPO and IPO, there are some strong offline methods like SimPO [1] that outperform IPO and DPO. However, any RL-based methods [2] or recent performant offline methods are compared to SPPO in the paper.

&nbsp;

**2. Insufficient analysis of empirical aspects of SPPO**

While SPPO's performance on diverse benchmarks is impressive, the paper does not suggest any analysis of how SPPO-trained models are aligned to PairPM. Especially regarding the choice of total training epochs of 18 and the iterative nature of SPPO, analysis of gradual shifts happening throughout the training would be needed, such as the loss trends or PairPM win rate changes.


&nbsp;

**3. Clarifications on terminologies for experiments**

Some experiment terminologies are not clearly stated. For instance, the concepts of "iteration", "round", or "epoch" are not clearly separated, so it is hard to follow the exact training procedure of SPPO in the paper. Related to this point, hyperparameters for DPO and IPO experiments throughout the iterations should also be more explicitly stated.


&nbsp;
&nbsp;


**References**

[1] SimPO: Simple Preference Optimization with a Reference-Free Reward (Meng et al., 2024)

[2] Back to Basics: Revisiting REINFORCE Style Optimization for Learning from Human Feedback in LLMs (Admadian et al., 2024)

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: The results indicate that the performance of DPO and IPO declines in iterations 2 and 3, whereas SPPO continues to improve across iterations. Could the authors provide insights why can SPPO maintains steady improvements while DPO and IPO do not?
soundness: 4
strengths: - Introduced a self-play, game-theoretical framework for preference alignment, leveraging a Nash equilibrium formulation.
- Proposed a new optimization objective that improves practical application and is theoretically motivated.
- SPPO demonstrates state-of-the-art results in multiple language model benchmarks and alignment benchmarks, outperforming DPO and IPO.
summary: This paper introduces SPPO an approach to align language models with human preferences. SPPO models alignment as a two-player, constant-sum game aimed at reaching the Nash equilibrium, which provides a theoretically sound basis for iteratively optimizing preferences. The approach uses a smaller, pre-trained preference model PairRM and a limited dataset to achieve high alignment performance across various benchmarks, including AlpacaEval 2.0, MT-Bench, and the Open LLM Leaderboard, without additional supervisions from stronger models.
weaknesses: - Lack of comparison with conventional RLHF methods. This paper does not include a direct comparison with conventional RLHF methods, i.e., BT formulated RM and PPO training with it.
- Lack of comparison with similar methods. The paper lacks a comparison with conceptually similar work, such as Nash Preference Optimization (NPO). Without this, it is difficult to assess whether the proposed objectives in SPPO offer practical or theoretical advantages over existing approaches.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: 1.	I believe the preference model, here is PairRM, is critical for the final performance of SPPO, it will be good if the authors also run experiments with other models (e.g. UltraRM-13B)
2.	The annotation step in line 4 of Algorithm 1 requires K^2 calls for preference model, then, the authors select the highest and lowest PairRM scores and winning and losing responses. This setting is used also for DPO and IPO? If so, the only differences come from the loss function definition?
3.	The work of SPO from Swamy et al. uses win rate as reward, and SPPO also computes K^2 preference scores, which should be very easy to be converted into win rate, then you can apply PPO etc for update. I’d like to see those results in Table 1 (this comparison can also answer some comments and questions from paragraph 4 in Section 1.)
4.	Snorkel-Mistral-PairRM-DPO should be a fair comparison for SPPO, as they both use PairRM in their pipeline. What’s the difference between Snorkel-Mistral-PairRM-DPO and Mistral-7B-DPO? The gap is very significant.
5.	In Figure 1 (should be Table?), why the base policy Mistral-7B-Instruct-v0.2 becomes worse at the first and second iterations. And the difference between 7.59 and 7.51 should be not significant.
6.	Do authors also evaluate Snorkel-Mistral-PairRM-DPO in Table 3? And Mistral-7B-DPO and IPO are worse than their base policy model. Thus, the prompts from Ultrafeedback should be not useful for GSM8k and other tasks?
soundness: 3
strengths: 1.	SPPO casts the RLHF as a constant-sum two-player game, and solves Nash equilibrium policy by proposing a simple form of loss function.
2.	This paper also draws some connections with policy gradient and token-level Q* learning approaches.
summary: This paper proposes a new preference learning algorithm, self-play preference optimization (SPPO for short), the main contribution comes from the new loss objective, which does not rely on pairwise comparisons. Experimental results show consistent improvements over iterative DPO and IPO.
weaknesses: 1.	The annotation step in line 4 of Algorithm 1 requires K^2 calls for preference model, which should be time consuming. 
2.	The preference model in this paper should play a critical role, however, this paper only test on a very specific model, called PairRM, it is not clear to me how reliable this algorithm works on other tasks. Also, SPPO should be an online algorithm, the preference model should be also updated together with policy model in order to capture the probability distribution of evolving policy.
3.	Experiments are on prompts from Ultrafeedback, LLMs of 7-8B, and only one fixed preference model PairRM, SPPO should be tested in more general settings.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: Am I correct in understanding that the equality between equations 3.9 and 3.10 is not strict and is accurate up to a constant $\frac{2}{\eta}$?
soundness: 3
strengths: - Convergence: A proof of algorithm convergence is provided.
- Relation to Other Methods: Theoretical analysis demonstrates how the proposed algorithm relates to other popular methods.
- Benchmarks: The algorithm's performance is evaluated on a large number of popular benchmarks for assessing general assistants.
summary: The work proposes a new method of LLM alignment called Self-Play Preference Optimization (SPPO). This algorithm is an iterative process. In each iteration, the Mean Square Error (MSE) loss function is minimized between the implicit reward formulated by Rafailov [1], in which the policy from the previous iteration acts as the reference policy, and the reward normalized by a function Z (x), which depends on the prompt (in practical implementation, this function is replaced by a constant).

Based on works that consider online alignment methods from the perspective of game-theory,  the expected probability that the response y is better than the responses of the policy from the previous iteration is used as reward for the answer y (in a practical implementation, the expectation is estimated by a finite number of responses using a preference model).

Proof of convergence to the Nash equilibrium on average is demonstrated. The proposed algorithm's connection with the Policy Gradient (PG) algorithm and Token-level Q* learning is shown. 

The experimental setup used Llama-3-8B-Instruct and Mistral-7B-Instruct-v0.2 models, UltraFeedback dataset, and PairRM was used as the preference model. The quality was evaluated using AlpacaEval 2.0, Arena-Hard, MT Bench, and OpenLLM LeaderBoard benchmarks. The results show that SPPO generally outperforms their baseline counterparts.
weaknesses: The main weaknesses of this paper are threefold:

- Missing Analysis of Hyperparameter $\eta$ ($\beta$ in Rafailov et al. [1]): Rafailov et al. [2] demonstrated a clear relationship between the KL divergence with the original policy and the quality of responses. Comparing algorithms with different KL divergences is incorrect, as one may have lower response quality due to a lesser KL divergence with the original policy. Quality can be improved by adjusting the hyperparameter  $\eta $ ($\beta$). The results would be more convincing if presented as a Pareto front, as done by Rame et al. [3].
- Absence of Comparison with Other Game-Theory-Based Methods: Since the work relies on Nash equilibrium and cites other methods grounded in the same theory, it is logical to compare the proposed method with the Nash-MD [4] algorithm, as well as Nash-EMA [4] and DNO [5] (For Nash-MD and Nash-EMA the convergence was proven by the last iteration rather than on average).
- Limited Experimental Setup: The algorithm's efficacy was tested only on two models of approximately the same size and one dataset. It would be interesting to see how the proposed method behaves with models of different sizes and on other tasks.

References : 
[1] Rafailov et al, Direct Preference Optimization: Your Language Model is Secretly a Reward Model. 
[2] Rafailov et al, Scaling Laws for Reward Model Overoptimization in Direct Alignment Algorithms.
[3] Rame et al, WARP: On the Benefits of Weight Averaged Rewarded Policies.
[4] Munos et al, Nash Learning from Human Feedback.
[5] Rosset et al, Direct Nash Optimization: Teaching Language Models to Self-Improve with General Preferences.

Meta-review: The paper introduces SPPO, a self-play alignment method that leverages preference probabilities to overcome the limitations of traditional RLHF approaches. SPPO outperforming previous methods like DPO and IPO on benchmarks such as AlpacaEval 2.0, MT-Bench, and Arena-Hard. The paper's strengths include a solid theoretical foundation for SPPO with a convergence guarantee, multiple interpretations of SPPO to enhance its validity, effective demonstration of monotonic improvements in models across tasks.  However, the paper also has some weaknesses, such as the lack of comparisons with conventional online RLHF methods (e.g., PPO, RLOO), insufficient analysis of SPPO's empirical aspects, and unclear experimental terminologies. Some of these weaknesses were addressed during the rebuttal period, making this submission slightly above the bar for acceptance at ICLR.

Suggestion: While SPPO uses PairRM, a BT RM can also be used for comparing preference pairs, making it reasonable to compare SPPO with PPO, RLOO and other RLHF methods that use Bradley-Terry RMs.

Decision: Accept (Poster)