Skip to content
AIAI Wranglers

25 Fine-Tuning and Alignment

Large language models, trained on trillions of tokens of internet text, acquire extraordinary breadth: they can summarize articles, write code, translate between languages, and answer factual questions. Yet this raw capability is, by itself, insufficient. A pretrained model is a stochastic parrot [14] in the most literal sense: it has learned to predict the next token in web text, including toxic rants, conspiracy theories, and confidently stated falsehoods. Asking such a model a question may yield a helpful answer, a harmful one, or a continuation of the prompt as if it were a web page, all with roughly equal probability.

The problem, then, is not one of capability but of control. We need the model to follow instructions, refuse harmful requests, acknowledge uncertainty, and produce outputs that humans judge as helpful, honest, and harmless. This is the alignment problem: the challenge of ensuring that a model's behaviour reflects human intent and human values, not merely the statistical patterns of its training data.

This chapter develops the mathematical foundations of alignment. We will see that alignment is, at its core, an optimization problem, but one with a subtle twist. The objective is not a fixed loss function given to us by nature (as in next-token prediction) but a moving target defined by human preferences, which are noisy, inconsistent, and expensive to collect. The central mathematical challenge is to extract a useful training signal from sparse preference data and use it to steer the model without destroying the capabilities acquired during pretraining.

Key Idea.

Alignment as constrained optimization. The alignment objective can be stated as: maximize a reward function reflecting human preferences while remaining close to the pretrained model. Formally, (Central Objective)maxπ𝔼x𝒟,yπ(|x)[r(x,y)]βDKL[π(|x)πref(|x)], where π is the policy (the language model viewed as a distribution over responses given prompts), r(x,y) is a reward model trained on human preferences, πref is the pretrained reference policy, and β>0 controls the strength of the KL constraint. The KL term is not a nuisance; it is the primary defense against reward hacking, preventing the model from degenerating into a narrow distribution that exploits artifacts of the learned reward.

Historical Note.

The idea of learning from human preferences has a rich history. Christiano et al. (2017) [1] proposed learning reward functions from pairwise human comparisons in Atari games and simulated robotics tasks, demonstrating that a few thousand preference labels could guide an RL agent more effectively than hand-crafted reward functions. Ziegler et al. (2019) [2] brought this idea to natural language, fine-tuning GPT-2 on human preferences for continuation quality. Stiennon et al. (2020) [3] showed that RLHF substantially outperforms supervised learning for text summarization, a result that surprised many, since summarization had been considered a “solved” supervised-learning task. Ouyang et al. (2022) [4] synthesized these ideas into the three-stage InstructGPT pipeline (supervised fine-tuning (SFT), reward model (RM) training, and Proximal Policy Optimization (PPO)), creating the first widely deployed aligned language model. Rafailov et al. (2023) [5] made a striking observation: the reward model and RL loop can be eliminated entirely, yielding Direct Preference Optimization (DPO), which reduces alignment to a single supervised-learning step on preference data.

The chapter is organized as follows. Supervised Fine-Tuning covers supervised fine-tuning, the first stage of the alignment pipeline, including parameter-efficient methods such as LoRA. Reward Modelling develops the mathematics of reward modelling, showing how pairwise human preferences give rise to a reward function via the Bradley–Terry model. Proximal Policy Optimization for Alignment studies Proximal Policy Optimization as applied to language model alignment, deriving the KL-constrained objective and its optimal solution. Direct Preference Optimization presents Direct Preference Optimization, the key theoretical contribution of the chapter, building the derivation step by step from the reparameterization trick to the partition-function cancellation that eliminates the need for a reward model. Group Relative Policy Optimization introduces Group Relative Policy Optimization (GRPO), which eliminates the critic network, and DAPO: Alignment at Scale extends this to DAPO with four innovations for scaling. Alignment for Diffusion Models shows how these ideas transfer to diffusion model alignment. Connections and Synthesis synthesizes the landscape, and Exercises provides exercises.

Roadmap for this chapter. We progress from supervised fine-tuning through reward modelling and reinforcement learning to direct preference methods and their extensions.

The three-stage pipeline that underlies most alignment work is illustrated in fig:alignment:pipeline. Each stage uses a different kind of data: pretraining consumes raw text at scale, SFT requires curated demonstrations, and alignment relies on pairwise preference judgments. The cost per datum increases at each stage, but the total data volume decreases by orders of magnitude.

The three-stage alignment pipeline. Pretraining provides broad capability on massive unlabeled data; supervised fine-tuning (SFT) teaches the model to follow instructions from curated demonstrations; alignment steers the model toward preferred outputs using human preference data. Data volume decreases while annotation cost per datum increases at each stage.

Supervised Fine-Tuning

The first stage of alignment is deceptively simple: take the pretrained language model and continue training it on a curated dataset of high-quality demonstrations. Each demonstration consists of a prompt (an instruction, question, or conversational context) paired with a desired response written by a human expert. This stage, known as supervised fine-tuning (SFT), transforms a base model that continues web text into a model that follows instructions.

Despite its simplicity, SFT has an outsized impact. Empirically, the jump in perceived quality from a base model to an SFT model is often larger than the subsequent jump from SFT to the aligned model. The reason is straightforward: SFT changes the format of the model's outputs, teaching it to respond to questions rather than complete documents, while alignment refines the quality within that format.

The SFT Objective

Definition 1 (Supervised Fine-Tuning Objective).

Given a dataset of demonstrations 𝒟SFT={(x(i),y(i))}i=1N where x(i) is a prompt and y(i)=(y1(i),,yTi(i)) is a response tokenized into Ti tokens, the SFT loss is the negative log-likelihood of the response tokens conditioned on the prompt: (SFT LOSS)SFT(θ)=1Ni=1Nt=1Tilogπθ(yt(i)|x(i),y<t(i)), where πθ(yt|x,y<t) is the model's predicted probability of token yt given the prompt x and all preceding response tokens y<t=(y1,,yt1).

Remark 1 (SFT Is Next-Token Prediction).

The SFT objective is identical in form to the pretraining objective; both are next-token prediction via cross-entropy. The only difference is the data: pretraining uses raw web text, while SFT uses curated prompt–response pairs. In practice, the loss is typically computed only over the response tokens yt, not the prompt tokens x, since we want the model to learn to generate responses, not to predict prompts. This is sometimes called prompt masking or completion-only training.

The SFT dataset is typically small by pretraining standards; InstructGPT used approximately 13,000 demonstrations [4], while Alpaca [15] used 52,000 instruction–response pairs generated by GPT-4. The key is not quantity but quality and diversity: the demonstrations must cover the range of tasks and response styles that we want the model to exhibit.

Training is straightforward: initialize from the pretrained checkpoint, set a small learning rate (typically 105 to 106), and train for 1–3 epochs. Overfitting is the primary concern: with only tens of thousands of examples, the model can memorize the training set within a single epoch.

Parameter-Efficient Fine-Tuning: LoRA

Full fine-tuning updates every parameter of the model, which poses two problems. First, it requires storing a full copy of the model gradients and optimizer states, which for a 70B-parameter model demands hundreds of gigabytes of GPU memory. Second, deploying multiple fine-tuned variants (one per task or customer) requires storing a separate copy of the full model for each variant.

Low-Rank Adaptation (LoRA), introduced by Hu et al. [16], addresses both problems by freezing the pretrained weights and injecting small trainable low-rank matrices into each layer.

Definition 2 (Low-Rank Adaptation (LoRA)).

For a pretrained weight matrix W0d×k, LoRA reparameterizes the effective weight as (LORA Reparam)W=W0+ΔW=W0+BA, where Bd×r and Ar×k with rmin(d,k). The forward pass computes (LORA Forward)h=W0x+αrBAx, where α>0 is a scaling hyperparameter. The matrices are initialized as A𝒩(0,σ2) and B=0, so that ΔW=0 at initialization and the model begins from the pretrained weights. Only A and B are trained; W0 is frozen.

The key insight is that the weight update ΔW=BA has rank at most r, so LoRA restricts the fine-tuning update to a low-rank subspace. This dramatically reduces the number of trainable parameters.

Proposition 1 (LoRA Parameter Reduction).

For a single weight matrix W0d×k, LoRA reduces the number of trainable parameters from dk to r(d+k). The compression ratio is (LORA Compression)dkr(d+k)=d2r(for d=k). For typical values d=k=4096 and r=8: full fine-tuning requires 4096×4096=16,777,216 parameters, while LoRA requires 8×(4096+4096)=65,536 parameters, a 256× reduction.

Proof.

The matrix Bd×r has dr parameters and Ar×k has rk parameters, giving r(d+k) total. The ratio dk/r(d+k) follows immediately. Substituting d=k=4096 and r=8 yields 16,777,216/65,536=256.

LoRA architecture. The pretrained weight matrix W0 (gray) is frozen. A low-rank bypass path through the trainable down-projection A (dimension dr) and up-projection B (dimension rd) captures the task-specific update. At initialization, B=0 ensures that the model starts from the pretrained weights. The rank bottleneck rd compresses the adaptation into a tiny subspace.

Definition 3 (QLoRA).

QLoRA [6] combines LoRA with aggressive quantization of the frozen weights. The pretrained matrix W0 is stored in 4-bit NormalFloat (NF4) format, a data type whose quantization levels are optimally spaced for normally distributed weights. QLoRA introduces two additional techniques: double quantization, which quantizes the quantization constants themselves to further reduce memory, and paged optimizers, which offload optimizer states to CPU memory when GPU memory is exhausted. The LoRA adapters A and B remain in 16-bit precision, so the gradient computation is unchanged. The result is that a 65B-parameter model can be fine-tuned on a single 48,GB GPU.

Example 1 (Fine-Tuning LLaMA-7B with LoRA).

Consider fine-tuning a LLaMA-7B model.

  1. Full fine-tuning: 7 billion parameters × 2 bytes (FP16) =14,GB of trainable parameters, plus optimizer states (Adam requires 2× the parameter memory), totaling 42,GB.

  2. LoRA (rank 8): Apply LoRA to the query and value projection matrices in all 32 Transformer layers. Each layer has 2 matrices of size 4096×4096, yielding 32×2×8×(4096+4096)×2 bytes 8,MB of trainable parameters.

  3. Compression ratio: 14GB/8MB1750×.

The LoRA-adapted model achieves comparable performance to full fine-tuning on instruction-following benchmarks while using approximately 0.06% of the trainable parameter budget.

Insight.

LoRA exploits the hypothesis that weight updates during fine-tuning have low intrinsic dimensionality [7]: the effective number of parameters needed to capture task-specific knowledge is far smaller than the full parameter count. Aghajanyan et al. showed that pretrained models can be fine-tuned in a randomly projected subspace of dimension as low as a few hundred, with minimal loss in performance. LoRA provides a structured, hardware-efficient way to exploit this low-rank structure, replacing random projections with learned low-rank factors.

