DPO step

Reports The Llama 3 Herd of Models (arXiv 2407.21783v3) · DPO (arXiv 2305.18290v3) · no training code is published · How to read

DPO step

Policy

×

learned · not counted here

The model being trained: its log-probability of each response, over the tokens the mask keeps.

ℓθ(y)=∑t: mt=1log⁡πθ(yt∣x,y<t)\ell_\theta(y)=\sum_{t:\,m_t=1}\log\pi_\theta(y_t\mid {\htmlData{light=prompt}{x}},y_{<t})
in
xx [B batch]mm [B batch, 2, T positions]
out
lPl_P [B batch, 2]

mt=1m_t=1 marks a token the mask keeps. ℓθ\ell_\theta, drawn lPl_P, is this plate’s name.

Sources2

Direct evidence

§4, eq. 7: L_DPO(π_θ; π_ref) = −E[log σ(β log π_θ(y_w|x)/π_ref(y_w|x) − β log π_θ(y_l|x)/π_ref(y_l|x))], over preference triples (x, y_w, y_l).

dpo · arXiv 2305.18290 / DPO-2305.18290v3.pdf
Pinned revision v3 ↗ · p. 4

Direct evidence

§4.1.4, Direct Preference Optimization: DPO on the SFT models with learning rate 10⁻⁵ and β = 0.1; special formatting tokens, including header and termination tokens, are masked out of the loss in chosen and rejected responses; an NLL term with scaling coefficient 0.2 is added on the chosen sequences.

meta · arXiv 2407.21783 / Llama3-Herd-2407.21783v3.pdf
Pinned revision v3 ↗ · p. 16