Skip to content

[LLM] Rewrite GSM8K reward function to follow standard GRPO conventions#3542

Open
vmoens wants to merge 1 commit intogh/vmoens/234/basefrom
gh/vmoens/234/head
Open

[LLM] Rewrite GSM8K reward function to follow standard GRPO conventions#3542
vmoens wants to merge 1 commit intogh/vmoens/234/basefrom
gh/vmoens/234/head

Conversation

@vmoens
Copy link
Collaborator

@vmoens vmoens commented Mar 5, 2026

Stack from ghstack (oldest at bottom):

Replace the complex 5-component additive reward (0-100 scale) with the
standard 0/0.1/1.0 convention used by veRL and DeepSeek-R1.

Key changes:

  • Use regex instead of xml.etree for tag extraction (robust to malformed output)
  • Add answer normalization (commas, dollar signs, trailing zeros, whitespace)
  • Remove reward_contained (substring match anti-pattern)
  • Simplify to: 1.0 correct, 0.1 format ok but wrong, 0.0 no answer
  • Add configurable format_reward and correct_reward parameters
  • Add comprehensive unit tests for the reward parser

Made-with: Cursor

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 5, 2026

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Cancelled Job, 6 Unrelated Failures

As of commit 457915d with merge base 491ed0f (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@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 Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

⚠️ PR Title Label Error

Unknown or invalid prefix [LLM].

Current title: [LLM] Rewrite GSM8K reward function to follow standard GRPO conventions

Supported Prefixes (case-sensitive)

Your PR title must start with exactly one of these prefixes:

Prefix Label Applied Example
[BugFix] BugFix [BugFix] Fix memory leak in collector
[Feature] Feature [Feature] Add new optimizer
[Doc] or [Docs] Documentation [Doc] Update installation guide
[Refactor] Refactoring [Refactor] Clean up module imports
[CI] CI [CI] Fix workflow permissions
[Test] or [Tests] Tests [Tests] Add unit tests for buffer
[Environment] or [Environments] Environments [Environments] Add Gymnasium support
[Data] Data [Data] Fix replay buffer sampling
[Performance] or [Perf] Performance [Performance] Optimize tensor ops
[BC-Breaking] bc breaking [BC-Breaking] Remove deprecated API
[Deprecation] Deprecation [Deprecation] Mark old function
[Quality] Quality [Quality] Fix typos and add codespell

Note: Common variations like singular/plural are supported (e.g., [Doc] or [Docs]).

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

⚠️ PR Title Label Error

Unknown or invalid prefix [LLM].

Current title: [LLM] Rewrite GSM8K reward function to follow standard GRPO conventions

Supported Prefixes (case-sensitive)

Your PR title must start with exactly one of these prefixes:

Prefix Label Applied Example
[BugFix] BugFix [BugFix] Fix memory leak in collector
[Feature] Feature [Feature] Add new optimizer
[Doc] or [Docs] Documentation [Doc] Update installation guide
[Refactor] Refactoring [Refactor] Clean up module imports
[CI] CI [CI] Fix workflow permissions
[Test] or [Tests] Tests [Tests] Add unit tests for buffer
[Environment] or [Environments] Environments [Environments] Add Gymnasium support
[Data] Data [Data] Fix replay buffer sampling
[Performance] or [Perf] Performance [Performance] Optimize tensor ops
[BC-Breaking] bc breaking [BC-Breaking] Remove deprecated API
[Deprecation] Deprecation [Deprecation] Mark old function
[Quality] Quality [Quality] Fix typos and add codespell

Note: Common variations like singular/plural are supported (e.g., [Doc] or [Docs]).

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

Labels

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 sota-implementations/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant