
Optimal KL-regularised policy (Kamath Eq 5.6)
Source:R/kamath_llm2_native.R
morie_kamath_ch5_rlhf_optimal_policy.Rdpi_r = pi_ref exp(r/beta) / Z. Z is computed, and a supplied Z is checked rather than trusted.

R/kamath_llm2_native.R
morie_kamath_ch5_rlhf_optimal_policy.Rdpi_r = pi_ref exp(r/beta) / Z. Z is computed, and a supplied Z is checked rather than trusted.