On the Design of KL-Regularized Policy Gradient Algorithms for LLM Reasoning

Yifan Zhang, Yifeng Liu, Huizhuo Yuan, Yang Yuan, Quanquan Gu +1 more
5/23/2025
31 citations
cs.LGcs.AIcs.CL
rlrlhf-rlvr-dpo

Official code: complex-reasoning/RPG (78 stars, Python, MIT, last commit 2026-04-29).

Abstract

Policy gradient algorithms have been successfully applied to enhance the reasoning capabilities of large language models (LLMs). KL regularization is ubiquitous, yet the design surface, choice of KL direction (forward vs. reverse), normalization (normalized vs. unnormalized), and estimator ($k_1/k_2/k_3$), is scattered across the literature and often intertwined with off-policy estimation.

Show full abstract

We ask a focused question: under the off-policy setting, what weighting is required for each KL variant so that the surrogate we optimize yields the exact gradient of the intended KL-regularized objective? We answer this with a compact, unified derivation we call the Regularized Policy Gradient (RPG) view. RPG (i) unifies normalized and unnormalized KL variants and shows that the widely-used $k_3$ penalty is exactly the unnormalized KL; (ii) specifies conditions under which REINFORCE-style losses with stop-gradient are gradient-equivalent to fully differentiable surrogates; (iii) identifies and corrects an off-policy importance-weighting mismatch in GRPO's KL term; and (iv) introduces RPG-Style Clip, a clipped-importance-sampling step within RPG-REINFORCE that enables stable, off-policy policy-gradient training at scale. On mathematical reasoning benchmarks (AIME24, AIME25), RPG-REINFORCE with RPG-Style Clip improves accuracy by up to $+6$ absolute percentage points over DAPO. We extend our experiments to 8K context length, and RPG-REINFORCE with RPG-Style Clip achieves 52% accuracy on AIME25, surpassing the official Qwen3-4B-Instruct model (47%). Notably, RPG is a stable and scalable RL algorithm for LLM reasoning, realized via (a) a KL-correct objective, (b) clipped importance sampling, and (c) an iterative reference-policy update scheme. Project Page: https://github.com/complex-reasoning/RPG.

View on arXivView PDF

Code Implementations(1)

MIT

[ICLR 2026] RPG: KL-Regularized Policy Gradient (https://arxiv.org/abs/2505.17508)

783Python, ShellMay 26, 20257 months agoMIT
deep-learningfoundation-modelslarge-language-modelsllmpost-training+1 more

Similar Papers

Cite this paper

@article{zhang2025design,
  title  = {On the Design of KL-Regularized Policy Gradient Algorithms for LLM Reasoning},
  author = {Yifan Zhang and Yifeng Liu and Huizhuo Yuan and Yang Yuan and Quanquan Gu and Andrew Chi-Chih Yao},
  year   = {2025},
  eprint = {2505.17508},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.17508v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.17508.svg)](https://codeofpaper.com/paper/2505.17508)

Discussion