fix(rm_hub): guard deepscaler reward against a missing response#2115
Open
vjsai wants to merge 1 commit into
Open
fix(rm_hub): guard deepscaler reward against a missing response#2115vjsai wants to merge 1 commit into
vjsai wants to merge 1 commit into
Conversation
get_deepscaler_rule_based_reward did 'if "</think>" in response' without checking response first. async_rm passes sample.response straight through, and the sibling reward functions in this package (gpqa, f1) already guard a missing response and return 0 — but deepscaler did not, so a None response raised 'TypeError: argument of type NoneType is not iterable' instead of scoring 0. Return 0 for a falsy response, matching the gpqa/f1 contract. An empty string already returned 0, so only the crash path changes. Adds a regression test for None / empty response.
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.
Summary
get_deepscaler_rule_based_reward(slime/rollout/rm_hub/deepscaler.py) starts withif "</think>" in response:without first checkingresponse. The dispatcherasync_rm(slime/rollout/rm_hub/__init__.py) passessample.responsestraight through:The sibling rule-based rewards in this same package already guard a missing response and return 0 —
gpqa.py(if not response: return 0.0) andf1.py(if prediction is None: return ZERO_METRIC) — butdeepscalerdid not, so aNoneresponse raised:instead of scoring 0 like its siblings.
Fix
Return
0for a falsy response at the top of the function, matching the gpqa/f1 contract. An empty-string response already returned 0 (no marker match), so only the crash path changes.Test Plan
Added
test_missing_response_returns_zerototests/test_rm_deepscaler.py(thecpu-unittestsuite):get_deepscaler_rule_based_reward(None, "42")→TypeError❌Noneand""→0✅; all existing cases unchanged.ruff checkpasses on both files.Prepared with AI assistance (Claude Code); the change was reviewed and tested by a human before submitting.