Mechanism

Optimizes the LLM policy πθ\pi_\theta against a token-level reward rt=−βlog⁡πθ(yt∣x,y<t)πref(yt∣x,y<t)+I[t=∣y∣]Rϕ(x,y)r_t = -\beta \log\frac{\pi_\theta(y_t\mid x,y_{<t})}{\pi_{\text{ref}}(y_t\mid x,y_{<t})} + \mathbb{I}[t=|y|]R_\phi(x,y) using Generalized Advantage Estimation (A^tGAE(γ,λ)\hat{A}_t^{\text{GAE}(\gamma,\lambda)}) computed with a learned value critic Vψ(x,y<t)V_\psi(x, y_{<t}) and a clipped importance-sampling surrogate objective: LPPO(θ)=Et[min⁡(ρt(θ)A^t, clip(ρt(θ),1−ϵ,1+ϵ)A^t)],ρt(θ)=πθ(yt∣x,y<t)πθold(yt∣x,y<t)\mathcal{L}_{\text{PPO}}(\theta) = \mathbb{E}_t\left[\min\left(\rho_t(\theta)\hat{A}_t, \, \text{clip}(\rho_t(\theta), 1-\epsilon, 1+\epsilon)\hat{A}_t\right)\right], \quad \rho_t(\theta) = \frac{\pi_\theta(y_t\mid x,y_{<t})}{\pi_{\theta_{\text{old}}}(y_t\mid x,y_{<t})}

Practical Notes

Requires 4 models in GPU memory (πθ,πref,Rϕ,Vψ\pi_\theta, \pi_{\text{ref}}, R_\phi, V_\psi); critic warmup and advantage whitening are critical for stability.

References

  1. Proximal Policy Optimization Algorithms ↗

    John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, Oleg Klimov · 2017

  2. Fine-Tuning Language Models from Human Preferences ↗

    Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei et al. · 2019

    All 8 authors

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

  3. Training language models to follow instructions with human feedback ↗

    Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin et al. · 2022

    All 20 authors

    Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, Ryan Lowe