Manuscript Offprint

arXiv:2609.01072

Let Confidence Change, Not the Prediction: Prediction-Preserving Repair for Post-hoc Calibration

Daehwan Kim, Haejun Chung, Ikbeom Jang

Abstract

Post-hoc calibration corrects reported confidence, yet a multiclass calibrator can also change the associated top-1 prediction. Accuracy captures only the net effect of these changes on correctness, not how often predictions change; the Top-1 Prediction Change Rate (TPCR) instead measures this frequency. We propose Calibrator-Output Repair for Top-1 Decision Preservation (CORD), the first post-fit adapter to impose exact prediction preservation by repairing the full calibrated probability vector. From the original and calibrated outputs alone, CORD determines the mass assigned to the original top-1. The calibrated conditional distribution allocates the remaining mass over the other classes, yielding a repaired vector whose own argmax recovers the original prediction. On the calibration split, CORD coordinates the repaired masses to retain the calibrated outputs' mean mass on original predictions whenever attainable. The adapter alters neither the fitted calibrator nor its direct output, fits no additional supervised map, and requires no user- or validation-tuned hyperparameter. Across CIFAR-10/100 and ImageNet-1K, CORD attains zero TPCR by construction and lowers mean ECE, NLL, and Brier relative to the corresponding direct outputs in every dataset; paired gains persist under distribution shift and across calibration-set sizes. CORD thus removes the preservation constraint from calibrator fitting and assigns exact recovery of the original decision to subsequent output repair. Our code is available at https://github.com/labhai/ORCU.

Introduction

Post-hoc calibration leaves the parameters of a trained classifier fixed and fits a separate map to its outputs. Its goal is confidence calibration, whereby predictions reported with confidence pp are correct with frequency pp (Guo et al. 2017). In standard multiclass prediction, a single probability vector both selects the predicted class through its argmax and encodes the corresponding confidence in the value at that coordinate. A post-hoc map that modifies this vector can therefore change not only the reported confidence but also the final top-1 prediction. Some calibration maps retain the original classifier's top-1 (Guo et al. 2017; Zhang, Kailkhura, and Han 2020; Rahimi et al. 2020; Tomani, Cremers, and Buettner 2022), whereas others may change it (Guo et al. 2017; Kull et al. 2019). A calibrated vector used as the final predictive distribution associates its confidence with the

Figure

Figure 1: Accuracy hides the extent of top-1 prediction changes. For Vector Scaling on ImageNet-1K with ResNet-50, accuracy change reflects the net balance of accuracy-improving (C+C^+) and accuracy-degrading (C−C^-) revisions, whereas TPCR in Equation (10) counts all revisions, including accuracy-neutral changes between incorrect classes (C0C^0).

class selected by its own argmax; when the calibrated top-1 changes, that class differs from the original classifier's choice. The resulting report is coherent for the composed predictor, but the object of calibration has shifted.

Preventing this shift at fit time requires constraining the calibration map to preserve the original top-1, thereby narrowing the class of admissible probability transformations. Mix-n-Match (Zhang, Kailkhura, and Han 2020) makes this tension explicit by identifying accuracy preservation and high expressive power as calibration desiderata and illustrating how greater expressive power can come at the cost of classification accuracy. Measured as an accuracy change, the resulting compromise can appear small, yet accuracy records only the net effect on correctness of changes to the original top-1 predictions, not their extent. Applying Vector Scaling (Guo et al. 2017) to a pretrained ResNet-50 on ImageNet-1K reduces accuracy by only 0.24 percentage points yet changes the original top-1 prediction for 5.74% of examples (Figure 1). Only ground-truth labels reveal how each revision affects correctness. Here, revisions with opposing effects nearly offset one another, while those between incorrect classes make no contribution to the accuracy change. The net effect is small; the extent is not.

We therefore ask a different question—What if the preservation constraint were removed from fitting and imposed af-

†Corresponding authors.

terward? We open this route with Calibrator-Output Repair for Top-1 Decision Preservation (CORD), the first post-fit adapter to impose exact prediction preservation by repairing a fitted calibrator's full probability vector. Using only the original and calibrated outputs, CORD constructs a repaired probability vector whose argmax matches the original prediction. It leaves both the fitted calibrator and its direct output unchanged, fits no additional supervised map, and introduces no user- or validation-tuned hyperparameter. The calibrator is thus fitted without a preservation constraint; prediction preservation is imposed only afterward in constructing the repaired output and is no longer determined by the choice of calibrator.

Moving preservation outside fitting requires a principled repair, as the calibrated vector is the output of a fitted calibration map and an unrestricted rewrite would be indistinguishable from an arbitrary override. CORD therefore changes only how probability mass is split between the originally predicted class and all remaining classes, restoring the original top-1 while leaving the calibrated vector's relative allocation among those classes unchanged. Because independent point-wise repairs can collectively shift the mean mass assigned to the original predictions, CORD coordinates them over the calibration split to retain the calibrated outputs' mean mass on those predictions whenever attainable. One fitted calibrator thereby yields two normalized reports, with the direct output describing the prediction induced by its own argmax and the repaired output describing the original classifier's prediction. CORD thus allows the reported confidence to change while keeping the prediction it describes fixed. Overall, we make the following contributions:

  • We expose how multiclass calibration can change the top-1 prediction that the reported confidence describes; accuracy records only the net effect of such changes on correctness, whereas the Top-1 Prediction Change Rate (TPCR) captures their total incidence.

  • We introduce CORD, the first post-fit adapter to impose exact prediction preservation by repairing a fitted calibrator's full probability report. It preserves the calibrated conditional distribution over the remaining classes without auxiliary supervised fitting or a user- or validation-tuned hyperparameter.

  • We demonstrate across diverse datasets, classifiers, and calibrator families that CORD attains zero TPCR by construction while lowering ECE, NLL, and Brier on average relative to the direct outputs, with gains persisting under distribution shift and across calibration-set sizes.