Remark 2 (Inference-Time Merging).

At inference time, the LoRA adapters can be merged into the base weights: W=W0+(α/r)BA. After merging, the forward pass is identical to that of a standard model with no additional latency or memory overhead. Moreover, multiple LoRA adapters (one per task) can be stored separately and swapped dynamically, enabling efficient multi-task serving from a single base model. This is sometimes called LoRA task routing and is the basis of systems like S-LoRA [8] that serve hundreds of LoRA adapters from a single GPU.

Reward Modelling

The SFT model follows instructions, but not all instructions are followed equally well. Given a prompt, the model might produce several plausible responses that differ in helpfulness, accuracy, tone, and safety. How do we teach the model which responses are better?

The answer is to learn a reward model from human preference data. Instead of asking humans to write perfect demonstrations (which is expensive and difficult to scale), we ask them a simpler question: given two responses, which one is better? This pairwise comparison format is cognitively easier for annotators, produces more consistent labels, and can be used to construct a scalar reward function that captures the aggregate structure of human preferences.

Preference Data

Definition 4 (Preference Dataset).

A preference dataset is a collection (Preference DATA)𝒟={(x(i),yw(i),yl(i))}i=1N, where for each prompt x(i), the response yw(i) is preferred (“winning”) and yl(i) is dispreferred (“losing”), as judged by a human annotator. We write ywyl|x to denote the preference relation.

In practice, collecting preference data proceeds as follows: (1) sample a batch of prompts from a distribution of interest; (2) for each prompt, generate K candidate responses from the current policy; (3) present pairs (or K-tuples) of responses to human annotators and ask them to rank the responses; (4) convert the rankings into pairwise preferences.

The Bradley–Terry Model

To convert pairwise preferences into a trainable objective, we need a preference model: a probabilistic model of the annotator's choice. The most widely used model is the Bradley–Terry model, which dates to 1952 [17] and is also the foundation of the Elo rating system in chess.

Definition 5 (Bradley–Terry Preference Model).

Given a latent reward function rϕ:𝒳×𝒴 parameterized by ϕ, the Bradley–Terry model defines the probability that response yw is preferred over yl given prompt x as (BT Model)p(ywyl|x)=σ(rϕ(x,yw)rϕ(x,yl)), where σ(z)=1/(1+ez) is the logistic sigmoid function.

The Bradley–Terry model has a clean interpretation: the probability that yw is preferred depends only on the difference in rewards. If rϕ(x,yw)rϕ(x,yl), then σ()1 and preference for yw is near-certain. If the rewards are equal, the preference probability is exactly 1/2 (a coin flip), as one would expect.

Reward Model Training

The reward model is trained by maximum likelihood under the Bradley–Terry model.

Definition 6 (Reward Model Loss).

The reward model training loss is the negative log-likelihood of the observed preferences under the Bradley–Terry model: (RM LOSS)RM(ϕ)=𝔼(x,yw,yl)𝒟[logσ(rϕ(x,yw)rϕ(x,yl))]. This is a binary cross-entropy loss where the “label” is always 1 (since yw is always the preferred response by construction) and the “logit” is the reward difference rϕ(x,yw)rϕ(x,yl).

Remark 3 (K-way Rankings).

In practice, annotators often rank K responses rather than comparing just two. Given K responses ranked y(1)y(2)y(K), we form (K2) pairwise comparisons. This is more data-efficient: K responses yield K(K1)/2 training pairs. InstructGPT uses K=4 to K=9 rankings per prompt, generating between 6 and 36 pairwise comparisons from each annotation [4]. To avoid correlated training examples, InstructGPT ensures that all pairs from a single ranking appear in the same training batch.

Proposition 2 (Reward Identifiability).

Under the Bradley–Terry model, the reward function r(x,y) is identifiable only up to an input-dependent constant. That is, r(x,y) and r(x,y)+f(x) induce the same preference distribution for any function f:𝒳.

Proof.

Substitute r(x,y)=r(x,y)+f(x) into the Bradley–Terry model: (Reward Identifiability)p(ywyl|x)=σ(r(x,yw)r(x,yl))=σ(r(x,yw)+f(x)r(x,yl)f(x))=σ(r(x,yw)r(x,yl))=p(ywyl|x). The f(x) terms cancel because the Bradley–Terry probability depends only on the reward difference, which is invariant to any additive function of the input alone. Therefore, without additional constraints (such as normalizing the reward to have zero mean per prompt), the reward is determined only up to this additive ambiguity.

The reward model data collection and training pipeline. Prompts are sampled, K responses are generated from the current policy, a human annotator ranks them, the rankings are decomposed into pairwise preferences, and the reward model is trained on the resulting preference dataset.

Caution.

Goodhart's Law and Reward Hacking. “When a measure becomes a target, it ceases to be a good measure.” When the learned reward model rϕ is optimized too aggressively, the policy may discover adversarial inputs to the reward model, outputs that score high on rϕ but are low quality according to true human preferences. This phenomenon, known as reward hacking or reward overoptimization, is the alignment analogue of Goodhart's law. Empirically, Gao et al. [9] showed that reward model score initially tracks true preference quality as optimization proceeds, but eventually diverges: the policy finds reward-model-specific artifacts that inflate the score without improving actual quality. The KL penalty in the RLHF objective is the primary defense, limiting how far the policy can deviate from the reference and thereby bounding the extent of reward exploitation.

Example 2 (InstructGPT Reward Model).

InstructGPT [4] trains a 6B-parameter reward model, not the full 175B model. The RM is initialized from the SFT model checkpoint: the language model head (the unembedding matrix that projects hidden states to vocabulary logits) is removed and replaced with a linear projection to a scalar: (RM Architecture)rϕ(x,y)=𝒘𝒉L+b, where 𝒉Ld is the hidden state at the last token position of the concatenated input (x,y), and 𝒘d, b are learned parameters. Using a smaller model (6B rather than 175B) for the reward model improves training stability and reduces the risk of overfitting to the relatively small preference dataset (33K comparisons).

Remark 4 (Reward Model Architecture).

The standard recipe for building a reward model is:

  1. Initialize from the SFT model checkpoint (which has already learned useful representations of language quality).

  2. Replace the language model head with a scalar projection d.

  3. Train on preference data using the Bradley–Terry loss .

  4. The reward for a prompt–response pair is the scalar output at the last token position.

This architecture has the advantage that the reward model “understands” language at a level comparable to the policy, since it shares the same pretrained backbone. However, it also means that the reward model has the same failure modes as the language model (hallucination, sensitivity to phrasing), which contributes to the reward hacking problem.

Proximal Policy Optimization for Alignment

With a reward model in hand, we can now formulate alignment as a reinforcement learning problem. The language model is the policy πθ, the prompt is the state, the generated response is the action, and the reward model provides the reward signal. The goal is to update the policy to maximize the expected reward while staying close to the pretrained reference policy.

The KL-Constrained Objective

Definition 7 (KL-Constrained Reward Maximization).

The alignment objective is (RLHF Objective)maxπθ𝔼x𝒟,yπθ(|x)[rϕ(x,y)]βDKL[πθ(|x)πref(|x)], where πref is the SFT policy (frozen after Stage 1), rϕ is the reward model (frozen after Stage 2), and β>0 controls the strength of the KL constraint. The KL divergence is (KL DIV)DKL[πθ(|x)πref(|x)]=𝔼yπθ(|x)[logπθ(y|x)πref(y|x)].

The KL term serves two purposes. First, it prevents reward hacking: by limiting how far the policy can deviate from the reference, it bounds the extent to which the policy can exploit artifacts of the learned reward model (see warn:goodhart). Second, it preserves the general capabilities acquired during pretraining: without the KL constraint, aggressive reward maximization can cause the model to forget how to perform tasks that are not directly rewarded, a phenomenon known as catastrophic forgetting.

The Optimal Policy

The KL-constrained objective has a remarkably clean closed-form solution, which will play a central role in the DPO derivation (Direct Preference Optimization).

Theorem 1 (Optimal Policy under KL Constraint).

The optimal policy for the KL-constrained objective is (Optimal Policy)π(y|x)=1Z(x)πref(y|x)exp(r(x,y)β), where the partition function is (Partition Function)Z(x)=yπref(y|x)exp(r(x,y)β).

Proof.

We seek to maximize the functional (J Functional)J[π]=yπ(y|x)r(x,y)βyπ(y|x)logπ(y|x)πref(y|x), subject to the constraint yπ(y|x)=1. Introducing a Lagrange multiplier λ for the normalization constraint, we form the Lagrangian (Lagrangian)[π,λ]=yπ(y|x)[r(x,y)βlogπ(y|x)πref(y|x)]+λ(1yπ(y|x)). Taking the functional derivative with respect to π(y|x) for a fixed y and setting it to zero: (Lagrangian Deriv)π(y|x)=r(x,y)βlogπ(y|x)πref(y|x)βλ=0. Solving for π(y|x): (LOG Ratio)logπ(y|x)πref(y|x)=r(x,y)βλβ, and exponentiating: (Unnormalized)π(y|x)=πref(y|x)exp(r(x,y)β)exp(βλβ). The factor exp((βλ)/β) is independent of y and serves as the normalization constant. Defining Z(x)=exp((β+λ)/β) and enforcing yπ(y|x)=1 recovers (Partition Function).

To verify this is a maximum, note that J[π] is strictly concave in π (as the sum of a linear term and a negative KL divergence, which is strictly concave), so the unique stationary point is the global maximum.

The optimal policy has an intuitive interpretation: it is the reference policy reweighted by the exponentiated reward. Responses with high reward are upweighted, responses with low reward are downweighted, and the temperature β controls the sharpness of this reweighting. As β0, the policy concentrates on the reward-maximizing response; as β, the policy converges to πref.

Per-Token Reward and the PPO Objective

In practice, the reward model assigns a single scalar rϕ(x,y) to the entire response. To apply token-level policy gradient methods, we distribute this reward across tokens. The standard approach combines the KL penalty at each step with the final reward at the last token.

