Repository navigation
fix(livemath): score (B), [B] and **B** as the choice they name - #378
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Conversation
normalize_label stripped trailing ".", ")" and ":" but nothing at the
front, so a model answering <answer>(B)</answer> was parsed as "(B" and
scored wrong even when B was correct. [B] and **B** failed the same way,
while B, B. and B) passed. hard is the exact-match result, so these
answers got zero reward during training and counted as misses in the
reported accuracy.
Strip surrounding Markdown bold and a leading "(" or "[" along with the
existing trailing punctuation. Wrong labels and free text such as
"Option B" are still not matched.
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.
Summary
Fixes #376.
A LiveMathematicianBench answer written as
(B),[B]or**B**was scored wrong even when B was the correct choice. These formats are now parsed as the label they name.B,B.andB)were already accepted and are unchanged.User impact:
hardis the exact-match result, so a correct answer in one of these common formats got zero reward during training and counted as a miss in reported accuracy. The optimizer could also be pushed toward learning answer formatting instead of the task.Proof: the regression tests fail on upstream
6ee29a0and pass with this change.Root cause
normalize_label()inskillopt/envs/livemathematicianbench/evaluator.pywas:It removed trailing punctuation but nothing at the front, so
(B)became(B, which is not a valid label.parse_choice_label()then fell through to returning that invalid label.[B]and**B**were never stripped at all.Changes
normalize_label()also strips surrounding Markdown bold, a leading(or[, and a trailing], in addition to the existing trailing.,)and:.(A)against B, free text such asOption B, and empty answers still score 0._normalize_labelfor gold data, where labels are plain letters. It is unchanged; predictions only pass through the evaluator.tests/test_livemath_evaluator.py, testing throughevaluate(), which is what the rollout calls.Reproduction
Before:
1.0 'B',0.0 '(B',0.0 '[B]',0.0 '**B**'After:
1.0 'B'for all four.Testing
python -m pytest tests/test_livemath_evaluator.py -q: on upstream6ee29a0, 4 failed (assert '(B' == 'B'and similar) and 6 passed; with the fix, 10 passed.python -m pytest tests/test_livemath_evaluator.py tests/test_benchmark_task_output_paths.py -q: 26 passed.python -m pytest -q: 2079 passed, 12 skipped, 4 xfailed.python -m ruff checkon the changed files: all checks passed.python -m mkdocs build --strict: passed.Risk and compatibility
Only answers that previously normalized to an invalid label change outcome. Any answer that already matched a label is scored the same. This changes LiveMathematicianBench scores upward for runs whose target model wraps its choice, so results from before and after this fix are not directly comparable. No backend, config key, file format or CLI change.