References (54)

  • Box-Constrained Softmax Function and Its Application for Post-Hoc Calibration (opens arXiv in a new tab)
  • Structured Matrix Scaling for Multi-Class Calibration (opens arXiv in a new tab)
  • Smooth ECE: Principled reliability diagrams via kernel smoothing
  • Quantile Adaptive Temperature Scaling for Confidence Calibration (opens arXiv in a new tab)
  • Reassessing how to compare and improve the calibration of machine learning models
  • Imagenet: A large-scale hierarchical image database
  • Repvgg: Making vgg-style convnets great again
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Accuracy-preserving calibration via statistical modeling on probability simplex
  • On calibration of modern neural networks
  • Top-label calibration and multiclass-to-binary reductions
  • Deep residual learning for image recognition
  • Benchmarking neural network robustness to common corruptions and perturbations (opens arXiv in a new tab)
  • Densely connected convolutional networks
  • Sample-dependent adaptive temperature scaling for improved calibration
  • Re-thinking Post-Hoc Calibration in Semantic Segmentation (opens arXiv in a new tab)
  • Learning multiple layers of features from tiny images
  • Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities with dirichlet calibration
  • Confidence calibration of classifiers with many classes
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • A convnet for the 2020s
  • Improving uncertainty calibration of deep neural networks via truth discovery and geometric optimization
  • Shufflenet v2: Practical guidelines for efficient cnn architecture design
  • Meta-cal: Well-controlled post-hoc calibration by ranking
  • Class-wise and reduced calibration methods
  • Intra order-preserving functions for calibration of multi-class neural networks
  • Mitigating bias in calibration error estimation
  • Very deep convolutional networks for large-scale image recognition
  • Parameterized temperature scaling for boosting the expressive power in post-hoc uncertainty calibration
  • Wide residual networks (opens arXiv in a new tab)
  • Mix-n-match: Ensemble and compositional methods for uncertainty calibration in deep learning (opens arXiv in a new tab)
  • Instance-wise monotonic calibration by constrained transformation (opens arXiv in a new tab)
  • Prediction-Preserving Repair for Post-hoc Calibration
  • Post-Fit Prediction Preservation) of the main paper
  • Every exact tie is resolved by selecting the smallest maximizing class index, and the same rule is used for the original, direct, and repaired outputs
  • Since $[\mathcal{S}_{\delta_{\mathrm{stab}}}(u)]_j - [\mathcal{S}_{\delta_{\mathrm{stab}}}(u)]_k = (1 - \delta_{\mathrm{stab}})(u_j - u_k)$, stabilization preserves every pairwise order relation and the complete maximizer set, while producing a normalized vector with all coordinates in $(0,1)$
  • Rewrite the aggregate equality in Equation (7) of the main paper as $\sum_{i=1}^{n} s_{i} = n\mu$
  • Let $h_g : (0,1) \to \mathbb{R}$ be given by $h_g(s) = (s-g)/\{s(1-s)\}$ and write $H(g,\eta) = h_g^{-1}(\eta)$
  • It follows that $E_\mu$ is a nonempty closed interval
  • Finite bracket
  • The interval $[L, U]$ is therefore a finite bracket containing both zero and the nearest-zero multiplier $\eta^{\star}$
  • Moreover, for every $j \neq a$
  • To examine variations of this weighting without changing any other component of CORD, consider the family indexed by $\lambda \in [0,1]$:
  • Within this fixed-weight family, $\lambda=1/2$ is the only fixed setting for which exchanging $b_i$ and $p_{i,a_i}^0$ leaves the local-reference rule unchanged for all admissible pairs, yielding the arithmetic mean in Equation (5) of the main paper
  • For each $\lambda$, the same coordinated-repair program and shared-scalar solver apply, and the structural guarantees in Proposition 1 of the main paper remain unchanged
  • Across $\lambda \in [0.3,0.9]$, the largest point estimate occurs at different weights across the three metrics; CORD fixes $\lambda=1/2$ by the symmetry criterion above
  • np.ndarray, calibrated: np.ndarray) -> np.ndarray: p0, q = _stabilize(original), _stabilize(calibrated) a, _, tail, g, lower, upper = _quantities(p0, q) head = _response(self.eta_, g, lower, upper) repaired = (1.0 - head[:, None]) * tail repaired[np.arange(a.size), a] = head return repaired
  • midpoint = left + 0.5 * (right - left) if midpoint == left or midpoint == right: return left if _response(midpoint, g, lower, upper).mean() <= target: left = midpoint else: right = midpoint
  • Across all pairs, CORD exactly recovers the original top-1 predictions and hence the original accuracy, while the paired ECE, NLL, and Brier entries show how the effects of repair vary with the revisions induced by each Base direct output
  • Values are averaged over classifier–calibrator pairs and five splits
  • Averaged over classifiers, calibrators, and 15 corruptions, CORD maintains zero TPCR and lower ECE, NLL, and Brier than Base at every severity on both datasets
  • Rows show CIFAR-10-C and CIFAR-100-C; curves average over classifiers, calibrators, 15 corruptions, and five splits
  • Curves average over classifiers and calibrators; shading shows pointwise 95% CIs across five splits
  • Per classifier, Base† denotes the prediction-non-preserving Base with the lowest direct-output standard ECE, and Base†+CORD its paired repair