[Fix] MMMU-Pro cot_postproc: robustly extract the option letter (handles "Answer: $LETTER" echoes)#1591
Merged
kennymckormick merged 1 commit intoJul 3, 2026
Conversation
cot_postproc counted uppercase letters across the whole 'Answer:' line, so the
capital 'A' in the word 'Answer' always added a spurious letter and the
single-letter fast-path almost never fired. Models that echo the prompt's
'$LETTER' template literally (e.g. 'Answer: $B') then fell through to returning
raw text that the downstream option matcher cannot parse, scoring correct
answers as wrong.
Fix: inspect only the text after the last 'Answer:' marker (also handles
multiple 'Answer:' lines by taking the last one).
Validation (eval-only rescoring of identical predictions, gemma-4-31b):
MMMU_Pro_V COT 18.55%->67.92%, MMMU_Pro_10c COT ~56%->~74%, matching the
reference evaluate.py extraction (rfind('Answer:')).
kennymckormick
approved these changes
Jul 3, 2026
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
MMMUProDataset.cot_postprocmis-extracts the predicted option in two common cases, causing correct answers to be scored as wrong on the CoT settings of MMMU-Pro:Answer:line. The capital A in the word "Answer" is always counted, solen(counter) == 1almost never holds and the clean-letter fast-path rarely fires.'Answer: $LETTER'template literally — e.g.Answer: $B— the fallback returns the raw text" $B", which the downstream option matcher (exact_matching) cannot parse, so the item is scored incorrect.build_promptexplicitly instructs"...format: 'Answer: $LETTER'...", and several models reproduce the$literally, so this is hit frequently — especially in the Vision setting (MMMU_Pro_V), where the options live inside the image.Fix
Inspect only the text after the last
Answer:marker (and take the lastAnswer:line, in case the model emits more than one). This removes the spuriousAfrom "Answer" and makesAnswer: $Bresolve toB.Validation
Eval-only rescoring of identical saved predictions (a 31B open model, greedy,
--judge exact_matching), with onlycot_postprocchanged:In this run 77% of
MMMU_Pro_Vanswers were written asAnswer: $X(literal$). The fixed values match both the referenceevaluate.pyextraction (rfind("Answer:")) and the models' own stated answers, and are consistent with the public MMMU-Pro leaderboard for this model.Single-function change, no new dependencies.