Implement iterative/online DPO: generate on-policy pairs, label with a toy preference func

Direct Alignment: DPO, Rejection Sampling & Distillation5 / 5

Chapter 135 / 5

Direct Alignment: DPO, Rejection Sampling & Distillation

Implement iterative/online DPO: generate on-policy pairs, label with a toy preference func

Super-hard

Implement iterative/online DPO: generate on-policy pairs, label with a toy preference function, and run successive DPO rounds; show the win-rate trend.

Target interface
seq_logp(model, toks)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.