CascadeEvaluator._get_llm_correctness counts a judge reply that starts with "Correctness" (or "Correctly") as correct, even when the verdict is negative

Author: shaurya416Created Sep 25, 2026Updated Sep 25, 2026

opencompass/evaluator/cascade_evaluator.py:118 (identical logic duplicated at :121)

python
if 'prediction' in llm_detail:
    response = llm_detail['prediction'].strip().upper()
    return response == 'A' or response.startswith('CORRECT')
elif 'llm_judge' in llm_detail:
    response = llm_detail['llm_judge'].strip().upper()
    return response == 'A' or response.startswith('CORRECT')

.startswith('CORRECT') also matches any reply whose first word begins with those letters, such as "CORRECTNESS" or "CORRECTLY". A judge reply that starts with one of those words and then gives a negative verdict is counted as a positive one.

Measured

_get_llm_correctness was extracted verbatim with ast and run on its own. It is pure string and dict logic, so no repository modules were imported.

input got expected note
{'prediction': 'Correctness: No, the answer is wrong.'} True False judge says the answer is wrong; counted as correct
{'llm_judge': 'Correctness: incorrect, does not match gold.'} True False same defect through the llm_judge key (line 121)
{'prediction': 'Correctness is not met; the final numeric answer differs from the gold target.'} True False any written verdict that opens with "Correctness" triggers it
{'prediction': 'Correctly? No. B'} True False "Correctly" also matches the prefix
{'prediction': 'B'} False False control: negative letter, handled correctly
{'prediction': 'INCORRECT'} False False control: negative word, handled correctly (it doesn't start with "CORRECT")
{'prediction': 'A'} True True control: documented positive format
{'prediction': 'CORRECT'} True True control: documented positive fallback format
{'prediction': 'correct.'} True True intended use: case-insensitive, trailing punctuation tolerated

The repository's own judge parser disagrees on these rows. _generic_llmjudge_postprocess in opencompass/datasets/generic.py does a regex search for A|B. It returns 'unknown' (not correct) for all three "Correctness ..." inputs above. So the same reply counts as incorrect in the judge stage's own accuracy and as correct in the cascade result.

Consequence

_get_llm_correctness reads the judge's raw reply. generic_llmjudge_postprocess passes the evaluator's output through unchanged as details, so each detail's prediction is the judge's raw text unless a judge pred_postprocessor cleans it. Its result is stored as llm_correct (line 286). It also feeds llm_correct/llm_accuracy, the final_correct counter (lines 295-307), final_accuracy, and each sample's cascade_correct.

The grader prompts shipped for cascade evaluation are in opencompass/configs/datasets/aime2025/aime2025_cascade_eval_gen_5e9f4f.py and examples/eval_cascade_evaluator.py, plus the GPQA and AIME2025 raw-prompt variants. They give the judge two different answer formats: "Just return the letters "A" or "B", with no text around it" and "Simply reply with either CORRECT, INCORRECT". They also end with the line "Judging the correctness of candidates' answers:". If a judge ignores the format and starts its verdict with a word that echoes that closing line, such as "Correctness: No, ..." or "Correctness is not met, ...", the negative verdict is silently counted as positive. No error or warning is raised and no row is dropped.

In cascade mode (parallel=False, which every shipped CascadeEvaluator config sets), the judge only sees samples the rule-based evaluator already marked wrong. Each flipped verdict then adds a false pass to final_correct and final_accuracy. In the constructor's default parallel=True mode, every sample goes to the judge, and a flipped verdict is ORed with the rule result into final_correct.

Suggested fix

Keep the exact match for A and require a word boundary after CORRECT, so a leading "CORRECTNESS" or "CORRECTLY" no longer matches while "correct." still does:

python
import re
...
return response == 'A' or re.match(r'CORRECT\b', response) is not None

Apply the same change in the llm_judge branch at line 121. Run against the table above, this returns False for the three "Correctness ..." rows and True for A, CORRECT and correct.. It also returns False for B and INCORRECT. The 'Correctly? No. B' row also becomes False.

Happy to open the PR.

Source: open-compass/opencompass