docs: fix the clip explanation in the GRPO trainer page - #7190
Open
JiangLLM wants to merge 1 commit into
Open
Conversation
JiangLLM
force-pushed
the
fix/grpo-clip-old-policy
branch
from
September 12, 2026 07:29
6d33646 to
5a5b6b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The GRPO trainer page explains the clip term with this sentence:
The ratio inside the clip is π_θ / π_θ_old. So the clip term limits how far the update moves from the old policy, not from the reference policy. The reference policy is a separate model in this loss. It appears only in the KL penalty, which the page covers one section above.
I changed "reference policy" to "old policy" and added the symbol. One line, docs only.
Before submitting
AI writing disclosure
We welcome the use of AI tools to help with contributions. For transparency and to help us improve our review process, please indicate the level of AI involvement in this PR.
Note
Low Risk
Documentation-only wording fix with no runtime or API impact.
Overview
Corrects a terminology mistake in the GRPO trainer docs for the clipped surrogate objective: the explanation of
clip(·, 1−ε, 1+ε)now says it limits how far updates move from the old policy ( \pi_{\theta_{\text{old}}} ), not the reference policy.That matches the ratio ( \pi_\theta / \pi_{\theta_{\text{old}}} ) in the displayed loss; the reference policy remains only in the separate KL term above.
Reviewed by Cursor Bugbot for commit 5a5b6b0. Bugbot is set up for automated code reviews on this repo. Configure here.