Evolving Alignment via Asymmetric Self-Play

## Abstract

Abstract Current RLHF frameworks for aligning large language models (LLMs) typically assume a fixed prompt distribution, which is sub-optimal and limits the scalability of alignment and generalizability of models.
To address this, we introduce a general open-ended RLHF framework that casts alignment as an asymmetric game between two players: (i) a creator that generates increasingly informative prompt distributions using the reward model, and (ii) a solver that learns to produce more preferred responses on prompts produced by the creator. This framework of E volving Alignment v ia A symmetric Self-Play ( eva ), results in a simple and efficient approach that can utilize any existing RLHF algorithm for scalable alignment . eva outperforms state-of-the-art methods on widely-used benchmarks, without the need of any additional human crafted prompts. Specifically, eva improves the win rate of Gemma2-9b-it on Arena-Hard from 51.6 % percent 51.6 51.6\% 51.6 % to 60.1 % percent 60.1 60.1\% 60.1 % with DPO, from 55.7 % percent 55.7 55.7\% 55.7 % to 58.9 % percent 58.9 58.9\% 58.9 % with SPPO, from 52.3 % percent 52.3 52.3\% 52.3 % to 60.7 % percent 60.7 60.7\% 60.7 % with SimPO, and from 54.8 % percent 54.8 54.8\% 54.8 % to 60.3 % percent 60.3 60.3\% 60.3 % with ORPO, surpassing its 27B version and matching claude-3-opus . This improvement is persistent even when new human crafted prompts are introduced.
Finally, we show eva is effective and robust under various ablation settings.

## 1 Introduction

Long-lived artificial intelligence must deal with an ever-evolving, open-ended world, yet currently face constraints in both the *scale* and *quality* of available data, and the *growth rate* at which new, useful information is created.
High quality human data, crucial for scaling large language model (LLM) based intelligence, is projected to run out in the next few years (Villalobos et al., ); the quality of such data is also expected to stagnate: as LLMs become more capable, they need to solve increasingly complex or new challenges, requiring training data beyond abilities of humans to create. This necessitates a new fundamental mechanism for self-improving, where models can continuously self-generate and self-solve harder problems. We thereby investigate the research question below:
Can language models *self-create* new, learnable tasks to work on,
to *self-improve* to *generalize* better for human preferences alignment?

Figure: Figure 3: Pipeline: We generalize classical RLHF with open-ended RLHF, optimized with a creator-solver game for self-improving language models. Our proposed eva strategically evolves prompt distributions with a creator policy, which synthesizes prompts with an easy-to-implement *estimate, sample then evolve* procedure; specifically, it estimates the informativeness for each prompt by how contrastive the self-generated responses are to the prompt, from the reward signals it receives. The creator evolves new prompts from highly informative prompts, which the solver uses for continual training. Both the solver and creator policy can share the same network or operate independently. See more on our minimax-regret objective that drives the above design in $\S$ 3.
Refer to caption: x5.png

Many preference optimization algorithms (Christiano et al., ; Zhao et al., ; Rafailov et al., ) have been proposed to improve language model alignment, however, they all default to fixed prompt training distributions. Such fixed training paradigms lack of scalability and inevitably lead to: (i) *generalization issues* (models may underperform or hack on instructions that are insufficiently represented within the fixed set) and (ii) *efficiency issues* (data annotation and model training are costly, however not all prompts provide the same utility; it is wasteful to invest in sub-optimal fixed set, while identifying informative prompts by human efforts is non-trivial) (Team et al., ; ).

Motivated by such limitations of optimizing over a specific, static distribution of prompts, we develop eva (Evolving Alignment *via* Asymmetric Self-Play), a scalable and open-ended RLHF framework allowing autonomous evolving of training distributions for self-improving language models, as in Figure 2, 3. Central to eva is a game with the minimax-regret objective, achieved by alternating optimization between creating prompts and solving them. Such interplay encourages evolving curricula (Parker-Holder et al., ), and benefits both generalization and efficiency (see also $\S$ 3.4). Orthogonal to recent self-play studies in LLM alignment (Munos et al., ; Choi et al., ; Wu et al., ), eva is *asymmetric* (Sukhbaatar et al., ); and in contrast to many self-training works (Gulcehre et al., ; Singh et al., ; Dong et al., ) focusing on improving in ${\mathcal{Y}}\mid{\mathcal{X}}$, we jointly optimize in $({\mathcal{X}},{\mathcal{Y}})$ by generative exploration, with two policies of different goals:

- •
Creator  : evolves the prompt distribution for alignment.
- •
Solver    : produces responses and optimizes alignment based on the evolving prompts.

Our main contributions include:

- •
A new principle: We propose a generalized open-ended RLHF objective for aligning language models, which seeks to jointly optimize the prompt distribution and the response policy, thus incentivizes models to self-improve to generalize well on new, unseen tasks beyond the initial training prompt distribution for alignment, as in Definition 1.
- •
A new algorithm: To optimize the objective, we design a practical algorithm via asymmetric self-play, which is implemented through alternating optimization in a creator-solver game, and can be easily *plugged into any existing alignment pipeline*, as in Algorithm 1.
- •
State-of-the-art performance: We empirically validate our method on public alignment benchmarks and present general *strong performance improvement* when plugged in with different preference optimization algorithms (i.e., DPO, SPPO, SimPO, ORPO). We also conduct extensive ablation studies that provide additional insights on the choice of informativeness metric, reward model, and training schedules, as in $\S$ 4.

eva is easy to deploy. We hope it can serve as a scalable method for the AI community to build open-ended, sample-efficient and robustly self-improving intelligence, that aligns with human values.

## 2 Preliminaries

We hereby review major concepts, which we later in $\S$ 3 use the *regret* and *advantage* function to identify informative prompts, leading to learning curricular implicitly maximizing *contrastive ratio*.

##### Alignment by RLHF.

Classical RLHF (Ouyang et al., ) optimizes on a fixed distribution ${\mathcal{D}}$:

$$ $\displaystyle\max_{\pi_{\bm{\theta}}}\ \mathbb{E}_{{\mathbf{x}}\sim\mathcal{D} ,{\mathbf{y}}\sim\pi_{\bm{\theta}}({\mathbf{y}}\mid{\mathbf{x}})}\Bigl{[}\ r({ \mathbf{x}},{\mathbf{y}})\ \Bigl{]}-\beta\cdot\mathbb{D}_{\mathrm{KL}}\Bigl{[} \ \pi_{\bm{\theta}}({\mathbf{y}}\mid{\mathbf{x}})\ \|\ \pi_{\mathrm{ref}}({ \mathbf{y}}\mid{\mathbf{x}})\ \Bigl{]},$ (1) $$

where ${\mathbf{x}}$ and ${\mathbf{y}}$ denote the prompts and responses, and $r(\cdot,\cdot)$ is the reward function.

##### Reward.

Let the *optimal policy* of Eq. 1 be $\pi^{\star}(\cdot)$ and $Z(\cdot)$ be the partition function, we have:

$$ $\displaystyle\hskip 5.0ptr({\mathbf{x}},{\mathbf{y}})=\beta\cdot\log\frac{\pi^ {\star}({\mathbf{y}}\mid{\mathbf{x}})}{\pi_{\text{\text{ref}}}({\mathbf{y}} \mid{\mathbf{x}})}{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{ 0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}\ +\ \beta\cdot \log Z({\mathbf{x}})}.$ (2) $$

##### Regret.

Let $r^{\star}({\mathbf{x}})=\max_{{\mathbf{y}}^{\prime}}r({\mathbf{x}},{\mathbf{y}
}^{\prime})$ be the optimal reward achievable at ${\mathbf{x}}$, the *regret* to take ${\mathbf{y}}$ is:

$$ $\displaystyle\hbox{\pagecolor{gray!10}\raisebox{0.0pt}[-8.0pt][0.0pt]{$ \operatorname{Regret}({\mathbf{x}},{\mathbf{y}})$}}=r^{\star}({\mathbf{x}})-r( {\mathbf{x}},{\mathbf{y}}).$ (3) $$

##### Advantage.

The *advantage* function quantifies how much better a response ${\mathbf{y}}$ is w.r.t. a baseline:

$$ $\displaystyle\hskip 8.0pt\hbox{\pagecolor{gray!10}\raisebox{0.0pt}[-8.0pt][0.0 pt]{$A({\mathbf{x}},{\mathbf{y}})$}}=r({\mathbf{x}},{\mathbf{y}})-\mathbb{E}_{ {\mathbf{y}}^{\prime}\sim\pi({\mathbf{y}}^{\prime}\mid{\mathbf{x}})}\Bigr{[}\ r({\mathbf{x}},{\mathbf{y}}^{\prime})\ \Bigr{]}.$ (4) $$

Variants of advantage (e.g., the worst-case advantage $A^{\star}_{\min}$) are related to regret, as shown in Table 2.

##### Direct preference optimization.

The DPO (Rafailov et al., ) objective for RLHF is:

$$ $\displaystyle\hskip 16.0pt{\mathcal{L}}_{\beta}^{\text{DPO}}(\pi_{\bm{\theta}} )=\sum_{\left({\mathbf{y}}_{+},{\mathbf{y}}_{-},{\mathbf{x}}\right)\in\mathcal {D}}-\log\Bigr{[}\sigma\Bigr{(}\beta\cdot\Delta_{{\bm{\theta}};{\text{ ref}}}^ {{\mathbf{x}}}\Bigr{)}\Bigr{]},$ (5) $$

where we use $+,-$ to denote chosen and rejected responses, and denote the contrastive ratio as:

$$ $\displaystyle\hskip 16.0pt\hbox{\pagecolor{gray!10}\raisebox{0.0pt}[-8.0pt][0. 0pt]{$\Delta_{{\bm{\theta}};{\text{ ref}}}^{{\mathbf{x}}}$}}:=\log\frac{\pi_{ \bm{\theta}}\left({\mathbf{y}}_{+}\mid{\mathbf{x}}\right)}{\pi_{\text{ref}} \left({\mathbf{y}}_{+}\mid{\mathbf{x}}\right)}-\log\frac{\pi_{\bm{\theta}} \left({\mathbf{y}}_{-}\mid{\mathbf{x}}\right)}{\pi_{\text{ref}}\left({\mathbf{ y}}_{-}\mid{\mathbf{x}}\right)}.$ (6) $$

By reward reparameterization with Eq. 2, advantage also relates to contrastive ratio, as in $\S$ 3.4.

## 3 Method

##### Algorithm overview.

At a high level, eva extends classical RLHF to open-ended RLHF *via* a creator that adapts prompt distributions with an easy-to-implement *estimate, sample then evolve* procedure, mimicking the *minimax-regret* policy of asymmetric self-play games, as detailed in $\S$ 3.3.

Figure: Algorithm 1 eva: Evolving Alignment via Asymmetric Self-Play

##### Section overview.

We aim to develop language models that can *self-improve to generalize well on new, unseen tasks* beyond the initial training prompt distribution for scalable alignment.
In $\S$ 3.1, we present the limitations of classical RLHF and generalize it to the new objective of open-ended RLHF. In $\S$ 3.2, we introduce the creator-solver game to tractably optimize the objective. In $\S$ 3.3, we detail the practical algorithm, compatible with any preference optimization method as the solver, with our designed creator in the loop. Lastly in $\S$ 3.4, we present various interpretations for eva.

### 3.1 The Principle: Open-edned RLHF for Joint Self-Improvement

Intuition.   Classical RLHF (cf., Eq. 1) optimizes over a *static* prompt distribution, meaning that the agent is only aligned to a fixed reference point, making it brittle when it is evaluated on new problems from the ever-changing real world. Our Open-Ended RLHF breaks away from this static framework, with the goal to develop an agent that *generalizes* well across *unseen, novel* environments (where the tasks entailed in prompts may not have been explicitly encountered during training). To achieve this, we must design a new objective that moves beyond optimizing over a fixed dataset $\mathcal{D}$.

##### Formalization.

We thus formally introduce *optimizable* prompt generation policy $\pi_{\bm{\phi}}({\mathbf{x}})$, which is *jointly* optimized with the response policy $\pi_{{\bm{\theta}}}({\mathbf{y}}\mid{\mathbf{x}})$, as follows:

###### Definition 1 (Open-ended RLHF)

