TL;DR
While Temperature Scaling (TS) is the go-to method for fixing overconfident neural networks, applying it before Conformal Prediction (CP) creates a surprising trade-off: it improves conditional coverage (fairness across classes) but often significantly bloats the size of the prediction sets. This paper provides the first mathematical theory explaining this non-monotonic relationship and offers a roadmap for practitioners to tune temperature as a "knob" to balance set precision against reliability.
What Problem Does This Paper Address?
Modern deep learning models are notoriously overconfident—they might predict "Cat" with 99% probability when they are actually only right 70% of the time. To fix this, researchers use two main tools:
- Calibration (e.g., Temperature Scaling): Adjusting the model's output scores so they reflect true probabilities.
- Conformal Prediction (CP): Instead of a single label, the model outputs a set of labels (e.g., {Cat, Dog}) guaranteed to contain the truth with high probability (e.g., 90%).
While both are used to handle uncertainty, they are usually treated as independent steps. Many practitioners blindly apply Temperature Scaling (TS) before running CP algorithms. This paper asks: What actually happens to a conformal prediction set when you change the model's temperature? Does "better calibration" always lead to "better prediction sets"?
Methods
The authors conduct an extensive study on the interplay between TS and three major CP methods:
- LAC (Least Ambiguous set-valued Classifier): A simple threshold-based method.
- APS (Adaptive Prediction Sets): A method that includes labels until a cumulative probability threshold is met.
- RAPS (Regularized APS): A variation of APS that penalizes large sets to keep them concise.
The core of the paper is the exploration of Temperature Scaling beyond calibration. Usually, $T$ is chosen to minimize error (NLL or ECE). Here, the authors sweep $T$ from 0.5 to 5.0 to observe how it affects the Average Set Size (AvgSize) and the Top-5% Class-Coverage Gap (TopCovGap)—a measure of how "fair" the coverage is across different classes.
Crucially, they establish a mathematical theory using a "bound function" to explain why prediction set sizes don't just increase or decrease linearly with temperature, but instead follow a specific non-monotonic "hump" pattern.
Key Insights and Ideas
- The Hidden Trade-off: For adaptive methods (APS/RAPS), TS calibration is a double-edged sword. It makes the model "fairer" (improving class-conditional coverage) but at the cost of making the prediction sets much larger and less useful.
- LAC is "Temperature-Blind": Interestingly, the simplest CP method (LAC) is almost entirely unaffected by temperature scaling. If you only care about set size and don't mind poor conditional coverage, TS doesn't help or hurt LAC.
- The Non-Monotonic "Hump": As you increase temperature $T$, the average set size for APS/RAPS first increases, hits a peak at a "critical temperature," and then starts to decrease.
- The "Aha!" Moment: The authors prove this happens because of a tug-of-war: increasing $T$ decreases the individual softmax scores (which should increase set size), but it also decreases the quantile threshold $\hat{q}$ used by the CP algorithm. The non-monotonic trend is the result of these two forces shifting at different rates.
Key Results
- Set Size Bloat: On CIFAR-100 with a ResNet50, "optimal" TS calibration increased the average prediction set size from 5.31 to 9.14—a nearly 72% increase in set size just to achieve better calibration.
- Coverage Improvement: That same calibration improved the conditional coverage gap from 12.6% to 9.0%, showing that the sets became more reliable across different classes even as they grew larger.
- Guideline for Practitioners: The authors suggest using two separate temperatures: $T^*$ for standard probability calibration and a separate $\hat{T}$ to tune the CP sets. They show that by picking a temperature based on the "dip" in the coverage curve, their method can outperform specialized algorithms like Mondrian CP in both set size and reliability.
Limitations and Future Work
- Theoretical Scope: While the empirical results cover LAC, APS, and RAPS, the rigorous mathematical proofs focus primarily on APS. The authors note that RAPS is "closely related," but a full theoretical treatment of the regularization terms in RAPS remains for future work.
- Conditional Coverage Theory: The paper provides a solid theory for set size changes, but the theoretical analysis of why TS improves conditional coverage is left as an open research question.
- Exchangeability: Like most CP research, this assumes the data is "exchangeable" (similar to i.i.d.). How these temperature dynamics play out under "distribution shift" (where the test data looks different from the training data) is not explored.
Summary updated