Skip to content

fix(graders): record refused verdicts from the LLM graders - #46

Open
Krishnachaitanyakc wants to merge 1 commit into
Future-House:mainfrom
Krishnachaitanyakc:fix/parse-grade-response-refused
Open

fix(graders): record refused verdicts from the LLM graders#46
Krishnachaitanyakc wants to merge 1 commit into
Future-House:mainfrom
Krishnachaitanyakc:fix/parse-grade-response-refused

Conversation

@Krishnachaitanyakc

Copy link
Copy Markdown

Both grading prompts ask for correct, incorrect or refused, but _parse_grade_response maps everything except correct to INCORRECT, so refused is never returned and GradeResult.refusal stays False on both LLM paths.

GradingFunction()._parse_grade_response("<grade> refused </grade>")
# GradeType.INCORRECT

Visible in the committed baselines: all 205 rows in both *-grader-openended.csv files have sure=False, including answers like "The specific p-value cannot be determined without the actual data."

grade and correct are unchanged for every input since REFUSED.numeric_grade is already 0. Only refusal gains True values, so regenerating open ended results would move precision, coverage and n_sure.

`_parse_grade_response` collapsed every non-`correct` verdict to
INCORRECT, so the `refused` verdict that both OPEN_ENDED_GRADING_PROMPT
and OPEN_ENDED_RANGE_GRADING_PROMPT instruct the grading model to emit
could never be returned. `GradeResult.refusal` was therefore always
False on `_grade_llm_verifier` and `_grade_range_llm_verifier`, making
an abstention indistinguishable from a wrong answer in every open-ended
result. `_grade_str_verifier` already handled all three cases.

This is visible in the committed baselines: all 205 rows of each
open-ended grader CSV carry `sure=False`, including answers such as
"The specific p-value cannot be determined without the actual data."

Map the three documented verdicts explicitly. Anything else (a missing
or malformed <grade> tag, or an unexpected verdict string) keeps its
current INCORRECT result, since an unreadable verdict is a formatting
failure by the grading model rather than an abstention by the answerer.

No accuracy figure changes: GradeType.REFUSED.numeric_grade is already
0 and is_correct is already False, so the `grade` and `correct` columns
are identical for every input. Only `refusal` (persisted as the `sure`
column by grade_outputs.py) gains True values, which moves precision,
coverage and n_sure, the numbers those metrics were always meant to
report.
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