Inferensys

Glossary

Reliability Diagram

A visual plot that bins predicted probabilities against observed frequencies to graphically diagnose miscalibration, where a perfectly calibrated model follows the identity diagonal.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
CALIBRATION DIAGNOSTIC

What is a Reliability Diagram?

A visual tool for assessing whether a probabilistic classifier's confidence scores align with its actual empirical accuracy.

A reliability diagram is a graphical diagnostic that plots a model's predicted probability against its observed frequency of correctness to visually identify miscalibration. Predictions are grouped into discrete bins based on confidence, and the average accuracy within each bin is compared to the bin's midpoint. A perfectly calibrated model follows the identity diagonal, where a 70% confidence prediction is correct exactly 70% of the time.

Deviations from the diagonal reveal systematic biases: points below the diagonal indicate overconfidence, while points above indicate underconfidence. This plot complements scalar metrics like Expected Calibration Error (ECE) by showing where miscalibration occurs across the probability spectrum, making it an essential tool for model validators diagnosing the trustworthiness of a classifier's output.

RELIABILITY DIAGRAM

Key Diagnostic Features

A reliability diagram is a visual diagnostic tool that bins predicted probabilities and plots them against observed frequencies to reveal systematic miscalibration patterns.

01

The Identity Diagonal

The diagonal line (y = x) represents perfect calibration. A model is perfectly calibrated if, for all predictions with a confidence of P%, the actual accuracy is exactly P%.

  • Above the diagonal: The model is underconfident—its accuracy is higher than its predicted probability.
  • Below the diagonal: The model is overconfident—its predicted probability exceeds its actual accuracy.
  • Deviation magnitude indicates the severity of miscalibration at that confidence level.
02

Binning Strategy

The diagram partitions the probability interval [0,1] into M equal-width or equal-mass bins. For each bin:

  • X-axis: The mean predicted probability of samples in that bin.
  • Y-axis: The empirical frequency of positive outcomes.
  • Bin count (M) is a hyperparameter; 10–20 bins are typical. Too few bins obscure detail, while too many create noisy, unreliable estimates.
  • Equal-mass binning (each bin contains the same number of samples) ensures consistent statistical reliability across the plot.
03

Confidence Histogram

A reliability diagram is often paired with a marginal histogram showing the distribution of predicted probabilities.

  • Sharpness: A model concentrated near 0 and 1 is sharp (confident). A model spread across the range is diffuse.
  • Sharpness is distinct from calibration. A model can be perfectly calibrated but uselessly diffuse (e.g., always predicting the base rate).
  • The histogram reveals where the model operates—critical for understanding if miscalibration occurs in regions with sufficient data density.
04

ECE as a Summary Metric

The Expected Calibration Error (ECE) is the primary scalar summary derived from a reliability diagram.

  • Formula: ECE = Σ (|B_m| / N) × |acc(B_m) − conf(B_m)|, where B_m is bin m, N is total samples, acc is accuracy, and conf is mean confidence.
  • ECE is the weighted average of the gaps between each bin's point and the diagonal.
  • Limitation: ECE is sensitive to binning choices and can be gamed by models that distribute errors uniformly. Always inspect the full diagram alongside the scalar.
05

Multiclass Extension

For multiclass classification, reliability diagrams can be constructed in several ways:

  • Top-label calibration: Plots the confidence of the predicted class against the accuracy of that prediction. Most common for classifiers with many classes.
  • Classwise calibration: Generates a separate diagram for each class, plotting P(class=k) against the observed frequency of class k. Stricter and more diagnostic.
  • Confidence histograms for multiclass problems often reveal whether a model collapses probability mass onto a single class regardless of uncertainty.
06

Diagnosing Recalibration Needs

The shape of the reliability curve directly informs the choice of recalibration method:

  • Sigmoidal S-shape (overconfident at extremes, underconfident in the middle): Platt scaling or temperature scaling are effective parametric fixes.
  • Non-monotonic or irregular deviations: Isotonic regression is preferred as it makes no functional form assumptions.
  • Systematic underconfidence across all bins: Indicates a need for label smoothing during training or adjusting the decision threshold.
  • Always recalibrate on a held-out validation set to avoid overfitting the calibration map.
CONFIDENCE CALIBRATION

Frequently Asked Questions

Clear, technically precise answers to the most common questions about reliability diagrams and their role in diagnosing model miscalibration.

A reliability diagram is a visual diagnostic tool that plots a model's predicted probabilities against its observed empirical frequencies to assess calibration quality. The mechanism involves binning predictions into discrete intervals (e.g., 0.0-0.1, 0.1-0.2) based on their confidence scores. For each bin, the average predicted probability is plotted on the x-axis, while the fraction of correctly classified samples within that bin is plotted on the y-axis. A perfectly calibrated model follows the identity diagonal (y=x), meaning a 70% confidence prediction is correct exactly 70% of the time. Deviations above the diagonal indicate underconfidence (accuracy is higher than predicted), while deviations below the diagonal signal overconfidence (predicted probability exceeds actual accuracy). The diagram often includes a histogram of sample counts per bin to indicate where predictions are concentrated, providing a comprehensive view of calibration across the entire probability spectrum.

CALIBRATION DIAGNOSTICS COMPARISON

Reliability Diagram vs. Related Diagnostic Tools

Comparing the Reliability Diagram against other common tools used to evaluate and visualize model calibration and predictive uncertainty.

FeatureReliability DiagramExpected Calibration Error (ECE)Risk-Coverage Curve

Primary Output

Visual plot of accuracy vs. confidence per bin

Single scalar summary metric (0 to 1)

Visual plot of error rate vs. coverage

Identifies Over/Under-Confidence

Identifies Specific Miscalibrated Bins

Evaluates Selective Classification Trade-off

Provides Per-Bin Sample Count Visibility

Sensitive to Bin Width Selection

Directly Visualizes Identity Diagonal

Summary Metric for Model Comparison

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.