Skip to content

fix(v1): prefer Final Judgment over draft boxed answers in parse_judge_choice - #2256

Open
crazywriter1 wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
crazywriter1:fix/v1-parse-judge-choice-utils-score
Open

fix(v1): prefer Final Judgment over draft boxed answers in parse_judge_choice#2256
crazywriter1 wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
crazywriter1:fix/v1-parse-judge-choice-utils-score

Conversation

@crazywriter1

@crazywriter1 crazywriter1 commented Aug 5, 2026

Copy link
Copy Markdown

Supersedes #2008 — same fix, rebased onto current main after #2204 moved scoring helpers to verifiers/v1/utils/score.py.

Summary

  • parse_judge_choice previously unwrapped the last \boxed{...} before looking for verdict markers, so a draft box could wipe a later Final Judgment / Final Answer line and return the wrong choice.
  • Search order is now: explicit verdict marker on the full reply → boxed answer (if present) → last choice match.
  • If a verdict marker is present but has no choice after it, fall through to boxed / last-match instead of returning None.

Risk

Low. Only flips scores when a reply has both a draft \boxed{...} and a later explicit verdict line (or an empty marker that previously failed). Default yes/no-only reference prompts are mostly unaffected.

Test plan

  • Manual: Draft: \boxed{A} + Final Judgment: BB
  • Manual: Final Judgment: (empty) + earlier \boxed{A}A
  • Manual: verdict-marker-only, boxed-only, boxed-over-CoT, last-match, incomplete <think> cases

Note

Low Risk
Scoring-only change in judge reply parsing; may flip grades when replies mix draft boxes and later verdict lines, with no auth or runtime impact.

Overview
parse_judge_choice no longer replaces the post-</think> text with a strict \boxed{...} extract before hunting verdict lines, so a draft box cannot override a later explicit verdict.

Parsing order is now: scan the full reply for FINAL JUDGMENT / FINAL ANSWER / FINAL VERDICT (then bare JUDGMENT / VERDICT / ANSWER), last marker wins, and the A/B/C (or custom) choice must sit on that marker’s line via new _choice_on_marker_line. If no marker yields a choice (e.g. empty Final Judgment:), it falls back to strict boxed content when present, else the last choice token in the text.

Also drops the noqa: BLE001 on the broad except in verify_boxed_math_answer (behavior unchanged).

Reviewed by Cursor Bugbot for commit 08bc1a8. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix parse_judge_choice to prefer Final Judgment markers over draft boxed answers

  • Adds a _choice_on_marker_line helper in score.py that restricts choice detection to the same line as a verdict marker, preventing later lines from being matched incorrectly.
  • Reworks parse_judge_choice to prefer the last "Final" verdict marker over bare markers, and defers boxed-answer extraction until after marker-based matching so earlier boxed content cannot shadow a later verdict line.
  • Falls back to a boxed answer choice, then to the last choice match in the text, if no marker-based choice is found.
  • Behavioral Change: choices are no longer accepted from lines following a verdict marker; only the marker's own line is scanned.

Macroscope summarized 08bc1a8.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c404576. Configure here.

Comment thread verifiers/v1/utils/score.py Outdated
Comment thread verifiers/v1/utils/score.py Outdated
@crazywriter1
crazywriter1 force-pushed the fix/v1-parse-judge-choice-utils-score branch from c404576 to 08bc1a8 Compare August 5, 2026 12:57
…e_choice

Search the full reply for verdict markers before unwrapping \boxed{...}, and fall back to boxed/last-match when a marker has no choice after it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant