Skip to content

feat(metrics): add ECE and RMS calibration error metrics#3913

Open
shadowmodder wants to merge 1 commit into
EleutherAI:mainfrom
shadowmodder:feat/ece-rms-calibration-metrics
Open

feat(metrics): add ECE and RMS calibration error metrics#3913
shadowmodder wants to merge 1 commit into
EleutherAI:mainfrom
shadowmodder:feat/ece-rms-calibration-metrics

Conversation

@shadowmodder

Copy link
Copy Markdown

Closes #2189

Summary

Adds two new calibration quality metrics as requested in #2189:

  • ece — Expected Calibration Error with equal-width binning
  • rms_ce — Root-Mean-Square Calibration Error

Both follow the existing brier_score pattern exactly:

  • Registered via @register_aggregation + @register_metric
  • output_type=["multiple_choice"]
  • Accept (gold_label, predicted_probability) pairs
  • Return a scalar in [0, 1]. Lower is better.

Design

ECE bins predictions into n_bins equal-width buckets and computes the weighted average of |accuracy − confidence| per bin (Guo et al., "On Calibration of Modern Neural Networks", ICML 2017).

RMS-CE uses an L2 norm instead of L1, giving more weight to large miscalibration gaps.

Usage in a task YAML

metric_list:
  - metric: ece
  - metric: rms_ce
  - metric: brier_score

References

Closes EleutherAI#2189

Adds two new calibration quality metrics:
- ece: Expected Calibration Error with equal-width binning (Guo et al. 2017)
- rms_ce: Root-Mean-Square Calibration Error

Both are registered as output_type=['multiple_choice'] metrics compatible
with the brier_score pattern. Each accepts (gold_label, predicted_probability)
pairs and returns a scalar in [0, 1]. Lower is better.
@CLAassistant

CLAassistant commented Jul 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Adding RMS Calibration Error as a Metric

2 participants