Let ${\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}
\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}\pi_{\bm{\phi},{\bm{
\theta}}}({\mathbf{x}},{\mathbf{y}})}:={\color[rgb]{0,0,0}\definecolor[named]{
pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill
{0}\pi_{\bm{\phi}}({\mathbf{x}})}\cdot{\color[rgb]{0,0,0}\definecolor[named]{
pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill
{0}\pi_{{\bm{\theta}}}({\mathbf{y}}\mid{\mathbf{x}})}$ and $\pi_{\text{ref}}({\mathbf{x}},{\mathbf{y}}):=p_{\text{ref}}({\mathbf{x}})\cdot
\pi_{\text{ref}}({\mathbf{y}}\mid{\mathbf{x}})$. We define *evolving alignment*(^1^11This generalizes RLHF (Eq. 1), which is a special case if $\pi_{\phi}$ is static as $p_{\text{ref}}$. To see this, expand Eq. 7: $\displaystyle\max_{\bm{\phi},{\bm{\theta}}}\ \mathbb{E}_{{\color[rgb]{0,0,0} \definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0} \pgfsys@color@gray@fill{0}\mathbf{x}\sim\pi_{\phi}(\cdot)},{\color[rgb]{0,0,0} \definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0} \pgfsys@color@gray@fill{0}\mathbf{y}\sim\pi_{\theta}(\cdot\mid\mathbf{x})}} \bigr{[}\ r(\mathbf{x},\mathbf{y})\ \bigr{]}$ $\displaystyle-{\color[rgb]{0,.545,0}\definecolor[named]{pgfstrokecolor}{rgb}{ 0,.545,0}\mathbb{E}}_{{\color[rgb]{0,.545,0}\definecolor[named]{pgfstrokecolor }{rgb}{0,.545,0}\mathbf{x}\sim\pi_{\phi}(\cdot)}}{\color[rgb]{0,.545,0} \definecolor[named]{pgfstrokecolor}{rgb}{0,.545,0}\bigr{[}\ }{\color[rgb]{ 0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke {0}\pgfsys@color@gray@fill{0}{\mathbb{D}}_{\text{KL}}\bigr{[}{\color[rgb]{ 0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke {0}\pgfsys@color@gray@fill{0}\pi_{\theta}({\mathbf{y}}|{\mathbf{x}})}\ \|\ \pi _{\text{ref}}({\mathbf{y}}|{\mathbf{x}})\bigr{]}}\ {\color[rgb]{0,.545,0} \definecolor[named]{pgfstrokecolor}{rgb}{0,.545,0}\bigr{]}}-{\color[rgb]{ 0,.545,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,.545,0}{\mathbb{D}}_{\text {KL}}\bigr{[}\ \pi_{\phi}({\mathbf{x}})\ \|\ p_{\text{ref}}({\mathbf{x}})\ \bigr{]}}.$) as the open-ended joint optimization on the prompt and response policy for alignment w.r.t the joint reference policy:

$$ $\displaystyle\max_{\bm{\phi},{\bm{\theta}}}\ \mathbb{E}_{\hbox{\pagecolor{ Green3!10!white}\vspace{-1pt}$\scriptstyle{\color[rgb]{0,.545,0}\definecolor[ named]{pgfstrokecolor}{rgb}{0,.545,0}{\mathbf{x}}\sim\pi_{\bm{\phi}}({\mathbf{ x}})}$\vspace{-1pt}},\ \hbox{\pagecolor{Red!10}\vspace{-1pt}$\scriptstyle{ \color[rgb]{.932,.39,.39}\definecolor[named]{pgfstrokecolor}{rgb}{.932,.39,.39 }{\mathbf{y}}\sim\pi_{{\bm{\theta}}}({\mathbf{y}}|{\mathbf{x}})}$\vspace{-1pt} }}\Biggr{[}\ r({\mathbf{x}},{\mathbf{y}})\ \Biggr{]}-\beta\cdot{\mathbb{D}}_{ \text{KL}}\Biggl{[}\ \hbox{\pagecolor{Green3!10!white}$\displaystyle{\color[ rgb]{0,.545,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,.545,0}\pi_{\bm{\phi} ,{\bm{\theta}}}(}{\color[rgb]{0,.545,0}\definecolor[named]{pgfstrokecolor}{rgb }{0,.545,0}{\mathbf{x}}}{\color[rgb]{0,.545,0}\definecolor[named]{ pgfstrokecolor}{rgb}{0,.545,0},\ }{\color[rgb]{0,.545,0}\definecolor[named]{ pgfstrokecolor}{rgb}{0,.545,0}{\mathbf{y}}}{\color[rgb]{0,.545,0}\definecolor[ named]{pgfstrokecolor}{rgb}{0,.545,0})}$}\ \|\ {\color[rgb]{0,0,0}\definecolor [named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0} \pgfsys@color@gray@fill{0}\pi_{\text{ref}}({\mathbf{x}},{\mathbf{y}})}\ \Biggl {]},\vspace{-5pt}$ (7) $$

Here, $p_{\text{ref}}({\mathbf{x}})$ represents an idealized, potentially intractable probability measure over all possible tasks (instantiated *via* prompts) in the wild, as a conceptual reference that encompasses the full diversity and complexity of tasks agents may encounter, serving as a guiding target for alignment. Additionally, the *joint optimization* ensures that the task distribution and the agent’s response policy are updated in tandem, enabling adaptation to increasingly complex tasks, thereby promoting generalization.

###### Definition 1 (Open-ended RLHF)

### 3.2 The Mechanism: Asymmetric Self-Play via the Creator v.s. Solver Game

Intuition. It is hard to directly optimize Eq. 7, due to (i) the intractability of the unspecified reference (Dennis et al., ); (ii) the instability of joint differentiation (Goodfellow et al., ). We present an alternating optimization solution by casting it as an asymmetric creator-solver game.

- •
Intuitively, the creator can guide the solver by prompt curricula with *increasing complexity*, encouraging efficient and general learning to handle the diversity in the wild.
- •
Mathematically, this resembles RL optimization *via* expectation-maximization (Dayan and Hinton, ; Singh et al., ), where $\bm{\phi}$ for the prompt distribution is fixed at each step.

Formalization. We formalize the alternating optimization as an asymmetric game as follows:

- •
Creator  : the prompt player $\pi_{\mathcal{X}}$ that strategically generate prompts for the solver.
- •
Solver    : the response player $\pi_{{\mathcal{Y}}\mid{\mathcal{X}}}$ (or $\pi$) that learn to generate preferred responeses.

We take the *minimax regret* strategy (Savage, ), where the solver minimizes and the creator maximizes regret (Hejna et al., ), i.e., the gap in the reward of the current and optimal policy:

$$ $\displaystyle\operatorname{Regret}({\mathbf{x}},\pi)=\mathbb{E}_{{\mathbf{y}}^ {\prime}\sim\pi({\mathbf{y}}^{\prime}\mid{\mathbf{x}})}\Bigr{[}\ r({\mathbf{x} },{\mathbf{y}}^{\prime})\ \Bigr{]}-\mathbb{E}_{{\mathbf{y}}^{\prime}\sim\pi^{ \star}({\mathbf{y}}^{\prime}\mid{\mathbf{x}})}\Bigr{[}\ r({\mathbf{x}},{ \mathbf{y}}^{\prime})\ \Bigr{]}.$ (8) $$

At the Nash equilibrium (Nash et al., ), prior works (Dennis et al., ) have shown:
{mdframed}

###### Remark 1 (Minimax Regret)

If the solver-creator game reaches an equilibrium, the solver follows a minimax regret strategy, i.e., it optimizes to perform well under all cases:

$$ $\displaystyle{\color[rgb]{.932,.39,.39}\definecolor[named]{pgfstrokecolor}{rgb }{.932,.39,.39}\pi^{\star}}\in\arg\min_{{\color[rgb]{.932,.39,.39}\definecolor [named]{pgfstrokecolor}{rgb}{.932,.39,.39}\pi\in\Pi_{{\mathcal{Y}}|{\mathcal{X }}}}}\max_{{\color[rgb]{0,.545,0}\definecolor[named]{pgfstrokecolor}{rgb}{ 0,.545,0}\pi_{\mathcal{X}}}{\color[rgb]{0,.545,0}\definecolor[named]{ pgfstrokecolor}{rgb}{0,.545,0}\in\Pi_{\mathcal{X}}}}\ \mathbb{E}_{{\color[rgb] {0,.545,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,.545,0}{\mathbf{x}}\sim \pi_{{\mathcal{X}}}}}\Bigr{[}\ \operatorname{Regret}({\mathbf{x}},{\color[rgb] {.932,.39,.39}\definecolor[named]{pgfstrokecolor}{rgb}{.932,.39,.39}\pi})\ \Bigr{]}.$ (9) $$

However, without access to the true optimal policy, we must approximate the regret. Leveraging the *stochastic policy* and the *reward signals*, we design the advantage-based proxy:
{mdframed}

###### Definition 2 (Informativeness Proxy)

We measure the informativeness of a prompt by the (absolute) empirical worst-case optimal advantage, approximating the minimax regret:

$$ $\displaystyle\text{info}({\mathbf{x}})\leftarrow\widehat{A}_{\min}^{\star}:=| \min_{{\mathbf{y}}}r({\mathbf{x}},{\mathbf{y}})-\max_{{\mathbf{y}}^{\prime}}r( {\mathbf{x}},{\mathbf{y}}^{\prime})|,$ (10) $$

which is estimated by sampling multiple responses for ${\mathbf{x}}$ from the solver and calculating gap between the maximal reward (from the best ${\mathbf{y}}$) and the minimal reward (from the worst ${\mathbf{y}}$).

In summary, our open-ended RLHF allow for the creation of an evolving prompt distribution that challenges the agent progressively for better generalization; the introduced minimax regret objective further adds *robustness* on top of such evolving curricula by *incentivizing agents to perform well in all cases*. We use the informativeness proxy (which has a few useful properties under different interpretations, as in $\S$ 3.4; an attentive reader may want to distinguish this from Shannon information (Shannon, )) to guide the learning. Together, eva casts alignment as an asymmetric game, with a mechanism that the creator keeps challenging the solver, and the solver learns to improve.

###### Remark 1 (Minimax Regret)

###### Definition 2 (Informativeness Proxy)

### 3.3 The Practical Algorithm

We now illustrate practical implementations of eva in Algo 1 (cf., Fig 3).

#### 3.3.1 The Creator Step : Estimate, Sample then Evolve

Plainly, the creator finds most useful prompts and generate variants of them for preference optimization. One may relate this to evolution strategies (Schwefel, ) which find the most promising species, then mutate and crossover, or to curriculum RL (Parker-Holder et al., ) which finds environments with high-regret levels, then edits within some distance. As in Section 3.2, we do not seek a differentiable creator in this work. The creator is implemented in three steps as in Figure 3.

##### Step 1: info ⁢ ( ⋅ ) info ⋅ \texttt{info}(\cdot) info ( ⋅ ) – estimate the informativeness.

For each ${\mathbf{x}}$ in the prompt set ${\mathcal{X}}_{t}$, we generate responses, annotate rewards and estimate a informativeness metric to ${\mathbf{x}}$ by Eq. 10 (see also Table 2).

##### Step 2: sample ⁢ ( ⋅ ) sample ⋅ \texttt{sample}(\cdot) sample ( ⋅ ) – weighted sampling for an informative subset.

Using the informativeness metric as the weight,
we sample a informative prompt subset ${\mathcal{X}}_{t}^{\texttt{info}}$ to be evolved later.

##### Step 3: evolve ⁢ ( ⋅ ) evolve ⋅ \texttt{evolve}(\cdot) evolve ( ⋅ ) – evolving for a proximal region of high-advantage prompts.

Our algorithm is agnostic to and does not rely on any specific evolving method. We take EvolInstruct (Xu et al., ) as an off-the-shelf method, which conducts in-depth (i.e., adding constraints, deepening, concretising, complicating) and in-breadth evolving (i.e., mutation) for prompts. Specifically, we iterate over each prompt in the ${\mathcal{X}}_{t}^{\texttt{info}}$, where each one is evolved to multiple variations, then optionally mix the newly generated prompts with a uniformly sampled buffer from ${\mathcal{X}}_{t}$ to create ${\mathcal{X}}_{t}^{\prime}$.

#### 3.3.2 The Solver Step : Solve then Optimize

This step is the classical preference optimization (Rafailov et al., ), where responses are generated and the gradient descent is performed. Take the pointwise reward model setting as an example, for every prompt, we sample $n$ responses with reward annotated for each; we take the responses with the maximal and the minimal reward to construct the preference pairs, then optimize upon.

Put together, eva can unify existing iterative optimization pipeline (Tran et al., ) with a new creator module, which can either share the same network as the solver policy or operate independently.

### 3.4 Understanding eva in Different Intuitive Wyas

##### Learning potential.

Our metric intuitively identifies the learning potential of a prompt by measuring the gap between the best and worst response from the solver. We reason, that prompts eliciting *both* high-reward and low-reward outcomes, reflect *learnable* tasks where the model is capable of improving but has not yet mastered, thereby implying learning potential (cf., Jiang et al. ()).

##### Worst-case guarantees.

The minimax-regret objective, by design, leads to solvers that perform robustly across the prompt space, thus gives the wrost-case guarantee. While exact equilibrium may not be attainable with approximation, our empirical results in $\S$ 4.2.1 present robustness.

##### Auto-curricula for the players.

With the stochastic policy, the advantage may be heuristically understood as the reward difference between *a base solver* and *a reference solver*. Rather than optimizing separate solvers (Dennis et al., ), we sample multiple times from the same policy to create the pair. In this way, the creator is incentivized to produce new prompts that are just out of the comfort zone of solvers (Chaiklin et al., ):

- •
For overly challenging prompts, both solutions perform poorly, leading to a low proxy.
- •
For overly easy prompts, the base solution already performs well, again giving a low proxy.
- •
The optimal strategy is to find prompts that are just beyond the solver’s current capability.

##### Auto-curricula inherent to Contrastive Optimization.

Contrastive preference optimization generalizes DPO and a family of algorithms (c.f., Hejna et al. (); Rafailov et al. (); Tang et al. ()), many of whose losses monotonically decrease as the contrastive ratio increases. Here, by Eq. 2 and Eq. 6, the *contrastive ratio* can be written via the *advantage-based proxy*:

$$ $\displaystyle\hbox{\pagecolor{gray!10}\raisebox{0.0pt}[-8.0pt][0.0pt]{$A^{ \star}_{\min}({\mathbf{x}})$}}=\beta\cdot{\color[rgb]{0,0,0}\definecolor[named ]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0} \pgfsys@color@gray@fill{0}\hbox{\pagecolor{gray!10}\raisebox{0.0pt}[-8.0pt][0. 0pt]{$\Delta_{{\bm{\theta}^{\star}};{\text{ ref}}}^{{\mathbf{x}}}$}}}.$ (11) $$

By our proxy, we implicitly incentivize the creator to generate prompts that *bring the most contrastive responses*, which decrease the loss the most. This matches the curriculum learning literature, which prioritizes (in our case, *generatively* prioritizes) examples with smaller losses for better convergence and generalization (Bengio et al., ). We hereby suggest the Contrastive Curriculum Hypothesis: In contrastive preference optimization, prioritizing prompts with higher contrastive ratio improves sample efficiency and generalization. We show initial empirical results on this in $\S$ 4.2.1 and $\S$ 4.2.4.

## 4 Experiments

##### Datasets and models for training.

We use UltraFeedback (Cui et al., ) as the training dataset, which contains diverse high-quality prompts that are primarily human-generated. We use the instruction-finetuned Gemma-2-9B (Team et al., ) as the primary model, which is a strong baseline for models of its size. Detailed experimental setting can be found in $\S$ A.

##### Evaluation settings.

We choose: (i) AlpacaEval 2.0 (Dubois et al., ), which assesses general instruction following with 805 questions; (ii) MT-Bench (Zheng et al., ), which evaluates multi-turn instruction following with 80 hard questions in 8 categories; (iii) Arena-Hard (Li et al., ), which is derived from 200K user queries on Chatbot Arena with 500 challenging prompts across 250 topics. We use gpt-4-1106 as the judge and gpt-4-0314 as the baseline for win rate.

##### Optimization algorithms.

We focus on direct preference optimization and consider the following:

- •
With reference policy: DPO (Rafailov et al., ), SPPO (Wu et al., ).
- •
Without reference policy: SimPO (Meng et al., ), ORPO (Hong et al., ).

##### Reward models as preference oracles.

We use ArmoRM-8B (Wang et al., ) as our default reward model as the human-preference proxy, and consider the following for ablation studies:

- •
Pointwise: ArmoRM-8B (Wang et al., ), SkyworkRM-27B (Liu and Zeng, ).
- •
Pairwise: PairRM-0.4B (Jiang et al., ), PairRM-8B (Dong et al., ).

### 4.1 Main Results

In general, eva brings notable gains in alignment without relying on any human-crafted data, thus offering more efficiency. In the base setup, building on the one-iteration finetuned model (${\bm{\theta}}_{0\rightarrow 1}$), eva adds a creator to self-evolve the prompt set of the initial iteration and uses any preference optimization algorithm for an additional open-ended RLHF iteration, resulting in ${\bm{\theta}}_{1\rightarrow\tilde{1}}$(^2^22Unless stated otherwise, each iteration uses 10K prompts (i.e., 1/6 partition from UltraFeedback in classical training). We denote ${\bm{\theta}}_{t\rightarrow t+1}$ as the model trained with new human prompts based on the $t$-th checkpoint, and ${\bm{\theta}}_{t\rightarrow\tilde{t}}$ as the model trained with evolved prompts from the $t$-th checkpoint w/o adding any new human prompts.).

##### eva achieves self-improvement.

As shown in red rows in Table 1, eva yields notable performance improvement over ${\bm{\theta}}_{0\rightarrow 1}$ across different optimization algorithms, especially on the harder Arena-Hard benchmark, which is recognized to be more challenging and distinguishable among others due to the complexity of its prompts and its fairer scoring system (Li et al., ; Meng et al., ). Specifically, eva brings $8.4\%$ gain with SimPO as the solver, and $8.5\%$ gain with DPO as the solver, surpassing its 27B version and matching claude-3-opus-240229 as reported on the [AH leaderboard](https://github.com/lm-sys/arena-hard-auto/tree/efc012e192b88024a5203f5a28ec8fc0342946df?tab=readme-ov-file#full-leaderboard-updated-0831), while using fully self-automated prompt generation for alignment.

##### eva can surpass human-crafted prompts.

We further show that eva-prompt-trained models (${\bm{\theta}}_{1\rightarrow\tilde{1}}$) can match and even outperform those trained on additional new prompts from UltraFeedback (${\bm{\theta}}_{1\rightarrow 2}$) (which we denoted as human prompts), while being much cheaper and more efficient. Additionally, on MT-Bench, training with new human prompts typically show decreased performance in the first turn and only modest gains in the second turn. In contrast, eva notably enhances second-turn performance. We hypothesize that eva evolves novel, learnable prompts that include characteristics of second-turn questions, reflecting emergent skills like handling follow-up interactions.

**Table 1: Main results. Our eva achieves notable alignment gains and can surpass human prompts on major benchmarks across a variety of representative direct preference optimization algorithms.**
| Model Family ($\rightarrow$) | Gemma-2-9B-it |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Benchmark ($\rightarrow$) | Arena-Hard | MT-Bench | AlpacaEval 2.0 |  |  |  |
| Method ($\downarrow$) / Metric ($\rightarrow$) | WR (%) | avg. score | $1^{\text{st}}$ turn | $2^{\text{nd}}$ turn | LC-WR (%) | WR (%) |
| ${\bm{\theta}}_{0}$: SFT | 41.3 | 8.57 | 8.81 | 8.32 | 47.11 | 38.39 |
| ${\bm{\theta}}_{0\rightarrow 1}$: DPO | 51.6 | 8.66 | 9.01 | 8.32 | 55.01 | 51.68 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva | 60.1 (+8.5) | 8.90 | 9.04 | 8.75 (+0.43) | 55.35 | 55.53 |
| ${\bm{\theta}}_{1\rightarrow 2}$:  + new human prompts | 59.8 | 8.64 | 8.88 | 8.39 | 55.74 | 56.15 |
| ${\bm{\theta}}_{0\rightarrow 1}$: SPPO | 55.7 | 8.62 | 9.03 | 8.21 | 51.58 | 42.17 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva | 58.9 (+3.2) | 8.78 | 9.11 | 8.45 (+0.24) | 51.86 | 43.04 |
| ${\bm{\theta}}_{1\rightarrow 2}$:  + new human prompts | 57.7 | 8.64 | 8.90 | 8.39 | 51.78 | 42.98 |
| ${\bm{\theta}}_{0\rightarrow 1}$: SimPO | 52.3 | 8.69 | 9.03 | 8.35 | 54.29 | 52.05 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva | 60.7 (+8.4) | 8.92 | 9.08 | 8.77 (+0.42) | 55.85 | 55.92 |
| ${\bm{\theta}}_{1\rightarrow 2}$:  + new human prompts | 54.6 | 8.76 | 9.00 | 8.52 | 54.40 | 55.72 |
| ${\bm{\theta}}_{0\rightarrow 1}$: ORPO | 54.8 | 8.67 | 9.04 | 8.30 | 52.17 | 49.50 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva | 60.3 (+5.5) | 8.89 | 9.07 | 8.71 (+0.41) | 54.39 | 50.88 |
| ${\bm{\theta}}_{1\rightarrow 2}$:  + new human prompts | 57.2 | 8.74 | 9.01 | 8.47 | 54.00 | 51.21 |

### 4.2 Ablation Studies

We conduct in-depth ablation studies on eva, with findings below to be elaborated on later:

- •
$\S$ 4.2.1 - informativeness metric: our *regret*-based metric outperforms other alternatives.
- •
$\S$ 4.2.2 - sample-then-evolve procedure: our method outperforms greedy selection.
- •
$\S$ 4.2.3 - scaling w/ reward models: the alignment gain of eva scales with reward models.
- •
$\S$ 4.2.4 - continual training : our method has monotonic gain with incremental training; the *evolved data and schedule* by eva serves as an *implicit regularizer* for better local minima.

#### 4.2.1 The Choice of Informativeness Metrics: info(·)

**Table 2: The reward-advantage-based metrics that serve as the informativeness proxies for prompts.**
| Metric | $\textbf{\hskip 51.21504pt info}({\mathbf{x}})$ | Related Interpretations |
| --- | --- | --- |
| $A^{\star}_{\text{min}}\text{: worst-case optimal advantage}$ | $|\min_{{\mathbf{y}}}r({\mathbf{x}},{\mathbf{y}})-\max_{{\mathbf{y}}^{\prime}}r<br>({\mathbf{x}},{\mathbf{y}}^{\prime})|$ | minimax regret (Savage, ) |
| $A^{\star}_{\text{avg}}\text{: average optimal advantage}$ | $|\frac{1}{N}\sum_{{\mathbf{y}}}r({\mathbf{x}},{\mathbf{y}})-\max_{{\mathbf{y}}<br>^{\prime}}r({\mathbf{x}},{\mathbf{y}}^{\prime})|$ | Bayesian regret (Banos, ) |
| $A^{\star}_{\text{dts}}\text{: dueling optimal advantage}$ | $|\max_{{\mathbf{y}}\neq{\mathbf{y}}^{\star}}r({\mathbf{x}},{\mathbf{y}})-\max_<br>{{\mathbf{y}}^{\prime}}r({\mathbf{x}},{\mathbf{y}}^{\prime})|$ | dueling regret (Wu and Liu, ) |

**Table 3: Choice of informativeness metric. Our informativeness metric by *advantage* achieves the best performances, comparing with others as the weight to sample prompts to evolve by the creator.**
| Model Family ($\rightarrow$) | Gemma-2-9B-it |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Benchmark ($\rightarrow$) | Arena-Hard | MT-Bench | AlpacaEval 2.0 |  |  |  |
| Method ($\downarrow$) / Metric ($\rightarrow$) | WR (%) | avg. score | $1^{\text{st}}$ turn | $2^{\text{nd}}$ turn | LC-WR (%) | WR (%) |
| ${\bm{\theta}}_{0\rightarrow 1}$: DPO | 51.6 | 8.66 | 9.01 | 8.32 | 55.01 | 51.68 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  (uniform) | 57.5 | 8.71 | 9.02 | 8.40 | 53.43 | 53.98 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($\texttt{var}({\bm{r}})$) | 54.8 | 8.66 | 9.13 | 8.20 | 54.58 | 52.55 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($\texttt{avg}({\bm{r}})$) | 58.5 | 8.76 | 9.13 | 8.40 | 55.01 | 55.47 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($1/\texttt{avg}({\bm{r}})$) | 56.7 | 8.79 | 9.13 | 8.45 | 55.04 | 54.97 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($1/A_{\text{min}}^{\star}$) | 52.3 | 8.64 | 8.96 | 8.31 | 53.84 | 52.92 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($A_{\text{avg}}^{\star}$) (our variant) | 60.0 | 8.85 | 9.08 | 8.61 | 56.01 | 56.46 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($A^{\star}_{\text{dts}}$) (our variant) | 60.0 | 8.86 | 9.18 | 8.52 | 55.96 | 56.09 |
| \cdashline1-7<br>${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva  ($A^{\star}_{\text{min}}$) (our default) | 60.1 (+8.5) | 8.90 | 9.04 | 8.75 (+0.43) | 55.35 | 55.53 |

##### Advantage as the informativeness metric outperforms baselines.

As in Table 4.2.1, eva offers an effective curriculum by the advantage-based proxy as the informativeness metric (bottom row):

- •
Comparing w/ *uniform evolving* (brown): Existing baselines generate prompts in a uniform manner (Yuan et al., ) w/o informativeness measure (cf., the principle of insufficient reason (Keynes, ; Tobin et al., )). Ours (green) concretely outperform, corroborating Das et al. () that uniform learners can suffer from sub-optimality gaps.
- •
Comparing w/ *other heuristics* (blue): Prior practices (Team et al., ) tried heuristics like prioritizing prompts w/ the most variance in its rewards or w/ the lowest/highest average. We find our advantage based methods (green) outperforms those heuristics.
- •
Comparing w/ the *inverse advantage* (purple): Contrary to curriculum learning, a line of works conjecture that examples w/ higher losses may be prioritized (Jiang et al., ; Kawaguchi and Lu, ), which can be done by inverting our metric. We find it significantly *hurt* the alignment gain, corroborating Mindermann et al. () that those examples are often noisy, unlearnable or irrelevant, meaning our curriculum is effective and practical.
- •
Among our *advantage variants* (green): We designed variants of our default advantage-based metric, as in Table 2; the default $A^{\star}_{\min}$ remains competitive among its peers. Together, the advantage-based principle provides a robust guideline for prompt sampling and evolving.

The lesson is that we must be selective about which are the promising to evolve, otherwise unlearnable, noisy or naïve prompts may hinder learning. Our regret-inspired metric represents a solid baseline.

#### 4.2.2 The Effect of the sample-then-evolve procedure

**Table 4: Effect of evolving. The blue are those training w/ only the informative subset and w/o evolving); we denote -sample for the default weighted sampling procedure in Algo 1, while using -greedy for the variant from the classical active data selection procedure (*cf*., a recent work (Muldrew et al., ) and a pre-LLM work (Kawaguchi and Lu, )), which selects data by a high-to-low ranking via the metric greedily. We show evolving brings a remarkable alignment gain (the red v.s. the blue); and as we evolve, sampling is more robust than being greedy (*cf*., Russo et al. ()).**
| Benchmark ($\rightarrow$) | Arena-Hard | MT-Bench | AlpacaEval 2.0 |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Method ($\downarrow$) / Metric ($\rightarrow$) | WR (%) | avg. score | $1^{\text{st}}$ turn | $2^{\text{nd}}$ turn | LC-WR (%) | WR (%) |
| ${\bm{\theta}}_{0\rightarrow 1}$: DPO | 51.6 | 8.66 | 9.01 | 8.32 | 55.01 | 51.68 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  [no evolve]-greedy | 56.1 | 8.68 | 8.98 | 8.38 | 54.11 | 53.66 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  [no evolve]-sample | 55.3 | 8.69 | 9.00 | 8.38 | 54.22 | 54.16 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva-greedy (our variant) | 59.5 | 8.72 | 9.06 | 8.36 | 54.52 | 55.22 |
| \cdashline1-7<br>${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva-sample (our default) | 60.1 | 8.90 | 9.04 | 8.75 | 55.35 | 55.53 |

##### The design of evolve(·) in eva is effective.

As in Table 4.2.2, we show:

- •
Removing the $\texttt{evolve}(\cdot)$ step: if we only do subset sampling or ordered selection, we still have gain, but not as much as w/ evolving (e.g., eva brings $4.8\%$ additional wins on AH).
- •
Altering the $\texttt{sample}(\cdot)$ step: if we greedily select prompts by the metric instead of using them as weights for importance sampling, the performance will be weaker as we evolve.

This shows that simply adaptive training within a fixed prompt distribution is unsatisfactory; our open-ended RLHF with *generative* prompt exploration gives a substantial headroom for self-improvement.

#### 4.2.3 Scaling Pointwise and Pairwise Reward Models

Figure: Figure 4: eva scales with quality of reward models, under pointwise RMs w/ DPO (*left*) and pairwise RMs w/ SPPO (*right*). Note SPPO handles general preferences thus requires pairwise RMs, and DPO relies on the Bradley-Terry assumption, for which pointwise RMs are suitable.
Refer to caption: x6.png

#### 4.2.4 eva Improves Both Sample Efficiency and Generalization

We then continuously run the default *incremental training* (i.e., trainining from the last checkpoint w/ the evolved set in each iteration), as in Fig 5, eva presents monotonic performance gain over iterations, and surpasses that trained w/ new human prompts, implying the generalization benefit(^3^33Behaviors of the dashed/dotted lines relate to *loss of plasticity* (Ash and Adams, ; Dohare et al., ; Abbas et al., ; Xue et al., ). Classical works resolve it by the optimization view (e.g., weight perturbing), whereas eva offers a fresh data view, potentially mimicking an implicit regularizer for better generalization.).

Figure: Figure 5: Continual training. eva stays robust w/ more iterations in incremental training.
Refer to caption: x8.png

## 5 Related Works

##### Self-improving algorithms and iterative optimization.

This line of work focuses on iteratively generating samples from the response policy and continuously re-training the policy by selected self-generated samples. Major works include ReST (Gulcehre et al., ; Singh et al., ), STaR (Zelikman et al., ), RFT (Yuan et al., ), RAFT (Dong et al., ), self-improving LLMs (Huang et al., ; Yuan et al., ); in the context of preference optimization, iterative DPO (Xu et al., ; Tajwar et al., ; Tran et al., ; Xiong et al., ; Pang et al., ) has proven effective. Most works focus on self-training by improving in ${\mathcal{Y}}\mid{\mathcal{X}}$, while we *jointly optimize* both responses and prompts via generative exploration in the $({\mathcal{X}},{\mathcal{Y}})$ space. Among them, we also distinctly present a game-theoretic framework with the minimax-regret principle as the guidance.

##### Prompt synthesis for language models.

Existing works include Self-Instruct (Wang et al., ), WizardLM (Xu et al., ; Luo et al., ), Self-Align (Sun et al., ), Glan (Li et al., ), EvoPrompt (Guo et al., ), Magpie (Xu et al., ) and others (Long et al., ). eva is an orthogonal contribution since any synthesis method can be plugged in as the $\texttt{evolve}(\cdot)$ for the creator. Importantly, our work presents a new reward-related metric to endow prompt the notion of informativeness, with new implications as in $\S$ 3.4. We also focus on preference optimization algorithms, while those existing works primarily use synthesized prompts in an SFT-only way.

##### Self-play and open-ended curriculum RL.

Agents trained on a fixed data distribution are often brittle and may struggle to adapt to the real world (Hughes et al., ). Self-play (Samuel, ; Silver et al., ) addresses this by having the agent learn through self-interaction, thus creating more diverse experiences and automatic curricula. In asymmetric self-play, the paradigm centers on “*Alice proposing a task, and Bob doing it*” (Sukhbaatar et al., ; Samvelyan et al., ; Beukman et al., ; Anil et al., ). We revive the classical asymmetric self-play principle (Sutton et al., ) in optimizing language models. Unlike traditional curriculum RL (Parker-Holder et al., ), which usually renders environments from specified levels (Dennis et al., ), our approach is *generative* by nature, as we directly generate contexts from the auto-regressive language models.

##### Self-play in RLHF.

A growing line of research frames RLHF as a *symmetric* self-play game, where both players are response players (Munos et al., ; Wu et al., ; Choi et al., ; Rosset et al., ). However, these methods still rely on a fixed prompt distribution thus is sub-optimal. In contrast, we solve this by *asymmetric* self-play, enabling evolving prompt distributions for more generalizable language agents. During our work, we notice one concurrent paper adopting the asymmetric two-player setup (Zheng et al., ), however (i) it applies to red teaming tasks instead of general alignment benchmarks, (ii) it is incompatible w/ direct preference optimization, and (iii) it relies on the maxmin principle (which is known to be producing unlearnable environments (Dennis et al., )) instead of the minimax *regret* principle (Fan, ; Savage, ) as we do. We also first precisely defined the new problem of *open-ended RLHF*, that generalizes over classical RLHF.

## 6 Concluding Remarks

Limitations and future directionss.
eva defines a new paradigm for alignment, opening up many new directions, e.g., (i) extending to differentiable creator policies, combining w/ other $\texttt{evolve}(\cdot)$ methods; (ii) evolving for more iterations w/ on-policy solvers like RLOO (Ahmadian et al., ); (iii) investigating exploration bonuses for diversity, coverage and extrapolation, and self-consuming loops (Gerstgrasser et al., ); (iv) extending the game with more players for full automation (e.g., rewarders, critics, correctors, verifiers, retrievers); (v) extending from alignment to reasoning (e.g., auto-conjecturing in theorem proving (Poesia et al., ) can be cast as asymmetric games), w/ process reward models and hierarchical tree search for creator and solver generations; (vii) exploring other metric like Fisher information for theoretical guarantees; (viii) scaling up w/ more data.

##### Conclusions.

eva is a new, simple framework for aligning language models, and can be plugged into any existing alignment pipeline. The primary takeaway may be that RLHF can be made open-ended: (i) self-evolving joint data distributions can bring significant gain (as shown across various preference optimization algorithms), and (ii) reward advantage acts as an effective metric informing the collection and creation of *future* prompts for alignment. eva presents a new view of alignment by framing it as an asymmetric game between a creator generating new and learnable prompts and a solver producing preferred responses. eva also *incentivizes agents to create problems* rather than to simply *solve problems*, which is a key feature of intelligence, yet model trainers may often neglect.

## Acknowledgments

We extend our sincerest gratitude to Bilal Piot for his thoughtful reviews and valuable advice on this paper. We are also grateful to Chenkai Kuang, Dustin Tran, Albert Webson, Hanzhao Lin, Clara Huiyi Hu, Jeremiah Liu, Luheng He, Chenjie Gu, Yong Cheng, Pei Sun, and Heng-Tze Cheng for their fun discussions and notes on Self-Play. We also thank David Abel, Yuxin Chen, Ziniu Hu, Guohao Li, Rylan Schaeffer, Haifeng Xu, Chaoqi Wang and Yifei Wang for their initial helpful discussions and references on fine-tuning, contrastive learning, data synthesis, open-endedness, and continual reinforcement learning.

## Reproducibility Statement

We hope to open-source all the code, datasets (synthesized prompts and responses) and models, upon approval – before then, we are more than happy to provide any clarification requested to help re-implement eva and replicate our results. Our code base is made to be simple to use for practitioners, requiring only a creator module addition to the commonly adopted [Alignment Handbook](https://github.com/huggingface/alignment-handbook) pipeline.

The appendix is organized as follows:

- •
$\S$ A - Details on Reproducibility
- •
$\S$ B - Plug-In Loss Functions Used in Main Results
- •
$\S$ C - Additional Experimental Results
- •
$\S$ D - Prompt and Response Examples
- •
$\S$ E - Extended Literature Review on Open-Endedness

## Appendix

## Appendix A Details on Reproducibility

##### Code release.

As mentioned, we hope to open-source all the code and all the datasets (generated prompts and responses) and models (beyong the current model family), upon approval – before then, we are more than happy to provide any clarification requested to help re-implement eva and replicate our results. In general, our code base is made to be simple to use for practitioners, requiring only a creator module addition within the commonly adopted [Alignment Handbook](https://github.com/huggingface/alignment-handbook) pipeline.

##### Hyperparameter settings.

We follow the original hyperparameter settings as in [Hong et al., , Meng et al., , Wu et al., ], default to be:

| Hyperparameter ($\downarrow$) / Loss ($\rightarrow$) | DPO | ORPO | SimPO | SPPO |
| --- | --- | --- | --- | --- |
| learning rate | 5e-7 | 5e-7 | 8e-7 | 5e-7 |
| learning rate scheduler | cosine | cosine | cosine | linear |
| $\beta$ | 0.05 | / | 10 | 0.001 |
| $\gamma$ | / | / | 5 | / |
| $\lambda$ | / | 0.5 | / | / |
| no. epochs per iter | 2 | 1 | 1 | 6 |
| warmup ratio per iter | 0.1 | 0.1 | 0.1 | 0.1 |
| effective batch size | 8 | 8 | 32 | 8 |
| max length | 2048 | 2048 | 2048 | 1024 |
| max prompt length | 1024 | 1024 | 1024 | 512 |
| optimizer | adamw | adamw | adamw | rmsprop |

##### Iterative Training Settings.

By default [Tran et al., , Yuan et al., ], we train with equal-size prompt subset in each iteration. Unless otherwise specified, we use 10K prompts from the UltraFeedback dataset [Cui et al., ] per iteration. The incremental training proceeds as follows:

- •
${\bm{\theta}}_{0}$ : Base SFT model.
- •
${\bm{\theta}}_{0\rightarrow 1}$ : initialize with ${\bm{\theta}}_{0}$; then train with the prompt split ${\mathcal{X}}_{1}$ by self-generated responses from the initial model ${\bm{\theta}}_{0}$.
- •
${\bm{\theta}}_{1\rightarrow 2}$ : initialize with ${\bm{\theta}}_{0\rightarrow 1}$; trained with the prompt split ${\mathcal{X}}_{2}$ via by self-generated responses from the initial model ${\bm{\theta}}_{0\rightarrow 1}$.

For evolving prompts (e.g., evolving ${\mathcal{X}}_{1}$ to ${\mathcal{X}}_{\tilde{1}}$), with the calculated informativeness metric for each prompt, we normalize them as the weight to do weighted sampling for a 25% informative subset to get ${\mathcal{X}}_{1}^{\texttt{info}}$. We then iterate over in ${\mathcal{X}}_{1}^{\texttt{info}}$ and call EvolInstrut [Xu et al., ] as the plug-in evolving method (with the number of evolutions as 4) using the default mutation templates for (i) in-depth evolving (constraints, deepening, concretizing, increased reasoning steps) and (ii) in-breadth evolving (extrapolation) as implemented in [tasks/evol_instruct/utils.py](https://github.com/argilla-io/distilabel/blob/main/src/distilabel/steps/tasks/evol_instruct/utils.py#L36) of distilabel==1.3.2. Next we uniformly select $80\%$ prompts from this evolved dataset and $20\%$ from the original dataset (i.e., the buffer) to form ${\mathcal{X}}_{\tilde{1}}$. We do not seek extensive parameter search (e.g., the number of evolutions, the evolving ratio) in this stage and encourage future works on exploring this and other plug-in evolving methods. For solver we generate 6 responses per prompt.

##### Software environments.

All our experiments are conducted on 8xNVIDIA H100 SXM GPUs. Our codebase primarily relies on transformers==4.40.0. For the response generation of Gemma models at the training stage, we use vllm==0.5.4 with flashinfer backend for CUDA 12.4 and torch 2.4. For evolving prompts, we use distilabel==1.3.2, and use LiteLLM to serve Gemini (default to be gemini-1.5-pro), OpenAI (default to be gpt-4o-mini) and transformers models (default to be gemma-2-9b-it). For evaluation on all benchmarks, we use sglang==0.2.10 and openai==1.35.14, with gpt-4-1106-preview as the judge model and gpt-4-0314-preview as the baseline model. Specifically for AlpacaEval 2.0, we use alpaca_eval_gpt4_turbo_fn as the annotator config. We use 42 as the random seed.

## Appendix B Plug-In Loss Functions Used in Main Results

**Table 6: Direct preference alignment algorithms used in the main experiments. In parameter tuning, we include an additional negative log-likelihood loss for chosen responses (i.e., $\frac{\gamma}{|{\mathbf{y}}_{+}|}\log\pi_{{\bm{\theta}}}({\mathbf{y}}_{+}|{ \mathbf{x}})$).**
| With Reference Model |  |
| --- | --- |
| DPO [Rafailov et al., ] | $\ell_{\beta}(\pi_{{\bm{\theta}}})=-\log\Bigr{[}\sigma\Bigr{(}\beta\cdot\Delta_<br>{{\pi_{\bm{\theta}}};{\pi_{\text{ref}}}}^{{\mathbf{x}}}\Bigr{)}\Bigr{]}{\color<br>[rgb]{.75,.75,.75}\definecolor[named]{pgfstrokecolor}{rgb}{.75,.75,.75}<br>\pgfsys@color@gray@stroke{.75}\pgfsys@color@gray@fill{.75}:=-\log\left[\sigma<br>\left(\beta\cdot\log\frac{\pi_{\bm{\theta}}\left({\mathbf{y}}_{+}\mid{\mathbf{<br>x}}\right)}{\pi_{\text{ref}}\left({\mathbf{y}}_{+}\mid{\mathbf{x}}\right)}-<br>\beta\cdot\log\frac{\pi_{\bm{\theta}}\left({\mathbf{y}}_{-}\mid{\mathbf{x}}<br>\right)}{\pi_{\text{ref}}\left({\mathbf{y}}_{-}\mid{\mathbf{x}}\right)}\right)<br>\right]}$ |
| SPPO [Wu et al., ] | $\ell_{\beta}(\pi_{{\bm{\theta}}})=-\log\left[\sigma\left(\left(\beta\cdot\log<br>\frac{\pi_{\bm{\theta}}\left({\mathbf{y}}_{+}\mid{\mathbf{x}}\right)}{\pi_{<br>\text{ref}}\left({\mathbf{y}}_{+}\mid{\mathbf{x}}\right)}-\frac{1}{2}\right)^{<br>2}+\left(\beta\cdot\log\frac{\pi_{\bm{\theta}}\left({\mathbf{y}}_{-}\mid{<br>\mathbf{x}}\right)}{\pi_{\text{ref}}\left({\mathbf{y}}_{-}\mid{\mathbf{x}}<br>\right)}+\frac{1}{2}\right)^{2}\right)\right]$ |
| Without Reference Model |  |
| SimPO [Meng et al., ] | $\ell_{\beta,\alpha}(\pi_{{\bm{\theta}}})=-\log\Bigr{[}\sigma\Bigr{(}\beta\cdot<br>\Delta_{{\pi_{\theta}^{1/|{\mathbf{y}}|}};1}^{{\mathbf{x}}}-\alpha\Bigr{)}<br>\Bigr{]}{\color[rgb]{.75,.75,.75}\definecolor[named]{pgfstrokecolor}{rgb}{<br>.75,.75,.75}\pgfsys@color@gray@stroke{.75}\pgfsys@color@gray@fill{.75}:=-\log<br>\left[\sigma\left(\frac{\beta}{|{\mathbf{y}}_{+}|}\log\pi_{{\bm{\theta}}}({<br>\mathbf{y}}_{+}|{\mathbf{x}})-\frac{\beta}{|{\mathbf{y}}_{-}|}\log\pi_{{\bm{<br>\theta}}}({\mathbf{y}}_{-}|{\mathbf{x}})-\alpha\right)\right]}$ |
| ORPO [Hong et al., ] | $\ell_{\lambda}(\pi_{{\bm{\theta}}})=-\log\Bigr{[}\sigma\Bigr{(}\lambda\cdot<br>\Delta_{\text{odds}_{{\bm{\theta}}};1}^{{\mathbf{x}}}\Bigr{)}\Bigr{]}{\color[<br>rgb]{.75,.75,.75}\definecolor[named]{pgfstrokecolor}{rgb}{.75,.75,.75}<br>\pgfsys@color@gray@stroke{.75}\pgfsys@color@gray@fill{.75}:=-\log\left[\sigma<br>\left(\lambda\cdot\log\frac{\text{odds}_{{\bm{\theta}}}({\mathbf{y}}_{+}|{<br>\mathbf{x}})}{\text{odds}_{{\bm{\theta}}}({\mathbf{y}}_{-}|{\mathbf{x}})}<br>\right)\right]}$, where $\text{odds}_{{\bm{\theta}}}=\frac{\pi_{\bm{\theta}}}{1-\pi_{{\bm{\theta}}}}$ |

## Appendix C Additional Experimental Results

In general, eva maintains the accuracy on downstream tasks and is robust on those reasoning-heavy tasks, and the scaling with reward models is more prominent on AlpacaEval, possibly due to the training sources for such reward models.

**Table 7: Performance on Downstream tasks.**
| Method ($\downarrow$) / Dataset ($\rightarrow$) | MUSR-TA | TruthfulQA-Gen | WMDP | GSM8K | GSM-Plus | MMLU-Pro |
| --- | --- | --- | --- | --- | --- | --- |
| ${\bm{\theta}}_{0}$: SFT | 38.80 | 34.76 | 58.62 | 24.64 | 18.62 | 52.08 |
| ${\bm{\theta}}_{0\rightarrow 1}$: DPO | 38.40 | 34.76 | 58.45 | 24.56 | 18.50 | 52.63 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva | 38.40 | 34.15 | 58.40 | 24.26 | 17.96 | 53.03 |
| ${\bm{\theta}}_{0\rightarrow 1}$: SPPO | 40.80 | 34.15 | 58.72 | 24.79 | 18.42 | 52.70 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva | 41.20 | 34.64 | 58.94 | 25.40 | 18.88 | 52.47 |

**Table 8: Effect of (pointwise) reward models.**
| Model Family ($\rightarrow$) | gemma-2-9b-it |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Benchmark ($\rightarrow$) | MT-Bench | Arena-Hard | AlpacaEval 2.0 |  |  |  |  |
| Method ($\downarrow$) / Metric ($\rightarrow$) | avg. score | $1^{\text{st}}$ turn | $2^{\text{nd}}$ turn | WR (%) | LC (%) | WR (%) |  |
| ${\bm{\theta}}_{0\rightarrow 1}$: DPO | 8.66 | 9.01 | 8.32 | 51.6 | 55.01 | 51.68 |  |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva-i (ArMO-8B) | 8.90 | 9.04 | 8.75 | 60.1 | 55.35 | 55.53 |  |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva-i (SkyworkRM-27B) | 8.75 | 9.07 | 8.43 | 60.3 | 56.12 | 56.40 |  |

**Table 9: Effect of (pairwise) reward models.**
| Model Family ($\rightarrow$) | gemma-2-9b-it |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Benchmark ($\rightarrow$) | MT-Bench | Arena-Hard | AlpacaEval 2.0 |  |  |  |
| Method ($\downarrow$) / Metric ($\rightarrow$) | avg. score | $1^{\text{st}}$ turn | $2^{\text{nd}}$ turn | WR (%) | LC (%) | WR (%) |
| ${\bm{\theta}}_{0\rightarrow 1}$: SPPO | 8.62 | 9.03 | 8.21 | 55.7 | 51.58 | 42.17 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva-i (PairRM-0.4B) | 8.78 | 9.11 | 8.45 | 58.9 | 51.86 | 43.04 |
| ${\bm{\theta}}_{1\rightarrow\tilde{1}}$:  + eva-i (PairRM-8B) | 8.89 | 9.08 | 8.70 | 60.2 | 52.71 | 44.52 |

## Appendix D Examples on Prompts and Model Generations

Figure: Figure 6: The initial prompt distribution of AlpacaEval by bart-large-mnli with 0-shot classification, which is imbalanced. For the reward distribution, the category with lowest average reward has the highest reward gap (i.e., the default informativeness proxy), implying the potential to improve.
Refer to caption: extracted/5967939/figs/example-prompt.png

**Table 10: Examples of evolved prompts from AlpacaEval. We suggest practitioners to include generated responses with oracle rewards and self-critique in the context for better prompt evolving, which is helpful for mitigating the effect of potential self-consuming loops in synthetic data training.**
| initial prompt $\rightarrow$ | Write me the code for a distributed transaction manager.\nThink step by step and use pseudo code first.\nThen, define interfaces for all involved actors and entities.\nUse Rational Unified approach for this part.\n\nOnly then move on to the actual implementation, class-by-class, and method-by-method.\nMake the code be implemented in C# and follow SOLID principles. |
| --- | --- |
| evolved #1 $\rightarrow$ | Craft a suite of syntax for a distributed transaction coordinator. Start with a sequential breakdown in pseudocode format. Following that, establish the protocols for communication and interaction amongst the various participants and components, incorporating the Rational Unified Process methodology.\n\nProceed thereafter to the concrete creation, detailing each class and function. Ensure that the final C# code adheres to the precepts of SOLID and is annotated for clarification and maintainability purposes. |
| evolved #2 $\rightarrow$ | Devise a comprehensive set of directives and structures for a distributed transaction coordinator architecture. Initiate by formulating a step-by-step algorithmic decomposition in pseudocode. Subsequently, delineate the frameworks for dialog and cooperation between the numerous entities and elements, utilizing the tenets of the Rational Unified Process methodology.\n\nContinue to the actual generation of the code, meticulously detailing every class and corresponding method. Guarantee that the culminating C# code is in strict compliance with SOLID principles and is supplemented with descriptive commentary to enhance future clarity and upkeep, while also validating the code against a set of unit tests to ensure robust functionality. |
| evolved #3 $\rightarrow$ | Commence by constructing an algorithm in pseudocode that meticulously breaks down the sequential stages for a distributed transaction coordinator system. Progress by outlining the communication protocols and collaborative mechanisms among the myriad components, adhering to the Rational Unified Process approach.\n\nAdvance to crafting the code in C#, ensuring each class and method is elaborated with precision, aligning with SOLID design principles. Integrate thorough comments for heightened maintainability and conduct comprehensive unit testing for assured operational integrity. |
| evolved #4 $\rightarrow$ | Design a detailed flowchart that represents the intricate steps of an orchestration engine for managing microservices in a cloud-native environment. Begin by detailing the service discovery, load balancing, and fault tolerance strategies, while incorporating the DevOps philosophy.\n\nProceed by developing the implementation in Java, focusing on clean, modular code following object-oriented programming best practices. Accompany your code with clear documentation for easy understanding and perform rigorous integration testing to guarantee robustness. |

**Table 11: Comparison of model generations on examples from MT-Bench.**
| 1st-turn prompt: When a number is divided by 10, the remainder is 4. What is the remainder when twice the number is divided by 4? |  |
| --- | --- |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| Here’s how to solve this problem:<br>1. Understand the first statement:<br>* "When a number is divided by 10, the remainder is 4" means the number can be represented as 10*k + 4, where k is an integer.<br>2. Double the number:<br>* Twice the number is 2*(10*k + 4) = 20*k + 8<br>3. Divide by 4:<br>* (20*k + 8) divided by 4 is (20*k)/4 + 8/4 = 5*k + 2<br>4. Find the remainder:<br>* Since 5*k is a multiple of 4, the remainder when twice the number is divided by 4 is 2.<br>Let me know if you’d like to try another example! | Here’s how to solve this problem:<br>1. Understand the first statement:<br>- "When a number is divided by 10, the remainder is 4" means the number can be represented as 10*k + 4, where k is an integer.<br>2. Double the number:<br>- Twice the number is 2*(10*k + 4) = 20*k + 8<br>3. Divide by 4:<br>- When (20*k + 8) is divided by 4, the 20*k term is perfectly divisible by 4.<br>- The remainder will be the same as the remainder when 8 is divided by 4, which is 0.<br>Therefore, the remainder when twice the number is divided by 4 is 0. |
| 2nd-turn prompt: What about when twice the number is divided by 5? |  |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| Here’s how to solve that:<br>1. We know: Twice the number is 20*k + 8 (from the previous calculation).<br>2. Divide by 5: (20*k + 8) divided by 5 is (20*k)/5 + 8/5 = 4*k + 1.6<br>3. Find the remainder: Since 4*k is a multiple of 5, the remainder when twice the number is divided by 5 is 1.<br>Let me know if you have any more number theory puzzles! | Here’s how to solve that:<br>1. Twice the number: We know twice the number is 20*k + 8 (from the previous steps).<br>2. Divide by 5:<br>* 20*k is divisible by 5.<br>* 8 divided by 5 leaves a remainder of 3.<br>Therefore, the remainder when twice the number is divided by 5 is 3. |
| Judgment (by gpt-4) |  |
| Judgment for gemma-2-9b-it-dpo | Judgment for gemma-2-9b-it-dpo-eva |
| The assistant’s response is incorrect. The assistant incorrectly calculated the remainder when twice the number is divided by 5. The assistant calculated the decimal part of the division operation, not the remainder. The correct calculation should be (20n + 8) % 5 = (20n % 5) + (8 % 5) = 0 + 3 = 3. Therefore, the remainder when twice the number is divided by 5 is 3, not 1 as the assistant stated.<br>The corrected response would be:<br>1. We know: Twice the number is 20*k + 8 (from the previous calculation).<br>2. Divide by 5: (20*k + 8) divided by 5 gives us a remainder of (20*k % 5) + (8 % 5) = 0 + 3 = 3.<br>3. Find the remainder: The remainder when twice the number is divided by 5 is 3.<br>Rating: [[3]], "score": 3, "turn": 2, "tstamp": 1722737011.7768948 | The assistant’s answer is correct and matches the reference answer. The assistant correctly explains that twice the number is 20*k + 8 and that when this is divided by 5, the remainder is 3. The assistant’s explanation is clear and easy to understand, making it helpful for the user. There are no mistakes to correct.<br>Rating: [[10]], "score": 10, "turn": 2, "tstamp": 1722846518.5543818 |

**Table 12: (Continued) comparison of model generations on examples from MT-Bench.**
| 1st-turn prompt:<br>Imagine you are writing a blog post comparing two popular smartphone models. Develop an outline for the blog post, including key points and subheadings to effectively compare and contrast the features, performance, and user experience of the two models. Please answer in fewer than 200 words. |  |
| --- | --- |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| ## Smartphone Showdown: [Model A] vs. [Model B]\n\n**I. Introduction**\n* Briefly introduce the two smartphone models being compared, highlighting their popularity and target audience.\n* State the purpose of the comparison: to help readers decide which phone best suits their needs.\n\n**II. Design and Display**\n* Physical dimensions, weight, and build quality comparison.\n* Screen size, resolution, and display technology (e.g., OLED, LCD).\n* Design aesthetics and user preferences.\n\n**III. Performance and Specs**\n* Processor, RAM, and storage comparison.\n* Benchmark scores and real-world performance analysis.\n* Battery life and charging capabilities.\n\n**IV. Camera Capabilities**\n* Rear and front camera specs (megapixels, aperture, features).\n* Image quality comparison in various lighting conditions.\n* Video recording capabilities.\n\n**V. Software and User Experience**\n* Operating system and user interface comparison.\n* App ecosystem and availability.\n* Software features and customization options.\n\n**VI. Price and Value**\n* Compare the price points of both models.\n* Analyze the value proposition based on features and performance.\n\n**VII. Conclusion**\n* Summarize the key differences and similarities.\n* Recommend the best phone for specific user profiles (e.g., budget-conscious, photography enthusiasts, gamers). | ## iPhone 14 Pro vs. Samsung Galaxy S23: Which Flagship Reigns Supreme?\n\n**I. Introduction**\n* Briefly introduce both smartphones and their position in the market.\n* State the purpose of the comparison: to help readers decide which phone best suits their needs.\n\n**II. Design and Display**\n* Physical dimensions, weight, and build quality comparison.\n* Screen size, resolution, refresh rate, and display technology (OLED vs. Super AMOLED).\n* Design aesthetics and unique features (e.g., notch vs. punch-hole, color options).\n\n**III. Performance and Camera**\n* Processor comparison (Apple A16 Bionic vs. Snapdragon 8 Gen 2).\n* RAM and storage options.\n* Camera specs: megapixels, lens types, aperture, and special features (e.g., telephoto, macro).\n* Image quality comparison based on sample photos and user reviews.\n\n**IV. Software and User Experience**\n* Operating systems: iOS 16 vs. Android 13.\n* User interface comparison: intuitiveness, customization options, and app ecosystems.\n* Special features: Face ID vs. in-display fingerprint sensor, voice assistants.\n\n**V. Battery Life and Charging**\n* Battery capacity and real-world usage comparison.\n* Fast charging speeds and wireless charging capabilities.\n\n**VI. Price and Value**\n* Compare starting prices and different storage configurations.\n* Assess the overall value for money based on features and performance.\n\n**VII. Conclusion**\n* Summarize the key differences and strengths of each phone.\n* Recommend the best phone for specific user types (e.g., photography enthusiasts, gamers, budget-conscious consumers). |
| 2nd-turn prompt:<br>Take your previous response and rephrase it as a limerick. |  |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| Two phones, a showdown so grand,\n[Model A] and [Model B], hand in hand.\nDesign, specs, and price,\nWe’ll analyze nice,\nTo help you choose, understand?\n\nLet me know if you’d like me to try filling in the bracketed parts with specific model names! | \nTwo phones, a Pro and a Galaxy,\nFor flagships, they truly are spacy.\nWith cameras and screens,\nAnd processors keen,\nWhich one wins? Read on, and be savvy! \nLet me know if you’d like another limerick! |
| Judgment (by gpt-4) |  |
| Judgment for gemma-2-9b-it-dpo | Judgment for gemma-2-9b-it-dpo-eva |
| The assistant’s response is creative and relevant to the user’s request. The user asked the assistant to rephrase the previous response, which was a detailed outline for a blog post, into a limerick. The assistant successfully did so, maintaining the essence of the original response in a limerick format. The assistant also offered to further customize the limerick by filling in the bracketed parts with specific model names, showing a willingness to provide additional detail if needed. However, the limerick does not fully capture the depth and detail of the original response, which is understandable given the constraints of the limerick format.<br>Rating: [[8]], "score": 8, "turn": 2, "tstamp": 1722737024.0327556 | The assistant’s response is creative and relevant to the user’s request. The assistant successfully rephrased the previous response, which was a detailed outline for a blog post comparing two smartphone models, into a limerick. The limerick is playful and engaging, and it maintains the essence of the original response, which is to compare the two phones and help the reader make an informed decision. The assistant also offers to create another limerick if the user wants, showing a willingness to continue the interaction.<br>Rating: [[9]], "score": 9, "turn": 2, "tstamp": 1722846542.9437995 |

**Table 13: (Continued) comparison of model generations on examples from MT-Bench.**
| 1st-turn prompt:<br>Each problem consists of three statements. Based on the first two statements, the third statement may be true, false, or uncertain.\n1. Oranges cost more than apples.\n2. Oranges cost less than bananas.\n3. Bananas cost more than apples and bananas cost more than orange.\nIf the first two statements are true, then the third statement is? |  |
| --- | --- |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| Here’s how to break down the logic:\n\n* **Statement 1:** Oranges > Apples (Oranges cost more than apples)\n* **Statement 2:** Oranges < Bananas (Oranges cost less than bananas)\n\nThis means the price order is: Bananas > Oranges > Apples\n\n* **Statement 3:** Bananas > Apples AND Bananas > Oranges\n\nStatement 3 is **partially true**.\n\n* The part "Bananas > Apples" is true based on our price order.\n* The part "Bananas > Oranges" is also true based on our price order.\n\n\nLet me know if you’d like to try another one! | Here’s how to break down the logic:\n\n* **Statement 1:** Oranges > Apples (Oranges cost more than apples)\n* **Statement 2:** Oranges < Bananas (Oranges cost less than bananas)\n\nThese statements tell us that bananas are the most expensive, then oranges, and apples are the least expensive.\n\n* **Statement 3:** Bananas > Apples AND Bananas > Oranges\n\nSince bananas are indeed more expensive than both apples and oranges, statement 3 is **true**.\n\n\nLet me know if you’d like to try another one! |
| 2nd-turn prompt:<br>If the third statement is true. Is the first statement true, false, or uncertain? Please explain. |  |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| If the third statement is true, the first statement is **false**.\n\nHere’s why:\n\n* **Statement 3:** States that bananas cost more than both apples AND oranges.\n\nThis means the price order is: Bananas > Oranges > Apples.\n\n* **Statement 1:** States that oranges cost more than apples.\n\nIf bananas are the most expensive, and oranges are second, then oranges cannot be more expensive than apples.\n\n\nLet me know if you have any other logic puzzles! | If the third statement is true, then the first statement is **uncertain**.\n\nHere’s why:\n\n* **Statement 3:** Bananas > Apples AND Bananas > Oranges\n\nThis tells us bananas are the most expensive, but it doesn’t explicitly state the relative prices of apples and oranges.\n\n* **Statement 1:** Oranges > Apples\n\nThis statement claims oranges are more expensive than apples.\n\nStatement 3 doesn’t contradict statement 1, but it also doesn’t confirm it. It’s possible that oranges *are* more expensive than apples, but statement 3 alone doesn’t give us enough information to be sure. |
| Judgment (by gpt-4) |  |
| Judgment for gemma-2-9b-it-dpo | Judgment for gemma-2-9b-it-dpo-eva |
| The assistant’s response is incorrect. The assistant states that if the third statement is true, the first statement is false. However, the third statement only establishes that bananas cost more than both apples and oranges. It does not provide information about the relative costs of apples and oranges. Therefore, the first statement could be true (if oranges cost more than apples), false (if oranges cost less than apples), or uncertain (if oranges and apples cost the same). The assistant’s explanation is flawed because it incorrectly assumes that the order of costs must be Bananas > Oranges > Apples, when in fact the order could also be Bananas > Apples = Oranges or Bananas > Apples > Oranges. \n\nCorrected Assistant’s Answer: If the third statement is true, then bananas cost more than apples and bananas cost more than oranges. This means that oranges could still cost more than apples, making the first statement true. However, it’s also possible that oranges and apples have the same cost, which would make the first statement false. Therefore, based on the third statement alone, the first statement is uncertain.<br>Rating: [[2]], "score": 2, "turn": 2, "tstamp": 1722737017.2808955 | The assistant’s response is correct and helpful. The assistant explains that the first statement is uncertain if the third statement is true, which aligns with the reference answer. The assistant provides a clear explanation of why this is the case, stating that the third statement doesn’t contradict the first statement, but it also doesn’t confirm it. Therefore, the assistant’s response is accurate and informative.\n\nThe assistant’s response: "If the third statement is true, then the first statement is **uncertain**. Here’s why: Statement 3: Bananas > Apples AND Bananas > Oranges. This tells us bananas are the most expensive, but it doesn’t explicitly state the relative prices of apples and oranges. Statement 1: Oranges > Apples. This statement claims oranges are more expensive than apples. Statement 3 doesn’t contradict statement 1, but it also doesn’t confirm it. It’s possible that oranges *are* more expensive than apples, but statement 3 alone doesn’t give us enough information to be sure.<br>Rating: [[10]], "score": 10, "turn": 2, "tstamp": 1722846527.2339694 |

**Table 14: (Continued) comparison of model generations on examples from MT-Bench.**
| 1st-turn prompt:<br>Implement a function to find the median of two sorted arrays of different sizes with O(1) space complexity and O(n) time complexity. |  |
| --- | --- |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| python\n\def find_median_sorted_arrays(nums1, nums2):\n   """\n   Finds the median of two sorted arrays of different sizes.\n\n   Args:\n   nums1: The first sorted array.\n   nums2: The second sorted array.\n\n   Returns:\n   The median of the two sorted arrays.\n   """\n\n   m, n = len(nums1), len(nums2)\n   if m > n:\n   nums1, nums2, m, n = nums2, nums1, n, m  # Ensure m <= n\n\n   imin, imax, half_len = 0, m, (m + n + 1) // 2\n\n   while imin <= imax:\n   i = (imin + imax) // 2\n   j = half_len - i\n   if i < m and nums2[j - 1] > nums1[i]:\n   imin = i + 1  # i is too small, increase it\n   elif i > 0 and nums1[i - 1] > nums2[j]:\n   imax = i - 1  # i is too big, decrease it\n   else:\n   # i is perfect\n\n   if i == 0:\n   max_left = nums2[j - 1]\n   elif j == 0:\n   max_left = nums1[i - 1]\n   else:\n   max_left = max(nums1[i - 1], nums2[j - 1])\n\n   if (m + n) % 2 == 1:\n   return max_left\n\n   if i == m:\n   min_right = nums2[j]\n   elif j == n:\n   min_right = nums1[i]\n   else:\n   min_right = min(nums1[i], nums2[j])\n\n   return (max_left + min_right) / 2.0\n\n# Example usage\nnums1 = [1, 3]\nnums2 = [2]\nmedian = find_median_sorted_arrays(nums1, nums2)\nprint(f"The median of {nums1} and {nums2} is: {median}")\n\n\n**Explanation:**\n\n1. **Handle Unequal Lengths:**\n   - If ‘nums1‘ is longer than ‘nums2‘, swap them to ensure ‘nums1‘ is always the shorter array. This simplifies the logic.\n\n2. **Binary Search:**\n   - The core idea is to use binary search on the shorter array (‘nums1‘).\n   - ‘imin‘ and ‘imax‘ define the search range for the partition point ‘i‘ in ‘nums1‘.\n   - ‘half_len‘ calculates the desired total number of elements on the left side of the partition (to find the median).\n\n3. **Partitioning:**\n   - In each iteration, ‘i‘ divides ‘nums1‘ into two parts: ‘nums1[0:i]‘ and ‘nums1[i:m]‘.\n   - ‘j‘ is calculated to divide ‘nums2‘ so that the total number of elements on the left side is ‘half_len‘.\n\n4. **Adjusting the Partition:**\n   - We compare elements at the boundaries of the partitions to see if ‘i‘ is in the correct position:\n   - If ‘nums2[j - 1] > nums1[i]‘, ‘i‘ is too small, so we move ‘imin‘ to ‘i + 1‘.\n   - If ‘nums1[i - 1] > nums2[j]‘, ‘i‘ is too large, so we move ‘imax‘ to ‘i - 1‘.\n\n5. **Finding the Median:**\n   - Once ‘i‘ is in the correct position, we find:\n   - ‘max_left‘: The maximum element in the left partitions of both arrays.\n   - ‘min_right‘: The minimum element in the right partitions of both arrays.\n   - If the total length is odd, ‘max_left‘ is the median.\n   - If the total length is even, the median is the average of ‘max_left‘ and ‘min_right‘.\n\n**Time Complexity:** O(log(min(m, n))) because we perform binary search on the shorter array.\n\n**Space Complexity:** O(1) as we only use a constant amount of extra space for variables. | python\n\def find_median_sorted_arrays(nums1, nums2):\n   """\n   Finds the median of two sorted arrays of different sizes.\n\n   Args:\n  nums1: The first sorted array.\n   nums2: The second sorted array.\n\n   Returns:\n  The median of the two sorted arrays.\n   """\n\n   m, n = len(nums1), len(nums2)\n   if m > n:\n   nums1, nums2, m, n = nums2, nums1, n, m  # Ensure m <= n\n\n   imin, imax, half_len = 0, m, (m + n + 1) // 2\n\n   while imin <= imax:\n   i = (imin + imax) // 2\n   j = half_len - i\n  if i < m and nums2[j - 1] > nums1[i]:\n  imin = i + 1  # i is too small, increase it\n   elif i > 0 and nums1[i - 1] > nums2[j]:\n  imax = i - 1  # i is too big, decrease it\n   else:\n   # i is perfect\n\n if i == 0:\n  max_left = nums2[j - 1]\n   elif j == 0:\n   max_left = nums1[i - 1]\n   else:\n   max_left = max(nums1[i - 1], nums2[j - 1])\n\n   if (m + n) % 2 == 1:\n  return max_left\n\n  if i == m:\n   min_right = nums2[j]\n  elif j == n:\n  min_right = nums1[i]\n  else:\n   min_right = min(nums1[i], nums2[j])\n\n   return (max_left + min_right) / 2.0\n\n# Example usage\nnums1 = [1, 3]\nnums2 = [2]\nmedian = find_median_sorted_arrays(nums1, nums2)\nprint(f"The median of {nums1} and {nums2} is: {median}")\n\n\n**Explanation:**\n\n1. **Handle Unequal Lengths:**\n   - If ‘nums1‘ is longer than ‘nums2‘, swap them to ensure ‘nums1‘ is always the shorter array. This simplifies the logic.\n\n2. **Binary Search:**\n   - The core idea is to use binary search on the shorter array (‘nums1‘).\n   - ‘imin‘ and ‘imax‘ define the search range for the partition point ‘i‘ in ‘nums1‘.\n   - ‘half_len‘ calculates the desired total number of elements on the left side of the partition (to find the median).\n\n3. **Partitioning:**\n   - In each iteration, ‘i‘ divides ‘nums1‘, and ‘j‘ divides ‘nums2‘ such that the total number of elements on the left side is ‘half_len‘.\n\n4. **Adjusting the Search Range:**\n   - If ‘nums2[j - 1] > nums1[i]‘, it means ‘i‘ is too small, so we need to move the partition point in ‘nums1‘ to the right (‘imin = i + 1‘).\n   - If ‘nums1[i - 1] > nums2[j]‘, ‘i‘ is too large, so we move it to the left (‘imax = i - 1‘).\n\n5. **Finding the Median:**\n   - When the correct partition is found (‘i‘ is in the right position), we find:\n   - ‘max_left‘: The maximum element on the left side of the partition.\n   - ‘min_right‘: The minimum element on the right side of the partition.\n   - If the total number of elements is odd, ‘max_left‘ is the median.\n   - If even, the median is the average of ‘max_left‘ and ‘min_right‘.\n\n**Time Complexity:** O(log(min(m, n))) because we are performing binary search on the shorter array.\n\n**Space Complexity:** O(1) as we are only using a constant amount of extra space for variables. |
| Judgment (by gpt-4) |  |
| Judgment for gemma-2-9b-it-dpo | Judgment for gemma-2-9b-it-dpo-eva |
| The assistant’s answer is correct and provides a detailed explanation of the code. The assistant correctly states that the time complexity is O(log(min(m, n))) and the space complexity is O(1), which aligns with the reference answer. The assistant also provides an example usage of the function, which is helpful for understanding how to use it. The assistant’s code is a different implementation than the reference answer, but it achieves the same result and meets the same complexity requirements.<br>However, the assistant’s answer does not address the user’s original question about achieving O(n) time complexity. The assistant should have clarified that it’s not possible to find the median of two sorted arrays of different sizes with O(1) space complexity and O(n) time complexity, as stated in the reference answer.<br>Rating: [[8]], "score": 8, "turn": 1, "tstamp": 1722737514.2011044 | The assistant’s answer is correct and provides a detailed explanation of the code. The assistant correctly states that the time complexity is O(log(min(m, n))) and the space complexity is O(1), which aligns with the reference answer. The assistant also provides a step-by-step explanation of the code, which is very helpful for understanding the logic behind the solution. The assistant’s code is also correct and will correctly find the median of two sorted arrays of different sizes. Therefore, there are no corrections needed for the assistant’s response.<br>Rating: [[10]], "score": 10, "turn": 1, "tstamp": 1722846533.772981 |

**Table 15: (Continued) comparison of model generations on examples from MT-Bench.**
| 1st-turn prompt:<br>You are given two sorted lists of size m and n. Implement a function to find the kth smallest element in the union of the two lists with linear complexity. |  |
| --- | --- |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| ‘‘‘python\n\def find_kth_smallest(list1, list2, k):\n   """\n   Finds the kth smallest element in the union of two sorted lists.\n\n   Args:\n    list1: The first sorted list.\n    list2: The second sorted list.\n    k: The desired kth smallest element.\n\n   Returns:\n    The kth smallest element in the union of the two lists.\n   """\n\n   m, n = len(list1), len(list2)\n   i, j = 0, 0\n   min_heap = []  \n\n # Build a min-heap with the first elements of both lists\n   for x in range(min(m, n)):\n    heapq.heappush(min_heap, (list1[x], x, 0)) # (value, list_index, position_in_list)\n    heapq.heappush(min_heap, (list2[x], x, 1))\n\n # Extract k smallest elements from the heap\n   for _ in range(k - 1):\n    _, _, _ = heapq.heappop(min_heap)\n\n # The top element of the heap is the kth smallest\n   return heapq.heappop(min_heap)[0]\n\n# Example usage:\nlist1 = [2, 5, 8, 12]\nlist2 = [1, 3, 7, 9, 10]\nk = 5\nkth_smallest = find_kth_smallest(list1, list2, k)\nprint(f"The {k}th smallest element is: {kth_smallest}")\n\n\n**Explanation:**\n\n1. **Initialization:**\n   - ‘m‘ and ‘n‘ store the lengths of the input lists.\n   - ‘i‘ and ‘j‘ are pointers to track the current position in each list.\n   - ‘min_heap‘ is a min-heap used to efficiently store and retrieve the smallest elements encountered so far.\n\n2. **Building the Min-Heap:**\n   - The code iterates through the first ‘min(m, n)‘ elements of both lists.\n   - For each element, a tuple ‘(value, list_index, position_in_list)‘ is pushed onto the ‘min_heap‘. This tuple helps us keep track of the element’s value, the list it belongs to, and its original position.\n\n3. **Extracting k-1 Smallest Elements:**\n   - The ‘for‘ loop runs ‘k - 1‘ times, effectively extracting the ‘k-1‘ smallest elements from the ‘min_heap‘.\n\n4. **Finding the kth Smallest:**\n   - After the loop, the top element of the ‘min_heap‘ contains the ‘k‘th smallest element.\n   - ‘heapq.heappop(min_heap)‘ removes and returns this element.\n\n**Time Complexity:**\n\n- Building the min-heap: O(m + n)\n- Extracting k-1 elements: O(k * log(k))\n- Overall: **O(m + n + k * log(k))**, which is approximately **O(m + n)** since ‘k‘ is usually much smaller than ‘m + n‘.\n\n\n\nLet me know if you have any other questions! | ‘‘‘python\n\def find_kth_smallest(list1, list2, k):\n """\n Finds the kth smallest element in the union of two sorted lists.\n\n Args:\n   list1: The first sorted list.\n   list2: The second sorted list.\n   k: The desired rank of the smallest element.\n\n Returns:\n   The kth smallest element in the union of the lists.\n """\n\n i = 0  # Index for list1\n j = 0 # Index for list2\n merged = []  # Store the merged elements\n\n while i < len(list1) and j < len(list2):\n   if list1[i] <= list2[j]:\n   merged.append(list1[i])\n   i += 1\n   else:\n   merged.append(list2[j])\n   j += 1\n\n # Add any remaining elements from list1\n while i < len(list1):\n   merged.append(list1[i])\n   i += 1\n\n # Add any remaining elements from list2\n while j < len(list2):\n   merged.append(list2[j])\n   j += 1\n\n return merged[k - 1]  # Return the kth element (index k-1)\n\n# Example usage:\nlist1 = [2, 5, 8, 12]\nlist2 = [1, 3, 7, 9, 10]\nk = 5\n\nkth_smallest = find_kth_smallest(list1, list2, k)\nprint(f"The {k}th smallest element is: {kth_smallest}")\n\n\n**Explanation:**\n\n1. **Initialization:**\n - ‘i‘ and ‘j‘ are index pointers for ‘list1‘ and ‘list2‘ respectively, starting at 0.\n - ‘merged‘ is an empty list to store the merged sorted elements.\n\n2. **Merging:**\n - The ‘while‘ loop continues as long as both ‘i‘ and ‘j‘ are within the bounds of their respective lists.\n - In each iteration, it compares the elements at ‘list1[i]‘ and ‘list2[j]‘.\n - The smaller element is appended to ‘merged‘, and the corresponding index (‘i‘ or ‘j‘) is incremented.\n\n3. **Adding Remaining Elements:**\n - After one list is exhausted, the remaining elements from the other list are directly appended to ‘merged‘.\n\n4. **Returning the kth Element:**\n - Finally, ‘merged[k - 1]‘ is returned, which represents the kth smallest element in the union (remember that list indices start from 0).\n\n**Linear Complexity:**\n\n- The algorithm iterates through each element in both lists at most once during the merging process.\n- The time complexity is therefore O(m + n), which is linear in the total number of elements (m + n), making it efficient for large lists. |
| Judgment (by gpt-4) |  |
| Judgment for gemma-2-9b-it-dpo | Judgment for gemma-2-9b-it-dpo-eva |
| The assistant’s answer is incorrect. The user asked for a solution with linear complexity, but the assistant provided a solution with a time complexity of O(m + n + k * log(k)), which is not linear. The assistant’s solution uses a min-heap, which is not necessary and adds unnecessary complexity to the solution.<br>Rating: [[2]], "score": 2, "turn": 1, "tstamp": 1722737030.6411152 | The assistant’s answer is correct and helpful. It provides a Python function that implements the two-pointer approach to find the kth smallest element in the union of two sorted lists. The assistant’s function is slightly different from the reference, but it achieves the same goal. The assistant’s function merges the two lists into a new list and then returns the kth element from the merged list. The assistant also provides a detailed explanation of how the function works and confirms that the time complexity is linear, which is what the user asked for. However, the assistant’s function uses extra space to store the merged list, which is not necessary and not as efficient as the reference.<br>Rating: [[8]], "score": 8, "turn": 1, "tstamp": 1722846543.867601 |

**Table 16: (Continued) comparison of model generations on examples from MT-Bench.**
| 2nd-turn prompt: Does there exist an algorithm with better time complexity? If so, implement it. |  |
| --- | --- |
| Answer from gemma-2-9b-it-dpo | Answer from gemma-2-9b-it-dpo-eva |
| You are absolutely right! There’s a more efficient algorithm with a time complexity of **O(m + n)** without using a heap.\n\nHere’s the implementation:\n\npython\n\def find_kth_smallest_optimized(list1, list2, k):\n """\n Finds the kth smallest element in the union of two sorted lists\n with O(m + n) time complexity.\n\n Args:\n list1: The first sorted list.\n list2: The second sorted list.\n k: The desired kth smallest element.\n\n Returns:\n The kth smallest element in the union of the two lists.\n """\n m, n = len(list1), len(list2)\n i, j = 0, 0\n result = []\n\n # Merge the lists while keeping track of the kth smallest\n while len(result) < k:\n if i < m and j < n:\n   if list1[i] <= list2[j]:\n   result.append(list1[i])\n   i += 1\n   else:\n   result.append(list2[j])\n   j += 1\n elif i < m:\n   result.append(list1[i])\n   i += 1\n else:\n result.append(list2[j])\n j += 1\n\n return result[k - 1]\n\n# Example usage:\nlist1 = [2, 5, 8, 12]\nlist2 = [1, 3, 7, 9, 10]\nk = 5\nkth_smallest = find_kth_smallest_optimized(list1, list2, k)\nprint(f"The {k}th smallest element is: {kth_smallest}")\n\n\n**Explanation:**\n\n1. **Initialization:**\n - ‘m‘ and ‘n‘ store the lengths of the lists.\n - ‘i‘ and ‘j‘ are pointers for ‘list1‘ and ‘list2‘, respectively.\n - ‘result‘ is a list to store the merged and sorted elements.\n\n2. **Merging and Tracking:**\n - The ‘while‘ loop continues until ‘k‘ elements are in the ‘result‘ list.\n - In each iteration, it compares the current elements from ‘list1‘ and ‘list2‘.\n - The smaller element is appended to ‘result‘, and the corresponding pointer (‘i‘ or ‘j‘) is incremented.\n - If one list is exhausted, the remaining elements from the other list are appended to ‘result‘.\n\n3. **Returning the kth Smallest:**\n - Finally, ‘result[k - 1]‘ contains the ‘k‘th smallest element.\n\n**Time Complexity:**\n\n- The algorithm iterates through both lists once, resulting in a time complexity of **O(m + n)**.\n\n\n\nLet me know if you have any more questions! | You are right to ask! While the previous algorithm has linear time complexity, we can achieve an even better solution with **O(log(min(m, n)))** time complexity using a slightly more sophisticated approach.\n\nThe key idea is to leverage the sorted nature of the lists and use a **binary search** strategy.\n\nHere’s the implementation:\n\n\##\npython\n\def find_kth_smallest_optimized(list1, list2, k):\n  """\n  Finds the kth smallest element in the union of two sorted lists with O(log(min(m, n))) time complexity.\n\n  Args:\n  list1: The first sorted list.\n  list2: The second sorted list.\n  k: The desired rank of the smallest element.\n\n  Returns:\n  The kth smallest element in the union of the lists.\n  """\n  m, n = len(list1), len(list2)\n  if m > n:\n  list1, list2, m, n = list2, list1, n, m # Ensure list1 is the shorter one\n\n  left, right = 0, m\n  while left <= right:\n  partitionX = (left + right) // 2\n  partitionY = k - partitionX\n\n  maxLeftX = list1[partitionX - 1] if partitionX > 0 else float(’-inf’)\n  minRightX = list1[partitionX] if partitionX < m else float(’inf’)\n\n  maxLeftY = list2[partitionY - 1] if partitionY > 0 else float(’-inf’)\n  minRightY = list2[partitionY] if partitionY < n else float(’inf’)\n\n  if maxLeftX <= minRightY and maxLeftY <= minRightX:\n if partitionX == 0:\n  return list2[partitionY - 1]\n elif partitionY == 0:\n  return list1[partitionX - 1]\n else:\n  return max(list1[partitionX - 1], list2[partitionY - 1])\n  elif maxLeftX > minRightY:\n right = partitionX - 1 # Too many elements on the right side of list1\n  else:\n left = partitionX + 1 # Too many elements on the right side of list2\n\n\n**Explanation:**\n\n1. **Shorten Lists:** If ‘list1‘ is longer than ‘list2‘, swap them to ensure ‘list1‘ is always the shorter one. This simplifies the logic.\n\n2. **Binary Search:**\n  - ‘left‘ and ‘right‘ pointers define the search space within ‘list1‘.\n  - ‘partitionX‘ is the middle point in ‘list1‘, and ‘partitionY‘ is calculated to divide the remaining elements in ‘list2‘ such that ‘partitionX + partitionY = k‘.\n  - ‘maxLeftX‘, ‘minRightX‘, ‘maxLeftY‘, and ‘minRightY‘ represent the largest element to the left and smallest element to the right of the partitions in both lists.\n\n3. **Comparison and Adjustment:**\n  - If the ‘maxLeftX‘ is less than or equal to ‘minRightY‘ and ‘maxLeftY‘ is less than or equal to ‘minRightX‘, it means the kth smallest element lies within the current partitions. We return the larger of ‘maxLeftX‘ and ‘maxLeftY‘.\n  - If ‘maxLeftX‘ is greater than ‘minRightY‘, it indicates that we need to search in the left subarray of ‘list1‘ (i.e., decrease ‘right‘).\n  - Otherwise, we search in the right subarray of ‘list1‘ (i.e., increase ‘left‘).\n\n4. **Termination:** The binary search continues until ‘left‘ crosses ‘right‘, indicating the correct partition has been found.\n\n**Time Complexity:**\n\n- The binary search divides the search space in half at each step.\n- Therefore, the time complexity is O(log(min(m, n))), which is significantly faster than linear time for large lists where one list is much smaller than the other. |
| Judgment (by gpt-4) |  |
| Judgment for gemma-2-9b-it-dpo | Judgment for gemma-2-9b-it-dpo-eva |
| The assistant’s first response to the user’s question is incorrect. The user asked for a function to find the kth smallest element in the union of two sorted lists with linear complexity. The assistant provided a function that uses a min-heap, which has a time complexity of O(m + n + k * log(k)). This is not linear complexity, as the user requested. The assistant’s second response to the user’s question is also incorrect. The user asked if there exists an algorithm with better time complexity than linear. The assistant provided a function that has a time complexity of O(m + n), which is linear, not better than linear. The assistant should have provided a function that uses a binary search approach, which has a time complexity of O(log(m) + log(n)), as the reference answer correctly does.<br>Rating: [[2]], "score": 2, "turn": 2, "tstamp": 1722737031.5033472 | The assistant’s response is correct and helpful. The assistant provided a Python function that uses a binary search approach to find the kth smallest element in the union of two sorted lists. The assistant also provided a detailed explanation of how the function works, including the time complexity of the function. The assistant’s answer matches the reference answer in terms of the algorithm used and the explanation provided. The assistant also correctly identified that the binary search approach has a better time complexity than the linear approach. However, the assistant’s code has a minor issue. The assistant’s code does not handle the case when ‘k‘ is greater than the sum of the lengths of the two lists. In such a case, the code will raise an ‘IndexError‘. This can be fixed by adding a check at the beginning of the function to return ‘None‘ if ‘k‘ is greater than the sum of the lengths of the two lists.<br>Rating: [[9]], "score": 9, "turn": 2, "tstamp": 1722846556.6828268 |

## Appendix E Extended Literature Review on Open-Endedness

The design of our game-theoretic framework for language model post-training is inspired from many prior works in open-ended learning. As reflected in $\S$ 3, the central idea of open-ended learning is *not* to optimize for a *specific, static* distribution, but to develop an agent that can *generalize* well across *unseen, novel* environments, which are the environments that the agent has not been explicitly trained on. To achieve this, unsupervised environment design proposes to generate environments that present a curriculum of *increasing complexity* for the agent to evolve, which ensures that the agent’s learning is not *narrow*, but broad enough to handle the diversity of complexity of future environments. In such curriculum, as the agent solves simpler environments, it moves on to more difficult ones, thus progressively builds more sophisticated strategies. Furthermore, by adopting a *minimax regret* framework, this approach adds a layer of robustness by minimizing the agent’s performance gap in worst-case (i.e., most adversarial) environments. It is not just about generalizing to novel environments but also about ensuring that agents to handle the most challenging scenarios.

In addition to distinctions discussed in $\S$ 5, we here list several foundational works in this line, and encourage the LLM community to explore with more rigor and depth: Schmidhuber [] presents an initial investigation into open-ended learning via self-supervised curiosity-driven exploration; Wang et al. [] emphasize co-evolution of environments and agent policies by training a population of agents that adapt to and solve progressively complex challenges; Dennis et al. [] formally introduce the notion of Unsupervised Environment Design (UED), where a protagonist and antagonist agent pair simulates regret by competing in shared environments, driving the protagonist (the main learner) to adapt to increasingly challenging scenarios; Jiang et al. [] introduce Prioritized Level Replay (PLR), which uses a rolling buffer of high-regret levels to dynamically adjust the training curriculum, and selects levels with the higher learning potential; Parker-Holder et al. [] further propose improvements by editing previously high-regret levels; Hughes et al. [] present a formal definition for open-ended system with respect to *novelty* and *learnability*, which generalizes various systems, e.g., AlphaGo [Silver et al., ], AdA [Team et al., ], etc.

Our focus here was on classical, seminal, and directly relevant works. We welcome suggestions for any additional references we may have missed that could enhance our citations – please feel free to reach out.

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 8
presentation: 3
questions: Q1: Could you explain more about the particular choice of evolution algorithm used in your implementation of eva and different potential strengths and weaknesses related to this choice? 

Q2: Do you see empirical evidence of your intuition about learning progress discussed in section 3.4? It seems like some of these claims are directly testable. 

Q3: Could you visualize the curriculum learned in your experiments with eva? It would be very nice to get an intuition for why performance improves and what the heuristic prioritizes over time. 

Minor - Q4: When discussing future directions, the authors write  "(vii) further scaling up w/ million-level data". Can you clarify what this means? Seems like some important context is missing?
soundness: 3
strengths: - It is very cool to see a curriculum learning approach leading to improvements in practical RLHF settings with LLMs. 
- I thought the writing quality and presentation of the paper was generally pretty strong throughout with the discourse feeling well structured.
- I appreciated the way that the approach was motivated through discussion of minimax regret in section 3.2. 
- I also found the connection with learning progress highlighted in section 3.4 quite interesting and feel that my concerns about the heuristic nature of the approach are largely addressed through this motivation. 
- The results in Table 1 are very impressive, especially in comparison to human prompts. 
- It is nice to see that the success of eva is very robust to the particular RLHF optimizer used. 
- A nice set of benchmarks and ablations are considered for the experiments. 
- I also thought the robustness with respect to more training iterations was a nice benefit to highlight.
summary: This paper looks to bring RLHF training past using a fixed prompt distribution. The authors pose the learning problem as an asymmetric game between two players: a prompt creator and solver. The authors then introduce eva, which is a simple prompt evolution approach that can be used in conjunction with existing RLHF algorithms. eva improves the performance of DPO, SimPO, SPPO, and ORPO 
on widely-used benchmarks within the community.
weaknesses: - The novelty of the approach is not huge based on the prior literature, although I do believe a very practical contribution is made. 
- The approach is motivated intuitively and includes heuristics i.e. the "Informativeness Proxy" rather than a mathematical derivation of the optimization rule from first principles. 
- Evolving seems important for achieving performance based off table 4, but the particular algorithm chosen is not really described or contrasted with other approaches. This is discussed in the "Prompt synthesis for language models" section of the related work as an orthogonal contribution because other related approaches could be plugged into evolve(·), but it would be very interesting to understand more about how critical this particular choice is for the success of eva. 
- There are some typos that the authors missed such as "DIFFERENT INTUITIVE WYAS" and "Limitations and future directionss".

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: 1. Since equation 7, can't be directly solved, and is solved in an asymmetric fashion, then in the solver loop the KL should be over the response distribution and not joint right?
2. How is the KL divergence w.r.t reference policy for the algorithm? Please provide detailed ablation.
3. Whats the reward model availability? Is the true reward model available? 
4. There is a recent line of works on Stacklberg and Bilevel RLHF which deals with the entanglement in a leader-follower setting. Although not specific to updating prompt dist, but can be trivially applied. Provide a detailed comparison with the literature around that [1,2, 3].
5. Can you provide intuitions behind equation 7, on the KL divergence between the joint policy for both prompt and response? Is it even tractable to estimate or approximate this KL 


[1]. Principled Penalty-based Methods for Bilevel Reinforcement Learning and RLHF
[2]. SAIL: Self-Improving Efficient Online Alignment of Large Language Models
[3]. STA-RLHF: Stackelberg Aligned Reinforcement Learning with Human Feedback
soundness: 2
strengths: The reliance of static prompt distribution has inherently limited the capabilities of various alignment designs eventually resulting in issues such as distribution shifts and even jailbreaks can be considered as a special case of the same. Hence, the problem statement is timely and crucial. The paper introduces a creator-solver framework evolving the prompt distribution which enhances the generalization ability of LLMs, allowing them to adapt to more diverse and challenging prompts, which better mirrors real-world applications. An additional advantage lies in the fact, the algorithm can be added on top of current baselines which is crucial rather than building new algorithm from scratch. The empirical results show improvements on existing benchmarks when applied on top of baseline algorithms.
summary: Majority of the recent alignment/RLHF pipelines have been designed on static prompt distribution leading to several issues of distribution shift on different prompt distribution. Hence to mitigate this issue, the current work formulates the problem as an asymmetric game where the creator generates novel and informative prompts whereas the solver solves it. This approach improves the performance of existing baselines on SOTA benchmarks.
weaknesses: 1. How is Equation 10 tractable and how is it being solved? Any heuristic of sampling and approximating should result in sub-optimality which is not clear where its accounted.
2. The optimization is over \pi in equation 9 for solving the minimax regret. However, its not absolutely clear how the KL divergence plays a role here and how it is ensured that the response and prompt distributions are close to reference. Without that, the alignment problem is ill-defined. Please provide concrete justifications in theory and empirical results.
3. As described in Algorithm 1, informativeness is evaluated and a prompt subset is created based on current policy estimate and then the policy is updated based on the prompt subset. However, this causes an inter-dependence between the two which leads to nested structure, which is not clearly explained. Specifically, while computing the informativeness score for the prompts, it depends on \theta^*(x_t-1) i.e optimal parameter for the previous distribution. Provide clear explaination on the same. 
4. While iterating, every new prompt distribution will require generating new response, how is the evaluation coming from which reward model?  Is the ground reward available, if not please explain how the preference is obtained and how does it affect suboptimality?
5. Overall, which expression/Theorem guides us in understanding the improvement of prior suboptimality is not clear? Can you please point out/highlight how the current method improves upon the prior suboptimality due to static prompt distribution?
6. Its extremely crucial to show the prompt distribution and demonstrate its perplexity to ensure its not generating some meaningless or irrelevant prompts, since its not very evident on the KL divergence in the prompt space and its relation with the informative measure. Please provide detailed explaination to clarify that.

---

confidence: 5
contribution: 3
initial_rating: 5
presentation: 4
questions: The informativeness proxy seems to be similar to the variance of the rewards because they all concern the diversity of the generated responses. However, in lines 393-395, the results shows using variance leads to poor performance. How to interpret this?
soundness: 3
strengths: This paper is well-written, easy-to-follow and informative; It contains thorough ablation study to show the effectiveness of the proposed method; The empirical evaluation shows much improvement.
summary: This paper proposes EVA: Evolving Alignment via A symmetric Self-Play, a framework that that casts alignment as an asymmetric game between two players, a prompt creator and a policy learner. They selects prompts which induce responses with largest reward gaps, and generate similar prompts with those selected prompts. The proposed method improves the baseline by a margin.
weaknesses: **Main concerns**

1. The number of iterations in the main results is 2, with only one EVA step in each experiment, which is a little different from what the demonstration in Figure 3 shows. If the EVA step is performed multiple times, would the results be better or worse? What is performance like when you access all data in ultrafeedback?

2. The connection between the minimax regret objective and the algorithm is a somehow vague. The regret concerns the performance gap with the optimal policy. It's not reflected by the informativeness proxy.

**Minor issues**

Line 278: type wrost -> worst

Meta-review: Current training paradigms only leverage static distribution of prompts and it suffers from efficiency issues and generalization issues. Motivated by it, the authors proposed a new framework eva, which is able to create new prompts. eva improves the performance of the current training method.

The paper is well-written and the authors conduct substantial experiments to illustrate the performance of the proposed algorithm. However, the novelty of this paper is limited. Moreover, the intuition behind the design of the algorithm is not entirely stated, such as the connection between the minimax regret and informativeness proxy, which constitutes the main reason for rejection.

Decision: Reject