- Key idea
- Calibration, reliability diagrams, ECE, proper scoring rules (log loss, Brier), temperature scaling, semantic entropy and conformal prediction
- Real world
- A weather forecaster is calibrated if, on all the days they said "70% chance of rain", it rained on about 70% of them. Being calibrated isn't the same as being accurate: always forecasting the yearly average is calibrated but useless.
- In an LLM
- Pre-trained models' token probabilities tend to be well calibrated; after RLHF, they often become overconfident. Reasoning models asked to state a confidence can do better. A model that knows when it doesn't know can abstain instead of hallucinating.
Calibration
A forecaster, person or model is calibrated if its stated probabilities match observed frequencies: among all the times it says 80%, it's right 80% of the time.
Calibration is checked with a reliability diagram: group predictions by stated confidence (0–10%, 10–20%, …), and plot the actual accuracy in each group. A calibrated model's bars sit on the diagonal. Expected calibration error (ECE) is the average gap between bar and diagonal, weighted by how many predictions fall in each group.
On the 50 days a forecaster said "90% rain", it rained on 30. They're overconfident at the high end: their 90% means 60%. ECE adds up such gaps across all confidence levels.
A model answers 1,000 trivia questions and reports a confidence for each. Of the answers it rated 95% confident, only 70% are correct. Telling users "95%" would be misleading; and any system that relies on that number, such as one that only answers when confidence is above 90%, would make too many mistakes.
Two numbers, two different things
- Discrimination (or resolution): does the model put higher confidence on its right answers than its wrong ones?
- Calibration: are the confidence values themselves trustworthy?
A proper scoring rule rewards both, and can't be gamed by reporting anything other than your true belief. The two standard ones:
- Log loss: minus the log-probability given to what happened. It's cross-entropy, the same loss language models are trained with. A confident miss costs a lot.
- Brier score: the squared difference between stated probability and outcome (1 or 0). Bounded, gentler on confident misses.
Training on log loss is one reason pre-trained models start out reasonably calibrated: a proper scoring rule is minimised by predicting the true frequencies.
Fixing it: temperature scaling
The simplest fix divides the model's logits by a single number fitted on held-out data. softens overconfident predictions; sharpens underconfident ones. It never changes which answer ranks first, so accuracy is untouched, only the stated confidence.
Try it
Uncertainty from a text model
LLMs don't output one probability per answer; they output one per token, and many different strings mean the same thing. Ways to get answer-level uncertainty:
| Method | Idea |
|---|---|
| Sequence probability | Multiply token probabilities. Penalises long answers and different phrasings of the same answer. |
| Ask the model | "How confident are you?" Verbalised confidence; after RLHF it's often better calibrated than token probabilities. |
| P(True) | Show the model its own answer and ask whether it's true; read off the probability of "True". |
| Sampling consistency | Sample several answers; agreement means confidence. |
| Semantic entropy | Sample answers, cluster them by meaning, and compute entropy over the clusters. High entropy flags likely confabulation. |
| Conformal prediction | Output a set of answers guaranteed to contain the right one with, say, 90% probability. |
Asked "Where is the Eiffel Tower?", a model samples "Paris", "In Paris, France" and "It's in Paris." Token-level entropy looks high: three different strings. Semantic entropy groups them into one meaning, so uncertainty is low. If samples said "Paris", "Rome", "Berlin", semantic entropy is high, and the model is probably guessing.
"Your recovery will take 4 to 8 weeks, and that range is right for 9 in 10 patients" is a conformal-style statement: not a single guess, but a set with a coverage guarantee, checked on past patients.
Instead of trusting a single sample, a model keeps sampling answers to a question and stops when a rule says the set it has collected contains a correct answer with 90% probability. The rule is calibrated on a few hundred past questions with known answers, the way the doctor’s range was checked on past patients. Easy questions stop after one or two samples; hard ones produce a larger set, and the set’s size becomes an honest signal of uncertainty. This is the idea behind Conformal Language Modeling.
Why hallucination is a calibration problem
Kalai et al. (2025) argue that hallucinations are a predictable statistical outcome, not a mystery. Pre-training is like a binary classification task, "is this a valid statement?", and a calibrated model must sometimes generate errors for facts seen only once in training. Post-training then grades models with benchmarks that give 0 for "I don't know" and 1 for a lucky guess, so guessing scores better than abstaining. Their fix is in evaluation: reward abstention when confidence is below a stated threshold.
That's also why recent RL work adds calibration to the reward: train with a Brier-score term so that the model's stated confidence must match its accuracy, not just get the answer right.
Where this shows up
- Reward design: confidence-aware rewards with proper scoring rules: reward design.
- Selective answering and abstention: answer only when confidence beats a threshold.
- Evaluation: calibration is reported alongside accuracy in many model cards.
- Entropy of the policy during RL is a different quantity, about exploration: entropy.
Definitions
A model with confidence for prediction is calibrated if
With bins over predictions:
Temperature scaling
Semantic entropy
Sample , cluster them into meaning classes using bidirectional entailment, and estimate
Conformal prediction
On a calibration set of examples, compute a nonconformity score (e.g. one minus the model's probability of the correct answer). Let be the quantile. Then for a new example, the set satisfies , assuming only exchangeability.
Papers
- On Calibration of Modern Neural Networks (Guo et al., 2017): ECE, temperature scaling
- Language Models (Mostly) Know What They Know (Kadavath et al., 2022): P(True), calibration of LLMs
- Just Ask for Calibration (Tian et al., 2023): verbalised confidence after RLHF
- Semantic Uncertainty (Kuhn et al., 2023); Farquhar et al., Detecting hallucinations in large language models using semantic entropy (Nature, 2024)
- A Gentle Introduction to Conformal Prediction (Angelopoulos & Bates, 2021) and Conformal Language Modeling (Quach et al., 2023)
- Why Language Models Hallucinate (Kalai et al., 2025)
- Reasoning Models Better Express Their Confidence (Yoon et al., 2025)
- Beyond Binary Rewards: Training LMs to Reason About Their Uncertainty (Damani et al., 2025): Brier score in the RL reward