[reward] fix: keep boxed answers within the documented length budget - #7440
Open
JimmyWang0417 wants to merge 1 commit into
Open
[reward] fix: keep boxed answers within the documented length budget#7440JimmyWang0417 wants to merge 1 commit into
JimmyWang0417 wants to merge 1 commit into
Conversation
Assisted-by: OpenAI Codex
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?
compute_score()already limits math-DAPO solutions to their final 300characters, matching the documented maximum MATH-500 answer length of 159
characters.
is_correct_strict_box()then applies another 100-character slice,which can remove the opening
\boxed{marker from a valid answer and silentlyscore it as incorrect.
This change keeps the existing 300-character bound as the single window. Strict
boxed-answer extraction receives the full bounded string while preserving the
existing four-element validation for
pause_tokens_index.Checklist Before Starting
math_dapo,is_correct_strict_box, boxed-answer length, andpause_tokens_indexwork.function but leaves both 100-character slices unchanged.
ground_truthto the returned score dictionary.it does not claim or test this length-window defect.
strict_box_verifythrough reward managers withoutchanging
math_dapo.py.tests/special_sanity/check_pr_title.py.Test
Before the fix, the documented-length strict, fallback, and pause-index cases
failed because the second 100-character slice removed the box opener:
After removing only the redundant slice assignments:
The full dependency test environment and remote CI were not run locally.
API and Usage Example
No signature, return-schema, configuration, or score-value changes. Existing
callers continue to use
compute_score()unchanged.Design & Code Changes
compute_score()as the sole owner of the 300-character efficiencywindow.
extraction.
pause_tokens_indexvalidation without inferring anunproven token-to-character coordinate conversion.
pause-index compatibility, and unchanged no-box failure behavior.
AI Assistance
OpenAI Codex was used for repository exploration, implementation assistance,
test orchestration, and review. I reviewed every changed line, can explain the
change end-to-end, and personally ran the focused regression tests.
Checklist Before Submitting
AGENTS.md.cpu_unit_tests.yml.changes.
recipesubmodule is not involved.