THUDM / THUDM/slime

grade_answer_verl fails when rm_type="boxed_math" strips the \boxed{} wrapper upstream

Open Beginner friendly
#543 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

The “boxed” reward shortcuts (rm_type="boxed_math", "boxed_dapo", etc.) already strip the LaTeX box around the response before calling grade_answer_verl. However, grade_answer_verl still assumes the solution string contains a \boxed{} and unconditionally calls extract_answer(solution_str). Because the wrapper has already been removed, extract_answer returns None, the helper immediately returns False, and the rollout get scored as incorrect even when the numeric answer matches the label.

Where

  • slime/slime/rollout/rm_hub/init.py lines 28–37: the rm_type.startswith("boxed_") branch reassigns response = extract_boxed_answer(response) or "" before dispatching to grade_answer_verl.
  • slime/slime/rollout/rm_hub/math_utils.py lines 487–494: grade_answer_verl always parses the response with extract_answer(solution_str).

Steps to Reproduce

  1. Use rm_type="boxed_math" when calling async_rm.
  2. Feed a sample whose response ends with Answer: \boxed{5}.
  3. Because of the boxed prefix, init.py strips the wrapper, so solution_str is just "5" when it reaches grade_answer_verl.
  4. extract_answer("5") returns None; the function returns False, yielding reward 0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in slime/slime/rollout/rm_hub/init.py at the rm_type.startswith("boxed_") branch, then read grade_answer_verl in slime/slime/rollout/rm_hub/math_utils.py. Reproduce the boxed_math path with a response ending in Answer: \boxed{5}, and verify that the stripped response is graded correctly instead of returning False.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.