The per-token reward is defined as (PER Token Reward)Rt={βlogπθ(yt|x,y<t)πref(yt|x,y<t)if t<T,rϕ(x,y)βlogπθ(yT|x,y<T)πref(yT|x,y<T)if t=T. At each intermediate step, the reward is the negative KL penalty: the cost of deviating from the reference policy. At the final step, the reward model score is added. The total reward t=1TRt=rϕ(x,y)βt=1Tlog(πθ(yt|x,y<t)/πref(yt|x,y<t)) equals the sequence-level objective , so optimizing the per-token formulation is equivalent to optimizing the original objective.

The policy is then updated using the PPO clipped objective: (PPO CLIP)PPO(θ)=𝔼t[min(rt(θ)A^t,clip(rt(θ),1ϵ,1+ϵ)A^t)], where (PPO Ratio)rt(θ)=πθ(yt|y<t,x)πold(yt|y<t,x) is the importance sampling ratio between the current and old policies, A^t is the generalized advantage estimate (GAE), and ϵ (typically 0.2) is the clipping range. The min and clip operations ensure that the policy does not change too much in a single update, stabilizing training.

Definition 8 (PPO-ptx: Pretraining Loss Mixing).

To prevent catastrophic forgetting of general capabilities, InstructGPT augments the PPO objective with a pretraining loss: (PPO PTX)J(θ)=JPPO(θ)+γ𝔼x𝒟pretrain[logπθ(x)], where γ>0 balances alignment with capability preservation and 𝒟pretrain is a sample of pretraining data. InstructGPT uses γ=27.8, indicating that preserving general capabilities is weighted heavily relative to the PPO signal.

The InstructGPT Pipeline

Algorithm 1 (InstructGPT RLHF Pipeline).

The full InstructGPT training pipeline consists of three stages:

Stage 1 - Supervised Fine-Tuning (SFT):

  1. Collect a dataset of 13K prompt–demonstration pairs from human labelers.

  2. Fine-tune the pretrained GPT-3 model on this dataset using the SFT loss for 16 epochs.

  3. Select the checkpoint with highest validation reward model score (not lowest validation loss).

Stage 2 - Reward Model (RM) Training:

  1. For each of 33K prompts, generate K{4,,9} responses from the SFT model.

  2. Have human labelers rank the K responses.

  3. Decompose rankings into (K2) pairwise preferences.

  4. Initialize a 6B model from the SFT checkpoint, replace the LM head with a scalar projection, and train using the Bradley–Terry loss .

Stage 3 - PPO:

  1. Initialize the policy πθ from the SFT model.

  2. Initialize the value function (critic) from the RM weights.

  3. For each PPO iteration: enumerate[label=()]

  4. Sample a batch of prompts x𝒟.

  5. Generate responses yπθ(|x).

  6. Compute rewards Rt using .

  7. Compute advantages A^t using GAE.

  8. Update the policy using the PPO-ptx objective .

  9. Update the value function to minimize the value loss. enumerate

The InstructGPT three-stage pipeline. Stage 1 (green) produces the SFT model from human demonstrations. Stage 2 (orange) trains a reward model on preference rankings. Stage 3 (purple) optimizes the policy with PPO, using the RL loop shown below: generate responses, compute rewards, and update the policy.

Example 3 (Reward Hacking Without KL Penalty).

Consider what happens when β=0 in (RLHF Objective), pure reward maximization with no KL constraint. The policy is free to deviate arbitrarily from πref. In practice, this leads to degenerate behaviour. For instance, a helpfulness reward model might assign high scores to effusively positive responses (“I'm so happy to help you with this wonderful question!”) regardless of content. Without the KL penalty, the policy quickly converges to producing such responses for every prompt, achieving high reward-model scores while being completely useless. With β>0, the KL penalty charges a cost for this deviation: the model cannot stray far from the reference policy's distribution, which includes diverse and substantive responses. The result is a model that is somewhat more helpful (high reward) while remaining broadly capable (low KL from reference).

Remark 5 (Critic Initialization).

The value function (critic) in PPO estimates the expected future reward V(x,y<t)=𝔼[t=tTRt|x,y<t]. In InstructGPT, the critic is initialized from the reward model weights. This gives the critic a significant head start: the RM has already learned to evaluate response quality, so the initial value estimates are meaningful rather than random. This initialization is crucial for stable training, as random critic values lead to high variance in the advantage estimates and erratic policy updates.

Remark 6 (InstructGPT Results).

The InstructGPT paper [4] reported a striking result: a 1.3B-parameter InstructGPT model was preferred over the 175B-parameter GPT-3 base model by human evaluators 85% of the time. This demonstrated that alignment can compensate for orders-of-magnitude differences in model size: a well-aligned small model can be more useful than a poorly aligned large one. The result catalyzed the field, demonstrating that the bottleneck for useful AI systems was not just scale but alignment.

Direct Preference Optimization

The RLHF pipeline described in Proximal Policy Optimization for Alignment works, but it is complex. It requires training three separate models (the SFT policy, the reward model, and the PPO critic), managing an online RL loop with all its instabilities (reward hacking, value function divergence, hyperparameter sensitivity), and running four neural networks simultaneously during training (the policy, the reference policy, the reward model, and the critic). Each of these components introduces potential points of failure, and the overall system is notoriously difficult to tune.

Direct Preference Optimization (DPO), introduced by Rafailov et al. (2023) [5], makes a beautiful observation: the reward model and the RL loop are unnecessary. By exploiting the closed-form solution for the optimal policy (Theorem 1), DPO reparameterizes the reward in terms of the policy and eliminates the reward model entirely. The result is a simple, stable, supervised-learning objective that directly optimizes the policy on preference data.

Recap: From Bradley–Terry to the KL-Constrained Objective

Let us briefly review the key results from Reward Modelling and Proximal Policy Optimization for Alignment that DPO builds upon.

The Bradley–Terry model (Definition 5) gives the probability of preference in terms of a latent reward: (DPO BT Recap)p(ywyl|x)=σ(r(x,yw)r(x,yl)).

The KL-constrained alignment objective (Definition 7) is (DPO KL Recap)maxπθ𝔼x,yπθ[r(x,y)]βDKL[πθπref], and its optimal solution (Theorem 1) is (DPO Optimal Recap)π(y|x)=1Z(x)πref(y|x)exp(r(x,y)/β).

The standard RLHF pipeline uses (DPO BT Recap) to train a reward model, then uses the reward model in (DPO KL Recap) to train the policy with PPO. DPO takes a different path.

The Reparameterization Trick

The key insight begins with a simple algebraic manipulation. Starting from the optimal policy , take the logarithm of both sides: (DPO LOG Optimal)logπ(y|x)=logπref(y|x)+r(x,y)βlogZ(x). Now solve for the reward: (DPO Reward Reparam)r(x,y)=βlogπ(y|x)πref(y|x)+βlogZ(x).

This is the reparameterization: the reward is expressed purely in terms of the optimal policy π, the reference policy πref, and the partition function Z(x). The reward model has been eliminated, replaced by the log-ratio of the optimal and reference policies, plus a prompt-dependent constant.

Remark 7.

Equation should be compared with the reward identifiability result (Proposition 2): the reward is only identifiable up to an input-dependent constant, and here that constant is βlogZ(x). This ambiguity is harmless for pairwise preferences, as we will see in the next subsection.

Partition Function Cancellation

Now substitute the reparameterized reward into the Bradley–Terry model : (DPO Cancel)p(ywyl|x)=σ(r(x,yw)r(x,yl))=σ(βlogπ(yw|x)πref(yw|x)+βlogZ(x)βlogπ(yl|x)πref(yl|x)βlogZ(x))=σ(βlogπ(yw|x)πref(yw|x)βlogπ(yl|x)πref(yl|x)). The βlogZ(x) terms cancel. This cancellation is the mathematical heart of DPO: the intractable partition function, which would require summing over all possible responses, simply disappears in the pairwise preference setting. No approximation is needed; the cancellation is exact.

The DPO Loss

With the partition function gone, we can replace the true optimal policy π with our parameterized policy πθ (since we are optimizing πθ to approach π) and write down a loss function directly.

Definition 9 (DPO Loss).

The Direct Preference Optimization loss is (DPO LOSS)DPO(πθ;πref)=𝔼(x,yw,yl)𝒟[logσ(βlogπθ(yw|x)πref(yw|x)βlogπθ(yl|x)πref(yl|x))].

Let us unpack this expression. Define the implicit reward of a response under the current policy: (Implicit Reward)r^θ(x,y)=defβlogπθ(y|x)πref(y|x). Then the DPO loss simplifies to (DPO LOSS Simple)DPO=𝔼[logσ(r^θ(x,yw)r^θ(x,yl))], which is precisely the Bradley–Terry loss with the explicit reward rϕ replaced by the implicit reward r^θ. The DPO loss is a binary cross-entropy loss that encourages the policy to assign higher implicit reward to the preferred response than to the dispreferred response.

Theorem 2 (DPO–RLHF Equivalence).

In the limit of infinite data and infinite model capacity, the global minimizer of the DPO loss is the same policy π that would be obtained by the full RLHF pipeline: training a reward model with the Bradley–Terry loss and then optimizing the KL-constrained objective to convergence.

Proof sketch.

The DPO loss is derived by substituting the closed-form optimal policy into the Bradley–Terry likelihood. The derivation is exact; no approximations are made. Therefore, the population-level DPO loss is minimized when πθ=π, the same policy that simultaneously (a) satisfies the Bradley–Terry model under the true reward and (b) solves the KL-constrained optimization. In the finite-sample or finite-capacity regime, DPO and RLHF may converge to different solutions due to different optimization landscapes and regularization properties, but the population-level optima coincide.

Gradient Analysis

Understanding the gradient of the DPO loss reveals an elegant self-weighting mechanism.

Proposition 3 (DPO Gradient).

The gradient of the DPO loss with respect to θ is (DPO Gradient)θDPO=β𝔼(x,yw,yl)𝒟[σ(r^θ(x,yl)r^θ(x,yw))weighting factor(θlogπθ(yw|x)θlogπθ(yl|x))], where r^θ(x,y)=βlog(πθ(y|x)/πref(y|x)) is the implicit reward.

Proof.

Starting from the DPO loss , let u=r^θ(x,yw)r^θ(x,yl). Then DPO=𝔼[logσ(u)]. Using ddulogσ(u)=1σ(u)=σ(u), we have (DPO GRAD Step1)θDPO=𝔼[σ(u)θu]=𝔼[σ(r^θ(x,yl)r^θ(x,yw))θu]. Now compute θu: (DPO GRAD Step2)θu=θ[r^θ(x,yw)r^θ(x,yl)]=βθ[logπθ(yw|x)logπθ(yl|x)]=β[θlogπθ(yw|x)θlogπθ(yl|x)], since πref does not depend on θ. Substituting into yields .

The gradient has a beautiful interpretation. The update increases the log-probability of the preferred response yw and decreases the log-probability of the dispreferred response yl. But the magnitude of the update is controlled by the sigmoid weighting factor σ(r^ylr^yw), which is large when the model currently assigns higher implicit reward to the wrong response (r^yl>r^yw) and small when the model already gets it right (r^yw>r^yl). This is automatic hard-example mining: the gradient focuses on the pairs that the model currently ranks incorrectly, and ignores the easy pairs that are already correct.

Proposition 4 (Implicit Reward Model).

After DPO training, the policy itself encodes a reward model: (Implicit RM)r(x,y)=βlogπθ(y|x)πref(y|x)+βlogZ(x), where Z(x) is an input-dependent constant. Since preferences depend only on reward differences (Proposition 2), the Z(x) term is irrelevant for ranking responses, and the log-ratio log(πθ(y|x)/πref(y|x)) serves as a fully functional reward model.

Insight.

DPO converts an RL problem into a classification problem. Instead of training three models (policy, reward model, critic) and running an online RL loop with all its instabilities, DPO trains a single model with a binary cross-entropy-style loss on static preference data. The reward model is not eliminated; it is absorbed into the policy. Every DPO-trained policy is a reward model (up to an irrelevant constant), accessible via the log-ratio in (Implicit RM). This duality between policies and reward models is the fundamental insight underlying DPO.

The DPO derivation as a logical flow. Starting from the Bradley–Terry preference model and the KL-constrained objective, we derive the closed-form optimal policy, reparameterize the reward in terms of the policy, and observe that the partition function Z(x) cancels in pairwise comparisons, yielding the DPO loss directly.
RLHF vs. DPO: a structural comparison. Left: the RLHF pipeline requires three models (policy, reward model, critic) connected in an online RL loop. Right: DPO requires only the policy, which is trained with a supervised loss on static preference data. The reward model is absorbed into the policy via the implicit reward (Proposition 4).

The DPO Algorithm

Algorithm 2 (DPO Training).

Input: Reference policy πref (the SFT model), preference dataset 𝒟={(x(i),yw(i),yl(i))}, temperature β>0, learning rate η.

Procedure:

  1. Initialize πθπref.

  2. Freeze πref (no gradient updates).

  3. For each mini-batch (x,yw,yl)𝒟: enumerate[label=()]

  4. Compute log-probabilities under πθ: logπθ(yw|x) and logπθ(yl|x).

  5. Compute log-probabilities under πref (forward pass, no gradient): logπref(yw|x) and logπref(yl|x).

  6. Compute implicit rewards: r^w=β(logπθ(yw|x)logπref(yw|x)), r^l=β(logπθ(yl|x)logπref(yl|x)).

  7. Compute loss: =logσ(r^wr^l).

  8. Update: θθηθ. enumerate

  9. Output: Aligned policy πθ.

The simplicity of Algorithm 2 is remarkable compared to the InstructGPT pipeline (Algorithm 1). There is no reward model to train, no critic to initialize, no online generation loop, and no GAE computation. The entire alignment procedure reduces to computing log-probabilities under two models (the policy and the frozen reference) and backpropagating through a binary cross-entropy loss.

Example 4 (DPO vs. PPO on Summarization).

On the TL;DR summarization task [3], Rafailov et al. reported the following results:

  • DPO achieves a win rate of 61% against the SFT baseline (as judged by GPT-4).

  • PPO (best of sweep) achieves a win rate of 57% against the same baseline.

  • DPO uses approximately 3× less compute than PPO, since it avoids online generation and reward model inference during training.

The fact that DPO matches or exceeds PPO while being dramatically simpler was a key factor in its rapid adoption.

Remark 8 (Choice of β).

The temperature parameter β controls how far the aligned policy can deviate from the reference. The effects are as follows:

  • Small β (e.g., β=0.1): aggressive optimization. The implicit reward is amplified, so the policy can move far from πref to maximize preference alignment. Risk: overfitting to preference data, reduced diversity, potential reward hacking.

  • Large β (e.g., β=0.5): conservative optimization. The policy stays close to πref, making small adjustments. Risk: underfitting, failing to fully capture human preferences.

  • Typical range: β[0.1,0.5]. Rafailov et al. use β=0.1 for summarization and β=0.5 for dialogue.

Remark 9 (DPO Limitations).

Despite its elegance, DPO has known limitations:

  1. Distribution shift: DPO trains on offline preference data (generated by the SFT policy or a previous checkpoint), but the policy πθ evolves during training. As πθ diverges from the data-generating policy, the preference pairs become less informative, and the model may learn to distinguish responses that it would never generate. Online variants such as online DPO and iterative DPO address this by periodically regenerating preference data from the current policy.

  2. Reference policy dependence: The DPO loss depends on πref through the log-ratio. If πref assigns near-zero probability to a response in the preference data, the log-ratio becomes very large, leading to numerical instability. In practice, this requires careful filtering of preference data to ensure both responses are plausible under πref.

  3. No exploration: Unlike PPO, which generates new responses during training and can discover novel high-reward strategies, DPO is limited to the behaviors represented in the static preference dataset. This can be a significant disadvantage for tasks where the optimal strategy is not well represented in the training data.

We summarize the comparison between RLHF (PPO) and DPO in Table 1.

AspectRLHF (PPO)DPO
Models requiredPolicy + Reward Model + Critic (3)Policy only (1)
Training dataOnline (generated during training)Offline (static preference dataset)
Reward modelExplicit, separately trainedImplicit in the policy
OptimizationReinforcement learning (policy gradient)Supervised learning (cross-entropy)
Partition functionApproximated (not needed explicitly)Cancels exactly in pairwise comparisons
HyperparametersMany (PPO clip, GAE λ, critic lr, )Few (β, learning rate)
Compute costHigh (4 forward passes per step)Low (2 forward passes per step)
ExplorationYes (online generation)No (offline data)
Reward hackingControlled by KL penaltyImplicitly controlled by β
Distribution shiftMitigated by online samplingCan be problematic
Comparison of RLHF (PPO) and DPO for language model alignment.

Group Relative Policy Optimization

The PPO algorithm described in Proximal Policy Optimization for Alignment requires maintaining four neural networks simultaneously during training: the policy πθ, the reference policy πref, the reward model rϕ, and a critic (value function) Vψ. The critic alone can be as large as the policy itself, doubling the GPU memory required. For models at the 70B–671B parameter scale, this cost is prohibitive: a 671B policy would require two copies of itself (policy + critic) plus a reward model, easily exceeding the memory of an entire compute cluster.

Group Relative Policy Optimization (GRPO), introduced by Shao et al. (2024) [18] in the context of DeepSeekMath, eliminates the critic entirely by computing advantages relative to a group of sampled outputs. The key insight is disarmingly simple: instead of learning a value function to estimate the advantage, just sample multiple outputs for the same prompt and normalize their rewards.

Key Idea.

Group-based advantage estimation. Given a prompt x, sample a group of G candidate outputs {o1,o2,,oG} from the current policy πθ. Score each output with the reward model to obtain {r1,r2,,rG}. The advantage of output oi is simply its z-scored reward within the group: A^i=rirσr,r=1Gj=1Grj,σr=1Gj=1G(rjr)2. No learned value function is needed; the group is the baseline.

From PPO to GRPO

Recall the PPO objective from (PPO CLIP). In standard PPO, the advantage A^t at each token is estimated using Generalized Advantage Estimation (GAE), which requires the value function Vψ. GRPO replaces this with a constant advantage across all tokens in a given output: every token in output oi receives the same advantage A^i.

Definition 10 (GRPO Objective).

Given a prompt x, group of outputs {o1,,oG} sampled from the old policy πθold, and group-normalized advantages {A^1,,A^G}, the GRPO objective is: (GRPO Objective)JGRPO(θ)=1Gi=1G1|oi|t=1|oi|[min(ρi,tA^i,clip(ρi,t,1ϵ,1+ϵ)A^i)βDKL(i,t)], where the importance ratio is ρi,t=πθ(oi,t|x,oi,<t)/πθold(oi,t|x,oi,<t), ϵ is the clipping threshold (typically 0.2), and the per-token KL divergence uses the unbiased estimator (GRPO KL)DKL(i,t)=πref(oi,t|x,oi,<t)πθ(oi,t|x,oi,<t)logπref(oi,t|x,oi,<t)πθ(oi,t|x,oi,<t)1.

Remark 10 (Unbiased KL Estimator).

The estimator in (GRPO KL) is derived from the identity DKL[pq]=𝔼p[log(p/q)]. Let u=q(x)/p(x) where xp. Then 𝔼p[ulogu1]=DKL[pq], since 𝔼p[u]=xp(x)q(x)/p(x)=1 and 𝔼p[logu]=𝔼p[log(p/q)]=DKL[pq]. The estimator ulogu10 for all u>0 (with equality at u=1), so each sample provides a non-negative, unbiased estimate of the KL divergence. This avoids the variance issues of the naive estimator log(p/q) when p and q are close.

Outcome Supervision vs. Process Supervision

GRPO is particularly effective for tasks with verifiable rewards (mathematics, coding, formal logic) where the correctness of the final answer can be checked automatically. In this setting, two supervision strategies are natural:

  • Outcome supervision: The reward depends only on the final answer: ri=𝟏[answer(oi) is correct]. This is cheap to implement but provides a sparse signal.

  • Process supervision: The reward incorporates intermediate reasoning steps, e.g., checking each line of a mathematical derivation. This provides a denser signal but requires a process reward model (PRM) or step-level verification.

DeepSeekMath [18] demonstrates that GRPO with outcome supervision alone achieves 51.7% accuracy on the MATH benchmark, competitive with GPT-4 on mathematical reasoning, using a 7B parameter model. The group-based normalization ensures that even with binary (correct/incorrect) rewards, the advantage signal is informative: within any group, correct solutions receive positive advantage and incorrect ones receive negative advantage.

Proposition 5 (GRPO Advantage with Binary Rewards).

If the reward is binary, ri{0,1}, and k out of G outputs in the group are correct (0<k<G), then: A^i={1k/Gk(Gk)/G2=Gkkif oi is correct,0k/Gk(Gk)/G2=kGkif oi is incorrect. The advantage magnitude is larger for the minority class: if few outputs are correct (kG), correct outputs receive large positive advantage; if few are incorrect (kG), incorrect outputs receive large negative advantage.

Proof.

The group mean is r=k/G and the variance is σr2=1Gi(rik/G)2=kG(1k/G)2+GkG(k/G)2=k(Gk)G2. For a correct output, A^i=(1k/G)/σr=(Gk)/(Gσr)=(Gk)/k. For an incorrect output, A^i=(0k/G)/σr=k/(Gσr)=k/(Gk).

Example 5 (GRPO in Action: Mathematical Reasoning).

Consider the prompt: “Solve 01x2exdx.” We sample G=8 candidate outputs from the policy. Suppose 3 outputs arrive at the correct answer e2 and 5 produce incorrect results. The rewards are r{1,1,1,0,0,0,0,0} with r=3/8, σr=15/640.484. The advantages are: A^correct=13/80.484+1.29(reinforce these outputs),A^incorrect=03/80.4840.77(suppress these outputs). The correct (minority) outputs receive a larger magnitude advantage, ensuring the policy updates focus on amplifying rare successful strategies. No value function was needed; the group provided its own baseline.

The GRPO pipeline. A group of G outputs is sampled, scored by the reward model, z-score normalized within the group to produce advantages, and used in a clipped PPO-style update. The critic is eliminated entirely.

PPO vs. GRPO: A Comparison

AspectPPOGRPO
Advantage estimationLearned critic Vψ (GAE)Group z-score normalization
Models in memoryPolicy + Critic + Reward + Reference (4)Policy + Reward + Reference (3)
Memory savingBaseline50% (no critic)
Token-level advantageYes (different A^t per token)No (same A^i for all tokens)
KL regularizationReward penalty or PPO constraintExplicit KL term per token
Best suited forGeneral RLHF, creative tasksVerifiable tasks (math, code)
Comparison of PPO and GRPO for language model alignment.

Algorithm 3 (GRPO Training).

  1. Input: Prompt dataset 𝒟, initial policy πθ, reference policy πref, reward model rϕ, group size G, clip threshold ϵ, KL coefficient β
  2. for iteration =1,2,
  3. Sample a batch of prompts {x(1),,x(B)}𝒟
  4. for each prompt x(j)
  5. Sample G outputs: o1,,oGπθold(|x(j))
  6. Compute rewards: ri=rϕ(x(j),oi) for i=1,,G
  7. Normalize: A^i=(rir)/σr
  8. Compute JGRPO(θ) via (GRPO Objective)
  9. Update θθ+αθJGRPO(θ)
  10. Update old policy: θoldθ

Remark 11 (Connection to DeepSeek-R1).

GRPO is the foundational RL algorithm behind DeepSeek-R1 [10], the reasoning-focused language model discussed in DeepSeek-R1: A Case Study. DeepSeek-R1 applies GRPO at massive scale (671B MoE parameters), using rule-based reward functions for mathematical reasoning and coding tasks. The critic-free design is essential at this scale: maintaining a separate 671B critic would roughly double the already enormous memory footprint. The success of DeepSeek-R1 demonstrated that GRPO scales reliably to frontier-class models.

DAPO: Alignment at Scale

GRPO provides a solid foundation, but scaling RL-based alignment to very large models and datasets reveals several failure modes. Yu et al. (2025) [11] identify four specific pathologies in standard GRPO training and propose targeted fixes, each with a clear mathematical motivation. Together, these fixes constitute Dynamic-sampling Aligned Policy Optimization (DAPO).

The four innovations are:

  1. Clip-Higher: asymmetric clipping to prevent entropy collapse;

  2. Dynamic Sampling: filtering degenerate groups to improve signal quality;

  3. Token-Level Loss: global token normalization to prevent length bias;

  4. Overlong Reward Shaping: soft penalty for exceeding length limits.

We now develop each innovation in detail.

Clip-Higher: Asymmetric Clipping

In standard PPO/GRPO, the importance ratio ρi,t is clipped symmetrically to [1ϵ,1+ϵ]. This prevents excessively large policy updates. However, Yu et al. observe that symmetric clipping causes entropy collapse: the policy's entropy decreases monotonically during training, and the model converges to a narrow distribution that generates only a few stereotyped responses.

The root cause is an asymmetry in the update dynamics. When a token already has high probability under the current policy:

  • A positive advantage pushes ρi,t above 1+ϵ, and the clip prevents further increase: the gradient is zeroed out.

  • A negative advantage pushes ρi,t below 1ϵ, and the clip activates only when the ratio is very small.

The net effect is that high-probability tokens can be suppressed but not amplified, while low-probability tokens (which contribute most to entropy) are clipped on the upside. Over many iterations, the distribution narrows.

Definition 11 (Clip-Higher).

Replace the symmetric clip [1ϵ,1+ϵ] with an asymmetric clip [1ϵlow,1+ϵhigh] where ϵhigh>ϵlow: (CLIP Higher)Jclip-higher=min(ρi,tA^i,clip(ρi,t,1ϵlow,1+ϵhigh)A^i). In DAPO, ϵlow=0.2 and ϵhigh=0.28.

Proposition 6 (Clip-Higher Prevents Entropy Collapse).

Consider a token with positive advantage (A^i>0). Under symmetric clipping, the gradient θJ is zeroed when ρi,t>1+ϵ. Under Clip-Higher with ϵhigh>ϵ, the gradient remains active for ρi,t(1+ϵ,1+ϵhigh], allowing low-probability tokens (which produce large ρi,t when their probability increases) to continue increasing. Since entropy 𝖧(π)=vπ(v)logπ(v) increases when probability mass is transferred from high-probability tokens to low-probability tokens, Clip-Higher permits entropy-increasing updates that symmetric clipping blocks.

Symmetric vs. Clip-Higher clipping. The asymmetric upper bound allows low-probability tokens with positive advantage to continue increasing their probability, preventing entropy collapse.

Dynamic Sampling

When all G outputs in a group are correct (or all incorrect), the z-scored advantages are zero (the numerator rir vanishes for all i), providing no learning signal. Worse, these degenerate batches still consume compute for sampling and reward evaluation.

Definition 12 (Dynamic Sampling).

After sampling a group of G outputs for prompt x, compute the number of correct outputs k=i𝟏[ri=1]. Discard and resample the group if k=0 or k=G. Only groups satisfying 0<k<G are used for the policy update. Formally, the effective dataset is: 𝒟eff={(x,o1,,oG)|0<i=1G𝟏[ri=1]<G}.

Remark 12 (Dynamic Sampling and Difficulty Curriculum).

Dynamic Sampling implicitly creates a difficulty curriculum. Early in training, easy prompts (where k=G) are filtered out because the model already solves them perfectly. As training progresses and the model improves, harder prompts that previously had k=0 begin producing some correct outputs and enter the training set. This natural curriculum concentrates training signal on prompts at the frontier of the model's capability, neither too easy nor too hard.

Token-Level Loss

Standard GRPO normalizes the loss per sequence: the inner sum over tokens is divided by |oi|, then averaged over the group. This means each sequence contributes equally, regardless of length. Consequently, short sequences have higher per-token gradient magnitude, biasing the policy toward generating shorter outputs.

Definition 13 (Token-Level Loss).

Replace the sequence-level normalization 1Gi1|oi|t() with a global token normalization: (Token Level LOSS)Jtoken(θ)=1i=1G|oi|i=1Gt=1|oi|[min(ρi,tA^i,clip(ρi,t,1ϵlow,1+ϵhigh)A^i)βDKL(i,t)]. Each token contributes equally to the gradient, regardless of the length of the sequence it belongs to.

Overlong Reward Shaping

In practice, generated outputs that exceed the maximum context length Lmax are truncated and typically receive zero reward (the truncated output is rarely correct). This creates a sharp cliff in the reward landscape at Lmax, which is difficult for the policy to learn from, as the model receives no information about how close it was to producing a valid answer within the length limit.

Definition 14 (Overlong Reward Shaping).

For an output oi that exceeds the length limit Lmax, replace the hard zero reward with a soft penalty that increases linearly with the excess length: (Overlong Reward)roverlong(oi)=min(1,max(0,|oi|LmaxLcache)), where Lcache is a buffer length (typically Lcache=512 tokens). This provides a smooth gradient from 0 (at |oi|=Lmax) to 1 (at |oi|=Lmax+Lcache).

Remark 13 (Gradient of Overlong Reward).

The overlong reward provides a gradient signal proportional to 1/Lcache for outputs in the range [Lmax,Lmax+Lcache]. This encourages the model to “tighten” its reasoning, finding more concise solution strategies, rather than simply truncating. Without this shaping, the model has no incentive to reduce length until it is already below Lmax.

The Full DAPO Algorithm

Combining all four innovations yields the complete DAPO algorithm.

Algorithm 4 (DAPO Training).

  1. Input: Prompt dataset 𝒟, policy πθ, reference πref, reward rϕ, group size G, clips ϵlow,ϵhigh, KL coefficient β, max length Lmax, cache Lcache
  2. for iteration =1,2,
  3. Sample batch of prompts {x(1),,x(B)}
  4. for each prompt x(j)
  5. repeat
  6. Sample G outputs: o1,,oGπθold(|x(j))
  7. Compute rewards: rirϕ(x(j),oi); if |oi|>Lmax, add roverlong(oi)
  8. ki𝟏[ri>0] Dynamic Sampling check
  9. until 0<k<G
  10. Normalize: A^i=(rir)/σr
  11. Compute Jtoken(θ) via (Token Level LOSS) with Clip-Higher
  12. Update θθ+αθJtoken(θ)
  13. θoldθ

Example 6 (DAPO Ablation on AIME 2024).

Yu et al. (2025) [11] report a progressive ablation study on the AIME 2024 competition math benchmark, starting from a vanilla GRPO baseline and adding each DAPO innovation:

ConfigurationAIME 2024 Score
GRPO baseline30.0
+ Clip-Higher36.7
+ Dynamic Sampling40.0
+ Token-Level Loss43.3
+ Overlong Reward (full DAPO)50.0

Each innovation provides a meaningful improvement, with the full DAPO system achieving 50.0 on AIME 2024, a 67% relative improvement over the GRPO baseline. Notably, Clip-Higher provides one of the two largest single improvements (+6.7 points, matched by Overlong Reward Shaping), confirming that entropy collapse is among the most critical failure modes.

DAPO ablation waterfall chart on AIME 2024. Each innovation adds a meaningful improvement; the shaded region shows the baseline GRPO score.

Alignment for Diffusion Models

The alignment techniques developed in sec:alignment:ppo,sec:alignment:dpo,sec:alignment:grpo were designed for autoregressive language models, where the policy πθ(y|x) is a tractable distribution factorized token by token. But the alignment problem is equally pressing for generative image models. A text-to-image diffusion model may produce photorealistic images, but they may be aesthetically unpleasing, contain artifacts, fail to match the text prompt, or generate unsafe content. Human (or automated) feedback can improve these aspects, if we can formalize the diffusion process as a decision-making problem amenable to RL.

This section shows that the T-step denoising process of a diffusion model can be cast as a Markov Decision Process (MDP), enabling direct application of policy gradient methods. We then survey four complementary alignment approaches: DDPO (RL-based), DRaFT (direct gradient), Diffusion-DPO (preference-based), and ReFL (reward feedback).

Denoising as a Markov Decision Process

Definition 15 (Denoising MDP).

The T-step denoising process of a diffusion model defines an MDP (𝒮,𝒜,P,R,T) with:

  • States: st=(xt,t,c) where xt is the noisy image at step t, t is the timestep, and c is the text conditioning;

  • Actions: at=xt1, the denoised image at the next step;

  • Transition: deterministic given the action (the action is the next state's image component);

  • Policy: πθ(at|st)=pθ(xt1|xt,c), the learned denoising distribution;

  • Reward: R(s0)=r(x0,c), a scalar reward given only at the final step t=0, evaluating the quality of the generated image x0 with respect to the prompt c.

The denoising process as a Markov Decision Process. Each denoising step is an action, and the reward is given only at the terminal state x0.

Proposition 7 (Exact Log-Probabilities in Gaussian Denoising).

When the denoising policy is Gaussian, pθ(xt1|xt,c)=𝒩(xt1;μθ(xt,t,c),σt2I), the log-probability of each transition is: (Diffusion Logprob)logpθ(xt1|xt,c)=d2log(2πσt2)xt1μθ(xt,t,c)22σt2, where d is the dimensionality of xt. This is exact and differentiable; no approximation is needed, unlike the intractable logpθ(x0) of the full generative model.

Proof.

This follows directly from the density of a multivariate Gaussian with diagonal covariance σt2I.

DDPO: Denoising Diffusion Policy Optimization

Black et al. (2024) [19] propose DDPO, applying policy gradient methods directly to the denoising MDP.

The policy gradient for the denoising MDP is: (DDPO Gradient)θJ=𝔼[r(x0,c)t=1Tθlogpθ(xt1|xt,c)]. This is a standard REINFORCE gradient applied to the T-step trajectory. Black et al. propose two variants:

  • DDPO-SF (score function): Directly applies (DDPO Gradient) with a learned baseline b(c) to reduce variance: θJ𝔼[(r(x0,c)b(c))tθlogpθ(xt1|xt,c)].

  • DDPO-IS (importance sampling): Uses a PPO-style clipped objective with importance ratios: (DDPO IS)JDDPO-IS=𝔼[t=1Tmin(ρtA^,clip(ρt,1ϵ,1+ϵ)A^)], where ρt=pθ(xt1|xt,c)/pθold(xt1|xt,c) and A^=r(x0,c)b(c).

Remark 14 (Variance Scales with T).

The REINFORCE gradient in (DDPO Gradient) has variance that scales linearly with the number of denoising steps T, since the trajectory length is T. With typical values of T=501000, this can be substantial. DDPO-IS mitigates this through the clipping mechanism, and practical implementations often use T=50 (DDIM sampling) rather than T=1000 (DDPM).

DRaFT: Direct Reward Fine-Tuning

When the reward function r is differentiable with respect to the generated image x0 (e.g., a neural network aesthetic scorer or CLIP similarity), we can bypass the high-variance REINFORCE estimator entirely and backpropagate the reward gradient directly through the denoising chain.

Definition 16 (DRaFT Objective).

Given a differentiable reward r(x0,c), the DRaFT objective [12] is simply: (Draft)DRaFT(θ)=𝔼xT𝒩(0,I),c𝒟[r(Denoiseθ(xT,c),c)], where Denoiseθ(xT,c) denotes the full T-step deterministic (DDIM) denoising chain from xT to x0.

The gradient θDRaFT is computed by backpropagating through all T denoising steps. For a typical diffusion model with T=50 steps and hundreds of millions of parameters, this requires enormous memory. DRaFT addresses this in two ways:

  1. DRaFT-K: Backpropagate through only the last K denoising steps (typically K=1 or K=5), treating the first TK steps as frozen. This reduces memory by a factor of T/K at the cost of a biased gradient.

  2. LoRA: Apply LoRA (Parameter-Efficient Fine-Tuning: LoRA) to the diffusion model's U-Net, reducing the number of trainable parameters and the memory footprint of gradient computation.

Remark 15 (DRaFT-1 Approximation Quality).

Clark et al. (2024) show empirically that DRaFT-1 (backprop through only the final denoising step) achieves 80–90% of the reward improvement of full-chain DRaFT, while using 50× less memory. This is because the final denoising step has the most direct influence on the pixel-level content of x0; earlier steps primarily determine the coarse structure, which is less sensitive to small parameter changes.

Diffusion-DPO: Preference Learning for Diffusion

Wallace et al. (2024) [13] adapt DPO (Direct Preference Optimization) to diffusion models. The key challenge is that DPO requires log-likelihoods logπθ(y|x), but for diffusion models the marginal likelihood logpθ(x0|c) is intractable.

The solution uses the evidence lower bound (ELBO) as a proxy. Recall that for a diffusion model, the ELBO decomposes into a sum of per-step terms: (Diffusion ELBO)logpθ(x0|c)ELBO=t=1T𝔼q(xt|x0)[DKL[q(xt1|xt,x0)pθ(xt1|xt,c)]]+C, where C is a constant independent of θ.

Definition 17 (Diffusion-DPO Loss).

Given preference pairs (c,x0w,x0l) where x0w is preferred over x0l, the Diffusion-DPO loss [13] is: (Diffusion DPO)Diff-DPO=𝔼[logσ(βTΔ)], where Δ is the difference in per-step denoising losses: (Diffusion DPO Delta)Δ=(𝝐𝝐θ(xtw,t,c)2𝝐𝝐ref(xtw,t,c)2)(𝝐𝝐θ(xtl,t,c)2𝝐𝝐ref(xtl,t,c)2), with t sampled uniformly from {1,,T}, 𝝐𝒩(0,I), and xtw,xtl obtained by adding noise to x0w,x0l according to the forward diffusion schedule.

Insight.

Diffusion-DPO is a single-step loss. Despite the diffusion model having T denoising steps, the Diffusion-DPO loss evaluates at a single randomly sampled timestep t, just like standard diffusion training. This makes it as computationally efficient as regular fine-tuning; no multi-step sampling or trajectory rollout is needed. The factor of T in (Diffusion DPO) compensates for the single-step approximation to the full ELBO.

Example 7 (Aligning Stable Diffusion with Aesthetics).

Wallace et al. (2024) [13] align Stable Diffusion XL using Diffusion-DPO with the Pick-a-Pic dataset of human preference pairs. The aligned model achieves a 69% win rate against the base model in human evaluations of visual quality, while maintaining text-image alignment. DDPO achieves similar win rates but requires online sampling during training, making it approximately 5× more expensive.

ReFL: Reward Feedback Learning

Xu et al. (2023) [20] propose a simpler approach when a differentiable reward model (ImageReward) is available: simply backpropagate the reward signal into the later denoising steps.

Definition 18 (ReFL Objective).

The ReFL loss fine-tunes only the last K denoising steps: (REFL)ReFL(θ)=𝔼xKpθfrozen[rIR(x^0(xK,θ),c)], where x^0(xK,θ) is the predicted clean image from step K using a one-step approximation, and rIR is the ImageReward model.

Remark 16 (ReFL vs. DRaFT).

ReFL is essentially a special case of DRaFT-K using ImageReward as the reward function. The key contribution is the ImageReward model itself: a BLIP-based model fine-tuned on 137K human preference annotations that correlates well with human judgments of text-image alignment and aesthetic quality.

Diffusion Alignment Taxonomy

Taxonomy of diffusion model alignment methods.
MethodApproachReward TypeOnline SamplingMulti-Step BackpropData
DDPOPolicy gradientAny (black-box)YesNoNone (online)
DRaFTDirect gradientDifferentiableNoYes (K steps)None
Diffusion-DPOPreferenceNone neededNoNoPreference pairs
ReFLDirect gradientDifferentiableNoYes (K steps)None
Comparison of diffusion alignment methods.

Connections and Synthesis

Having developed the mathematical foundations of six alignment methods (PPO, DPO, GRPO, DAPO, DDPO, Diffusion-DPO) and two direct-gradient methods (DRaFT, ReFL), we now step back and identify the unifying themes.

A Unified Framework

Definition 19 (Unified Alignment Objective).

Every alignment method discussed in this chapter can be viewed as an instance of the constrained optimization problem: (Unified)maxπ(π)β𝒞(π,πref), where (π) is a reward functional measuring alignment quality and 𝒞(π,πref) is a constraint functional measuring deviation from the reference policy.

The methods differ in how they instantiate , how they handle the constraint 𝒞, and whether optimization is performed online (with sampling) or offline (on a fixed dataset):

MethodModelsOnline?GradientMemoryBest For
PPO (RLHF)4YesPolicy gradientVery highGeneral alignment
DPO2NoSupervisedLowPreference-rich data
GRPO3YesPolicy gradientHighVerifiable tasks
DAPO3YesPolicy gradientHighLarge-scale math/code
DDPO2YesPolicy gradientModerateImage alignment (any reward)
Diff-DPO2NoSupervisedLowImage alignment (preference data)
DRaFT1NoDirect (backprop)ModerateImage alignment (differentiable reward)
ReFL1NoDirect (backprop)LowImage alignment (ImageReward)
Unified comparison of alignment methods. “Models” counts the number of neural networks held in GPU memory simultaneously.

The Alignment Spectrum

The methods in this chapter can be arranged along a spectrum from fully online RL to fully offline supervised learning:

Key Idea.

No single method dominates. The choice of alignment method depends on three factors:

  1. Reward verifiability: For tasks with automatic verifiers (math, code), GRPO/DAPO excel because they can leverage binary correctness signals. For tasks requiring human judgment (creative writing, helpfulness), PPO or DPO with preference data is more appropriate.

  2. Data availability: DPO requires a static dataset of preference pairs; PPO/GRPO generate their own data online. If collecting preference data is cheap, DPO is simpler; if expensive, online methods amortize the cost.

  3. Compute budget: PPO requires 4 models in memory; GRPO eliminates the critic; DPO requires only 2. At frontier scale (100B+ parameters), memory constraints often dictate the method.

Historical Timeline

Historical timeline of alignment research. The field has evolved from RL-based methods (top row) toward simpler, more efficient approaches (bottom row).

Historical Note.

The alignment research timeline reveals a clear trend toward simplification. The original RLHF pipeline (Christiano et al., 2017) required a separate reward model and a full RL training loop. InstructGPT (2022) made this practical at scale but still needed four neural networks. DPO (2023) eliminated the reward model and RL loop entirely. GRPO (2024) kept the RL formulation but eliminated the critic. DAPO (2025) refined GRPO with engineering innovations for scale. Meanwhile, diffusion alignment followed a parallel trajectory: from DDPO (RL-based) to Diffusion-DPO (direct preference) and DRaFT/ReFL (direct gradient). The field is converging toward methods that are simpler, more memory-efficient, and require less infrastructure, while maintaining or improving alignment quality.

Exercises

Exercise 1 (SFT Loss Derivation).

Show that the SFT objective SFT(θ)=1Ni=1Nt=1Tilogπθ(yt(i)|x(i),y<t(i)) is equivalent to minimizing the KL divergence DKL[p^dataπθ] where p^data is the empirical distribution of demonstration sequences, up to a constant independent of θ.

Exercise 2 (LoRA Parameter Count).

Consider LLaMA-7B, which has 32 transformer layers, each containing attention projections WQ,WK,WV,WO4096×4096 and MLP projections Wgate,Wup4096×11008 and Wdown11008×4096.

  1. How many total parameters does the model have in these weight matrices alone?

  2. If LoRA with rank r=8 is applied to WQ and WV only, how many trainable parameters are added? What fraction of the full parameter count is this?

  3. Repeat (b) for rank r=64 applied to all seven weight matrices. At what rank does LoRA training cost exceed 1% of full fine-tuning?

Exercise 3 (Bradley–Terry MLE).

Derive the Bradley–Terry MLE explicitly. Given N preference pairs (yw(i),yl(i)) for a fixed prompt x, and a parametric reward function rϕ(x,y), show that the negative log-likelihood (ϕ)=i=1Nlogσ(rϕ(x,yw(i))rϕ(x,yl(i))) is convex in the reward differences δi=rϕ(x,yw(i))rϕ(x,yl(i)).

Exercise 4 (Reward Identifiability).

Prove that the reward function under the Bradley–Terry model is identifiable only up to a prompt-dependent constant. Specifically, show that if r(x,y) satisfies p(ywyl|x)=σ(r(x,yw)r(x,yl)) for all pairs, then r(x,y)=r(x,y)+f(x) for any function f satisfies the same equations. Conversely, show that any two solutions must differ by such an additive function.

Exercise 5 (DPO Reparameterization from Scratch).

Starting from the KL-constrained objective maxπ𝔼[r(x,y)]βDKL[ππref]:

  1. Derive the optimal policy π(y|x)πref(y|x)exp(r(x,y)/β).

  2. Invert this to express the reward as r(x,y)=βlogπ(y|x)πref(y|x)+βlogZ(x).

  3. Substitute into the Bradley–Terry model and show that Z(x) cancels.

  4. Write the resulting DPO loss explicitly.

  5. Verify that θDPO=0 when πθ=π.

Exercise 6 (DPO Gradient Analysis).

Compute the gradient of the DPO loss with respect to θ: θDPO=β𝔼[σ(r^lr^w)(θlogπθ(yw|x)θlogπθ(yl|x))], where r^y=βlogπθ(y|x)πref(y|x).

  1. Show that the sigmoid weight σ(r^lr^w) is large when the model assigns higher implicit reward to the losing response, interpreting this as “hard example mining.”

  2. What happens to the gradient magnitude as training progresses and the model correctly ranks most preference pairs?

  3. Compare this to the PPO gradient, which weights updates by the advantage A^. Under what conditions are the two gradients similar?

Exercise 7 (DPO–RLHF Equivalence).

Prove that in the infinite-data, infinite-capacity regime, the DPO and RLHF solutions coincide. Specifically:

  1. Show that if πθ is the global minimizer of the DPO loss (over all policies), then πθ is the optimal policy of the KL-constrained RLHF objective.

  2. Show that if the preference data is generated according to the Bradley–Terry model with a ground-truth reward r, then the implicit DPO reward r^(x,y)=βlogπθ(y|x)πref(y|x) recovers r(x,y) up to a prompt-dependent constant.

Exercise 8 (GRPO Advantage Variance).

Analyze the variance of the GRPO advantage estimator.

  1. For a fixed prompt, let r1,,rGiidpr be i.i.d. rewards. Compute 𝖵ar[A^1] in terms of the moments of pr and the group size G.

  2. Show that 𝖵ar[A^1]1 as G (since the z-score has unit variance in the limit).

  3. For binary rewards with success probability p, find the group size G that minimizes the coefficient of variation of the advantage. How does G depend on p?

Exercise 9 (PPO vs. GRPO Memory).

Consider a transformer with L layers, hidden dimension d, and P total parameters. Assume Adam optimization (2 states per parameter) and 16-bit mixed precision.

  1. Compute the GPU memory required for PPO training: policy (P params + Adam states), critic (P params + Adam states), reward model (P params, frozen), reference (P params, frozen).

  2. Compute the memory for GRPO (no critic).

  3. For P=7×109, compute the memory savings in gigabytes. At what model size does the saving exceed the capacity of a single A100 (80,GB)?

Exercise 10 (Clip-Higher Entropy Analysis).

Consider a vocabulary of size V and a policy πθ over this vocabulary. Suppose token v has πθ(v)=δ1/V and positive advantage A^>0.

  1. Show that after one gradient step with symmetric clipping ϵ, the importance ratio for token v is clipped at 1+ϵ when δ is small enough.

  2. With Clip-Higher (ϵhigh>ϵ), compute the additional probability mass that can be transferred to token v per update step.

  3. Argue that the entropy 𝖧(πθ) is increasing in the probability of low-probability tokens. Conclude that Clip-Higher permits entropy-increasing updates.

Exercise 11 (Dynamic Sampling Probability).

Suppose the policy produces correct outputs with probability p for a given prompt, independently across the group.

  1. Compute the probability that a group of size G passes the Dynamic Sampling filter (i.e., 0<k<G).

  2. For G=16, plot this probability as a function of p. At what values of p is filtering most likely to reject?

  3. Compute the expected number of sampling attempts before passing the filter.

  4. How does Dynamic Sampling affect the effective training distribution? Show that prompts with p0 or p1 are underrepresented relative to prompts with p0.5.

Exercise 12 (Overlong Reward Gradient).

Consider the overlong reward shaping from Definition 14.

  1. Compute roverlong|oi| for outputs in the three regimes: |oi|<Lmax, Lmax|oi|Lmax+Lcache, and |oi|>Lmax+Lcache.

  2. Show that the gradient magnitude in the middle regime is 1/Lcache. What is the effect of increasing Lcache?

  3. Compare this to a hard threshold reward (0 for |oi|>Lmax, full reward otherwise) in terms of the gradient signal available at length Lmax+1.

Exercise 13 (Diffusion MDP Formalization).

Formalize the denoising MDP of Definition 15 rigorously.

  1. Define the state space 𝒮, action space 𝒜, and transition kernel P precisely.

  2. Show that the trajectory probability is pθ(τ)=p(xT)t=1Tpθ(xt1|xt,c).

  3. Derive the policy gradient θJ=𝔼[r(x0,c)t=1Tθlogpθ(xt1|xt,c)] from the standard REINFORCE theorem.

  4. Compute the variance of this estimator as a function of T and the reward variance.

Exercise 14 (DDPO Variance vs. Denoising Steps).

The REINFORCE gradient for the denoising MDP has the form g=r(x0,c)t=1Tθlogpθ(xt1|xt,c).

  1. Assuming the per-step score functions θlogpθ(xt1|xt,c) are independent with variance σs2 (a simplifying assumption), show that 𝖵ar[g]=Tσs2𝖵ar[r]+T2σs2𝔼[r]2 (approximately).

  2. Using DDIM with TT steps, how does the variance change? Argue that reducing T by a factor of k reduces variance by approximately the same factor.

  3. Why does DDPO-IS (PPO-style clipping) further reduce variance compared to DDPO-SF (REINFORCE)?

Exercise 15 (DRaFT-K Gradient Approximation).

In DRaFT-K, we backpropagate through only the last K steps.

  1. Write the DRaFT-K gradient as θK=xKr(x^0)x^0xKxKθ (chain rule through K steps).

  2. Show that DRaFT-T (full chain) gives the exact gradient, while DRaFT-1 is a biased approximation.

  3. Assuming the Jacobians xt1/xtρ<1 (a contraction), bound the approximation error θTθK in terms of ρ and TK.

  4. For Stable Diffusion with T=50 and a typical contraction factor ρ0.95, at what K is the approximation error below 10% of the full gradient norm?

Exercise 16 (Diffusion-DPO ELBO Derivation).

Derive the Diffusion-DPO loss from first principles.

  1. Starting from the standard DPO loss =logσ(βlogπθ(x0w|c)πref(x0w|c)βlogπθ(x0l|c)πref(x0l|c)), substitute the ELBO approximation for logπθ(x0|c).

  2. Show that the ELBO difference simplifies to a sum of per-step denoising loss differences.

  3. Argue that sampling a single timestep t and multiplying by T gives an unbiased estimator of the full ELBO difference.

  4. Write out the final single-step loss and verify it matches (Diffusion DPO).

Exercise 17 (LoRA Rank vs. Accuracy).

The LoRA update is ΔW=BA where Bd×r and Ar×k.

  1. Show that rank(ΔW)r.

  2. If the true optimal update ΔW=WW0 has rank R>r, bound the approximation error BAΔWF in terms of the singular values of ΔW (hint: Eckart–Young theorem).

  3. Discuss the trade-off: increasing r reduces approximation error but increases memory and risks overfitting. When is r=8 likely sufficient vs. when is r=64 needed?

Exercise 18 (KL Penalty Sensitivity).

Consider the KL-constrained objective J(π)=𝔼π[r(x,y)]βDKL[ππref].

  1. Show that Jβ=DKL[ππref] where J is the optimal value and π the optimal policy (envelope theorem).

  2. Conclude that increasing β always decreases the optimal reward.

  3. For the DPO loss, show that the implicit KL constraint is controlled by β. What happens as β0 and β?

  4. Design an experiment to select β optimally for a specific task. What metric would you use?

Exercise 19 (Designing an Alignment Pipeline).

You are tasked with aligning a 13B-parameter language model for code generation. The model should produce correct, efficient, and well-documented Python code. You have access to:

  • A training dataset of 50K coding problems with reference solutions;

  • An automated test suite that can verify correctness;

  • 8 NVIDIA A100 GPUs (80,GB each);

  • A budget of 500 GPU-hours.

  1. Which alignment method(s) would you choose? Justify based on the properties of the task and available resources.

  2. Design the reward function. Would you use binary (pass/fail) rewards or a more nuanced scoring?

  3. Estimate the memory requirements for your chosen method. Does it fit in 8 × 80,GB with appropriate parallelism?

  4. Describe how you would monitor for reward hacking.

Exercise 20 (Open Problem: Optimal β Schedule).

In all alignment methods, β is typically fixed throughout training. Investigate whether a β schedule could improve results.

  1. Argue intuitively why starting with small β (aggressive optimization) and increasing it (conservative fine-tuning) might be beneficial.

  2. Conversely, argue why starting with large β (exploration near πref) and decreasing it (exploitation) could also work.

  3. Design a simple β schedule (e.g., linear, cosine, step) and describe how you would evaluate it experimentally.

  4. This is an open research problem. What theoretical tools (e.g., regret bounds, convergence rates) might help determine the optimal schedule?

References

  1. Deep Reinforcement Learning from Human Preferences

    Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, Dario Amodei

    Advances in Neural Information Processing Systems, vol. 30 · 2017

    BibTeX
    @article{christiano2017deep,
      title={Deep Reinforcement Learning from Human Preferences},
      author={Christiano, Paul F and Leike, Jan and Brown, Tom and Martic, Miljan and Legg, Shane and Amodei, Dario},
      journal={Advances in Neural Information Processing Systems},
      volume={30},
      year={2017}
    }

    Journal article

  2. Fine-Tuning Language Models from Human Preferences

    Daniel M Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B Brown, Alec Radford, Dario Amodei, Paul Christiano, Geoffrey Irving

    arXiv preprint arXiv:1909.08593 · 2019

    BibTeX
    @article{ziegler2019fine,
      title={Fine-Tuning Language Models from Human Preferences},
      author={Ziegler, Daniel M and Stiennon, Nisan and Wu, Jeffrey and Brown, Tom B and Radford, Alec and Amodei, Dario and Christiano, Paul and Irving, Geoffrey},
      journal={arXiv preprint arXiv:1909.08593},
      year={2019}
    }

    Journal article

  3. Learning to Summarize with Human Feedback

    Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, et al.

    Advances in Neural Information Processing Systems, vol. 33, pp. 3008-3021 · 2020

    BibTeX
    @article{stiennon2020learning,
      title={Learning to Summarize with Human Feedback},
      author={Stiennon, Nisan and Ouyang, Long and Wu, Jeffrey and Ziegler, Daniel and Lowe, Ryan and Voss, Chelsea and Radford, Alec and Amodei, Dario and Christiano, Paul F},
      journal={Advances in Neural Information Processing Systems},
      volume={33},
      pages={3008--3021},
      year={2020}
    }

    Journal article

  4. Training Language Models to Follow Instructions with Human Feedback

    Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, et al.

    Advances in Neural Information Processing Systems, vol. 35, pp. 27730-27744 · 2022

    BibTeX
    @article{ouyang2022training,
      title={Training Language Models to Follow Instructions with Human Feedback},
      author={Ouyang, Long and Wu, Jeffrey and Jiang, Xu and Almeida, Diogo and Wainwright, Carroll and Mishkin, Pamela and Zhang, Chong and Agarwal, Sandhini and Slama, Katarina and Ray, Alex and others},
      journal={Advances in Neural Information Processing Systems},
      volume={35},
      pages={27730--27744},
      year={2022}
    }

    Journal article

  5. Direct Preference Optimization: Your Language Model is Secretly a Reward Model

    Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D Manning, Chelsea Finn

    Advances in Neural Information Processing Systems, vol. 36 · 2023

    BibTeX
    @article{rafailov2023direct,
      title={Direct Preference Optimization: Your Language Model is Secretly a Reward Model},
      author={Rafailov, Rafael and Sharma, Archit and Mitchell, Eric and Ermon, Stefano and Manning, Christopher D and Finn, Chelsea},
      journal={Advances in Neural Information Processing Systems},
      volume={36},
      year={2023}
    }

    Journal article

  6. QLoRA: Efficient Finetuning of Quantized Language Models

    Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke Zettlemoyer

    Advances in Neural Information Processing Systems, vol. 36 · 2023

    BibTeX
    @article{dettmers2023qlora,
      title={{QLoRA}: Efficient Finetuning of Quantized Language Models},
      author={Dettmers, Tim and Pagnoni, Artidoro and Holtzman, Ari and Zettlemoyer, Luke},
      journal={Advances in Neural Information Processing Systems},
      volume={36},
      year={2023}
    }

    Journal article

  7. Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning

    Armen Aghajanyan, Sonal Gupta, Luke Zettlemoyer

    arXiv preprint arXiv:2012.13255 · 2021

    BibTeX
    @article{aghajanyan2021intrinsic,
      title={Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning},
      author={Aghajanyan, Armen and Gupta, Sonal and Zettlemoyer, Luke},
      journal={arXiv preprint arXiv:2012.13255},
      year={2021}
    }

    Journal article

  8. S-LoRA: Serving Thousands of Concurrent LoRA Adapters

    Ying Sheng, Shiyi Cao, Dacheng Li, Coleman Hooper, Nicholas Lee, Shuo Yang, Christopher Chou, Banghua Zhu, et al.

    arXiv preprint arXiv:2311.03285 · 2024

    BibTeX
    @article{sheng2024slora,
      title={{S-LoRA}: Serving Thousands of Concurrent {LoRA} Adapters},
      author={Sheng, Ying and Cao, Shiyi and Li, Dacheng and Hooper, Coleman and Lee, Nicholas and Yang, Shuo and Chou, Christopher and Zhu, Banghua and Zheng, Lianmin and Keutzer, Kurt and Gonzalez, Joseph E and Stoica, Ion},
      journal={arXiv preprint arXiv:2311.03285},
      year={2024}
    }

    Journal article

  9. Scaling Laws for Reward Model Overoptimization

    Leo Gao, John Schulman, Jacob Hilton

    arXiv preprint arXiv:2210.10760 · 2023

    BibTeX
    @article{gao2023scaling,
      title={Scaling Laws for Reward Model Overoptimization},
      author={Gao, Leo and Schulman, John and Hilton, Jacob},
      journal={arXiv preprint arXiv:2210.10760},
      year={2023}
    }

    Journal article

  10. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning

    DeepSeek-AI

    arXiv preprint arXiv:2501.12948 · 2025

    BibTeX
    @article{deepseekr1,
      title={{DeepSeek-R1}: Incentivizing Reasoning Capability in {LLMs} via Reinforcement Learning},
      author={{DeepSeek-AI}},
      journal={arXiv preprint arXiv:2501.12948},
      year={2025}
    }

    Journal article

  11. DAPO: An Open-Source LLM Reinforcement Learning System at Scale

    Qiying Yu, others

    arXiv preprint arXiv:2503.14476 · 2025

    BibTeX
    @article{yu2025dapo,
      title={{DAPO}: An Open-Source {LLM} Reinforcement Learning System at Scale},
      author={Yu, Qiying and others},
      journal={arXiv preprint arXiv:2503.14476},
      year={2025}
    }

    Journal article

  12. Directly Fine-Tuning Diffusion Models on Differentiable Rewards

    Kevin Clark, Paul Vicol, Kevin Swersky, David J Fleet

    International Conference on Learning Representations · 2024

    BibTeX
    @article{clark2024directly,
      title={Directly Fine-Tuning Diffusion Models on Differentiable Rewards},
      author={Clark, Kevin and Vicol, Paul and Swersky, Kevin and Fleet, David J},
      journal={International Conference on Learning Representations},
      year={2024}
    }

    Journal article

  13. Diffusion Model Alignment Using Direct Preference Optimization

    Bram Wallace, Meihua Dang, Rafael Rafailov, Linqi Zhou, Aaron Lou, Senthil Purber, Stefano Ermon, Caiming Xiong, et al.

    Conference on Computer Vision and Pattern Recognition · 2024

    BibTeX
    @article{wallace2024diffusion,
      title={Diffusion Model Alignment Using Direct Preference Optimization},
      author={Wallace, Bram and Dang, Meihua and Rafailov, Rafael and Zhou, Linqi and Lou, Aaron and Purber, Senthil and Ermon, Stefano and Xiong, Caiming and Joty, Shafiq and Naik, Nikhil},
      journal={Conference on Computer Vision and Pattern Recognition},
      year={2024}
    }

    Journal article

  14. On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?

    Emily M Bender, Timnit Gebru, Angelina McMillan-Major, Shmargaret Shmitchell

    Proceedings of the ACM Conference on Fairness, Accountability, and Transparency (FAccT) · 2021

    BibTeX
    @inproceedings{bender2021dangers,
      title={On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?},
      author={Bender, Emily M and Gebru, Timnit and McMillan-Major, Angelina and Shmitchell, Shmargaret},
      booktitle={Proceedings of the ACM Conference on Fairness, Accountability, and Transparency (FAccT)},
      year={2021}
    }

    Conference paper

  15. Stanford Alpaca: An Instruction-Following LLaMA Model

    Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, Tatsunori B Hashimoto

    GitHub repository · 2023

    BibTeX
    @article{taori2023stanford,
      title={Stanford {Alpaca}: An Instruction-Following {LLaMA} Model},
      author={Taori, Rohan and Gulrajani, Ishaan and Zhang, Tianyi and Dubois, Yann and Li, Xuechen and Guestrin, Carlos and Liang, Percy and Hashimoto, Tatsunori B},
      journal={GitHub repository},
      year={2023}
    }

    Journal article

  16. LoRA: Low-Rank Adaptation of Large Language Models

    Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen

    International Conference on Learning Representations · 2022

    BibTeX
    @article{hu2022lora,
      title={{LoRA}: Low-Rank Adaptation of Large Language Models},
      author={Hu, Edward J and Shen, Yelong and Wallis, Phillip and Allen-Zhu, Zeyuan and Li, Yuanzhi and Wang, Shean and Wang, Lu and Chen, Weizhu},
      journal={International Conference on Learning Representations},
      year={2022}
    }

    Journal article

  17. Rank Analysis of Incomplete Block Designs: I. The Method of Paired Comparisons

    Ralph Allan Bradley, Milton E Terry

    Biometrika, vol. 39, no. 3/4, pp. 324-345 · 1952

    BibTeX
    @article{bradley1952rank,
      title={Rank Analysis of Incomplete Block Designs: {I}. The Method of Paired Comparisons},
      author={Bradley, Ralph Allan and Terry, Milton E},
      journal={Biometrika},
      volume={39},
      number={3/4},
      pages={324--345},
      year={1952}
    }

    Journal article

  18. DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models

    Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Mingchuan Zhang, Y.K. Li, Y. Wu, et al.

    arXiv preprint arXiv:2402.03300 · 2024

    BibTeX
    @article{shao2024deepseekmath,
      title={{DeepSeekMath}: Pushing the Limits of Mathematical Reasoning in Open Language Models},
      author={Shao, Zhihong and Wang, Peiyi and Zhu, Qihao and Xu, Runxin and Song, Junxiao and Zhang, Mingchuan and Li, Y.K. and Wu, Y. and Guo, Daya},
      journal={arXiv preprint arXiv:2402.03300},
      year={2024}
    }

    Journal article

  19. Training Diffusion Models with Reinforcement Learning

    Kevin Black, Michael Janner, Yilun Du, Ilya Kostrikov, Sergey Levine

    International Conference on Learning Representations · 2024

    BibTeX
    @article{black2024training,
      title={Training Diffusion Models with Reinforcement Learning},
      author={Black, Kevin and Janner, Michael and Du, Yilun and Kostrikov, Ilya and Levine, Sergey},
      journal={International Conference on Learning Representations},
      year={2024}
    }

    Journal article

  20. ImageReward: Learning and Evaluating Human Preferences for Text-to-Image Generation

    Jiazheng Xu, Xiao Liu, Yuchen Wu, Yuxuan Tong, Qinkai Li, Ming Ding, Jie Tang, Yuxiao Dong

    Advances in Neural Information Processing Systems, vol. 36 · 2023

    BibTeX
    @article{xu2023imagereward,
      title={{ImageReward}: Learning and Evaluating Human Preferences for Text-to-Image Generation},
      author={Xu, Jiazheng and Liu, Xiao and Wu, Yuchen and Tong, Yuxuan and Li, Qinkai and Ding, Ming and Tang, Jie and Dong, Yuxiao},
      journal={Advances in Neural Information Processing Systems},
      volume={36},
      year={2023}
    }

    Journal article