$Q\sharp$: Provably Optimal Distributional RL for LLM Post-Training

Jin Peng Zhou, Kaiwen Wang, Jonathan Chang, Zhaolin Gao, Nathan Kallus +3 more
2/27/2025
cs.LGcs.AIcs.CL

Official code: jinpz/q_sharp (20 stars, last commit 2025-03-04).

Abstract

Reinforcement learning (RL) post-training is crucial for LLM alignment and reasoning, but existing policy-based methods, such as PPO and DPO, can fall short of fixing shortcuts inherited from pre-training. In this work, we introduce $Q\sharp$, a value-based algorithm for KL-regularized RL that guides the reference policy using the optimal regularized $Q$ function. We propose to learn the optimal $Q$ function using distributional RL on an aggregated online dataset. Unlike prior value-based baselines that guide the model using unregularized $Q$-values, our method is theoretically principled and provably learns the optimal policy for the KL-regularized RL problem. Empirically, $Q\sharp$ outperforms prior baselines in math reasoning benchmarks while maintaining a smaller KL divergence to the reference policy. Theoretically, we establish a reduction from KL-regularized RL to no-regret online learning, providing the first bounds for deterministic MDPs under only realizability. Thanks to distributional RL, our bounds are also variance-dependent and converge faster when the reference policy has small variance. In sum, our results highlight $Q\sharp$ as an effective approach for post-training LLMs, offering both improved performance and theoretical guarantees. The code can be found at https://github.com/jinpz/q_sharp.

View on arXivView PDF

Code Implementations(1)

jinpz/q_sharpOfficial100%

The official code release for Q#: Provably Optimal Distributional RL for LLM Post-Training

201Shell, PythonMar 4, 20251 years ago

Similar Papers

Cite this paper

@article{zhou2025qsharp,
  title  = {$Q\sharp$: Provably Optimal Distributional RL for LLM Post-Training},
  author = {Jin Peng Zhou and Kaiwen Wang and Jonathan Chang and Zhaolin Gao and Nathan Kallus and Kilian Q. Weinberger and Kianté Brantley and Wen Sun},
  year   = {2025},
  eprint = {2502.20548},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.20548v2}
}

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/2502.20548.svg)](https://codeofpaper.com/paper/2502.20548)

Discussion