Does confidence calibration improve conformal prediction?

HuaJun Xi, Jianguo Huang, Kangdao Liu, Lei Feng, Hongxin Wei

Abstract

Conformal prediction is an emerging technique for uncertainty quantification that constructs prediction sets guaranteed to contain the true label with a predefined probability. Previous works often employ temperature scaling to calibrate classifiers, assuming that confidence calibration benefits conformal prediction. However, the specific impact of confidence calibration on conformal prediction remains underexplored. In this work, we make two key discoveries about the impact of confidence calibration methods on adaptive conformal prediction. Firstly, we empirically show that current confidence calibration methods (e.g., temperature scaling) typically lead to larger prediction sets in adaptive conformal prediction. Secondly, by investigating the role of temperature value, we observe that high-confidence predictions can enhance the efficiency of adaptive conformal prediction. Theoretically, we prove that predictions with higher confidence result in smaller prediction sets on expectation. This finding implies that the rescaling parameters in these calibration methods, when optimized with cross-entropy loss, might counteract the goal of generating efficient prediction sets. To address this issue, we propose Conformal Temperature Scaling (ConfTS), a variant of temperature scaling with a novel loss function designed to enhance the efficiency of prediction sets. Extensive experiments demonstrate that our method improves existing adaptive conformal prediction methods in both image and text classification tasks.

Introduction

Conformal Prediction (CP) is a powerful framework for uncertainty quantification. Instead of a single "best guess," it produces a prediction set that is mathematically guaranteed to contain the true label with a user-defined probability (e.g., 95%). For these sets to be practically useful, they need to be efficient—meaning they should be as small as possible while maintaining the coverage guarantee.

Standard wisdom in machine learning suggests that well-calibrated models produce better uncertainty estimates. Consequently, many researchers have assumed that "calibrating" a model (ensuring its predicted probabilities match real-world frequencies) would naturally lead to more efficient conformal sets. This paper challenges that assumption, demonstrating that standard calibration techniques—like Temperature Scaling—often result in "bloated" prediction sets in adaptive conformal methods. The authors seek a way to optimize model outputs specifically for the goal of set efficiency rather than just probability accuracy.

Methods: Conformal Temperature Scaling (ConfTS)

The authors first demonstrate the inverse relationship between calibration and efficiency through empirical testing and theoretical proofs. They show that as a model becomes better calibrated (lower Expected Calibration Error), its prediction sets in adaptive methods like APS (Adaptive Prediction Sets) actually grow larger.

To solve this, they propose Conformal Temperature Scaling (ConfTS). Unlike standard Temperature Scaling, which tunes a parameter $t$ to minimize cross-entropy loss, ConfTS tunes $t$ to minimize the Efficiency Gap.

The Key Innovation: * Efficiency Gap: Defined as the difference between the conformal threshold ($\tau$) and the non-conformity score of the ground truth label. * The Loss Function: $L_{ConfTS} = (\tau(t) - S(x, y, t))^2$. By minimizing this mean squared error on a held-out validation set, the model learns a temperature that pushes the ground truth label's score as close to the threshold as possible, effectively shrinking the resulting sets. * Generality: This approach isn't limited to temperature; the authors extend it to other post-hoc methods like ConfPS (Platt Scaling) and ConfVS (Vector Scaling).

Key Insights: The Efficiency-Calibration Trade-off

There is a fundamental trade-off between calibration and efficiency. Standard calibration often makes models "less confident" to match true accuracy, but adaptive conformal prediction thrives on high-confidence (even "overconfident") predictions to produce smaller sets.

Impact of Temperature on Prediction Set Size and Coverage. Panels (a) and (b) show that increasing temperature (standard calibration) increases set size for APS and RAPS. Panel (c) illustrates the numerical precision limits where extremely low temperatures cause set sizes to explode.

As shown in the figure above, the authors prove theoretically and empirically that lower temperatures result in smaller expected prediction sets. Intuitively, sharpening the probability distribution makes the "top" labels much more dominant, allowing the conformal algorithm to stop sooner when accumulating probability. However, there are Numerical Precision Limits: if the temperature is too low, tail probabilities are truncated to zero due to floating-point limitations. This causes the conformal threshold to explode, leading to "trivial" sets containing all possible labels (as seen in panel c). ConfTS automatically finds the optimal point before these errors occur.

Experimental Results

The improvements offered by ConfTS are substantial and consistent across a wide variety of tasks (CIFAR-100, ImageNet, AG News) and architectures (ResNets, ViT, BERT, GPT-Neo):

  • Massive Size Reduction: On ImageNet, ConfTS reduced the average prediction set size of the APS method by 58.3% across six different model architectures.
  • ViT Performance: For a ViT-B-16 model at a 5% error rate ($\alpha=0.05$), the baseline set size was 36.72. ConfTS slashed this to 9.05 while still maintaining the 95% coverage guarantee.
  • Superiority over Conformal Training: The authors found that ConfTS achieved better efficiency in most cases than "Conformal Training" (ConfTr) without requiring expensive model retraining.
  • Cross-Domain Success: The method worked equally well for Large Language Models (LLMs) on text tasks, proving it is a general-purpose tool for uncertainty quantification.

Limitations and Future Work

While ConfTS significantly improves efficiency, it is primarily designed for adaptive conformal prediction scores (like APS and RAPS) and does not significantly improve non-adaptive scores like LAC (Least Ambiguous Prediction). Additionally, while the method improves marginal coverage efficiency, it does not explicitly guarantee "conditional coverage" (accuracy for every specific type of input), though empirical improvements in size-stratified coverage metrics were noted. Future work could involve designing specialized loss functions that explicitly target conditional coverage or other specific downstream utility metrics.

Summary updated

BibTeX
@article{xi2025does,
  author = {HuaJun Xi and Jianguo Huang and Kangdao Liu and Lei Feng and Hongxin Wei},
  title = {{Does confidence calibration improve conformal prediction?}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=6DDaTwTvdE},
}
Figure