Skip to content

[BugFix] Keep GRPO advantages centered for adjacent rewards - #4808

Open
wufei-png wants to merge 1 commit into
pytorch:mainfrom
wufei-png:fix/center-mc-advantage-before-rescaling
Open

wufei-png wants to merge 1 commit into
pytorch:mainfrom
wufei-png:fix/center-mc-advantage-before-rescaling

Conversation

@wufei-png

@wufei-png wufei-png commented Dec 2, 2026 •

Copy link
Copy Markdown

Description

Center rewards in shifted coordinates when MCAdvantage normalizes per-step rewards or trajectory returns.

Motivation and Context

The float32 rewards 32 and 32 + 2**-18 are adjacent. Computing their midpoint in the original coordinates rounds it to one endpoint, giving one rollout zero advantage. Subtracting the mean in shifted coordinates gives the two rollouts equal and opposite advantages. Closes #4807.

  • Issue raised for this change

Types of changes

  • Bug fix

Checklist

@meta-cla

meta-cla Bot commented Dec 2, 2026

Copy link
Copy Markdown

Hi @wufei-png!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@github-actions github-actions Bot added BugFix Objectives llm/ LLM-related PR, triggers LLM CI tests labels Dec 2, 2026
@pytorch-bot

pytorch-bot Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4808

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 16 Awaiting Approval

As of commit 83062c7 with merge base 6ffc7a2 (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla

meta-cla Bot commented Dec 2, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BugFix CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. llm/ LLM-related PR, triggers LLM CI tests Objectives

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] MCAdvantage changes when adding a common offset to nearby float32 rewards

1 participant