Repository navigation
fix(rm_hub): accept numeric zero ground truth in grade_answer_verl - #2486
Open
Domin-Focus wants to merge 1 commit into
Open
Domin-Focus wants to merge 1 commit into
Domin-Focus wants to merge 1 commit into
Conversation
Labels are passed through from the dataset as-is, so a zero answer
arrives as 0 / 0.0. The `if not ground_truth` guard treated these as a
missing label, so every correct \boxed{0} response scored 0 under
rm_type=math. THUDM#336 added str(ground_truth) to support non-string labels,
but the falsy guard runs before that conversion.
Only reject None and "", and add tests for numeric zero labels.
Domin-Focus
force-pushed
the
fix/math-zero-label
branch
from
October 20, 2026 11:37
d7ce423 to
b58034b
Compare
This branch has not been deployed
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.
Problem
grade_answer_verl(slime/rollout/rm_hub/math_utils.py:485) starts with:Labels are passed through from the dataset as-is (
slime/utils/data.py:272), so a zero answer arrives as0or0.0. Both are falsy, so the guard treats them as a missing label, and every correct\boxed{0}response scores 0 underrm_type=math. Under GRPO, a group where every sample gets 0 gives no learning signal for that prompt.#336 added
str(ground_truth)so this function would accept non-string labels, but the falsy guard runs before that conversion.Reproduction:
deepscaler(label == "") andgpqaalready handle numeric zero correctly. Onlymathis affected.Fix
Only reject a missing label:
Behavior is unchanged for every other input, including
"",Noneand whitespace-only labels.Tests
tests/test_rm_math.py:test_grade_answer_verl_accepts_numeric_zero_ground_truth[0, 0.0]: fails before this change, passes after.test_grade_answer_verl_rejects_wrong_answer_for_zero_ground_truth:\boxed{1}vs0is still rejected.test_grade_answer_verl_returns_false_on_missing_ground_truth["", None]: the existing empty-label test, extended toNone.python tests/test_rm_math.py: 36 passed.pre-commit run: passed.Note: #2150 edits a line two below this one in
grade_answer_verl(\fboxsupport). The two changes don't conflict logically. I'll rebase if that one lands first.