Skip to content

AI Glossary · Metrics

What is Confidence Calibration?

Confidence Calibration

Confidence calibration is how closely predicted probabilities match observed outcomes. Among comparable predictions assigned an 80% chance of being correct, about 80% should be correct if that confidence level is calibrated.

· Updated · Chain of Thought

AI Evaluation & Reliability

  • 1 explainer
  • 2 sources

Imagine a classifier assigns 80% confidence to 100 ticket categories. If about 80 labels are correct, that group is consistent with calibration at that level. One group is not enough: check across confidence ranges on representative held-out examples, with enough cases to distinguish real patterns from sampling noise.

Calibration differs from accuracy. A model can classify many cases correctly and still overstate its probabilities. The Guo and colleagues paper studies this mismatch in neural classifiers and examines methods for adjusting confidence estimates.

The distinction matters if a product sends uncertain cases to a person or acts on a probability threshold. A language model saying “I am confident” has not supplied a validated correctness probability. Define a measurable confidence signal and an outcome label for the particular task, test their relationship, and recheck it when the workload changes. Calibration does not guarantee that any individual answer is right.

An overall probability score does not isolate calibration either. The scikit-learn calibration guide notes that Brier loss and log loss combine calibration with discriminative power and the uncertainty in the data, so a lower Brier loss does not necessarily mean a better-calibrated model.

Same predictions, different routing

Consider two invented ways to score the same 100 ticket-label predictions. Each score is a claimed probability that the chosen label is correct. The labels, correct answers and ordering of the two groups stay fixed. Only the reported probabilities change.

Invented confidence scores A and B for the same 100 ticket-label predictions
GroupRight / totalA (%)B (%)
Group 135 / 5070%90%
Group 245 / 5090%95%

Both scoring rules have the same 80% classification accuracy: 80 correct labels out of 100. Score A matches the assigned group frequencies; Score B overstates both. Higher confidence has not made the underlying predictions more accurate.

Suppose a routing rule accepts labels automatically at at least 90% confidence and sends the rest to review. Score A accepts 50 labels, with five wrong. Score B accepts all 100, with twenty wrong. The chosen threshold is only an illustration, not a recommended policy. In a real workflow, measure errors among accepted cases alongside how many cases bypass review, and choose the trade-off for the cost of mistakes.

Do these two matching groups prove Score A is calibrated?

No. These are assigned numbers, not observed validation results. Even in real data, matching a few finite groups does not prove population calibration, reliable scores within every subgroup or future performance. Report how many labeled cases support each confidence range, inspect relevant slices and allow for sampling noise.

Check the score on cases it has not learned from

Keep the data used to fit a confidence mapping separate from the cases used to assess it. The scikit-learn calibration guide explains why fitting the calibrator on the classifier’s own training predictions can bias its probabilities. An untouched evaluation set checks the resulting score rather than repeating its fitting exercise.

Recheck the score when the workload changes. Ovadia and colleagues found that calibration on the original distribution did not guarantee calibration under dataset shift in their classifier benchmarks. Their image, text and categorical experiments do not validate confidence for arbitrary generated answers. For an LLM workflow, define the specific outcome and collect relevant labeled evidence before treating a score or confident phrase as a correctness probability.

Work through expected calibration error

Guo and colleagues summarize calibration with expected calibration error (ECE): group predictions into confidence bins, take each bin’s gap between average confidence and accuracy, and weight it by the bin’s share of predictions. Take ten predictions in two occupied bins:

ConfidencePredictionsCorrect
0.6054 (80%)
0.9054 (80%)

The first bin understates its accuracy by 20 points and the second overstates it by 10. ECE is 5/10 × 0.20 + 5/10 × 0.10 = 0.15. Put all ten in one bin and the summary becomes |0.80 − 0.75| = 0.05, because the two errors point in opposite directions and cancel in the average. The predictions did not change, only the binning, so report the bin edges and the count in each bin with any ECE.

Sources

Go deeper