Summary
Calibration concerns a probability’s meaning, not which class ranks first. For binary event , calibration means in the evaluated population. This is different from calibrating predicted-label correctness, and weaker than calibrating every component of a multiclass distribution.
Task: ten untouched hypothetical binary cases all have positive-event probability ; six labels are one. Evaluate temperature , fitted on separate calibration data. Calculate the new probability, reliability gap, Brier score, and decisions at thresholds and .
Small sample frequencies have uncertainty; this fixture cannot establish population-wide improvement.
Measuring calibration
Use representative evaluation cases whose labels are mature and whose event definition is unchanged.
- Bin positive-event probabilities; report bin counts and mean probabilities.
- Count positive labels, not generic classification correctness, for each bin.
- Plot mean probability against positive fraction; the diagonal marks agreement.
- Report uncertainty and complementary proper scores such as Brier loss and log loss.
Event-frequency ECE averages absolute bin gaps using bin-frequency weights. It depends on binning and can conceal within-bin or subgroup errors; it does not measure discrimination by itself. For top-label calibration instead, define confidence as the selected class’s probability and outcomes as prediction correctness.
Spatial intuition
Calibration checks event frequencies; temperature can change actions without changing ranking
Reference drawing
Spatial intuition
Calibration checks event frequencies; temperature can change actions without changing ranking
Derivation
Why confidence can be wrong
Finite samples, model misspecification, fitting choices, and deployment shift can break probability-frequency agreement. Guo et al. studied particular neural classification settings, not a universal ordering of every model family.
Cross-entropy is a proper probability objective; minimizing empirical loss is not a guarantee of correct population probabilities.
How to fix calibration
Temperature scaling
Use for binary logits, or shared-scalar for multiclass scores, with . Fit the temperature on calibration data and evaluate the frozen map on independent cases.
Here . Dividing by two gives , hence . The observed positive fraction remains .
| Check | Original | After separate fit |
|---|---|---|
| Absolute reliability gap | ||
| Brier loss | ||
| Positive decisions at | Ten | Ten |
| Positive actions at | Ten | Zero |
Argmax accuracy remains six of ten. Shared positive temperature preserves class ordering, not every probability-based action.
Platt scaling
Fit to binary calibration labels. Its slope and intercept can change a threshold; an unconstrained negative slope can reverse ordering.
Isotonic regression
New task: replace a one-parameter map when nonlinear distortion persists and calibration data support a more flexible map. In a separate calibration fixture, three equally sized groups have scores and event rates . Each group has 20 cases, with positive counts . An increasing least-squares isotonic fit pools the last two rates to , giving . Check: previously distinct scores tie; both now exceed a threshold. Use when: scalar temperature leaves systematic errors; independently evaluate the frozen map and its plateaus.
Change the population
New task: deployment prevalence changes while score ordering stays stable. Collect mature representative labels and retest the same event by relevant slice. Check: a probability- bucket with five positive labels among ten now has empirical gap . Use when: traffic, labeling, or policy changes; ordering stability alone does not establish calibration.
Failure: always predicting a population’s base rate can be calibrated while distinguishing no cases.
Reconstruct: does lowering generation temperature calibrate factual confidence?
Answer
No. Decoding changes token sampling. Calibration requires a defined event and held-out frequency evidence, not merely more deterministic output.
Label smoothing during training
For classes, use under a declared smoothing convention. This changes training targets, not a post-hoc calibration fit; evaluate probability quality rather than assuming improvement.
Ensembling
Averaging probabilities changes the predictive distribution and inference cost. Neither lower error nor better calibration is guaranteed for every ensemble.
Bayesian methods
Posterior prediction, variational approximations, and Monte Carlo dropout represent different uncertainty procedures. Model assumptions and approximations still need checking; Bayesian construction alone does not prove empirical calibration under shift.
Calibration for LLMs
Next-token probability describes a token event conditional on context, not directly the truth of an entire answer. Self-consistency measures sampled agreement; confidently repeated errors can agree. Verbalized confidence is another model output, requiring a task-specific event definition and representative labeled evaluation. Do not rank these signals universally or treat post-training methods as automatically destroying every notion of calibration.
What an interviewer expects you to say
State the event, evaluated population, fitting/evaluation split, sample counts, and downstream decision rule.
Common confusions
Accuracy, discrimination, calibration, and decision cost answer different questions. Predictive intervals also have coverage notions; proper distributional scores such as CRPS measure more than calibration alone. Top-label calibration does not certify every class probability or subgroup.
Why interviewers ask
For a frozen argmax-only action, shared positive temperature leaves that action unchanged. Abstention, thresholds, and expected-cost policies can depend on the changed probabilities.
Related: decision thresholds, asymmetric costs, and abstention, How would you evaluate an LLM application?, and How do you handle hallucinations in production?.