NEW
A post-hoc calibration method that rescales softmax logits by a temperature parameter to adjust model confidence.
DESCRIPTION
Temperature scaling divides logits by a scalar T before softmax to calibrate predicted probabilities. It is fitted on validation data to minimize calibration error, leaving classification accuracy unchanged. This simple method often outperforms more complex calibrations for deep networks. Temperature scaling is widely used in safety-critical applications where reliable probabilities matter. It complements reliability diagrams and ECE metrics in model evaluation.
ALTERNATIVE DEFINITIONS
ICML 2017 (Guo et al.)
We find that temperature scaling—a simple variant of Platt scaling—works surprisingly well for neural networks.
Positions temperature scaling as an effective, simple calibration technique for DNNs.
Distill
Temperature scaling rescales logits before the softmax, controlling confidence and improving calibration.
Emphasizes intuition and visualization of calibration methods.
RELATED TERMS
Calibration Softmax Logit Expected Calibration Error Reliability Diagram Confidence Post-hoc Calibration Ensemble Methods
COMPETING TERMS
Platt Scaling Isotonic Regression
RELATIONS
- Broader: Scaling
KNOWLEDGE AREAS
AI Data Science MLOps Testing & Validation
TARGET AUDIENCE
Data Scientist MLOps Engineer AI Engineer
EXTERNAL SOURCES
- Wikipedia - Calibration (statistics)
- PMLR - Seminal paper on calibration and temperature scaling
- scikit-learn - Guidance on probability calibration
- Distill - Interactive article on model calibration
TOP QUESTIONS
Why use temperature scaling instead of more complex calibration methods?
It’s simple, efficient, and often effective without changing accuracy. One parameter fitted on validation data suffices in many cases.
Category: Relevancy
Does temperature scaling change classification accuracy?
Typically no. It adjusts probabilities while preserving the ranking of logits, leaving argmax predictions unchanged.
Category: Misunderstanding
How do you fit the temperature parameter?
Optimize T on validation data to minimize negative log likelihood or ECE. Use gradient-based methods or search.
Category: Implementation
What are common mistakes with temperature scaling?
Using training data to fit T, ignoring distribution shift, and not monitoring ECE after deployment can lead to miscalibration.
Category: Mistakes
When is temperature scaling insufficient?
Severe miscalibration or class-dependent errors may require isotonic regression, vector scaling, or ensembles.
Category: Risks
How does calibration relate to model safety?
Well-calibrated probabilities enable risk-aware decisions, thresholding, and uncertainty-driven intervention in safety-critical systems.
Category: Opinion
What metrics evaluate calibration quality?
Expected Calibration Error, Maximum Calibration Error, Brier score, reliability diagrams, and NLL assess calibration.
Category: Testing
Can temperature scaling be applied to regression?
Not directly; it targets classification logits. Regression calibration uses other uncertainty techniques.
Category: Alternatives
How does temperature scaling affect LLM decoding?
In generation, temperature modifies sampling diversity, but classic calibration refers to post-hoc probability adjustment of classifiers.
Category: Misunderstanding