Skip to content
nonconvexcard

The DPO gradient is a weighted contrastive step

ProofAdvanced⏱ 30 minLLMsdpogradienthard examplescontrastive

Problem

Compute ∇θLDPO\nabla_\theta\mathcal L_{\mathrm{DPO}} and interpret the two factors. Explain why the weighting gives automatic hard-example emphasis, and what happens as training progresses.

Write a complete argument. Every inequality you use should be one you could state precisely.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
The cross-entropy gradient is the prediction errorLLMsProofBeginner15 min
Rewards are identifiable only up to a prompt-dependent shiftLLMsProofIntermediate30 min
The softmax Jacobian as a variance, and saturationDeep LearningProofIntermediate30 min
Why exactly one factor starts at zeroFine-TuningProofIntermediate30 min
Closed form of the KL-regularised RL optimum abyssLLMsProofGraduate1 hour