On Calibration and Conformal Prediction of Deep Classifiers

Lahav Dabah, Tom Tirer · OpenReview

Abstract

In many classification applications, the prediction of a deep neural network (DNN) based classifier needs to be accompanied by some confidence indication. Two popular approaches for that aim are: 1) Calibration: modifies the classifier's softmax values such that the maximal value better estimates the correctness probability; and 2) Conformal Prediction (CP): produces a prediction set of candidate labels that contains the true label with a user-specified probability, guaranteeing marginal coverage but not, e.g., per class coverage. In practice, both types of indications are desirable, yet, so far the interplay between them has not been investigated. Focusing on the ubiquitous Temperature Scaling (TS) calibration, we start this paper with an extensive empirical study of its effect on prominent CP methods. We show that while TS calibration improves the class-conditional coverage of adaptive CP methods, surprisingly, it negatively affects their prediction set sizes. Motivated by this behavior, we explore the effect of TS on CP beyond its calibration application and reveal an intriguing trend under which it allows to trade prediction set size and conditional coverage of adaptive CP methods. Then, we establish a mathematical theory that explains the entire non-monotonic trend. Finally, based on our experiments and theory, we offer simple guidelines for practitioners to effectively combine adaptive CP with calibration, aligned with user-defined goals.

Introduction

Modern Deep Neural Networks (DNNs) are notoriously overconfident, often assigning high probabilities to incorrect predictions. To mitigate this, practitioners use Calibration (specifically Temperature Scaling) to align softmax outputs with actual accuracy. Simultaneously, high-stakes applications employ Conformal Prediction (CP) to generate prediction sets that guarantee the true label is included with a user-defined probability (e.g., 90%).

While both techniques aim to quantify uncertainty, their interplay has remained largely unexplored. This paper investigates whether the common practice of applying Temperature Scaling (TS) as a pre-processing step for CP actually leads to more efficient prediction sets.

Methods and Datasets

The study evaluates three prominent CP methods across CIFAR-10, CIFAR-100, and ImageNet using various architectures (ResNet, DenseNet, ViT):

  1. LAC (Least Ambiguous set-valued Classifier): A simple threshold-based method.
  2. APS (Adaptive Prediction Sets): Designed to improve "conditional coverage" across different classes.
  3. RAPS (Regularized APS): A variation of APS that penalizes large sets to maintain efficiency.

The analysis centers on Temperature Scaling (TS), where logits are divided by a temperature $T$. The authors scanned a wide range of temperatures to uncover the hidden relationship between $T$ and CP performance metrics.

Key Insights: The Efficiency-Reliability Trade-off

The research reveals a surprising "bloating" effect: for adaptive methods like APS and RAPS, "fixing" overconfidence with TS ($T > 1$) significantly increases prediction set sizes. For instance, on ImageNet with a ResNet152, the average set size nearly doubled after calibration.

Non-monotonic trends of prediction set size (top), coverage gap (middle), and q-hat (bottom) as a function of temperature T.

As illustrated above, there is a clear tug-of-war. Increasing $T$ improves class-conditional coverage (reducing the gap between easy and hard classes) but sacrifices efficiency (resulting in larger sets). The authors discovered that these trends are non-monotonic: set size hits a peak ("hump") and then declines, while the coverage gap hits a minimum and then rises.

Mathematical Theory and Results

The authors established a mathematical theory to explain this behavior. By defining a "bound function" $b(T)$ based on the gap between the top two logits, they proved that if the top logit is sufficiently dominant, TS will predictably increase or decrease the cumulative sum used by CP, explaining the observed non-monotonic trends.

Empirical results across multiple datasets and models showing the consistent trade-off between efficiency and reliability.

Key experimental findings include:

  • LAC Stability: The simplest method, LAC, is largely unaffected by TS calibration in terms of set size.
  • Adaptive Sensitivity: APS and RAPS are highly sensitive to $T$, with calibration often leading to significantly larger sets.
  • Optimal Disconnect: The optimal temperature for calibration ($T^*$) is rarely the optimal temperature for CP efficiency.

Practical Guidelines

Based on these findings, the authors suggest that practitioners should not blindly apply standard calibration temperatures to CP. Instead, they propose a dual-branch approach: use one temperature ($T^*$) for standard probability calibration and a separate, tunable temperature ($\hat{T}$) to navigate the specific trade-off between set size and conditional coverage required by the application.

Summary updated

BibTeX
@inproceedings{dabah2025calibration,
  author = {Lahav Dabah and Tom Tirer},
  title = {{On Calibration and Conformal Prediction of Deep Classifiers}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=oj9hnQpA9M},
}
Figure