Skip to content

fix(hle): scale confidence to 0-1 before computing calibration error - #1470

Open
damienen wants to merge 1 commit into
huggingface:mainfrom
damienen:fix/lighteval-03
Open

damienen wants to merge 1 commit into
huggingface:mainfrom
damienen:fix/lighteval-03

Conversation

@damienen

@damienen damienen commented Nov 2, 2026

Copy link
Copy Markdown

Fixes #1469

What was wrong

JudgeLLMHLE.compute_corpus passed the judge's confidence (0 to 100) and correctness (0 or 1) to calib_err without bringing them to the same scale. The reported calibration_error therefore mostly measured how confident the model sounds. A model that is always correct at 100% confidence scored 70.0 instead of 0.

Fix

Divide the confidences by 100 before calib_err and multiply the result by 100, as the official HLE judge script does. The binning is unchanged.

How it was verified

In a Linux container (CPU only), numpy 2.3.4, on main 311c9d04f4173791ff97bf2d3bf811ec057aa799:

  • Added tests/unit/tasks/test_hle.py: 200 correct answers at 100% confidence give calibration_error == 0.0. On main it fails with 70.0; with the fix it passes (pytest tests/unit/tasks/test_hle.py, lighteval installed with pip install -e .).
  • Simulated calibrated model (1000 samples, confidence 0 to 100, correct with that probability): main reports 50.24, with the fix 3.78, which matches the official scaling.

The rest of the test suite and the lint hooks were not run.

calib_err compared confidences in percent with 0/1 correctness. Divide
by 100 before the call and scale the result back, as the official HLE
judge does.
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.

HLE calibration_error compares confidence in percent (0-100) with correctness in 0/1, so a model that is always right at 100% confidence scores 70

1 participant