LLM Post-Training Alignment, Preference Optimization, and Reinforcement Learning for Reasoning in 2026: InstructGPT RLHF & PPO, DPO, ORPO & SimPO, Process Reward Models (PRM800K), and Group Relative Policy Optimization (GRPO)

Autoregressive pre-training over trillions of internet tokens equips foundation language models with broad world knowledge, syntactic fluency, and latent pattern-completion capabilities by optimizing the standard causal cross-entropy objective $\mathcal{L}{\text{PT}}(\theta) = -\sum{t=1}^{T} \log \pi_\theta(x_t \mid x_{<t})$. However, raw next-token prediction over uncurated web text is fundamentally misaligned with human intent: a pre-trained base model cannot distinguish between completing a prompt with a helpful, factual solution versus continuing a noisy forum thread, fabricating citations, or generating toxic text (arXiv:2203.02155, arXiv:2305.18290). As Ouyang et al. demonstrated in the landmark InstructGPT study (arXiv:2203.02155), scaling model parameters alone does not resolve this objective mismatch—human evaluators preferred outputs from an aligned $1.3\text{B}$-parameter InstructGPT (PPO-ptx) model over a $175\text{B}$-parameter base GPT-3 model despite a $100\times$ parameter disadvantage, while at the $175\text{B}$ scale InstructGPT achieved an $85 \pm 3\%$ win rate against base GPT-3 and a $71 \pm 4\%$ win rate against few-shot prompted GPT-3, cutting closed-domain hallucination rates nearly in half from $41\%$ to $21\%$.

Between 2022 and 2026, the post-training alignment and reasoning stack evolved through four major mathematical and systems engineering transformations—moving from multi-model online actor-critic pipelines to closed-form implicit-reward preference optimization, monolithic reference-free objectives, step-level process verification, and critic-free group-relative reinforcement learning for long-horizon chain-of-thought reasoning:

  1. Three-Stage RLHF, Bradley-Terry Pairwise Ranking, and PPO-ptx (InstructGPT, arXiv:2203.02155; PPO, arXiv:1707.06347): Classical Reinforcement Learning from Human Feedback (RLHF) first adapts a base model via Supervised Fine-Tuning (SFT) on human demonstrations ($12,725$ training prompts in InstructGPT), then trains a scalar Reward Model (RM) ($6\text{B}$ parameters across $33,207$ prompts with $K \in [4, 9]$ ranked completions per prompt, evaluated in a single forward pass across all $\binom{K}{2}$ pairs to prevent single-epoch overfitting), and finally optimizes the policy $\pi_\phi^{\text{RL}}$ via Proximal Policy Optimization (PPO) across $31,144$ API prompts with a per-token Kullback-Leibler (KL) divergence penalty $-\beta \log(\pi_\phi^{\text{RL}}(y \mid x) / \pi^{\text{SFT}}(y \mid x))$ and pre-training log-likelihood gradient mixing ($\gamma \mathbb{E}{x \sim \mathcal{D}{\text{pretrain}}}[\log \pi_\phi^{\text{RL}}(x)]$, termed PPO-ptx) to eliminate the "alignment tax" on public NLP benchmarks.
  2. Closed-Form Change-of-Variables & Implicit Reward Extraction (DPO, arXiv:2305.18290): Running online PPO requires simultaneously holding four large models in GPU High-Bandwidth Memory (HBM)—the active policy (actor) $\pi_\theta$, the value network (critic) $V_\psi$, the reward model $r_\phi$, and the frozen reference policy $\pi_{\text{ref}}$—while performing autoregressive rollout sampling inside the training loop. In Direct Preference Optimization (DPO), Rafailov et al. (arXiv:2305.18290) prove that the analytical optimal policy $\pi_r(y \mid x) = \frac{1}{Z(x)}\pi_{\text{ref}}(y \mid x)\exp(\frac{1}{\beta}r(x, y))$ of the KL-constrained RLHF objective can be algebraicly inverted to express the ground-truth reward directly in terms of the optimal policy: $r(x, y) = \beta \log \frac{\pi_r(y \mid x)}{\pi_{\text{ref}}(y \mid x)} + \beta \log Z(x)$. Substituting this reparameterization into the Bradley-Terry preference model cancels the intractable partition function $Z(x)$ exactly, turning RLHF into a single-stage binary cross-entropy loss over offline preference pairs $(x, y_w, y_l)$ that dominates PPO on the reward-KL frontier and elevates out-of-distribution CNN/DailyMail summarization win rates vs. ground truth from $0.26$ (PPO) to $0.36$ (DPO) at temperature $0.0$.
  3. Reference-Free Monolithic & Length-Normalized Preference Alignment (ORPO, arXiv:2403.07691; SimPO, arXiv:2405.14734): Standard DPO still requires a separate SFT warm-up stage, keeps a frozen reference model $\pi_{\text{ref}}$ in memory, and exhibits a fundamental mismatch between its training reward $\beta \log(\pi_\theta / \pi_{\text{ref}})$ and the length-normalized average log-likelihood metric $p_\theta(y \mid x) = \frac{1}{|y|}\log \pi_\theta(y \mid x)$ used during inference—causing roughly $50\%$ of DPO-trained preference triples to violate $p_\theta(y_w \mid x) > p_\theta(y_l \mid x)$ (arXiv:2405.14734, Section 2.2). Odds Ratio Preference Optimization (ORPO) eliminates both the SFT warm-up phase and $\pi_{\text{ref}}$ by appending a log-odds ratio penalty $\mathcal{L}{\text{OR}} = -\log \sigma(\log \frac{\mathbf{odds}\theta(y_w \mid x)}{\mathbf{odds}\theta(y_l \mid x)})$ directly to the NLL loss $\mathcal{L}{\text{SFT}}$, reaching $12.20\%$ on AlpacaEval 2.0, $66.19\%$ on IFEval, and $7.32$ on MT-Bench with Mistral-ORPO-7B. Simple Preference Optimization (SimPO, NeurIPS 2024) uses the length-normalized sequence log-probability $r_{\text{SimPO}}(x, y) = \frac{\beta}{|y|}\log \pi_\theta(y \mid x)$ directly as a reference-free implicit reward and introduces a target reward margin $\gamma > 0$ into the Bradley-Terry objective, outperforming DPO by up to $+6.4$ points on AlpacaEval 2 and $+7.5$ points on Arena-Hard, and lifting Gemma-2-9B-it-SimPO to a $72.4\%$ Length-Controlled (LC) win rate on AlpacaEval 2 and $59.1\%$ win rate on Arena-Hard.
  4. Step-Level Process Supervision (PRM800K, arXiv:2305.20050) & Critic-Free Group Relative Policy Optimization (DeepSeekMath GRPO, arXiv:2402.03300; DeepSeek-R1, arXiv:2501.12948): While offline preference optimization excels at stylistic alignment and instruction following, complex multi-step mathematical, scientific, and algorithmic reasoning requires granular credit assignment and online exploration. Lightman et al. (arXiv:2305.20050) built PRM800K ($800,000$ step-level human feedback labels across $75,000$ solutions to $12,000$ MATH problems), proving that a Process-Supervised Reward Model (PRM) scoring the product of per-step correctness probabilities solves $78.2\%$ of representative MATH test problems under best-of-$1,860$ search (versus $72.4\%$ for an Outcome-Supervised Reward Model (ORM) and $69.6\%$ for majority voting) while achieving $2.6\times$ higher data efficiency via active learning on "convincing wrong-answer" solutions. Finally, Group Relative Policy Optimization (GRPO) (arXiv:2402.03300) eliminates PPO's memory-heavy value critic $V_\psi$ completely by sampling a group of $G$ trajectories $\{o_1, \dots, o_G\} \sim \pi_{\theta_{\text{old}}}(O \mid q)$ per prompt and computing standardized group-relative advantages $\hat{A}{i,t} = (r_i - \operatorname{mean}(\mathbf{r})) / \operatorname{std}(\mathbf{r})$ with a positive unbiased KL estimator $\mathbb{D}{\text{KL}}(\pi_\theta \parallel \pi_{\text{ref}}) = \frac{\pi_{\text{ref}}}{\pi_\theta} - \log \frac{\pi_{\text{ref}}}{\pi_\theta} - 1$. Scaled to $671\text{B}$ total / $37\text{B}$ active MoE parameters in DeepSeek-R1-Zero and DeepSeek-R1 (arXiv:2501.12948), pure rule-based GRPO lifts AIME 2024 pass@1 from $15.6\%$ to $71.0\%$ ($86.7\%$ with cons@64) without a single human-labeled reasoning trajectory, while the multi-stage DeepSeek-R1 pipeline reaches $79.8\%$ pass@1 on AIME 2024, $97.3\%$ on MATH-500, $2,029$ Elo (96.3 percentile) on Codeforces, and $87.6\%$ LC win rate on AlpacaEval 2.0.
Three-Stage Reinforcement Learning from Human Feedback (RLHF) Architecture Diagram Showing Supervised Fine-Tuning (SFT), Pairwise Human Preference Reward Model (RM) Training, and Proximal Policy Optimization (PPO) Policy Updates

Three-Stage Reinforcement Learning from Human Feedback (RLHF) Architecture Diagram Showing Supervised Fine-Tuning (SFT), Pairwise Human Preference Reward Model (RM) Training, and Proximal Policy Optimization (PPO) Policy Updates

This architectural deep dive examines the complete mathematical derivations, loss gradients, memory topologies, production PyTorch implementations, and empirical benchmark results across SFT, RLHF (PPO-ptx), DPO, ORPO, SimPO, PRM800K, and GRPO (DeepSeekMath / DeepSeek-R1).

