Iterative Alignment › Iterative DPO
Language AI HandbookAll chapters Iterative Alignment › Iterative DPOOne section · Sections in this chapter3 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
As we discussed in the DPO chapters, Direct Preference Optimization implicitly defines a reward function through the log-probability ratio between the policy and reference model. This mathematical relationship makes the reference model central to what DPO learns. The reference model is an anchor point that defines the baseline against which improvements are measured. When we iterate DPO, we have a choice: keep the original reference model fixed, or update it at each iteration. This choice significantly affects training dynamics and the final model's behavior.
Fixed Reference Iteration
The simplest form of iterative DPO keeps the original reference model fixed across all iterations. At each round , we generate responses from the current policy , collect preferences, and train to get . This approach maintains a consistent anchor point throughout the entire iterative process, always measuring progress relative to where the model started.
The loss at iteration becomes:
Unpacking the formula components clarifies how they guide iterative training:
- : the loss function minimized at iteration
- : the expectation operator averaging over all preference pairs in the dataset
- : the dataset of preferences collected from responses generated by the current policy
- : the policy model currently being trained (parameterized by )
- : the fixed reference model (usually the initial policy)
- : the input prompt
- : the winning and losing responses, respectively, for prompt
- : the logistic sigmoid function
- : the temperature parameter controlling the strength of the KL penalty
- : the implicit reward term (higher values indicate the policy is more likely to generate than the reference)
The key change from standard DPO is that contains preferences over responses generated by , not the original reference model. This subtle but important difference ensures the model learns from comparisons that reflect its current capabilities rather than from stale comparisons between outputs it no longer produces. The model receives feedback on the kinds of responses it generates now. This makes the training signal directly relevant to improving current behavior.
However, keeping a fixed reference creates a growing gap between the reference and policy distributions. As the policy improves over iterations, it diverges further from . The implicit reward function now compares very different distributions. When the policy assigns high probability to a response that the reference considers extremely unlikely, the log ratio becomes very large. Conversely, when the policy considers a response unlikely but the reference assigns moderate probability, the log ratio becomes very negative. These extreme values can destabilize training by creating large gradients that push the model erratically.
Rolling Reference Iteration
A more common approach updates the reference model at each iteration. After training round , we set before starting round . This keeps the reference close to the current policy, maintaining stable gradients and so that the log probability ratios remain in a reasonable range throughout training.
The rolling reference focuses on incremental improvements instead of measuring progress against the initial model. By using the previous iteration's policy as the reference, we are essentially asking: "Given where we are now, which responses represent improvements?" This framing naturally prevents the extreme probability ratios that arise when comparing against a very different reference distribution.
The iterative procedure becomes:
- Initialize with a supervised fine-tuned model
- Set
- For each iteration :
- Generate responses from on a set of prompts
- Collect preferences over response pairs
- Train using DPO with reference
- Update
This rolling reference approach is sometimes called online DPO because the training data comes from the current policy rather than a static offline dataset. The term "online" here refers to the fact that data generation is interleaved with training, creating a dynamic feedback loop between model behavior and the training signal.
Rolling reference training starts from a neutral position. The policy and reference are identical at the beginning of each round, so the log probability ratios start at zero for all responses. This means the training signal comes entirely from the preference comparisons in the current iteration's dataset, without any accumulated bias from previous iterations. The model learns to improve relative to its immediate predecessor, and the cumulative effect of many such improvements can be substantial.


IPO for Iterative Training
Recall from our discussion of DPO variants that Identity Preference Optimization (IPO) avoids the length exploitation issues that can plague DPO over multiple iterations. The problem with standard DPO becomes particularly acute in iterative settings: if the model learns that slightly longer responses tend to win preference comparisons, it will generate longer responses, which will then be compared against each other, and the longest will again tend to win. This feedback loop can drive response length to extreme values over many iterations.
IPO addresses this concern through a fundamentally different objective formulation. Rather than using the sigmoid function to bound the preference probability, IPO directly targets a specific margin between the preferred and dispreferred log probability ratios. The IPO objective is:
The components of the IPO formula prevent the runaway behavior seen in DPO:
- : the Identity Preference Optimization loss
- : the expectation operator averaging over the dataset
- : the policy model being trained
- : the reference model
- : the input prompt
- : the preferred and dispreferred responses for prompt
- : the hyperparameter derived from the KL regularization strength
This objective minimizes the squared error between the log-likelihood ratio gap and a finite target margin of . The key insight is that IPO does not simply try to make the preferred response more likely than the dispreferred one; it tries to make the gap between them equal to a specific target value. Once the model achieves this target margin, further increasing the gap raises the loss. This built-in saturation prevents the model from pushing probability ratios to extreme values.


Unlike DPO, which tries to maximize the gap (bounded only by the asymptotic behavior of the sigmoid), IPO targets this specific margin, preventing the model from pushing probability ratios to extreme values. The squared error formulation means that overshooting the target margin is penalized just as much as undershooting it. This symmetric penalty structure provides natural regularization that becomes increasingly important over multiple iterations where small biases otherwise compound into significant distortions.