fix(eval): check last line for LLM judge verdict in fuzzy_match and ua_match - #272
Open
AUTHENSOR wants to merge 1 commit into
Open
fix(eval): check last line for LLM judge verdict in fuzzy_match and ua_match#272AUTHENSOR wants to merge 1 commit into
AUTHENSOR wants to merge 1 commit into
Conversation
…match Previously these functions checked the entire judge response for substring matches like 'correct' or 'different', which matched reasoning text before the verdict. Also replaced assert (which crashes on unrecognized synonyms) with a fail-safe return 0.0.
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
llm_fuzzy_matchandllm_ua_matchinevaluation_harness/helper_functions.pyextract the judge verdict by checking whether substrings like"correct","incorrect","same", or"different"appear anywhere in the judge response. When the judge reasons before its final verdict (common for GPT-4), the reasoning text can contain these words, causing the wrong verdict to be selected.Example: a judge response like
"The student's phrasing differs but is not incorrect. The answer is correct."matches"incorrect"first (via the substring scan over the full text), returning0.0when the verdict should be1.0.Additionally, both functions used
assert "correct" in response/assert "same" in response, which crashes the benchmark if the judge uses a synonym the harness does not expect (e.g.,"wrong"or"not matching").Fix
assertwith a fail-safereturn 0.0when no recognized verdict token is found.Verification
llm_fuzzy_matchandllm_ua_match(14 lines changed).cot_classify).assertcrash path is eliminated.