Executive Summary: Verified Mathematical & Empirical Benchmarks Across InstructGPT (PPO-ptx), DPO, ORPO, SimPO, PRM800K & DeepSeek GRPO

  • InstructGPT 3-Stage RLHF & PPO-ptx (arXiv:2203.02155): Trained on 12,725 SFT demonstration prompts (11,295 labeler + 1,430 customer), 33,207 RM comparison prompts (ranking $K=4\text{--}9$ completions per prompt in a single $\binom{K}{2}$ batch pass), and 31,144 PPO customer prompts with $77.3 \pm 1.3\%$ inter-labeler agreement. Outputs from 1.3B InstructGPT (PPO-ptx) beat 175B GPT-3 ($>100\times$ larger); 175B InstructGPT beats base 175B GPT-3 85 ± 3% of the time and few-shot GPT-3 71 ± 4% of the time, achieves a 73.4 ± 2% win rate vs. SFT (compared to 26.8 ± 2% for T0 and 29.8 ± 2% for FLAN), cuts closed-domain hallucinations from 41% to 21%, doubles TruthfulQA truthfulness, and reduces respectful-prompted RealToxicityPrompts toxicity by ~25%.
  • Direct Preference Optimization (DPO, arXiv:2305.18290): Eliminates explicit reward modeling and online RL rollouts via the closed-form Bradley-Terry policy reparameterization $\mathcal{L}_{\text{DPO}}(\pi_\theta; \pi_{\text{ref}}) = -\mathbb{E}_{(x, y_w, y_l)}\left[\log \sigma\left(\beta \log \frac{\pi_\theta(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)} - \beta \log \frac{\pi_\theta(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)}\right)\right]$. Weighting gradients by the implicit reward error $\sigma(\hat{r}_\theta(x, y_l) - \hat{r}_\theta(x, y_w))$ prevents policy degeneration, dominates PPO on the IMDb sentiment reward-KL frontier across target $\text{KL} \in \{3, 6, 9, 12\}$, is the only method to beat human-chosen responses on Anthropic-HH dialogue, and outperforms PPO out-of-distribution on CNN/DailyMail summarization (0.36 vs. 0.26 GPT-4 win rate at $T=0$; 0.31 vs. 0.23 at $T=0.25$).
  • Reference-Free Alignment (ORPO, arXiv:2403.07691; SimPO, arXiv:2405.14734): ORPO combines $\mathcal{L}_{\text{SFT}} + \lambda \mathcal{L}_{\text{OR}}$ in a single monolithic stage without $\pi_{\text{ref}}$, achieving up to 79.4% / 85.8% win rates over PPO on HH-RLHF / UltraFeedback and lifting Mistral-ORPO-7B to 12.20% AlpacaEval 2.0, 66.19% IFEval, and 7.32 MT-Bench. SimPO replaces the reference ratio with length-normalized average log-probability $\frac{\beta}{|y|}\log \pi_\theta(y \mid x)$ and target reward margin $\gamma > 0$, lifting Mistral-Base-7B AlpacaEval 2 LC win rate from 15.1% (DPO) to 21.5% (SimPO), Llama-3-8B-Instruct from 40.3% (DPO) to 44.7% (SimPO) / 53.7% (SimPO-v0.2), and Gemma-2-9B-it-SimPO to 72.4% AlpacaEval 2 LC win rate and 59.1% Arena-Hard.
  • Process Supervision (PRM800K, arXiv:2305.20050) & Group Relative Policy Optimization (GRPO, arXiv:2402.03300, arXiv:2501.12948): Trained on 800,000 step-level labels across 75,000 solutions to 12,000 MATH problems, OpenAI's large-scale PRM reaches 78.2% on MATH (best-of-1,860) vs. 72.4% (ORM) and 69.6% (majority vote), generalizes to held-out AP/AMC STEM exams at 72.9% aggregate vs. 63.8% (ORM), and gains 2.6× data efficiency from active learning. DeepSeek's critic-free GRPO boosts DeepSeekMath-RL-7B to 86.7% on GSM8K and 58.8% on MATH (CoT), while scaling pure rule-based GRPO in DeepSeek-R1-Zero drives AIME 2024 pass@1 from 15.6% to 71.0% (86.7% cons@64) and multi-stage DeepSeek-R1 (671B/37B MoE) reaches 79.8% AIME 2024, 97.3% MATH-500, 65.9% LiveCodeBench, and 2,029 Codeforces rating.

1. The Alignment Trilemma and the Three-Stage RLHF Pipeline (InstructGPT, arXiv:2203.02155)

