Skip to content

Fix MATH grading to use last Answer and harden equality check - #119

Open
shoemoney wants to merge 1 commit into
openai:mainfrom
shoemoney:shoemoney/fix-simple-evals-115
Open

Fix MATH grading to use last Answer and harden equality check#119
shoemoney wants to merge 1 commit into
openai:mainfrom
shoemoney:shoemoney/fix-simple-evals-115

Conversation

@shoemoney

@shoemoney shoemoney commented Aug 24, 2026

Copy link
Copy Markdown

Fixes #115

math_eval now grades the last Answer: line, not the first. Uses re.findall and takes the final match. This matches the prompt that asks for the last line to hold the answer. Self correction mid response no longer flips the score.

common now wraps both expressions in quotes in the equality prompt. Candidate text is delimited and cannot read as instructions. Adds guard for None extracts.

common now parses the grader reply with a tolerant check. Searches for word yes. Handles case, punctuation, and short rationales like yes. or The answer is yes.

Testing: reproduced both flip directions and the prompt injection and strict parse failures without API calls. Verified patched extraction picks last answer and tolerant parse accepts all expected yes variants. No existing repo tests affected.

Fixes openai#115. Use last Answer match, wrap expressions, tolerant yes parse.

Disclosure: developed in conjunction with my pair programmer Claude.
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.

MATH grading takes the first "Answer:" match (not the final answer), and check_equality interpolates candidate text raw into the grader prompt

1 participant