Skip to content
nonconvexcard

Closed form of the KL-regularised RL optimum

ProofGraduate⏱ 1 hourLLMsrlhfkl regularisationgibbsvariational

Problem

Prove that the maximiser of Ey∼π[r(x,y)]−β KL(π∥πref)\E_{y\sim\pi}[r(x,y)] - \beta\,\mathrm{KL}(\pi\|\pi_{\mathrm{ref}}) is π⋆(y∣x)∝πref(y∣x)er(x,y)/β\pi^\star(y\mid x)\propto\pi_{\mathrm{ref}}(y\mid x)e^{r(x,y)/\beta}, and explain why RLHF uses PPO rather than this formula.

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
Rewards are identifiable only up to a prompt-dependent shiftLLMsProofIntermediate30 min
The DPO gradient is a weighted contrastive stepLLMsProofAdvanced30 min
The RAG evidence lower boundRAGProofAdvanced30 min
Derive the DPO objective abyssLLMsProofGraduate1 hour