In "Training language models to follow instructions with human feedback" (arXiv:2203.02155), Ouyang et al. formalized the alignment objective around three core behavioral axes originally articulated by Askell et al. (2021): a language model must be helpful (accurately executing the user's explicit and implicit task instructions), honest (avoiding fabricated facts, expressing appropriate epistemic uncertainty, and staying grounded in closed-domain inputs), and harmless (refusing to generate toxic, abusive, or socially destructive content).

Verified Technical Lecture: Reinforcement Learning from Human Feedback (RLHF) Explained by IBM Technology (verified via live YouTube oEmbed HTTP 200).

1. Empirical Prompt Taxonomy and Dataset Architecture in InstructGPT

A crucial empirical insight of arXiv:2203.02155 (Section 3.2 & Table 1) is that real-world user interactions with deployed language models look very different from academic NLP classification benchmarks. When OpenAI screened and hired a team of $40$ human contractors (achieving $77.3 \pm 1.3\%$ inter-labeler agreement on held-out comparison pairs, outperforming the $73 \pm 4\%$ researcher agreement in Stiennon et al. 2020) and categorized the API prompt distribution across the Reward Model dataset, open-ended generation and brainstorming accounted for $56.8\%$ of all customer queries, whereas classification and closed-domain QA represented only $6.1\%$:

  • Generation (45.6%): Creative writing, code synthesis, structured drafting ($21,684$ prompts, mean length $130$ tokens).
  • Open QA (12.4%): Factual queries without provided reference context ($6,262$ prompts, mean length $89$ tokens).
  • Brainstorming (11.2%): Ideation and structured list generation ($5,245$ prompts, mean length $83$ tokens).
  • Chat (8.4%): Multi-turn conversational dialogue ($3,911$ prompts, mean length $386$ tokens).
  • Rewrite (6.6%): Style transfer, paraphrasing, and editing ($3,168$ prompts, mean length $183$ tokens).
  • Summarization (4.2%): Condensing user-supplied passages ($1,962$ prompts, mean length $424$ tokens).
  • Classification (3.5%) & Other (3.5%): Categorization ($1,615$ prompts) and miscellaneous requests ($1,767$ prompts).
  • Closed QA (2.6%) & Extraction (1.9%): Answering strictly from in-prompt text ($1,398$ prompts) and entity extraction ($971$ prompts).

Consequently, fine-tuning GPT-3 on compilations of academic NLP datasets such as FLAN and T0 (T0++) failed to align the model with real user queries: on the held-out customer test set ($3,196$ prompts from customers excluded from training), 175B InstructGPT (PPO-ptx) achieved a $73.4 \pm 2\%$ win rate against the 175B SFT baseline, whereas FLAN and T0 scored only $29.8 \pm 2\%$ and $26.8 \pm 2\%$, respectively (arXiv:2203.02155, Section 1 & Section 4.1).

InstructGPT Pipeline Stage (arXiv:2203.02155, Table 6 & Table 9) Train Prompts (Labeler / Customer) Validation Prompts (Labeler / Customer) Training Objective & Architectural Configuration
Stage 1: Supervised Fine-Tuning (SFT) 12,725 total (11,295 labeler / 1,430 API customer) 1,653 total (1,550 labeler / 103 API customer) 16 epochs causal NLL on human demonstrations; cosine LR decay; residual dropout 0.2; checkpoint selected by validation RM score.
Stage 2: Reward Modeling (RM, 6B Scale) 33,207 total (6,623 labeler / 26,584 API customer) 17,887 total (3,488 labeler / 14,399 API customer) 6B SFT backbone with unembedding layer replaced by scalar head $r_\theta(x, y)$; ranks $K \in [4, 9]$ outputs per prompt in one $\binom{K}{2}$ batch update.
Stage 3: RL Policy Optimization (PPO & PPO-ptx) 31,144 total (100% API customer prompts) 16,185 total (100% API customer prompts) Bandit PPO across 1.3B, 6B, and 175B models; 6B value critic initialized from RM; per-token KL penalty $\beta$ + pretraining mix $\gamma$ (PPO-ptx).
Held-Out Evaluation Test Set — 3,196 test prompts (held-out API customers) Mean prompt length 115 tokens (std 194, max 1,836); 175B PPO-ptx beats 175B GPT-3 85 ± 3% and few-shot GPT-3 71 ± 4%.

2. Stage 1 (SFT) & Stage 2 (Pairwise Bradley-Terry Reward Modeling and the $\binom{K}{2}$ Batching Invariant)

In Stage 1 (SFT), starting from pretrained GPT-3 checkpoints at $1.3\text{B}$, $6\text{B}$, and $175\text{B}$ parameters, Ouyang et al. fine-tuned on $12,725$ human-written demonstration prompts for $16$ epochs with residual dropout $0.2$ and cosine learning rate decay (arXiv:2203.02155, Section 3.5). Notably, validation cross-entropy loss begins overfitting after just $1$ epoch, yet continuing SFT training for $16$ epochs monotonically improves both downstream validation Reward Model scores and human preference ratings.

In Stage 2 (Reward Modeling), the final token-unembedding projection of the SFT model is replaced with a linear scalar projection head $r_\theta(x, y) \in \mathbb{R}$ that maps a concatenated prompt-response sequence $(x, y)$ to a scalar quality estimate at the final token (arXiv:2203.02155, Section 3.5). Importantly, OpenAI standardized exclusively on a $6\text{B}$-parameter Reward Model across all policy scales (including the $175\text{B}$ policy), finding that $175\text{B}$ RM training exhibited numerical instability and excessive memory overhead when initializing the RL value function.

Under the Bradley-Terry pairwise preference model (Bradley & Terry, 1952), the probability that human annotators judge completion $y_w$ ("winner") superior to $y_l$ ("loser") given prompt $x$ is modeled via the logistic sigmoid $\sigma(z) = (1 + e^{-z})^{-1}$ of their latent reward difference:

$$P(y_w \succ y_l \mid x) = \sigma\Big(r_\theta(x, y_w) - r_\theta(x, y_l)\Big) = \frac{1}{1 + \exp\big(-(r_\theta(x, y_w) - r_\theta(x, y_l))\big)}$$

To accelerate human annotation, labelers were presented with $K \in \{4, 5, \dots, 9\}$ candidate completions generated for the same prompt $x$ and asked to rank all $K$ responses simultaneously, yielding $\binom{K}{2} = \frac{K(K-1)}{2}$ pairwise comparisons per prompt (e.g., $\binom{4}{2} = 6$ to $\binom{9}{2} = 36$ pairs). Ouyang et al. discovered a critical $\binom{K}{2}$ batching invariant (arXiv:2203.02155, Equation 1 & Footnote 3): if all $\binom{K}{2}$ comparison pairs are naively flattened and shuffled across mini-batches, each completion $y_i$ participates in $K - 1$ separate gradient updates per epoch, causing the reward model to severely overfit within a single pass while requiring $\binom{K}{2}$ redundant forward passes per prompt. Instead, grouping all $\binom{K}{2}$ pairs from a single prompt $x$ into a single batch element requires only $K$ forward passes of the RM and completely eliminates intra-epoch overfitting:

$$\mathcal{L}{\text{RM}}(\theta) = -\frac{1}{\binom{K}{2}} \mathbb{E}{(x, y_w, y_l) \sim \mathcal{D}} \Big[\log \sigma\Big(r_\theta(x, y_w) - r_\theta(x, y_l)\Big)\Big]$$

Finally, because the pairwise difference $r_\theta(x, y_w) - r_\theta(x, y_l)$ is shift-invariant, a learned scalar bias $b_0$ is added post-training so that human-demonstration completions have an expected reward of exactly $0.0$ prior to RL optimization.

3. Stage 3 (PPO & PPO-ptx): Clipped Surrogate Policy Gradients, Per-Token KL Penalties, and Alignment Tax Mitigation

In Stage 3 (Reinforcement Learning), the autoregressive generation process is cast as a contextual bandit (or episodic token-level Markov Decision Process) where the environment presents a customer prompt $x \sim \mathcal{D}{\text{PPO}}$, the policy $\pi\phi^{\text{RL}}(y \mid x)$ generates a response $y = (y_1, \dots, y_T)$, and the episode terminates with scalar reward $r_\theta(x, y)$. If $\pi_\phi^{\text{RL}}$ maximizes $r_\theta(x, y)$ unconstrained, it rapidly exploits out-of-distribution adversarial regions of the $6\text{B}$ reward model (Goodhart's Law / reward over-optimization), collapsing into repetitive, ungrammatical token sequences.

To bound policy drift while simultaneously preventing catastrophic forgetting on standard NLP tasks (the alignment tax on SQuAD, DROP, HellaSwag, and WMT 2015 French-to-English translation), InstructGPT maximizes the combined PPO-ptx objective (arXiv:2203.02155, Equation 2):

$$\text{objective}(\phi) = \mathbb{E}{(x, y) \sim \mathcal{D}{\pi_\phi^{\text{RL}}}}\left[r_\theta(x, y) - \beta \log\left(\frac{\pi_\phi^{\text{RL}}(y \mid x)}{\pi^{\text{SFT}}(y \mid x)}\right)\right] + \gamma \mathbb{E}{x \sim \mathcal{D}{\text{pretrain}}}\Big[\log \pi_\phi^{\text{RL}}(x)\Big]$$

where $\beta > 0$ is the per-token KL divergence penalty coefficient against the frozen Stage-1 reference policy $\pi^{\text{SFT}}$, and $\gamma \ge 0$ controls the pre-training language modeling gradient coefficient ($\gamma = 0$ recovers standard PPO). At the token level $t \in \{1, \dots, |o|\}$ (arXiv:1707.06347; arXiv:2402.03300 Equations 1–2), the shaped per-token reward $r_t$ injects the KL penalty at every generation step and adds the terminal RM score at the end-of-sequence token $t = |o|$:

$$r_t = -\beta \log \frac{\pi_\phi^{\text{RL}}(o_t \mid q, o_{<t})}{\pi_{\text{ref}}(o_t \mid q, o_{<t})} + \mathbb{I}(t = |o|) \cdot r_\theta(q, o)$$

A learned $6\text{B}$ value function (critic) $V_\psi(q, o_{<t})$—initialized from the trained $6\text{B}$ Reward Model—estimates the expected cumulative return from partial prefix $(q, o_{<t})$, enabling Generalized Advantage Estimation (GAE($\gamma_{\text{RL}}, \lambda_{\text{GAE}}$)) via temporal-difference residuals $\delta_t = r_t + \gamma_{\text{RL}} V_\psi(s_{t+1}) - V_\psi(s_t)$:

$$A_t^{\text{GAE}} = \sum_{l=0}^{|o|-t} (\gamma_{\text{RL}} \lambda_{\text{GAE}})^l \delta_{t+l}$$

The actor parameters $\phi$ are updated by maximizing Schulman et al.'s PPO-Clip surrogate objective (arXiv:1707.06347, Equation 7; arXiv:2402.03300, Equation 1), which restricts the importance-sampling probability ratio $\rho_t(\phi) = \frac{\pi_\phi^{\text{RL}}(o_t \mid q, o_{<t})}{\pi_{\phi_{\text{old}}}^{\text{RL}}(o_t \mid q, o_{<t})}$ to the trust-region interval $[1 - \varepsilon, 1 + \varepsilon]$ (typically $\varepsilon = 0.2$):

$$\mathcal{J}{\text{PPO}}(\phi) = \mathbb{E}{q \sim \mathcal{P}(Q),\, o \sim \pi_{\phi_{\text{old}}}}\left[\frac{1}{|o|}\sum_{t=1}^{|o|} \min\Big(\rho_t(\phi) A_t^{\text{GAE}},\; \operatorname{clip}\big(\rho_t(\phi),\, 1-\varepsilon,\, 1+\varepsilon\big) A_t^{\text{GAE}}\Big)\right]$$


2. Direct Preference Optimization (DPO): Closed-Form Reward Reparameterization and Implicit Reward Gradients (arXiv:2305.18290)

While PPO-ptx established the viability of post-training alignment, running online actor-critic RL on foundation models imposes severe systems and algorithmic bottlenecks (arXiv:2305.18290, Section 1 & Section 3):

  1. Four-Model GPU Memory Footprint: Online PPO must keep four models resident across accelerator memory or ZeRO shards simultaneously: the trainable policy actor $\pi_\theta$, the trainable value critic $V_\psi$, the frozen reward model $r_\phi$, and the frozen reference policy $\pi_{\text{ref}}$.
  2. Autoregressive Rollout Bottleneck inside the Training Loop: At every RL iteration, $\pi_{\theta_{\text{old}}}$ must decode full token sequences autoregressively ($O(|y|)$ sequential HBM reads per batch), which is memory-bandwidth bound rather than compute-bound.
  3. Actor-Critic Variance & Hyperparameter Sensitivity: Training a token-level value critic $V_\psi(q, o_{<t})$ when the ground-truth reward $r_\phi(q, o)$ arrives only at the final token $t = |o|$ creates high-variance advantage estimates that require delicate learning-rate warmup, value-loss clipping, and KL coefficient scheduling.
Verified Technical Lecture: Direct Preference Optimization (DPO) - How to fine-tune LLMs directly without reinforcement learning by Luis Serrano Academy (verified via live YouTube oEmbed HTTP 200).

1. Mathematical Derivation of the Closed-Form DPO Objective (arXiv:2305.18290, Equations 3–7)

In "Direct Preference Optimization: Your Language Model is Secretly a Reward Model" (arXiv:2305.18290, Section 4 & Appendix A.1), Rafailov, Sharma, Mitchell, Ermon, Manning, and Finn begin with the exact same KL-constrained reward-maximization objective optimized by RLHF (arXiv:2305.18290, Equation 3):

$$\max_{\pi_\theta} \; \mathbb{E}{x \sim \mathcal{D},\, y \sim \pi\theta(y \mid x)}\Big[r(x, y)\Big] - \beta \mathbb{D}{\text{KL}}\Big[\pi\theta(y \mid x) \;\Big\|\; \pi_{\text{ref}}(y \mid x)\Big]$$

By expanding the KL divergence and rearranging terms into a Gibbs distribution, the unique global optimal policy $\pi_r(y \mid x)$ for any reward function $r(x, y)$ has an exact closed-form Boltzmann representation (arXiv:2305.18290, Equation 4):

$$\pi_r(y \mid x) = \frac{1}{Z(x)} \pi_{\text{ref}}(y \mid x) \exp\left(\frac{1}{\beta} r(x, y)\right), \qquad \text{where } Z(x) = \sum_{y} \pi_{\text{ref}}(y \mid x) \exp\left(\frac{1}{\beta} r(x, y)\right)$$

Directly evaluating $\pi_r(y \mid x)$ from a learned reward function $r_\phi(x, y)$ is computationally intractable because the partition function $Z(x)$ sums over the exponentially large space of all possible token sequences $y \in \mathcal{V}^*$. However, Rafailov et al. take the natural logarithm of both sides of Equation 4 and invert the mapping to express the reward function $r(x, y)$ analytically in terms of its optimal policy $\pi_r$, the reference policy $\pi_{\text{ref}}$, and the prompt-dependent partition function $Z(x)$ (arXiv:2305.18290, Equation 5):

$$r(x, y) = \beta \log \frac{\pi_r(y \mid x)}{\pi_{\text{ref}}(y \mid x)} + \beta \log Z(x)$$

Because the Bradley-Terry pairwise preference probability $p^(y_w \succ y_l \mid x) = \sigma(r^(x, y_w) - r^*(x, y_l))$ depends exclusively on the difference of rewards between two completions for the same prompt $x$, substituting Equation 5 into the Bradley-Terry likelihood causes the intractable log-partition term $\beta \log Z(x)$ to cancel out algebraically (arXiv:2305.18290, Equation 6):

$$r^(x, y_w) - r^(x, y_l) = \left[\beta \log \frac{\pi^(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)} + \cancel{\beta \log Z(x)}\right] - \left[\beta \log \frac{\pi^(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)} + \cancel{\beta \log Z(x)}\right]$$

$$p^(y_w \succ y_l \mid x) = \frac{1}{1 + \exp\left(\beta \log \frac{\pi^(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)} - \beta \log \frac{\pi^(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)}\right)} = \sigma\left(\beta \log \frac{\pi^(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)} - \beta \log \frac{\pi^*(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)}\right)$$

Maximum-likelihood estimation over an offline dataset of human preference triples $\mathcal{D} = \{(x^{(i)}, y_w^{(i)}, y_l^{(i)})\}_{i=1}^N$ directly yields the DPO Loss Function (arXiv:2305.18290, Equation 7):

$$\mathcal{L}{\text{DPO}}(\pi\theta; \pi_{\text{ref}}) = -\mathbb{E}{(x, y_w, y_l) \sim \mathcal{D}}\left[\log \sigma\left(\beta \log \frac{\pi\theta(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)} - \beta \log \frac{\pi_\theta(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)}\right)\right]$$

2. Mechanistic Gradient Analysis of DPO and Why Naive Probability Ratios Degenerate

Defining the implicit reward parameterized by the language model as $\hat{r}\theta(x, y) = \beta \log \frac{\pi\theta(y \mid x)}{\pi_{\text{ref}}(y \mid x)}$, differentiating $\mathcal{L}{\text{DPO}}(\pi\theta; \pi_{\text{ref}})$ with respect to $\theta$ exposes the exact credit-assignment mechanism of DPO (arXiv:2305.18290, Section 4):

$$\nabla_\theta \mathcal{L}{\text{DPO}}(\pi\theta; \pi_{\text{ref}}) = -\beta \mathbb{E}{(x, y_w, y_l) \sim \mathcal{D}}\Bigg[\underbrace{\sigma\Big(\hat{r}\theta(x, y_l) - \hat{r}\theta(x, y_w)\Big)}{\text{dynamic per-example importance weight}} \cdot \Bigg(\underbrace{\nabla_\theta \log \pi_\theta(y_w \mid x)}{\text{increase likelihood of } y_w} - \underbrace{\nabla\theta \log \pi_\theta(y_l \mid x)}_{\text{decrease likelihood of } y_l}\Bigg)\Bigg]$$

This gradient has three crucial properties proven in arXiv:2305.18290:

  1. Contrastive Likelihood Push-Pull: The inner term $\nabla_\theta \log \pi_\theta(y_w \mid x) - \nabla_\theta \log \pi_\theta(y_l \mid x)$ increases the log-probability of the preferred completion $y_w$ while decreasing the log-probability of the dispreferred completion $y_l$.
  2. Self-Regulating Margin Weighting: The scalar coefficient $\sigma(\hat{r}\theta(x, y_l) - \hat{r}\theta(x, y_w)) \in (0, 1)$ weights each preference pair proportionally to how strongly the implicit reward model currently misorders $y_l$ above $y_w$. Once $\hat{r}\theta(x, y_w) \gg \hat{r}\theta(x, y_l)$, the sigmoid factor smoothly decays toward zero, halting further aggressive suppression of $y_l$.
  3. Prevention of Unweighted Unlikelihood Collapse: In Appendix Table 3 of arXiv:2305.18290, Rafailov et al. demonstrate that removing this dynamic $\sigma(\hat{r}\theta(x, y_l) - \hat{r}\theta(x, y_w))$ importance weight (optimizing a naive probability ratio objective) causes language models to rapidly degenerate into high-entropy gibberish because pushing $\log \pi_\theta(y_l \mid x) \to -\infty$ with constant weight destroys shared grammatical token distributions.

Empirically (arXiv:2305.18290, Section 6.1–6.3 & Table 1), DPO dominates PPO across all target KL divergences ($\text{KL} \in \{3, 6, 9, 12\}$) on controlled IMDb sentiment generation, is the only alignment method that surpasses the human-chosen responses in the Anthropic-HH single-turn dialogue test set across sampling temperatures $T \in [0.0, 1.0]$, and achieves superior out-of-distribution generalization when Reddit TL;DR summarization policies are evaluated zero-shot on CNN/DailyMail news articles—reaching a $0.36$ GPT-4 win rate vs. ground truth at $T=0.0$ (vs. $0.26$ for PPO) and $0.31$ at $T=0.25$ (vs. $0.23$ for PPO).


3. Monolithic & Reference-Free Preference Alignment: ORPO (arXiv:2403.07691) and SimPO (arXiv:2405.14734)

Despite eliminating the reward model and critic, standard DPO retains two structural inefficiencies that prompted the next wave of post-training research in 2024–2026:

  1. Two-Stage Dependency & Reference Model Memory Overhead: Applying DPO directly to a raw pre-trained base model without first running an SFT stage fails to converge cleanly (arXiv:2403.07691, Section 1 & Section 3), and DPO still requires keeping a frozen copy of $\pi_{\text{ref}}$ in GPU HBM and computing two forward passes ($\pi_\theta$ and $\pi_{\text{ref}}$) for every chosen and rejected sequence.
  2. Train-Inference Metric Discrepancy & Length Exploitation: During autoregressive decoding (greedy, beam search, nucleus/top-$k$ sampling), the policy generates sequences that maximize length-normalized average token log-probability $p_\theta(y \mid x) = \frac{1}{|y|}\sum_{i=1}^{|y|} \log \pi_\theta(y_i \mid x, y_{<i})$ (arXiv:2405.14734, Equation 3). However, DPO optimizes the total unnormalized log-ratio sum $\beta \sum_{i=1}^{|y|} \log \frac{\pi_\theta(y_i \mid x, y_{<i})}{\pi_{\text{ref}}(y_i \mid x, y_{<i})}$. Meng, Xia, and Chen (arXiv:2405.14734, Section 2.2 & Figure 4b) demonstrated that because $r_{\text{DPO}}(x, y_w) > r_{\text{DPO}}(x, y_l)$ does not imply $p_\theta(y_w \mid x) > p_\theta(y_l \mid x)$, only roughly $50\%$ of preference triples in a DPO-trained model actually satisfy the generation-likelihood ordering $p_\theta(y_w \mid x) > p_\theta(y_l \mid x)$!

1. Odds Ratio Preference Optimization (ORPO, arXiv:2403.07691)

In "ORPO: Monolithic Preference Optimization without Reference Model" (arXiv:2403.07691, Section 3 & Section 4), Hong, Lee, and Thorne analyze why SFT alone increases the generation probability of both desired ($y_w$) and undesired ($y_l$) responses: cross-entropy NLL loss on $y_w$ boosts tokens shared by instruction-following templates, inadvertently raising $P_\theta(y_l \mid x)$ simultaneously.

Given the geometric mean token probability (length-normalized exponential average log-likelihood) of sequence $y$ of length $|y|$ tokens (arXiv:2403.07691, Equations 2–5; arXiv:2405.14734, Table 3):

$$p_\theta(y \mid x) = \exp\left(\frac{1}{|y|}\log \pi_\theta(y \mid x)\right) = \exp\left(\frac{1}{|y|}\sum_{t=1}^{|y|} \log P_\theta(y_t \mid x, y_{<t})\right)$$

ORPO defines the generation odds $\mathbf{odds}\theta(y \mid x)$ as the ratio of the probability of generating sequence $y$ to the probability of not generating $y$, and the odds ratio $\mathbf{OR}\theta(y_w, y_l)$ between the chosen and rejected responses:

$$\mathbf{odds}\theta(y \mid x) = \frac{p\theta(y \mid x)}{1 - p_\theta(y \mid x)}, \qquad \mathbf{OR}\theta(y_w, y_l) = \frac{\mathbf{odds}\theta(y_w \mid x)}{\mathbf{odds}_\theta(y_l \mid x)}$$

The monolithic ORPO Objective (arXiv:2403.07691, Equations 6–7) merges supervised fine-tuning and preference alignment into a single reference-free training phase:

$$\mathcal{L}{\text{ORPO}}(\theta) = \mathbb{E}{(x, y_w, y_l) \sim \mathcal{D}}\Big[\mathcal{L}{\text{SFT}} + \lambda \cdot \mathcal{L}{\text{OR}}\Big] = \mathbb{E}{(x, y_w, y_l) \sim \mathcal{D}}\left[-\frac{1}{|y_w|}\log \pi\theta(y_w \mid x) - \lambda \log \sigma\left(\log \frac{\mathbf{odds}\theta(y_w \mid x)}{\mathbf{odds}\theta(y_l \mid x)}\right)\right]$$

Why use the odds ratio rather than a raw probability ratio $p_\theta(y_w \mid x) / p_\theta(y_l \mid x)$ during monolithic SFT? Differentiating $\mathcal{L}_{\text{OR}}$ with respect to $\theta$ factors into a scalar mistake penalty $\delta(d)$ and a gradient contrast vector $h(d)$ (arXiv:2403.07691, Equations 8–10):

$$\nabla_\theta \mathcal{L}{\text{OR}} = \delta(d) \cdot h(d), \qquad \delta(d) = \left[1 + \frac{\mathbf{odds}\theta(y_w \mid x)}{\mathbf{odds}_\theta(y_l \mid x)}\right]^{-1}$$

$$h(d) = \frac{\nabla_\theta \log p_\theta(y_w \mid x)}{1 - p_\theta(y_w \mid x)} - \frac{\nabla_\theta \log p_\theta(y_l \mid x)}{1 - p_\theta(y_l \mid x)}$$

Notice the denominators $1 - p_\theta(y \mid x)$ in $h(d)$: as the SFT term drives $p_\theta(y_w \mid x)$ upward toward $1$, $(1 - p_\theta(y_w \mid x))^{-1}$ amplifies the positive adaptation gradient on $y_w$, whereas as $p_\theta(y_l \mid x)$ shrinks toward $0$, $(1 - p_\theta(y_l \mid x))^{-1} \to 1$ applies a gentle, bounded repulsive force on $y_l$ rather than blowing up as $p_\theta(y_l \mid x) \to 0$ (which happens under a direct probability ratio and causes catastrophic degeneration). Across OPT-125M, OPT-350M, and OPT-1.3B (arXiv:2403.07691, Tables 2–3), ORPO achieves up to $84.0\%$ win rate over SFT and $79.4\%$ over PPO on HH-RLHF (and $80.5\%$ over SFT / $85.8\%$ over PPO on UltraFeedback), while training Phi-2 (2.7B) ($\lambda = 0.25$), Llama-2 (7B) ($\lambda = 0.20$), and Mistral (7B) ($\lambda = 0.10$) for a single epoch on UltraFeedback alone yields Mistral-ORPO-β (7B) with $12.20\%$ on AlpacaEval 2.0 (surpassing Zephyr-β and Llama-2-Chat-13B), $66.19\%$ instruction-level loose accuracy on IFEval (Table 6), and $7.32$ on MT-Bench.

2. Simple Preference Optimization (SimPO, NeurIPS 2024, arXiv:2405.14734)

In "SimPO: Simple Preference Optimization with a Reference-Free Reward" (arXiv:2405.14734, Section 2.2 & Section 2.3), Meng, Xia, and Chen resolve DPO's train-inference discrepancy directly by defining the implicit reward as the scaled, length-normalized average token log-probability of the policy model itself (arXiv:2405.14734, Equation 4):

$$r_{\text{SimPO}}(x, y) = \frac{\beta}{|y|} \log \pi_\theta(y \mid x) = \frac{\beta}{|y|} \sum_{i=1}^{|y|} \log \pi_\theta(y_i \mid x, y_{<i})$$

Furthermore, drawing on margin-based classifier generalization theory ("home advantage" in Bradley-Terry models), SimPO introduces a strict target reward margin $\gamma > 0$ into the pairwise preference probability $p(y_w \succ y_l \mid x) = \sigma(r(x, y_w) - r(x, y_l) - \gamma)$, requiring the length-normalized reward of the winning response $y_w$ to exceed the losing response $y_l$ by at least $\gamma$ (arXiv:2405.14734, Equations 5–6):

$$\mathcal{L}{\text{SimPO}}(\pi\theta) = -\mathbb{E}{(x, y_w, y_l) \sim \mathcal{D}}\left[\log \sigma\left(\frac{\beta}{|y_w|}\log \pi\theta(y_w \mid x) - \frac{\beta}{|y_l|}\log \pi_\theta(y_l \mid x) - \gamma\right)\right]$$

In arXiv:2405.14734 (Table 4 & Table 5), ablating either component on Mistral-Base (7B) and Mistral-Instruct (7B) proves why both mechanisms are indispensable:

  • Full SimPO (Mistral-Base 7B / Mistral-Instruct 7B): Achieves $21.5\%$ / $32.1\%$ AlpacaEval 2 LC win rate and $16.6\%$ / $21.0\%$ Arena-Hard win rate (compared to $15.1\%$ / $26.8\%$ LC and $10.4\%$ / $16.3\%$ Arena-Hard for DPO).
  • Removing Length Normalization (w/o LN): Causes the model to exploit sequence length (strong positive correlation between reward and verbosity), collapsing the AlpacaEval 2 LC win rate from $21.5\% \to 11.9\%$ on Mistral-Base and from $32.1\% \to 19.1\%$ on Mistral-Instruct (arXiv:2405.14734, Table 5).
  • Removing Target Reward Margin ($\gamma = 0$): Drops AlpacaEval 2 LC win rate from $21.5\% \to 16.8\%$ on Mistral-Base (and Arena-Hard from $16.6\% \to 11.7\%$).
Preference Optimization Method (arXiv:2405.14734, Table 1 & Table 4) Ref-Free ($\pi_{\text{ref}}$ Dropped) Mistral-Base 7B (AE2 LC% / AH%) Mistral-Instruct 7B (AE2 LC% / AH%) Llama-3-Base 8B (AE2 LC% / AH%) Llama-3-Instruct 8B (AE2 LC% / AH%)
Supervised Fine-Tuning (SFT) Yes 8.4% / 1.3% 17.1% / 12.6% 6.2% / 3.3% 26.0% / 22.3%
RRHF / SLiC-HF Yes / Yes 11.6% / 5.8% · 10.9% / 7.3% 25.3% / 18.1% · 24.1% / 18.9% 12.1% / 6.3% · 12.3% / 6.0% 31.3% / 26.5% · 26.9% / 26.2%
DPO (arXiv:2305.18290) No (Needs $\pi_{\text{ref}}$) 15.1% / 10.4% 26.8% / 16.3% 18.2% / 15.9% 40.3% / 32.6%
IPO / KTO No (Needs $\pi_{\text{ref}}$) 11.8% / 7.5% · 13.1% / 5.6% 20.3% / 16.2% · 24.5% / 17.9% 14.4% / 17.8% · 14.2% / 12.5% 35.6% / 30.5% · 33.1% / 26.4%
CPO / ORPO (arXiv:2403.07691) Yes / Yes 9.8% / 6.9% · 14.7% / 7.0% 23.8% / 22.6% · 24.5% / 20.8% 10.8% / 5.8% · 12.2% / 10.8% 28.9% / 28.8% · 28.5% / 25.8%
R-DPO (Length-Regularized DPO) No (Needs $\pi_{\text{ref}}$) 17.4% / 8.0% 27.3% / 16.1% 17.6% / 17.2% 41.1% / 33.1%
SimPO (arXiv:2405.14734) Yes (100% Ref-Free) 21.5% / 16.6% 32.1% / 21.0% 22.0% / 23.4% 44.7% / 33.8% (v0.2: 53.7%)

When paired with stronger on-policy preference scoring in Llama3-Instruct-8B-SimPO-v0.2 (arXiv:2405.14734, Table 1), SimPO reaches a $53.7\%$ Length-Controlled win rate ($47.5\%$ raw win rate, average length $1,777$ chars) on the AlpacaEval 2 Leaderboard—surpassing Claude 3 Opus ($40.5\%$ LC), Llama-3-70B-Instruct ($34.4\%$ LC), and GPT-4 Turbo (11/06) ($50.0\%$ LC)—while Gemma-2-9B-it-SimPO reaches $72.4\%$ LC win rate on AlpacaEval 2 and $59.1\%$ win rate on Arena-Hard.


4. Process vs. Outcome Supervision: PRM800K and Step-Level Mathematical Verification (arXiv:2305.20050)

When language models transition from general conversational queries to multi-step mathematical proofs, formal logic, or compiler synthesis, a single intermediate algebraic mistake invalidates the entire derivation. In "Let's Verify Step by Step" (arXiv:2305.20050), Lightman, Kosaraju, Burda, Edwards, Baker, Lee, Leike, Schulman, Sutskever, and Cobbe (OpenAI) conducted the definitive empirical comparison between two reward-modeling paradigms on the competition-level MATH dataset:

  1. Outcome-Supervised Reward Models (ORMs, Section 2.5): Trained on uniformly sampled solutions (100 samples per problem at large scale) graded purely by whether the final boxed answer matches the ground-truth string. At test time, the ORM prediction at the final token scores the entire trajectory. Crucially, ORMs suffer from spurious positive labels (false-positive chains of thought that arrive at the right answer via flawed intermediate steps) and sparse credit assignment (a single negative label at the end of a 15-step derivation gives zero indication of which step failed).
  2. Process-Supervised Reward Models (PRMs, Section 2.6): Trained on newline-delimited step-by-step solutions where every individual step $s_j$ ($j \in \{1, \dots, K\}$) is supervised after its final token with a single classification target token (positive, negative, or neutral, up to the first incorrect step). At inference time, a single forward pass of the PRM over the complete candidate solution outputs step-level correctness probabilities $p_j = P_{\text{PRM}}(\text{step } j \text{ correct} \mid q, s_{\le j})$, and the total trajectory score is computed as the joint product of step-level correctness probabilities:

$$\mathcal{S}{\text{PRM}}(q, s{1:K}) = \prod_{j=1}^{K} P_{\text{PRM}}\Big(y_j = \text{correct} \;\Big|\; q, s_{1:j}\Big)$$

1. The PRM800K Dataset and $2.6\times$ Active Learning Data Efficiency

To train their large-scale GPT-4-based PRM (pre-trained on $\approx 1.5\text{B}$ MathMix tokens), OpenAI collected PRM800K: $800,000$ step-level human feedback labels across $75,000$ solutions to $12,000$ MATH problems (arXiv:2305.20050, Section 2.4). To prevent test contamination while maximizing training diversity, $4,500$ MATH test problems were folded into the PRM800K training pool, and evaluation was conducted on a strictly held-out representative subset of $500$ MATH test problems (plus $224$ fresh out-of-distribution STEM problems from newly released AP Calculus, AP Chemistry, AP Physics, AMC10, and AMC12 exams).

Instead of wasting human annotation budget labeling obvious errors, OpenAI employed an active learning selection strategy (arXiv:2305.20050, Section 2.4 & Section 4.2): at each iteration, the generator sampled $N$ solutions per problem and surfaced only the top-$K$ "convincing wrong-answer" solutions—trajectories that reached a demonstrably false final answer yet received the highest step-product score from the current $\text{PRM}{\text{selector}}$. Because every wrong-answer solution is guaranteed to contain at least one flawed step, every convincing wrong-answer trajectory directly exposes a blind spot of the current reward model. Using $\text{PRM}{\text{large}}$ as a synthetic labeling oracle for small-scale models (200× less pretraining compute), Lightman et al. (arXiv:2305.20050, Figure 4a & Section 4.2) proved that active learning on convincing wrong-answer solutions is $2.6\times$ more data-efficient than uniform random data collection.

Evaluation Benchmark & Search Budget (arXiv:2305.20050, Figure 3 & Table 1) Problem Count Majority Voting (Self-Consistency) Outcome Reward Model (ORM) Process Reward Model (PRM800K)
MATH Representative Test Subset (Best-of-1,860) 500 problems 69.6% 72.4% 78.2% (+5.8% over ORM)
OOD AP Calculus Exam (Best-of-100) 45 problems 80.0% 68.9% 86.7% (+17.8% over ORM)
OOD AP Chemistry Exam (Best-of-100) 60 problems 71.7% 68.9% 80.0% (+11.1% over ORM)
OOD AP Physics Exam (Best-of-100) 45 problems 82.2% 77.8% 86.7% (+8.9% over ORM)
OOD AMC10 & AMC12 Competition Math (Best-of-100) 84 problems 32.8% 49.1% 53.2% (+4.1% over ORM)
OOD Held-Out STEM Aggregate (Best-of-100, Table 1) 234 total 61.3% 63.8% 72.9% (+9.1% over ORM)

Crucially, as summarized by Lightman et al. in Section 6.2 (arXiv:2305.20050), process supervision exhibits a negative alignment tax: forcing the model to follow human-endorsed, step-by-step interpretable reasoning chains does not degrade problem-solving accuracy—it strictly improves best-of-$N$ search scaling across every compute budget from $N=1$ to $N=1,860$.


5. Critic-Free Group Relative Policy Optimization (GRPO): From DeepSeekMath (arXiv:2402.03300) to DeepSeek-R1 (arXiv:2501.12948)

While PRMs demonstrate the power of fine-grained verification at test time, scaling online Reinforcement Learning to $671\text{B}$-parameter Mixture-of-Experts models with $32\text{K}\text{--}128\text{K}$ reasoning trajectories is memory-prohibitive under standard PPO (arXiv:2402.03300, Section 4.1.1). In PPO, the value network (critic) $V_\psi$ is typically an LLM of the same parameter count as the policy $\pi_\theta$, doubling the trainable parameter, gradient, and Adam optimizer-state memory footprint while struggling to assign accurate token-level value predictions when rewards arrive only at the end of long reasoning chains.

Classical Reinforcement Learning Agent-Environment Feedback Loop Showing State S_t, Action A_t, and Scalar Reward R_t Transitions

Classical Reinforcement Learning Agent-Environment Feedback Loop Showing State S_t, Action A_t, and Scalar Reward R_t Transitions

1. Mathematical Formulation of Group Relative Policy Optimization (GRPO, arXiv:2402.03300, Equations 3–4)

In "DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models" (arXiv:2402.03300, Section 4.1), Shao et al. introduced Group Relative Policy Optimization (GRPO), which completely eliminates the value function critic $V_\psi$. Instead of learning a parameterized baseline network, for each query $q \sim \mathcal{P}(Q)$, GRPO samples a group of $G$ candidate outputs $\{o_1, o_2, \dots, o_G\} \sim \pi_{\theta_{\text{old}}}(O \mid q)$ (e.g., $G = 64$ in DeepSeekMath) and uses the empirical group mean and group standard deviation of their rewards to compute the baseline!

GRPO maximizes the following clipped surrogate objective with direct loss-level KL regularization (arXiv:2402.03300, Equation 3):

$$\mathcal{J}{\text{GRPO}}(\theta) = \mathbb{E}{q \sim \mathcal{P}(Q),\, \{o_i\}{i=1}^G \sim \pi{\theta_{\text{old}}}(O \mid q)}\left[\frac{1}{G}\sum_{i=1}^{G} \frac{1}{|o_i|} \sum_{t=1}^{|o_i|} \left\{\min\left(\rho_{i,t}(\theta)\hat{A}{i,t},\; \operatorname{clip}\big(\rho{i,t}(\theta),\, 1-\varepsilon,\, 1+\varepsilon\big)\hat{A}{i,t}\right) - \beta \mathbb{D}{\text{KL}}\Big[\pi_\theta \parallel \pi_{\text{ref}}\Big]\right\}\right]$$

where $\rho_{i,t}(\theta) = \frac{\pi_\theta(o_{i,t} \mid q, o_{i,<t})}{\pi_{\theta_{\text{old}}}(o_{i,t} \mid q, o_{i,<t})}$ is the token-level probability ratio, and $\mathbb{D}{\text{KL}}[\pi\theta \parallel \pi_{\text{ref}}]$ is estimated at every token not via the signed log-ratio inside the reward, but via Schulman's (2020) guaranteed non-negative unbiased KL estimator (arXiv:2402.03300, Equation 4):

$$\mathbb{D}{\text{KL}}\Big[\pi\theta \parallel \pi_{\text{ref}}\Big] = \frac{\pi_{\text{ref}}(o_{i,t} \mid q, o_{i,<t})}{\pi_\theta(o_{i,t} \mid q, o_{i,<t})} - \log \frac{\pi_{\text{ref}}(o_{i,t} \mid q, o_{i,<t})}{\pi_\theta(o_{i,t} \mid q, o_{i,<t})} - 1 \ge 0$$

Because $x - \log x - 1 \ge 0$ for all $x > 0$ (with equality if and only if $\pi_\theta = \pi_{\text{ref}}$), adding $\mathbb{D}_{\text{KL}}$ directly to the loss prevents negative-KL gradient spikes and decouples KL regularization from advantage standardization.

2. Outcome Supervision vs. Process Supervision Advantage Calculation in GRPO

In Sections 4.1.2 and 4.1.3 of arXiv:2402.03300, Shao et al. unify both Outcome Supervision and Process Supervision under GRPO:

  • Outcome Supervision GRPO (Section 4.1.2): The reward model (or deterministic rule verifier) scores each of the $G$ completions $\{o_1, \dots, o_G\}$ at termination, producing group reward vector $\mathbf{r} = \{r_1, r_2, \dots, r_G\}$. Every token $t \in \{1, \dots, |o_i|\}$ in completion $o_i$ is assigned the z-score normalized group advantage: $$\hat{A}_{i,t}^{\text{Outcome}} = \widetilde{r}_i = \frac{r_i - \operatorname{mean}(\mathbf{r})}{\operatorname{std}(\mathbf{r})}$$
  • Process Supervision GRPO (Section 4.1.3): Given a Process Reward Model scoring the end token $\operatorname{index}(j)$ of each intermediate reasoning step $j \in \{1, \dots, K_i\}$ across all $G$ outputs, yielding step-reward set $\mathbf{R} = \{\{r_1^{\operatorname{index}(1)}, \dots, r_1^{\operatorname{index}(K_1)}\}, \dots, \{r_G^{\operatorname{index}(1)}, \dots, r_G^{\operatorname{index}(K_G)}\}\}$, each step reward is first normalized by the global group step mean and standard deviation $\widetilde{r}i^{\operatorname{index}(j)} = \frac{r_i^{\operatorname{index}(j)} - \operatorname{mean}(\mathbf{R})}{\operatorname{std}(\mathbf{R})}$, and the advantage $\hat{A}{i,t}^{\text{Process}}$ of token $t$ is the cumulative sum of normalized future step rewards: $$\hat{A}{i,t}^{\text{Process}} = \sum{\operatorname{index}(j) \ge t} \widetilde{r}_i^{\operatorname{index}(j)}$$

Continuing pre-training from DeepSeek-Coder-Base-v1.5 7B on $120\text{B}$ math tokens from Common Crawl (DeepSeekMath-Base 7B, which outperforms the $77\times$ larger closed-source Minerva 540B on MATH: $36.2\%$ vs. $33.6\%$, Table 2), followed by chain-of-thought SFT (DeepSeekMath-Instruct 7B) and GRPO reinforcement learning (DeepSeekMath-RL 7B), elevated top-1 accuracy (without tool use) to $86.7\%$ on GSM8K, $58.8\%$ on MATH ($51.7\%$ base/CoT benchmarked in abstract, $60.9\%$ cons@64), $78.4\%$ on CMATH, and $87.6\%$ on Gaokao-MathCloze—surpassing every open-source model from $7\text{B}$ to $70\text{B}$ (arXiv:2402.03300, Table 5). Furthermore, Table 6 & Table 7 of arXiv:2402.03300 establish a critical pre-training insight: two-stage training with $400\text{B}$ Code tokens before $150\text{B}$ Math tokens boosts MMLU to $36.2\%$ and BBH to $35.3\%$ on a $1.3\text{B}$ model (versus $32.3\%$ / $32.5\%$ for math-only training), proving that code pre-training directly transfers structural deductive reasoning to mathematics.

3. DeepSeek-R1-Zero and DeepSeek-R1: Pure Rule-Based RL, Emergent Self-Verification, and Reasoning Distillation (arXiv:2501.12948)

In "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning" (arXiv:2501.12948, published in Nature Vol. 645, pp. 633–638), DeepSeek-AI demonstrated that complex multi-step reasoning behaviors—including self-verification, backtracking ("Aha moments"), and dynamic strategy adaptation—emerge spontaneously via pure reinforcement learning without any supervised fine-tuning warm-up.

  1. DeepSeek-R1-Zero (Pure RL on DeepSeek-V3-Base, $671\text{B}$ total / $37\text{B}$ active MoE, Section 2.2): Trained directly on DeepSeek-V3-Base via GRPO using purely rule-based rewards—an Accuracy Reward (verifying final boxed math answers or executing generated code against compiler test suites) and a Format Reward (enforcing <think>...</think> and <answer>...</answer> tags)—while purposefully avoiding neural reward models in the pure reasoning loop to prevent neural reward hacking at scale (arXiv:2501.12948, Section 2.2.2). Across thousands of RL steps, DeepSeek-R1-Zero's AIME 2024 pass@1 soared from $15.6\%$ to $71.0\%$, and with 64-sample majority voting (cons@64) reached $86.7\%$ (exceeding OpenAI-o1-0912 at $83.3\%$ cons@64), alongside $95.9\%$ on MATH-500 (arXiv:2501.12948, Table 2).
  2. DeepSeek-R1 (Four-Stage Cold-Start + Dual-RL Pipeline, Section 2.3): Because DeepSeek-R1-Zero suffered from language mixing and poor markdown readability inside its <think> blocks, DeepSeek-R1 introduces a four-stage post-training architecture: * Stage 1 (Cold-Start SFT, Section 2.3.1): Fine-tunes DeepSeek-V3-Base on a curated set of several thousand long-CoT cold-start trajectories with human-readable formatting and explicit summary blocks. * Stage 2 (Reasoning-Oriented GRPO + Language Consistency Reward, Section 2.3.2): Runs large-scale rule-based GRPO on math, code, STEM, and logic tasks while adding a language consistency reward (measured as the fraction of target-language words in the CoT). * Stage 3 (Rejection Sampling + $800\text{K}$-Sample SFT, Section 2.3.3): At RL convergence, curates $\approx 600\text{K}$ reasoning trajectories via rejection sampling (using generative reward judges alongside rule verifiers and filtering mixed-language or code-block-cluttered CoTs) combined with $\approx 200\text{K}$ non-reasoning samples (writing, factual QA, self-cognition), fine-tuning DeepSeek-V3-Base for $2$ epochs on the combined $800\text{K}$ dataset. * Stage 4 (All-Scenario RL Alignment, Section 2.3.4): Runs a secondary RL phase combining rule-based rewards for reasoning domains with neural preference reward models for general helpfulness (evaluated strictly on the final summary to avoid corrupting the internal CoT) and harmlessness (evaluated across the entire response, including both reasoning and summary).
  3. Why Direct Distillation Beats Small-Model RL (Section 2.4 & Table 6): Fine-tuning dense Qwen2.5 ($1.5\text{B}$, $7\text{B}$, $14\text{B}$, $32\text{B}$) and Llama-3 ($8\text{B}$, $70\text{B}$) models via SFT on the $800\text{K}$ trajectories curated from DeepSeek-R1 dramatically outperforms running large-scale zero-shot RL directly on the small base model (arXiv:2501.12948, Table 6): DeepSeek-R1-Distill-Qwen-32B achieves $72.6\%$ pass@1 ($83.3\%$ cons@64) on AIME 2024, $94.3\%$ on MATH-500, $62.1\%$ on GPQA Diamond, and $57.2\%$ on LiveCodeBench, crushing DeepSeek-R1-Zero-Qwen-32B (trained via direct RL on Qwen-32B, which reached only $47.0\%$ pass@1 on AIME 2024 and $40.2\%$ on LiveCodeBench)!
Benchmark (Metric) (arXiv:2501.12948, Table 2, Table 4 & Section 3.2) Claude-3.5-Sonnet-1022 GPT-4o-0513 DeepSeek-V3 (671B/37B) OpenAI o1-mini OpenAI o1-1217 DeepSeek-R1 (671B/37B) R1-Distill-Qwen-32B
AIME 2024 (Pass@1 / Cons@64) 16.0% / 26.7% 9.3% / 13.4% 39.2% / — 63.6% / 80.0% 79.2% / — 79.8% (R1-Zero: 71.0/86.7) 72.6% / 83.3%
MATH-500 (Pass@1) 78.3% 74.6% 90.2% 90.0% 96.4% 97.3% 94.3% (7B: 92.8%)
GPQA Diamond (Pass@1) 65.0% 49.9% 59.1% 60.0% 75.7% 71.5% (R1-Zero: 73.3%) 62.1% (14B: 59.1%)
LiveCodeBench (Pass@1-CoT) 38.9% 32.9% 36.2% 53.8% 63.4% 65.9% 57.2% (14B: 53.1%)
Codeforces (Rating / Percentile) 717 / 20.3% 759 / 23.6% 1134 / 58.7% 1820 / 93.4% 2061 / 96.6% 2029 / 96.3% 1691 (14B: 1481)
MMLU (Pass@1) / MMLU-Pro (EM) 88.3% / 78.0% 87.2% / 72.6% 88.5% / 75.9% 85.2% / 80.3% 91.8% / — 90.8% / 84.0% —
AlpacaEval 2.0 (LC%) / Arena-Hard 52.0% / 85.2% 51.1% / 80.4% 70.0% / 85.5% 57.8% / 92.0% — / — 87.6% / 92.3% —

6. Unified Systems & GPU HBM Memory Comparison Across Post-Training Paradigms

When architecting a post-training pipeline for a $7\text{B}\text{--}70\text{B}$ dense model or a $671\text{B}$ Mixture-of-Experts model, the choice between PPO, DPO, ORPO, SimPO, and GRPO determines both the active GPU HBM footprint and whether training is compute-bound (prefill forward/backward matrix multiplications) or memory-bandwidth-bound (autoregressive rollout generation).

Algorithm Active Models in GPU HBM Online Rollouts Required Implicit / Explicit Reward Definition Primary Production Use Case in 2026
PPO-ptx (arXiv:2203.02155) 4 Models: Actor $\pi_\phi$, Critic $V_\psi$, RM $r_\theta$, Ref $\pi_{\text{ref}}$ Yes ($1\text{--}4$ rollouts/prompt) Explicit neural $r_\theta(x, y) - \beta \log \frac{\pi_\phi}{\pi_{\text{ref}}}$ + GAE($\gamma, \lambda$) Multi-turn safety & chat alignment when a calibrated critic is available.
DPO (arXiv:2305.18290) 2 Models: Policy $\pi_\theta$ (trainable), Ref $\pi_{\text{ref}}$ (frozen) No (Offline pairs $(x, y_w, y_l)$) $\hat{r}_{\text{DPO}}(x, y) = \beta \log \frac{\pi_\theta(y \mid x)}{\pi_{\text{ref}}(y \mid x)}$ Stable offline preference tuning when strict KL proximity to $\pi_{\text{ref}}$ is needed.
ORPO (arXiv:2403.07691) 1 Model: Policy $\pi_\theta$ only ($100\%$ Ref-Free) No (Single monolithic SFT+OR stage) Log-odds $\log \frac{p_\theta(y \mid x)}{1 - p_\theta(y \mid x)}$ where $p_\theta = \exp(\frac{1}{|y|}\log \pi_\theta)$ Single-stage adaptation of raw base models directly on preference data.
SimPO (arXiv:2405.14734) 1 Model: Policy $\pi_\theta$ only ($100\%$ Ref-Free) No (Offline or iterative on-policy pairs) Length-normalized $r_{\text{SimPO}}(x, y) = \frac{\beta}{|y|}\log \pi_\theta(y \mid x)$ with margin $\gamma$ High-win-rate chat alignment eliminating verbosity bloat & reference HBM cost.
GRPO (arXiv:2402.03300) 2 Models (+ Rule/PRM): Policy $\pi_\theta$, Ref $\pi_{\text{ref}}$ (Zero Critic) Yes (Group $\{o_i\}_{i=1}^G \sim \pi_{\theta_{\text{old}}}$) Group z-score $\hat{A}_{i,t} = \frac{r_i - \operatorname{mean}(\mathbf{r})}{\operatorname{std}(\mathbf{r})}$ + unbiased $\mathbb{D}_{\text{KL}}$ Large-scale verifiable math, code, and test-time CoT reasoning (DeepSeek-R1).

7. Production PyTorch Implementation: Exact Loss Functions for DPO, ORPO, SimPO, and GRPO

Below is a clean, self-contained, type-annotated PyTorch reference implementation of the exact sequence log-probability reduction and loss objectives for DPO (arXiv:2305.18290 Eq. 7), ORPO (arXiv:2403.07691 Eq. 6–7), SimPO (arXiv:2405.14734 Eq. 6), and GRPO (arXiv:2402.03300 Eq. 3–4) operating on variable-length masked token sequences:

"""Exact PyTorch Reference Implementations for DPO, ORPO, SimPO, and GRPO Objectives.

Implements equations from:
  - DPO:  Rafailov et al. (2023), arXiv:2305.18290 (Eq. 7)
  - ORPO: Hong et al. (2024), arXiv:2403.07691 (Eq. 5-7)
  - SimPO: Meng et al. (2024), arXiv:2405.14734 (Eq. 4-6)
  - GRPO: Shao et al. (2024), arXiv:2402.03300 (Eq. 3-4)
"""

from __future__ import annotations
import torch
import torch.nn.functional as F

def masked_sequence_logprobs(
    logits: torch.Tensor,
    labels: torch.Tensor,
    prompt_mask: torch.Tensor,
    pad_token_id: int = -100,
) -> tuple[torch.Tensor, torch.Tensor]:
    """Compute sum and length-normalized average log-probabilities over response tokens.

    Args:
        logits: Tensor of shape (B, T, V) from causal LM forward pass.
        labels: Target token IDs of shape (B, T).
        prompt_mask: Boolean mask of shape (B, T), True for response tokens (y), False for prompt (x) or padding.
        pad_token_id: Ignored padding label ID.

    Returns:
        tuple of (sum_logprobs, avg_logprobs), each of shape (B,).
    """
    # Shift logits and labels for causal next-token prediction
    shift_logits = logits[:, :-1, :]
    shift_labels = labels[:, 1:]
    shift_mask = prompt_mask[:, 1:].to(shift_logits.dtype) * (shift_labels != pad_token_id).to(shift_logits.dtype)

    safe_labels = shift_labels.clamp(min=0)
    log_probs = F.log_softmax(shift_logits, dim=-1)
    token_log_probs = torch.gather(log_probs, dim=-1, index=safe_labels.unsqueeze(-1)).squeeze(-1)

    masked_log_probs = token_log_probs * shift_mask
    seq_lengths = shift_mask.sum(dim=-1).clamp(min=1.0)
    sum_logprobs = masked_log_probs.sum(dim=-1)
    avg_logprobs = sum_logprobs / seq_lengths
    return sum_logprobs, avg_logprobs

def dpo_loss(
    policy_chosen_sum_logps: torch.Tensor,
    policy_rejected_sum_logps: torch.Tensor,
    ref_chosen_sum_logps: torch.Tensor,
    ref_rejected_sum_logps: torch.Tensor,
    beta: float = 0.1,
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
    """Direct Preference Optimization (DPO) loss (arXiv:2305.18290, Eq. 7)."""
    chosen_logratios = policy_chosen_sum_logps - ref_chosen_sum_logps
    rejected_logratios = policy_rejected_sum_logps - ref_rejected_sum_logps
    logits = beta * (chosen_logratios - rejected_logratios)
    loss = -F.logsigmoid(logits).mean()

    chosen_rewards = beta * chosen_logratios.detach()
    rejected_rewards = beta * rejected_logratios.detach()
    return loss, chosen_rewards, rejected_rewards

def orpo_loss(
    policy_chosen_avg_logps: torch.Tensor,
    policy_rejected_avg_logps: torch.Tensor,
    lambda_or: float = 0.1,
    eps: float = 1e-7,
) -> torch.Tensor:
    """Monolithic Odds Ratio Preference Optimization (ORPO) loss (arXiv:2403.07691, Eq. 6-7)."""
    # SFT negative log-likelihood on chosen response y_w
    sft_loss = -policy_chosen_avg_logps.mean()

    # Log odds ratio: log(odds(y_w|x) / odds(y_l|x)) = log(p_w / (1 - p_w)) - log(p_l / (1 - p_l))
    log_odds_chosen = policy_chosen_avg_logps - torch.log1p(-torch.exp(policy_chosen_avg_logps).clamp(max=1.0 - eps))
    log_odds_rejected = policy_rejected_avg_logps - torch.log1p(-torch.exp(policy_rejected_avg_logps).clamp(max=1.0 - eps))
    log_odds_ratio = log_odds_chosen - log_odds_rejected

    or_loss = -F.logsigmoid(log_odds_ratio).mean()
    return sft_loss + lambda_or * or_loss

def simpo_loss(
    policy_chosen_avg_logps: torch.Tensor,
    policy_rejected_avg_logps: torch.Tensor,
    beta: float = 2.0,
    gamma: float = 0.5,
) -> torch.Tensor:
    """Simple Preference Optimization (SimPO) loss with target reward margin (arXiv:2405.14734, Eq. 6)."""
    reward_diff = beta * (policy_chosen_avg_logps - policy_rejected_avg_logps)
    return -F.logsigmoid(reward_diff - gamma).mean()

def grpo_outcome_loss(
    policy_token_logps: torch.Tensor,
    old_token_logps: torch.Tensor,
    ref_token_logps: torch.Tensor,
    response_mask: torch.Tensor,
    group_rewards: torch.Tensor,
    clip_eps: float = 0.2,
    beta_kl: float = 0.04,
    std_eps: float = 1e-6,
) -> torch.Tensor:
    """Group Relative Policy Optimization (GRPO) loss for a group of G outputs (arXiv:2402.03300, Eq. 3-4).

    Args:
        policy_token_logps: Current policy log-probs of shape (G, T).
        old_token_logps: Sampling policy log-probs of shape (G, T).
        ref_token_logps: Frozen reference policy log-probs of shape (G, T).
        response_mask: Binary mask of shape (G, T) indicating valid response tokens.
        group_rewards: Scalar terminal rewards of shape (G,) for the G completions to query q.
    """
    # Group-relative advantage standardization: A_{i,t} = (r_i - mean(r)) / std(r)
    mean_r = group_rewards.mean()
    std_r = group_rewards.std(unbiased=False).clamp(min=std_eps)
    advantages = ((group_rewards - mean_r) / std_r).unsqueeze(-1)  # (G, 1) broadcast across all tokens t

    # Token-level probability ratio rho_{i,t}
    ratio = torch.exp(policy_token_logps - old_token_logps)
    clipped_ratio = torch.clamp(ratio, 1.0 - clip_eps, 1.0 + clip_eps)
    surrogate = torch.minimum(ratio * advantages, clipped_ratio * advantages)

    # Schulman (2020) guaranteed non-negative unbiased KL estimator (Eq. 4)
    ref_over_policy = torch.exp(ref_token_logps - policy_token_logps)
    kl_div = ref_over_policy - (ref_token_logps - policy_token_logps) - 1.0

    per_token_objective = (surrogate - beta_kl * kl_div) * response_mask
    seq_lengths = response_mask.sum(dim=-1).clamp(min=1.0)
    per_seq_objective = per_token_objective.sum(dim=-1) / seq_lengths
    return -per_seq_objective.mean()

8. Frequently Asked Questions (FAQ)

1. Why did a 1.3B-parameter InstructGPT model outperform the 175B-parameter base GPT-3 model in human evaluations? In arXiv:2203.02155 (Section 1 & Section 4.1), base GPT-3 was trained exclusively to predict the next token on uncurated internet webpages ($\mathcal{L}_{\text{PT}}$), meaning it frequently responds to an instruction by generating more questions, tangential web boilerplate, or ungrounded hallucinations ($41\%$ closed-domain hallucination rate). By aligning the model via Supervised Fine-Tuning ($12,725$ prompts), a $6\text{B}$ Bradley-Terry Reward Model ($33,207$ prompts), and PPO-ptx ($31,144$ prompts), the $1.3\text{B}$ InstructGPT model directly optimizes for user helpfulness, explicit constraint satisfaction, and truthfulness—Demonstrating that post-training alignment yields a larger behavioral improvement on instruction following than a $100\times$ increase in raw pre-training parameter count.

2. How does Direct Preference Optimization (DPO) optimize the RLHF objective without training a separate reward model or running reinforcement learning? In arXiv:2305.18290 (Equations 4–7), Rafailov et al. use the closed-form Boltzmann solution of the KL-constrained reward-maximization problem, $\pi_r(y \mid x) = \frac{1}{Z(x)}\pi_{\text{ref}}(y \mid x)\exp(\frac{1}{\beta}r(x, y))$, and invert it algebraically to write the reward in terms of the optimal policy: $r(x, y) = \beta \log \frac{\pi_r(y \mid x)}{\pi_{\text{ref}}(y \mid x)} + \beta \log Z(x)$. When plugged into the pairwise Bradley-Terry preference model $p^(y_w \succ y_l \mid x) = \sigma(r^(x, y_w) - r^*(x, y_l))$, the prompt-dependent normalization constant $\beta \log Z(x)$ cancels out identically, leaving a binary cross-entropy loss directly over the log-probability ratios of the policy $\pi_\theta$ and frozen reference model $\pi_{\text{ref}}$.

3. Why does SimPO outperform DPO on AlpacaEval 2 and Arena-Hard while using less GPU memory? As proven by Meng et al. (arXiv:2405.14734, Section 2.2 & Table 4), DPO's implicit reward $\beta \log(\pi_\theta(y \mid x)/\pi_{\text{ref}}(y \mid x))$ mismatches the length-normalized average log-likelihood metric $p_\theta(y \mid x) = \frac{1}{|y|}\log \pi_\theta(y \mid x)$ that actually guides autoregressive decoding at inference time—causing roughly $50\%$ of DPO training pairs to violate $p_\theta(y_w \mid x) > p_\theta(y_l \mid x)$ and encouraging verbosity exploitation. SimPO uses the length-normalized reward $r_{\text{SimPO}}(x, y) = \frac{\beta}{|y|}\log \pi_\theta(y \mid x)$ directly alongside a target reward margin $\gamma > 0$, eliminating the frozen reference model $\pi_{\text{ref}}$ from GPU HBM and outperforming DPO by up to $+6.4$ points on AlpacaEval 2 and $+7.5$ points on Arena-Hard.

4. What is the difference between ORPO and SimPO when both are reference-free preference optimization algorithms? ORPO (arXiv:2403.07691) is a monolithic single-stage algorithm designed to replace both the SFT stage and the preference alignment stage simultaneously by adding a log-odds ratio penalty $-\lambda \log \sigma(\log \frac{\mathbf{odds}\theta(y_w \mid x)}{\mathbf{odds}\theta(y_l \mid x)})$ directly to the chosen-response NLL loss $\mathcal{L}{\text{SFT}}$. SimPO (arXiv:2405.14734), by contrast, is a dedicated post-SFT preference optimization objective that contrasts length-normalized log-probabilities $\frac{\beta}{|y_w|}\log \pi\theta(y_w \mid x) - \frac{\beta}{|y_l|}\log \pi_\theta(y_l \mid x) - \gamma$ with a strict additive target reward margin $\gamma > 0$, achieving higher final chat win rates when applied after a strong SFT checkpoint (44.7% vs. 28.5% AlpacaEval 2 LC win rate on Llama-3-8B-Instruct, Table 4).

5. Why do Process-Supervised Reward Models (PRMs) outperform Outcome-Supervised Reward Models (ORMs) on mathematical reasoning? In arXiv:2305.20050 (Section 3 & Section 6.1), an ORM grades a multi-step derivation solely by its final answer, which rewards spurious chains of thought that reach the right answer via faulty algebra and provides poor credit assignment when a 15-step proof fails. A PRM trained on PRM800K ($800,000$ step-level human annotations) predicts the validity of every individual reasoning step and scores a solution by the product of step correctness probabilities, pinpointing the exact step where an error occurs and lifting best-of-$1,860$ MATH accuracy from $72.4\%$ (ORM) to $78.2\%$ (PRM) (and OOD AP/AMC STEM test accuracy from $63.8\%$ to $72.9\%$).

6. How does Group Relative Policy Optimization (GRPO) eliminate PPO's value critic in DeepSeekMath and DeepSeek-R1? In arXiv:2402.03300 (Section 4.1.1) and arXiv:2501.12948 (Section 2.2.1), instead of training a separate value network $V_\psi$ of comparable size to the policy LLM $\pi_\theta$, GRPO samples a group of $G$ completions $\{o_1, \dots, o_G\} \sim \pi_{\theta_{\text{old}}}(O \mid q)$ for each prompt $q$ and uses their empirical group mean and group standard deviation as the baseline: $\hat{A}{i,t} = (r_i - \operatorname{mean}(\mathbf{r})) / \operatorname{std}(\mathbf{r})$. Combined with the positive unbiased KL estimator $\mathbb{D}{\text{KL}}(\pi_\theta \parallel \pi_{\text{ref}}) = \frac{\pi_{\text{ref}}}{\pi_\theta} - \log \frac{\pi_{\text{ref}}}{\pi_\theta} - 1$ added directly to the loss, GRPO cuts RL memory overhead nearly in half and scales pure rule-based reinforcement learning to $671\text{B}$ parameters in DeepSeek-R1-Zero and DeepSeek-R1.


9. Primary Sources & Official Technical References

  1. InstructGPT / Three-Stage RLHF & PPO-ptx (Ouyang et al., OpenAI 2022 — "Training language models to follow instructions with human feedback"): https://arxiv.org/abs/2203.02155 and full HTML text https://ar5iv.labs.arxiv.org/html/2203.02155
  2. Proximal Policy Optimization Algorithms (Schulman et al., OpenAI 2017 — "Proximal Policy Optimization Algorithms"): https://arxiv.org/abs/1707.06347 and full HTML text https://ar5iv.labs.arxiv.org/html/1707.06347
  3. Direct Preference Optimization / DPO (Rafailov, Sharma, Mitchell, Ermon, Manning, and Finn, Stanford 2023/2024 — "Direct Preference Optimization: Your Language Model is Secretly a Reward Model"): https://arxiv.org/abs/2305.18290 and full HTML text https://ar5iv.labs.arxiv.org/html/2305.18290
  4. Monolithic Odds Ratio Preference Optimization / ORPO (Hong, Lee, and Thorne, KAIST AI 2024 — "ORPO: Monolithic Preference Optimization without Reference Model"): https://arxiv.org/abs/2403.07691 and full HTML text https://arxiv.org/html/2403.07691v2
  5. Simple Preference Optimization / SimPO (Meng, Xia, and Chen, Princeton & UVA, NeurIPS 2024 — "SimPO: Simple Preference Optimization with a Reference-Free Reward"): https://arxiv.org/abs/2405.14734 and full HTML text https://arxiv.org/html/2405.14734v2
  6. Process Supervision & PRM800K (Lightman, Kosaraju, Burda, Edwards, Baker, Lee, Leike, Schulman, Sutskever, and Cobbe, OpenAI 2023 — "Let's Verify Step by Step"): https://arxiv.org/abs/2305.20050 and full HTML text https://ar5iv.labs.arxiv.org/html/2305.20050
  7. DeepSeekMath & Group Relative Policy Optimization / GRPO (Shao et al., DeepSeek-AI, Tsinghua & Peking University 2024 — "DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models"): https://arxiv.org/abs/2402.03300 and full HTML text https://arxiv.org/html/2402.03300v3
  8. DeepSeek-R1 & DeepSeek-R1-Zero (DeepSeek-AI, Nature Vol. 645, pp. 633–638, 2025/2026 — "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning"): https://arxiv.org/abs/2501.12948 and full HTML text https://arxiv.org/html/2501.12948v1
🔗 Share Post

Reading next story...

Back to Feed