Sam Babichenko

Reading notes / Bandits and exploration

Nash learning from human feedback and self-play preference optimization

Munos et al., 2024; Swamy et al., 2024

Prompts, responses and preferences
xxa prompt, drawn from the distribution ρ\rho
ρ\rhodistribution of prompts
yya response to the prompt xx, sampled from a policy, y∼π(⋅∣x)y\sim\pi(\cdot|x)
y′y'a second response to the same prompt, compared with yy
ξ\xia trajectory in SPO: the states and actions of one HH-step episode; for a language model, a response
P(y≻y′∣x)P(y\succ y'|x)probability that a randomly chosen rater prefers response yy to y′y' for prompt xx; P(y≻y′∣x)=1−P(y′≻y∣x)P(y\succ y'|x)=1-P(y'\succ y|x)
P(y≻π′∣x)P(y\succ\pi'|x)preference of a response yy over a policy π′\pi', Ey′∼π′(⋅∣x)P(y≻y′∣x)\mathbb E_{y'\sim\pi'(\cdot|x)}P(y\succ y'|x)
P(π≻π′)P(\pi\succ\pi')preference of policy π\pi over policy π′\pi', E P(y≻y′∣x)\mathbb E\,P(y\succ y'|x) with x∼ρx\sim\rho, y∼π(⋅∣x)y\sim\pi(\cdot|x), y′∼π′(⋅∣x)y'\sim\pi'(\cdot|x)
PβP_\betaregularized preference, Pβ(π≻π′)=P(π≻π′)−β KLρ(π∥πref)+β KLρ(π′∥πref)P_\beta(\pi\succ\pi')=P(\pi\succ\pi')-\beta\,\mathrm{KL}_\rho(\pi\|\pi_{\rm ref})+\beta\,\mathrm{KL}_\rho(\pi'\|\pi_{\rm ref}); still constant-sum
σ\sigmalogistic function, σ(z)=1/(1+e−z)\sigma(z)=1/(1+e^{-z})
rπr^\piBradley-Terry reward that best fits comparisons of pairs sampled from the policy π\pi
PBTπP^\pi_{\rm BT}preference implied by the fitted reward rπr^\pi, PBTπ(y≻y′)=σ(rπ(y)−rπ(y′))P^\pi_{\rm BT}(y\succ y')=\sigma(r^\pi(y)-r^\pi(y'))
ssshift in the population in Step 1: the three rater types have shares 13−s\tfrac{1}{3}-s, 13+s2\tfrac{1}{3}+\tfrac{s}{2}, 13+s2\tfrac{1}{3}+\tfrac{s}{2}
mijm_{ij}margin of the duel that yiy_i wins in Step 1's cycle, mij=P(yi≻yj)−12m_{ij}=P(y_i\succ y_j)-\tfrac12
Policies
π\pia policy: for each prompt xx, a distribution π(⋅∣x)\pi(\cdot|x) over responses
πθ\pi_\thetathe language model being trained, a policy with parameters θ\theta
πref\pi_{\rm ref}reference policy: the supervised model that training starts from and that the KL penalty pulls toward
π∗\pi^*minimax winner, π∗∈arg⁡max⁡πmin⁡π′P(π≻π′)\pi^*\in\arg\max_\pi\min_{\pi'}P(\pi\succ\pi'): a policy that every other policy beats with probability at most 12\tfrac{1}{2}
πβ∗\pi^*_\betaunique equilibrium of the regularized game PβP_\beta; it satisfies πβ∗(y∣x)∝πref(y∣x) eP(y≻πβ∗∣x)/β\pi^*_\beta(y|x)\propto\pi_{\rm ref}(y|x)\,e^{P(y\succ\pi^*_\beta|x)/\beta}
π(α)\pi^{(\alpha)}geometric mixture of a policy with the reference, π(α)(y)∝π(y)1−απref(y)α\pi^{(\alpha)}(y)\propto\pi(y)^{1-\alpha}\pi_{\rm ref}(y)^{\alpha}, for α∈[0,1]\alpha\in[0,1]
πt\pi_tNash-MD's policy after tt steps; in SPO, the current policy at round tt
ptp_tSPO's distribution over policies at round tt, the output of the no-regret learner
pˉ\bar paverage of the learner's distributions, pˉ=1T∑tpt\bar p=\frac{1}{T}\sum_tp_t, played as one policy
Π\Pipolicy class, assumed convex so that a mixture of policies is again a policy
Learning
ηt\eta_tNash-MD's step size at step tt; ηt=2/(β(t+2))\eta_t=2/(\beta(t+2)) in result (b)
DtD_tKL divergence from the regularized equilibrium to Nash-MD's iterate, KL(πβ∗∥πt)\mathrm{KL}(\pi^*_\beta\|\pi_t)
ℓt\ell_tlinear loss the online learner sees at round tt; in SPO, ℓt(p)=−P(p≻pt)\ell_t(p)=-P(p\succ p_t)
Reg(T)\mathrm{Reg}(T)regret bound after TT rounds: ∑tℓt(pt)−min⁡p∑tℓt(p)≤Reg(T)\sum_t\ell_t(p_t)-\min_p\sum_t\ell_t(p)\le\mathrm{Reg}(T)
HHtrajectory length: the number of steps a policy acts in one episode
A\mathcal Aset of actions available at each step
rt(ξ)r_t(\xi)SPO's reward for trajectory ξ\xi at round tt: its win rate against the current policy, rt(ξ)=P(ξ≻πt)r_t(\xi)=P(\xi\succ\pi_t)
g^\hat gNash-MD-PG's gradient estimate, ∇θlog⁡πθ(y∣x)(P(y≻y′∣x)−12−βlog⁡πθ(y∣x)πref(y∣x))\nabla_\theta\log\pi_\theta(y|x)\big(P(y\succ y'|x)-\tfrac{1}{2}-\beta\log\frac{\pi_\theta(y|x)}{\pi_{\rm ref}(y|x)}\big), with y′y' from the mixed opponent
Constants
β\betaKL weight; 0.008 for the Nash methods, 0.05 for RLHF in Step 6
α\alphaweight of the reference in the geometric mixture; ηtβ\eta_t\beta in Nash-MD, swept from 0 to 1 in Nash-MD-PG
BBlength of SPO's queue of recent trajectories; 10 to 1,000 in the experiments
kknumber of responses sampled per prompt, k≥2k\ge2; each is rewarded by its win rate against the others
Δ\Deltamargin by which one set of policies beats every other policy in SPO's fast rate O~(∣Π∣/(ΔT))\tilde O(|\Pi|/(\Delta T)) (Step 8)
Paper symbols
τ\tauMunos et al.'s symbol for the KL weight β\beta
μ\muMunos et al.'s symbol for the reference policy πref\pi_{\rm ref}
β\beta in Nash-MD-PGwhat Munos et al. write for the mixing weight α\alpha
πtμ\pi_t^\muwhat Munos et al. write for πt(ηtβ)\pi_t^{(\eta_t\beta)}
P(ξ1,ξ2)\mathcal P(\xi_1,\xi_2)Swamy et al.'s preference, 2P(ξ1≻ξ2)−1∈[−1,1]2P(\xi_1\succ\xi_2)-1\in[-1,1]
MWSwamy et al.'s minimax winner

Context. Standard RLHF turns pairwise comparisons into a scalar reward, usually through the P(y≻y′)=σ(r(y)−r(y′))P(y\succ y')=\sigma(r(y)-r(y')) with σ\sigma the logistic function: comparisons explained by one score per response (Bradley and Terry, 1952). Reading note: InstructGPT, and maximizes that reward with a KL penalty toward the starting model. A scalar reward imposes a single total order over responses, so it breaks when pooled rater preferences cycle. Three individually consistent rater groups can jointly prefer summary 1 to 2, 2 to 3, and 3 to 1. Even without cycles, the fitted reward depends on which policy sampled the training pairs whenever true preferences are not Bradley-Terry.

Munos et al. (2024) and Swamy et al. (2024) replace reward maximization with a symmetric two-player game whose payoff is the preference itself. The target is a Nash equilibrium that no opponent beats more than half the time, matching the a distribution over options that wins a comparison against every fixed option with probability at least 12\tfrac{1}{2} (Dudík et al., 2015). Reading note: Dueling bandits and the von Neumann winner of contextual dueling bandits. When raters disagree, that equilibrium can be a mixture of responses. Munos et al. fit a a network that reads a prompt and two responses and outputs the probability that a rater prefers the first, trained by cross-entropy on observed choices directly and add a KL penalty toward a reference policy to make the equilibrium unique. They prove that their algorithm, Nash mirror descent: each step raises the policy's win rate against a mixture of itself and the reference policy, with a KL penalty toward that mixture (Step 4), converges in its the current policy itself, as opposed to the average of all policies so far, which is what no-regret methods usually come with guarantees for, and test a policy-gradient version on summarization. Swamy et al. exploit symmetry. Because any policy wins half its comparisons against itself, one learner improving its win rate against its own current policy suffices. They call this self-play preference optimization (SPO) and test it on control tasks.

Setting. Draw a prompt xx from the distribution of prompts, and let a policy a policy: for each prompt xx, a distribution π(⋅∣x)\pi(\cdot|x) over responses sample a response y∼π(⋅∣x)y\sim\pi(\cdot|x). Write the probability that a randomly chosen rater prefers response yy to y′y' for prompt xx for the probability that a random rater prefers yy to y′y'. It satisfies P(y≻y′∣x)=1−P(y′≻y∣x)P(y\succ y'|x)=1-P(y'\succ y|x), so P(y≻y∣x)=12P(y\succ y|x)=\tfrac{1}{2}. Averaging over y′∼π′(⋅∣x)y'\sim\pi'(\cdot|x) gives a response's win rate against a policy, P(y≻π′∣x)=Ey′∼π′(⋅∣x)P(y≻y′∣x)P(y\succ\pi'|x)=\mathbb E_{y'\sim\pi'(\cdot|x)}P(y\succ y'|x). Averaging further over x∼ρx\sim\rho and y∼π(⋅∣x)y\sim\pi(\cdot|x) gives one policy's win rate against another, P(π≻π′)=E P(y≻y′∣x)P(\pi\succ\pi')=\mathbb E\,P(y\succ y'|x). The goal is a policy that every opponent beats with probability at most 12\tfrac{1}{2}:π∗∈arg⁡max⁡π min⁡π′ P(π≻π′).\pi^*\in\arg\max_\pi\ \min_{\pi'}\ P(\pi\succ\pi').Since P(π′≻π)=1−P(π≻π′)P(\pi'\succ\pi)=1-P(\pi\succ\pi'), this is a symmetric two-player a game in which the two players' payoffs add to the same constant for every pair of strategies, here 1; it behaves exactly like a zero-sum game. By the von Neumann's: for a payoff linear in each player's mixed strategy, max⁡πmin⁡π′=min⁡π′max⁡π\max_\pi\min_{\pi'}=\min_{\pi'}\max_\pi, so an equilibrium pair exists (von Neumann, 1928), the pair (π∗,π∗)(\pi^*,\pi^*) is a Nash equilibrium. Swamy et al. call π∗\pi^* the a policy, possibly a mixture, that every other policy beats with probability at most 12\tfrac{1}{2}; the von Neumann winner of dueling bandits. Reading note: Dueling bandits and the von Neumann winner.

Munos et al. add a KL penalty of weight the weight of the KL penalty toward πref\pi_{\rm ref}; 0.008 for the Nash methods and 0.05 for RLHF in the experiments>0{}\gt0 to keep training near a the supervised model that training starts from, where a learned preference model can be more accurate:Pβ(π≻π′)=P(π≻π′)−β KLρ(π∥πref)+β KLρ(π′∥πref),\begin{aligned}P_\beta(\pi\succ\pi')={}&P(\pi\succ\pi')\\&-\beta\,\mathrm{KL}_\rho(\pi\|\pi_{\rm ref})\\&+\beta\,\mathrm{KL}_\rho(\pi'\|\pi_{\rm ref}),\end{aligned}with KLρ(π∥πref)\mathrm{KL}_\rho(\pi\|\pi_{\rm ref})=Ex∼ρKL(π(⋅∣x)∥πref(⋅∣x)){}=\mathbb E_{x\sim\rho}\mathrm{KL}(\pi(\cdot|x)\|\pi_{\rm ref}(\cdot|x)). Swapping π\pi and π′\pi' negates both KL terms, so PβP_\beta stays constant-sum. Write the equilibrium policy of the regularized game PβP_\beta, unique for every β>0\beta\gt0: no policy beats it under PβP_\beta, and it is the reference tilted by its own win rates, πβ∗(y∣x)∝πref(y∣x) eP(y≻πβ∗∣x)/β\pi^*_\beta(y|x)\propto\pi_{\rm ref}(y|x)\,e^{P(y\succ\pi^*_\beta|x)/\beta} (Step 3) for its equilibrium.

Main results. (a) The regularized game has a unique equilibrium (Munos et al., Proposition 1). For every β>0\beta\gt0, PβP_\beta has a unique Nash equilibrium (πβ∗,πβ∗)(\pi^*_\beta,\pi^*_\beta), symmetric across both players. The policy πβ∗\pi^*_\beta satisfies a fixed-point tilt equation in its win rates against itself (derived here in Step 3).

(b) Nash-MD's last iterate converges (Munos et al., Theorem 1). At step tt, Nash-MD picks a step size the step size of Nash-MD at step tt; the reference's weight in the mixture is ηtβ\eta_t\beta, and result (b) uses ηt=2/(β(t+2))\eta_t=2/(\beta(t+2)) with why: ηtβ\eta_t\beta is the reference's weight in the geometric mixture, which must lie in [0,1][0,1] for the mixture inequality of Step 4, mixes its current policy the policy after tt steps of the algorithm with πref\pi_{\rm ref}, and updates toward higher win rates against that mixture (Step 4). Dropping xx, let DtD_t=KL(πβ∗∥πt){}=\mathrm{KL}(\pi^*_\beta\|\pi_t) measure per-prompt distance to the equilibrium. Each step contracts:Dt+1≤(1−ηtβ) Dt+2ηt2.D_{t+1}\le(1-\eta_t\beta)\,D_t+2\eta_t^2.Setting ηt=2/(β(t+2))\eta_t=2/(\beta(t+2)) givesDT≤8β2(T+1).D_T\le\frac{8}{\beta^2(T+1)}.

(c) One learner playing itself finds a minimax winner (Swamy et al., Theorem 2.3). Run a single a learner is no-regret when its regret bound grows slower than the number of rounds, Reg(T)/T→0\mathrm{Reg}(T)/T\to0, so its average loss per round approaches that of the best fixed choice in hindsight learner over a convex policy class the policy class, assumed convex so that a mixture of policies is again a policy. At round tt, give it the linear loss ℓt(p)=−P(p≻pt)\ell_t(p)=-P(p\succ p_t) against its own current distribution the learner's distribution over policies at round tt; for distributions p,qp,q, P(p≻q)P(p\succ q) averages P(π≻π′)P(\pi\succ\pi') over π∼p\pi\sim p and π′∼q\pi'\sim q. If its how much more loss the learner took than the best fixed choice in hindsight. Reading note: Adversarial and corrupted bandits is at most Reg(T)\mathrm{Reg}(T), then the average pˉ\bar p=1T∑t=1Tpt{}=\tfrac{1}{T}\sum_{t=1}^Tp_t satisfiesP(π≻pˉ)≤12+Reg(T)TP(\pi\succ\bar p)\le\tfrac{1}{2}+\frac{\mathrm{Reg}(T)}{T}for every policy π\pi, so pˉ\bar p lies within Reg(T)/T\mathrm{Reg}(T)/T of a minimax winner. On sequential decision problems of horizon the horizon, the number of steps in a trajectory with action set the set of actions available at each step, running the multiplicative-weights learner: pt+1(i)∝exp⁡(−η∑τ≤tℓτ(i))p_{t+1}(i)\propto\exp\big(-\eta\sum_{\tau\le t}\ell_\tau(i)\big), so the weight on each choice decays exponentially in that choice's cumulative loss; with nn choices, losses in [0,1][0,1] and a tuned step η\eta, its regret is O(Tlog⁡n)O(\sqrt{T\log n}) (Freund and Schapire, 1997) at every history gives Reg(T)=O(HTlog⁡∣A∣)\mathrm{Reg}(T)=O(H\sqrt{T\log|\mathcal A|}).

(d) Reward-based methods can miss it (Swamy et al., Theorem 2.4). Even with three responses and a uniform reference policy, there is a preference whose minimax winner is returned by neither KL-regularized maximization of a Bradley-Terry reward nor direct preference optimization: fits the policy directly with the Bradley-Terry likelihood of the comparisons, using the log-ratio βlog⁡(π/πref)\beta\log(\pi/\pi_{\rm ref}) as the implicit reward (Rafailov et al., 2023). Reading note: Direct preference optimization.

Consequences and limits. When raters disagree, the target is a mixture whose weights move smoothly with the population shares. Reward maximization instead jumps from one response to another as group sizes cross equality (Step 1). Optimizing pairwise preferences removes the intermediate reward model, so a preference model or judge plugs straight in. The extra cost is a second sample per update: Nash-MD compares each response against the mixed opponent, and SPO compares it against the current policy.

On Reddit summarization, a policy-gradient version of Nash-MD beats RLHF, self-play, and a best response to the reference under a larger model judge (Step 6). On control benchmarks (Step 10), SPO recovers mixed equilibria that an online reward model misses and solves non-Markovian preferences. When labels are randomly flipped, however, it can lose to a reward model.

Both theories leave gaps to practice. Nash-MD's bound assumes exact tabular updates, whereas Nash-MD-PG takes one gradient step and mixes policies token by token instead of at the sequence level (Step 5). SPO's bound assumes an exact no-regret learner, whereas practical SPO uses an RL optimizer with a finite sample queue (Step 8). The summarization experiment is a single model-judged task with no human raters and separately tuned KL weights, presented as an illustration. SPO was not tested on language models. Munos et al. also note that IPO (identity preference optimization; Azar et al., 2024), a DPO-like loss that regresses the policy's log-ratio margin between two responses toward a fixed target, trained here on pairs sampled from the current policy. Reading note: Direct preference optimization (Calandriello et al., 2024) approximates the unmixed self-play case of Nash-MD.

Step 1

A single reward cannot represent a split population, and its optimum jumps between answers. Take three responses y1,y2,y3y_1,y_2,y_3 and three rater types. Type 1 always prefers y2y_2 to y1y_1, type 2 always prefers y1y_1 to y3y_3, and type 3 always prefers y3y_3 to y2y_2. Each type is indifferent (probability 12\tfrac{1}{2}) on the other pairs. Give the types population shares 13−s\tfrac{1}{3}-s, 13+s2\tfrac{1}{3}+\tfrac{s}{2}, and 13+s2\tfrac{1}{3}+\tfrac{s}{2} for a the change in the shares of the three rater types, which are 13−s\tfrac{1}{3}-s, 13+s2\tfrac{1}{3}+\tfrac{s}{2} and 13+s2\tfrac{1}{3}+\tfrac{s}{2}, with ∣s∣≤13|s|\le\tfrac{1}{3}; at s=0s=0 the types are equally common with ∣s∣≤13|s|\le\tfrac{1}{3}. Pooling across types yieldsP(y2≻y1)=23−s2,P(y1≻y3)=23+s4,P(y3≻y2)=23+s4,\begin{aligned}P(y_2\succ y_1)&=\tfrac{2}{3}-\tfrac{s}{2},\\P(y_1\succ y_3)&=\tfrac{2}{3}+\tfrac{s}{4},\\P(y_3\succ y_2)&=\tfrac{2}{3}+\tfrac{s}{4},\end{aligned}which forms a strict cycle whenever s<13s\lt\tfrac{1}{3}.

A short balance condition gives the equilibrium for any three-way cycle (derived here). Write mij=P(yi≻yj)−12m_{ij}=P(y_i\succ y_j)-\tfrac{1}{2} for the margin of the duel that yiy_i wins. Against an interior equilibrium π∗\pi^*, every response must tie at 12\tfrac{1}{2}, or shifting mass onto a higher-winning response would beat π∗\pi^*. Because each response enters only two duels, its winning and losing contributions must balance:y1:  π∗(y3) m13=π∗(y2) m21,y2:  π∗(y1) m21=π∗(y3) m32,π∗∝(m32, m13, m21)=(16+s4, 16+s4, 16−s2).\begin{aligned}y_1:&\ \ \pi^*(y_3)\,m_{13}=\pi^*(y_2)\,m_{21},\\y_2:&\ \ \pi^*(y_1)\,m_{21}=\pi^*(y_3)\,m_{32},\\\pi^*&\propto(m_{32},\,m_{13},\,m_{21})\\&=\big(\tfrac{1}{6}+\tfrac{s}{4},\ \tfrac{1}{6}+\tfrac{s}{4},\ \tfrac{1}{6}-\tfrac{s}{2}\big).\end{aligned}Each response gets weight proportional to the margin of the duel it sits out, rising when the response it beats wins its own duel by more. Here the three margins sum to 12\tfrac{1}{2}, so normalizing doubles them to π∗=(13+s2,13+s2,13−s)\pi^*=(\tfrac{1}{3}+\tfrac{s}{2},\tfrac{1}{3}+\tfrac{s}{2},\tfrac{1}{3}-s) for ∣s∣≤13|s|\le\tfrac{1}{3} (Munos et al.; checked numerically here). The equilibrium weights move linearly with ss.

By contrast, a Bradley-Terry fit ranks y1y_1 first for s>0s\gt0 and y2y_2 first for s<0s\lt0. At s=0.1s=0.1 the fitted rewards are 00, −0.20-0.20, and −0.10-0.10 for y1,y2,y3y_1,y_2,y_3, with the mirror image at s=−0.1s=-0.1 (computed here). Maximizing that reward without a penalty puts all mass on y1y_1 for s>0s\gt0 and jumps discontinuously to y2y_2 for s<0s\lt0.

Step 2

A Bradley-Terry reward fitted on one policy's samples reproduces only the win rates against that policy. Even without a cycle, a reward model trained on one policy's outputs goes stale once the policy moves. Draw pairs (y,y′)(y,y') i.i.d. from a policy π\pi, and let the Bradley-Terry reward that best fits comparisons of pairs sampled from π\pi maximize the expected cross-entropy log-likelihood L(r)L(r) of observed choices. Write the preference implied by the fitted reward, PBTπ(y≻y′)=σ(rπ(y)−rπ(y′))P^\pi_{\rm BT}(y\succ y')=\sigma(r^\pi(y)-r^\pi(y'))(y≻y′)=σ(rπ(y)−rπ(y′))(y\succ y')=\sigma(r^\pi(y)-r^\pi(y')) for its implied preferences. Each response zz enters both positions of a sampled pair, so setting ∂r(z)L(r)=0\partial_{r(z)}L(r)=0 gives∂r(z)L(rπ)=2π(z) (P(z≻π)−PBTπ(z≻π))=0.\begin{aligned}\partial_{r(z)}L(r^\pi)&=2\pi(z)\,\big(P(z\succ\pi)\\&\quad-P^\pi_{\rm BT}(z\succ\pi)\big)=0.\end{aligned}For every zz in π\pi's support, the fit matches zz's win rate against π\pi itself and constrains nothing else. Munos et al. show that unless PP is exactly Bradley-Terry, another sampling policy with the same support yields a different fitted reward. A preference model trained by cross-entropy on (x,y,y′)(x,y,y') avoids this bias in the population limit. With enough data and capacity, its optimum is P(y≻y′∣x)P(y\succ y'|x) regardless of the sampling policy, though finite-sample accuracy still depends on data coverage.

Step 3

The regularized game has one equilibrium, the reference tilted by win rates against the equilibrium. The payoff Pβ(π≻π′)P_\beta(\pi\succ\pi') is linear in π\pi minus β\beta times the strictly convex KL divergence. It is therefore strictly concave in π\pi and strictly convex in π′\pi', so for a continuous payoff concave in the first player's strategy and convex in the second's, over convex sets one of which is compact, sup⁡inf⁡=inf⁡sup⁡\sup\inf=\inf\sup (Sion, 1958) guarantees an equilibrium. Munos et al. prove uniqueness from strict monotonicity of the payoff gradients. Comparing two candidate strategy pairs cancels the antisymmetric preference terms through P(π≻π′)+P(π′≻π)=1P(\pi\succ\pi')+P(\pi'\succ\pi)=1. That leaves −β-\beta times a sum of KL divergences between the two pairs, which is strictly negative unless they coincide.

The equilibrium also has a closed form in terms of itself (derived here). Against a fixed opponent πβ∗\pi^*_\beta, the first player maximizes P(π≻πβ∗)−β KLρ(π∥πref)P(\pi\succ\pi^*_\beta)-\beta\,\htmlData{gr=g14}{\mathrm{KL}_\rho(\pi\|\pi_{\rm ref})}. Since this objective is a linear payoff minus a KL penalty, its unique maximizer is a the distribution π(y)∝πref(y) ef(y)/β\pi(y)\propto\pi_{\rm ref}(y)\,e^{f(y)/\beta}, which maximizes Eπf−β KL(π∥πref)\mathbb E_\pi f-\beta\,\mathrm{KL}(\pi\|\pi_{\rm ref}). Reading note: Direct preference optimization of πref\pi_{\rm ref}. At equilibrium that best response equals πβ∗\pi^*_\beta itself:πβ∗(y∣x)∝πref(y∣x)×eP(y≻πβ∗∣x)/β.\begin{aligned}\pi^*_\beta(y|x)\propto{}&\pi_{\rm ref}(y|x)\\&\times e^{P(y\succ\pi^*_\beta|x)/\beta}.\end{aligned}This matches the KL-regularized RLHF optimum, with each response's win rate against πβ∗\pi^*_\beta replacing the fixed reward. The formula is therefore a fixed-point equation (checked numerically here on a three-response example).

Step 4

Each Nash-MD step shrinks the KL divergence to the equilibrium. Everything holds prompt by prompt, so drop xx. In a cyclic game, naive self-play pushes the policy sideways around the equilibrium. Nash-MD adds an inward pull by mixing the current policy with πref\pi_{\rm ref} first. For α∈[0,1]\alpha\in[0,1], define the geometric mixtureπ(α)(y)∝π(y)1−α πref(y)α.\pi^{(\alpha)}(y)\propto\pi(y)^{1-\alpha}\,\pi_{\rm ref}(y)^{\alpha}.At step tt, Nash-MD sets α=ηtβ\alpha=\htmlData{gr=g16}{\eta_t}\beta (using 0≤ηtβ≤10\le\eta_t\beta\le1) and takes a a step that maximizes the payoff's linear gain minus a KL penalty to the current point; for distributions it multiplies each probability by the exponential of its payoff and renormalizes on the preference against that mixture:πt+1=arg⁡max⁡π ηt P(π≻πt(α))−KL(π∥πt(α)).\begin{aligned}\pi_{t+1}=\arg\max_\pi\ &\eta_t\,P(\pi\succ\pi_t^{(\alpha)})\\&-\mathrm{KL}(\pi\|\pi_t^{(\alpha)}).\end{aligned}Its closed-form solution is πt+1(y)∝πt(α)(y) eηtP(y≻πt(α))\pi_{t+1}(y)\propto\pi_t^{(\alpha)}(y)\,e^{\eta_tP(y\succ\pi_t^{(\alpha)})}.

To prove the contraction, first write πt(α)(y)=πt(y)1−απref(y)α/Z\pi_t^{(\alpha)}(y)=\htmlData{gr=g18}{\pi_t}(y)^{1-\alpha}\pi_{\rm ref}(y)^\alpha/Z. Expanding the logarithm gives KL(π∥πt(α))=(1−α)KL(π∥πt)+αKL(π∥πref)+log⁡Z\mathrm{KL}(\pi\|\pi_t^{(\alpha)})=(1-\alpha)\mathrm{KL}(\pi\|\pi_t)+\alpha\mathrm{KL}(\pi\|\pi_{\rm ref})+\log Z for any policy π\pi. Setting π=πt(α)\pi=\pi_t^{(\alpha)} solves for log⁡Z=−(1−α)KL(πt(α)∥πt)−αKL(πt(α)∥πref)\log Z=-(1-\alpha)\mathrm{KL}(\pi_t^{(\alpha)}\|\pi_t)-\alpha\mathrm{KL}(\pi_t^{(\alpha)}\|\pi_{\rm ref}). Dropping the nonpositive term −(1−α)KL(πt(α)∥πt)-(1-\alpha)\mathrm{KL}(\pi_t^{(\alpha)}\|\pi_t), since 1−α≥01-\alpha\ge0, yields the mixture inequality:KL(π∥πt(α))≤α KL(π∥πref)+(1−α) KL(π∥πt)−α KL(πt(α)∥πref).\begin{aligned}\mathrm{KL}(\pi\|\pi_t^{(\alpha)})\le{}&\alpha\,\mathrm{KL}(\pi\|\pi_{\rm ref})\\&+(1-\alpha)\,\mathrm{KL}(\pi\|\pi_t)\\&-\alpha\,\mathrm{KL}(\pi_t^{(\alpha)}\|\pi_{\rm ref}).\end{aligned}Second, apply the standard one-step mirror-ascent bound. Negative entropy is 1-strongly convex in ℓ1\ell_1 by Pinsker's inequality, the step payoffs ηtP(y≻πt(α))\eta_tP(y\succ\pi_t^{(\alpha)}) lie in [0,ηt][0,\eta_t], and P(πt(α)≻πt(α))=12P(\pi_t^{(\alpha)}\succ\pi_t^{(\alpha)})=\tfrac{1}{2}, givingKL(π∥πt+1)≤KL(π∥πt(α))+ηt(12−P(π≻πt(α)))+2ηt2.\begin{aligned}\mathrm{KL}(\pi\|\pi_{t+1})\le{}&\mathrm{KL}(\pi\|\pi_t^{(\alpha)})\\&+\eta_t\big(\tfrac{1}{2}-P(\pi\succ\pi_t^{(\alpha)})\big)\\&+2\eta_t^2.\end{aligned}

Setting π=πβ∗\pi=\pi^*_\beta and substituting the mixture inequality into the mirror-ascent bound folds the reference terms into PβP_\beta. Because α=ηtβ\alpha=\eta_t\beta, the two α KL(⋅∥πref)\alpha\,\mathrm{KL}(\cdot\|\pi_{\rm ref}) terms combine with −ηtP(πβ∗≻πt(α))-\eta_tP(\pi^*_\beta\succ\pi_t^{(\alpha)}) to form −ηtPβ(πβ∗≻πt(α))-\eta_tP_\beta(\pi^*_\beta\succ\pi_t^{(\alpha)}):Dt+1≤(1−α) Dt+ηt(12−Pβ(πβ∗≻πt(α)))+2ηt2.\begin{aligned}D_{t+1}\le{}&(1-\alpha)\,\htmlData{gr=g19}{D_t}\\&+\eta_t\big(\tfrac{1}{2}-P_\beta(\pi^*_\beta\succ\pi_t^{(\alpha)})\big)\\&+2\eta_t^2.\end{aligned}At equilibrium, Pβ(πβ∗≻π′)≥Pβ(πβ∗≻πβ∗)=12P_\beta(\pi^*_\beta\succ\pi')\ge P_\beta(\pi^*_\beta\succ\pi^*_\beta)=\tfrac{1}{2} for every π′\pi', so the middle term is at most 00. That yields the recursion of result (b), and induction with ηt=2/(β(t+2))\eta_t=2/(\beta(t+2)) gives DT≤8/(β2(T+1))D_T\le8/(\beta^2(T+1)). Without regularization, online mirror descent against πt\pi_t guarantees only the average iterate, because the iterates of such dynamics circle the equilibrium and discrete steps drift outward. Likewise, each player plays the strategy that does best against the average of the opponent's past strategies; in two-player zero-sum games those averages converge to an equilibrium (Robinson, 1951) mixes over all past policies, which requires storing them. Nash-MD pulls iterates inward to πβ∗\pi^*_\beta while storing only the current policy and πref\pi_{\rm ref}.

Step 5

Nash-MD-PG is a policy gradient against a sample from a mixed opponent. Exact mirror ascent over all sequences is intractable for a language model πθ\pi_\theta. Nash-MD-PG instead takes one policy-gradient step per prompt xx. It samples a response from the policy being trained, πθ\pi_\theta, a language model with parameters θ\theta and a second response y′y' from a token-by-token mixture of πθ\pi_\theta and πref\pi_{\rm ref}. At each position, the opponent averages the two models' logits with weights 1−α1-\alpha and α\alpha and samples from the softmax. The update moves θ\theta alongg^=∇θlog⁡πθ(y∣x)(P(y≻y′∣x)−12−βlog⁡πθ(y∣x)πref(y∣x)).\begin{aligned}\hat g={}&\nabla_\theta\log\pi_\theta(y|x)\Big(\htmlData{gr=g8}{P(y\succ y'|x)}-\tfrac{1}{2}\\&-\beta\log\frac{\pi_\theta(y|x)}{\pi_{\rm ref}(y|x)}\Big).\end{aligned}Subtracting 12=P(y≻y∣x)\tfrac{1}{2}=P(y\succ y|x) acts as a constant baseline that leaves the expected gradient unchanged without a value model. With online raters, a single binary judgment (11 or 00) can replace P(y≻y′∣x)P(y\succ y'|x). The KL term points to πref\pi_{\rm ref} rather than πθ(α)\pi_\theta^{(\alpha)}. Holding the mixture fixed, ∇θKL(πθ∥πθ(α))=α ∇θKL(πθ∥πref)\nabla_\theta\mathrm{KL}(\pi_\theta\|\pi_\theta^{(\alpha)})=\alpha\,\nabla_\theta\mathrm{KL}(\pi_\theta\|\pi_{\rm ref}), so one gradient step toward the mixture is just a rescaled step toward the reference, and α\alpha is tuned apart from β\beta.

At α=0\alpha=0, Nash-MD-PG reduces to self-play against πθ\pi_\theta, and at α=1\alpha=1 to a best response against πref\pi_{\rm ref}. Token-by-token logit mixing differs from Step 4's sequence-level geometric mixture because each token's normalizer depends on the prefix; the authors leave that gap unanalyzed. They also test Nash-EMA-PG, which replaces the mixed opponent with an exponential moving average of past parameters as a cheap proxy for fictitious play.

Step 6

On summarization, Nash-MD-PG with a small mixing weight beats RLHF, self-play, and the best response to the reference. On TL;DR Reddit summarization (Stiennon et al., 2020), Munos et al. train a the 3-billion-parameter T5 encoder-decoder language model as trained with Google's T5X library; T5X-L, the size used for the policies, has about 0.8 billion (3B) preference model alongside a same-size reward model. On held-out high-confidence comparisons, the preference model agrees with human raters about 78% of the time and the reward model about 76%. All policies are T5X-L models initialized from a supervised model (πref\pi_{\rm ref}). Separate sweeps pick β=0.05\beta=0.05 for RLHF and β=0.008\beta=0.008 for every Nash variant. PaLM 2 Large judges pairwise win rates over 2,000 samples per pair (95% confidence interval at most ±0.023\pm0.023), with no human evaluation.

RLHF beats the supervised model in 99.0% of comparisons, the highest rate against πref\pi_{\rm ref}. Among trained policies, Nash-MD-PG at α=0.125\alpha=0.125 beats every competitor, winning 59.8% against RLHF and 59.2% against self-play. Against RLHF, win rate peaks at an interior α\alpha. It sits at 48.9% for self-play (α=0\alpha=0), stays above 50% from α=0.125\alpha=0.125 through α=0.5\alpha=0.5, and falls to 14.8% at α=1\alpha=1 (best response to πref\pi_{\rm ref}). That best response beats the supervised model only 94.3% of the time, the lowest among trained policies. The authors suggest it may be overfitting the preference model against one fixed opponent. Nash-EMA-PG wins at most 51.0% against RLHF.

Step 7

One learner suffices because a policy beats itself exactly half the time. Without KL regularization, iterates do not contract to a single point, so Swamy et al. target an unregularized minimax winner with no-regret learning. For losses ℓt(p)=−P(p≻pt)\ell_t(p)=-P(p\succ p_t), the regret bound reads ∑t=1Tℓt(pt)−min⁡p∑t=1Tℓt(p)≤Reg(T)\sum_{t=1}^T\ell_t(p_t)-\min_p\sum_{t=1}^T\ell_t(p)\le\mathrm{Reg}(T). Since every policy ties itself, ℓt(pt)=−P(pt≻pt)=−12\ell_t(p_t)=-P(p_t\succ p_t)=-\tfrac{1}{2} in every round. Comparing against any fixed policy π\pi gives (derived here)∑t=1TP(π≻pt)−T2≤Reg(T),P(π≻pˉ)≤12+Reg(T)/T.\begin{aligned}\textstyle\sum_{t=1}^TP(\pi\succ p_t)-\tfrac{T}{2}&\le\mathrm{Reg}(T),\\P(\pi\succ\bar p)&\le\tfrac{1}{2}+\mathrm{Reg}(T)/T.\end{aligned}Dividing by TT and using linearity in pˉ=1T∑t=1Tpt\bar p=\tfrac{1}{T}\sum_{t=1}^Tp_t yields the second line, proving result (c).

Swamy et al. derive the same bound through a two-player game. Two identical copies of a deterministic no-regret learner see the same losses by antisymmetry, so their iterates coincide forever and Freund and Schapire's two-player bound applies. Either way, the guarantee covers the average pˉ\bar p, which is itself a single policy because Π\Pi is convex. Under bandit feedback (one comparison per round instead of the full loss), importance-weighted losses as in exponential weights for bandit feedback: Hedge run on loss estimates that divide each observed loss by the probability of the choice that produced it (Auer et al., 2002). Reading note: Adversarial and corrupted bandits keep the rate at O~(1/T)\tilde O(1/\sqrt{T}).

Step 8

In practice the reward is each sample's win rate against other samples. On sequential tasks, an HH-step policy over actions A\mathcal A produces a the sequence of states and actions of one episode; for a language model, a response, and preferences compare whole trajectories, P(ξ≻ξ′)P(\xi\succ\xi'). Running Hedge over the full policy class is then intractable. Swamy et al. assign each trajectory the round-tt reward rt(ξ)r_t(\xi)=P(ξ≻πt){}=P(\xi\succ\pi_t) and run Hedge at every history on the resulting advantages. That update is at every state, πt+1(a∣s)∝πt(a∣s) eηAt(s,a)\pi_{t+1}(a|s)\propto\pi_t(a|s)\,e^{\eta A_t(s,a)} with AtA_t the current policy's advantage: Hedge on the advantages. The J(π)−J(π′)=∑hEsh∼πEa∼πAπ′(sh,a)J(\pi)-J(\pi')=\sum_h\mathbb E_{s_h\sim\pi}\mathbb E_{a\sim\pi}A^{\pi'}(s_h,a): the gap in return is the advantage, under π′\pi', of π\pi's actions, summed over the states π\pi visits then turns the per-history regrets into Reg(T)=O(HTlog⁡∣A∣)\mathrm{Reg}(T)=O(\htmlData{gr=g25}{H}\sqrt{T\log|\mathcal A|}). Because θ←θ+ηF(θ)−1∇θJ(θ)\theta\leftarrow\theta+\eta F(\theta)^{-1}\nabla_\theta J(\theta), with F(θ)=E[∇θlog⁡πθ ∇θlog⁡πθ⊤]F(\theta)=\mathbb E[\nabla_\theta\log\pi_\theta\,\nabla_\theta\log\pi_\theta^\top] the Fisher information of the policy: policy gradient preconditioned so that each step is measured in KL divergence instead of parameter distance (Kakade, 2001) coincides with soft policy iteration for suitable parameterizations, PPO, TRPO, or SAC can stand in for it.

Practical SPO avoids evaluating P(ξ≻πt)P(\xi\succ\pi_t) exactly by estimating win rates from recent samples. On control tasks, SPO samples ξt∼πt\xi_t\sim\pi_t and scores the trajectory by its win rate against a queue of the the number of recent trajectories kept in SPO's queue; 10 to 1,000 in the experiments most recent trajectories. It splits that score equally across the HH steps, which leaves the optimal policies unchanged, and passes the labeled transitions to the RL optimizer. For prompted tasks, a shared queue would mix unrelated prompts. Instead, SPO samples the number of responses sampled per prompt, at least 2≥2{}\ge2 responses per prompt xx and rewards each by its win rate against the others:r(yi)=1k−1∑j≠iP(yi≻yj∣x).r(y_i)=\frac{1}{k-1}\sum_{j\ne i}P(y_i\succ y_j|x).

Under a separation condition, Hedge-based SPO converges faster than 1/T1/\sqrt{T}. Suppose one set of policies beats every outside policy by at least a why: with this gap the learner's weight on the losing policies decays geometrically, which gives the faster rate; the paper states the margin on its [−1,1][-1,1] preference scale, its members stay within Δ/2\Delta/2 of each other, and the remaining policies stay within Δ\Delta of each other. Then SPO reaches a minimax winner within O~(∣Π∣/(ΔT))\tilde O(|\htmlData{gr=g21}{\Pi}|/(\Delta T)). That faster 1/T1/T rate costs linear dependence on ∣Π∣|\Pi|, analogous to regret bounds of order log⁡T/Δ\log T/\Delta for each worse option, Δ\Delta its gap to the best: small when the gaps are wide. Reading note: UCB and Thompson sampling for UCB.

Step 9

Reward-based RLHF and DPO miss the minimax winner even with three responses. Take responses a,b,ca,b,c with P(a≻b)=0.7P(a\succ b)=0.7, P(b≻c)=1P(b\succ c)=1, and P(c≻a)=1P(c\succ a)=1. The duels each response sits out have margins 0.50.5, 0.50.5, and 0.20.2, so Step 1's cycle rule gives the minimax winner (512,512,16)(\tfrac{5}{12},\tfrac{5}{12},\tfrac{1}{6}) (checked here). Under a uniform reference, KL-regularized maximization of any reward rr returns π∝er/β\pi\propto e^{r/\beta}. Because that tilt preserves rr's order, matching the minimax winner requires r(a)=r(b)>r(c)r(a)=r(b)\gt r(c). Step 2 fixes the ranking of a Bradley-Terry fit on uniform pairs without solving for the scores. The fit must match each response's uniform win rate: 13(12+0.7+0)=0.40\tfrac{1}{3}(\tfrac{1}{2}+0.7+0)=0.40 for aa, 0.600.60 for bb, and 0.500.50 for cc. Because a Bradley-Terry reward orders responses by that win rate, its tilted policy places bb above cc above aa for every β\beta. The exact fit gives rewards 00, 0.830.83, and 0.420.42 for a,b,ca,b,c (computed here), whereas Swamy et al. argue from the asserted reward (0,1,0)(0,1,0).

DPO fails on the same example. Swamy et al. show that the uniform policy has a lower expected DPO loss than the minimax winner for every β\beta, so DPO never returns the minimax winner either. Swamy et al. add one qualification. If preferences are collected on-policy and the reward model is refit frequently, iterative RLHF tracks SPO's changing win-rate rewards and may reach the minimax winner on average.

Step 10

On control tasks SPO finds minimax winners that a reward model misses, and is less robust to flipped labels. Swamy et al. compare SPO with an online giving a reward to each step for its state and action, so a trajectory's score is the sum over its steps Bradley-Terry reward model (RM) trained on replay-buffer comparisons. Both query the preference function online under the same policy optimizer (PPO on discrete tasks, SAC on continuous control), differing only in how they compute trajectory rewards. On three-group cyclic discrete tasks (PPO, 50 million steps), SPO's average action frequencies stay within total variation 0.000.00 to 0.020.02 of the closed-form minimax winner. RM's average action frequencies land 0.070.07 to 0.630.63 away, typically collapsing near one option. In a a simulated four-legged robot in the MuJoCo physics engine, a standard continuous-control task task with a cyclic preference over the angle of the final position around the origin, SPO's endpoints sweep full circles at radius about 1010, as the minimax winner requires.

On DeepMind Control tasks where preferences reflect true return, SPO matches or beats RM in sample efficiency. With labels flipped at probability 0.10.1 to 0.40.4, SPO matches RM on some tasks and fares noticeably worse on others. RM averages over many labels, whereas SPO uses each noisy comparison directly. On a non-Markovian task that maximizes total return while keeping the last quarter's reward below rmax⁡r_{\max}, SPO consistently exceeds 4rmax⁡4r_{\max}. Passing that threshold requires changing behavior late in the episode, and RM often falls short. The evidence consists of 10-seed training curves with standard errors (no summary table), and Swamy et al. run no language-model experiment.

Terms

Preference model
P(y≻y′∣x)P(y\succ y'|x) from two responses, fitted by cross-entropy; no Bradley-Terry assumption
Minimax winner
π∗∈arg⁡max⁡πmin⁡π′P(π≻π′)\pi^*\in\arg\max_\pi\min_{\pi'}P(\pi\succ\pi'); a symmetric Nash equilibrium, possibly a mixture
Regularized game
Pβ(π≻π′)=P(π≻π′)−βKLρ(π∥πref)+βKLρ(π′∥πref)P_\beta(\pi\succ\pi')=P(\pi\succ\pi')-\beta\mathrm{KL}_\rho(\pi\|\pi_{\rm ref})+\beta\mathrm{KL}_\rho(\pi'\|\pi_{\rm ref}); unique equilibrium
Regularized equilibrium
πβ∗∝πref eP(y≻πβ∗)/β\pi^*_\beta\propto\pi_{\rm ref}\,e^{P(y\succ\pi^*_\beta)/\beta}, the reference tilted by its own win rate
Bradley-Terry fit
matches each response's win rate against the sampling policy, and nothing more
Nash-MD
mirror ascent against πt(ηtβ)\pi_t^{(\eta_t\beta)}; KL(πβ∗∥πT)≤8/(β2(T+1))\mathrm{KL}(\pi^*_\beta\|\pi_T)\le8/(\beta^2(T+1))
Nash-MD-PG
∇log⁡πθ(y∣x) (P(y≻y′∣x)−12−βlog⁡πθ/πref)\nabla\log\pi_\theta(y|x)\,(P(y\succ y'|x)-\tfrac{1}{2}-\beta\log\pi_\theta/\pi_{\rm ref}), y′y' from the token-wise mixture
SPO
one no-regret learner with loss −P(p≻pt)-P(p\succ p_t); P(π≻pˉ)≤12+Reg(T)/TP(\pi\succ\bar p)\le\tfrac{1}{2}+\mathrm{Reg}(T)/T
SPO reward
win rate against a queue of recent samples, or against the other k−1k-1 responses to the same prompt
Summarization result
α=0.125\alpha=0.125 beats RLHF 59.8% under a PaLM 2 judge (±0.023\pm0.023); self-play 48.9%, best response 14.8%
Control results
SPO within total variation 0.02 of the minimax winner, RM up to 0.63; SPO worse than RM on some tasks with flipped labels

Sources

Connected notes

  • Direct preference optimizationLearning from human preferences · Exponential tilting

    Without the KL term the best policy puts all its mass on one sequence; with it the target is πrefer/β/Z\pi_{\rm ref}e^{r/\beta}/Z, which puts mass on exactly the sequences the reference model gives mass to and moves toward the best sequences as β\beta falls.

  • At λ=1\lambda=1 GAE is the observed return minus V(st)V(s_t), so the value model is only a baseline, while lower λ\lambda makes the advantage rely on its predictions; reward falls in order as λ\lambda goes from 1 to 0, so the bias this adds buys no useful drop in variance.

  • Classifier-confidence distillation collapses images onto typical prototypes and attraction-only drifting reduces to mean shift on density peaks (FID 177 against 8.5), while adding repulsion between synthetic views spreads ten images across each class and raises SigLIP2 coverage from under 10% to 77.0%.

  • In a PAC-Bayes bound the KL from posterior to prior is the complexity term, and a Gaussian prior centered at the initialization makes it grow with how precisely the weights are specified and how far they move in training.

Threads