Reassessing How to Compare and Improve the Calibration of Machine Learning Models

## Abstract

Abstract A machine learning model is calibrated if its predicted probability for an outcome matches the observed frequency for that outcome conditional on the model prediction. This property has become increasingly important as the impact of machine learning models has continued to spread to various domains. As a result, there are now a dizzying number of recent papers on measuring and improving the calibration of (specifically deep learning) models. In this work, we reassess the reporting of calibration metrics in the recent literature. We show that there exist trivial recalibration approaches that can appear seemingly state-of-the-art unless calibration and prediction metrics (i.e. test accuracy) are accompanied by additional generalization metrics such as negative log-likelihood. We then derive a calibration-based decomposition of Bregman divergences that can be used to both motivate a choice of calibration metric based on a generalization metric, and to detect trivial calibration. Finally, we apply these ideas to develop a new extension to reliability diagrams that can be used to jointly visualize calibration as well as the estimated generalization error of a model.

## 1 Introduction

Standard machine learning models are trained to predict probability distributions over a set of possible actions or outcomes. Model-based decision-making is then typically done by using the action or outcome associated with the highest probability, and ideally one would like to interpret the model-predicted probability as a notion of confidence in the predicted action/outcome.

In order for this confidence interpretation to be valid, it is crucial that the predicted probabilities are calibrated (Lichtenstein et al., ; Dawid, ; DeGroot & Fienberg, ), or accurately reflect the true frequencies of the outcome conditional on the prediction. As an informal (classic) example, a calibrated weather prediction model would satisfy the property that we observe rain 80% of the time on days for which our model predicted a $0.8$ probability of rain.

As the applications of machine learning models - particularly deep learning models - continue to expand to include high-stakes areas such as medical image diagnoses (Mehrtash et al., ; Elmarakeby et al., ; Nogales et al., ) and self-driving cars (Hu et al., ), so too does the importance of having calibrated model probabilities. Unfortunately, the seminal empirical investigation of Guo et al. () demonstrated that deep learning models can be poorly calibrated, largely due to overconfidence.

This observation has led to a number of follow-up works intended to improve model calibration using both training-time (Thulasidasan et al., ; Müller et al., ; Wang et al., ) and post-training methods (Joy et al., ; Gupta & Ramdas, ). Comparing these proposed improvements, however, is non-trivial due to the fact that the measurement of calibration in practice is itself an active area of research (Nixon et al., ; Kumar et al., ; Błasiok et al., ), and improvements with respect to one calibration measure do not necessarily indicate improvements with respect to another.

Even if we fix a choice of calibration measure, the matter is further complicated by the existence of trivially calibrated models, such as models whose confidence is always their test accuracy (see Section 3). Most works on improving calibration have approached these issues by choosing to report a number of different calibration metrics along with generalization metrics (e.g. negative log-likelihood or mean-squared error), but these choices vary greatly across works and are always non-exhaustive.

Motivated by this variance in calibration reporting, our work aims to answer the following questions:

- •
Do there exist any systematic issues in the reporting of calibration in the recent literature?
- •
Is there a theoretically motivated choice of which calibration and generalization measures to report, as well as an efficient means of estimating and visualizing them jointly?

### 1.1 Summary of Main Contributions and Takeaways

In answering these questions, we make the following contributions.

- 1.
We identify multiple issues in how calibration performance is reported in the context of multi-class classification, with the core issue being that many (even very recent) papers report only some notion(s) of calibration error along with test accuracy. With respect to these metrics, the trivial recalibration strategy of always predicting with the mean confidence obtained from a held-out calibration set outperforms the most popular post-training recalibration methods.
- 2.
Based on this observation, we revisit the use of proper scoring rules for measuring calibration. We focus on the particular case of scoring rules that are Bregman divergences, and derive a decomposition of the divergence into a calibration error and a leftover “sharpness” term. This latter term can be thought of as corresponding to how much information is preserved by a predictor; i.e. a constant predictor preserves no information from the original data while an injective predictor preserves everything. We show how our decomposition can be used to detect cases of “trivial calibration” and avoid potentially misleading results, and along the way prove several new results connecting Bregman divergences and notions of calibration in the literature.
- 3.
Finally, we propose an extension to reliability diagrams based on the aforementioned decomposition that can be used to jointly visualize calibration and sharpness, and show that our visualization can be used to quickly discern important trade-offs between recalibration methods. We also prove the consistency of our estimation approach, thereby extending existing estimation results. Our visualization approach is available as an open-source Python package, and can be installed simply via pip install sharpcal or from source at [https://github.com/2014mchidamb/reassessing-calibration](https://github.com/2014mchidamb/reassessing-calibration).

The main takeaway of our results is that the choice of calibration metric should be motivated by the choice of generalization metric or loss function and that both should always be reported together in order to ensure that improvements in model calibration are not at the cost of model sharpness.

### 1.2 Related Work

Measuring calibration. Expected calibration error (ECE) is almost certainly the most used calibration metric in the literature, and it is typically estimated using histogram binning (Naeini et al., ). Although originally estimated using uniformly spaced bins (Guo et al., ), different binning schemes (such as equal mass/quantile-based binning) and debiasing procedures have been proposed to improve estimation of ECE (Nixon et al., ; Kumar et al., ; Roelofs et al., ). As ECE is known to have a number of undesirable properties (e.g. discontinuous in the space of predictors), recent work has focused on modifying ECE to fix these issues (Błasiok & Nakkiran, ; Chidambaram et al., ).

Alternatives to ECE include proper scoring rules (Gneiting & Raftery, ), smooth calibration error (Kakade & Foster, ), maximum mean calibration error (Kumar et al., ), cumulative plots comparing labels and predicted probabilities (Arrieta-Ibarra et al., ), and hypothesis tests for miscalibration (Lee et al., ). Several of these approaches are analyzed under the recent theoretical framework of Błasiok et al. (), which puts forth a general desiderata for calibration measures.

In practice, most true calibration measures are only efficient for binary classification, and measuring calibration in the multi-class classification setting requires making concessions on the definition of calibration considered. Towards this end, a number of different calibration notions intended to efficiently work in the multi-class setting have been proposed in the literature (Vaicenavicius et al., ; Kull et al., ; Widmann et al., ; Zhao et al., ; Gupta & Ramdas, ; Gopalan et al., ). We elaborate more on binary vs. multi-class calibration in Section 2.

Improving calibration. Approaches for improving calibration can largely be categorized into post-training and training-time modifications. In the former category, standard approaches include histogram binning (Mincer & Zarnowitz, ; Zadrozny & Elkan, ), isotonic regression (Zadrozny & Elkan, ), Platt scaling (Platt, ), temperature scaling (Guo et al., ), and adaptive variants of temperature scaling (Joy et al., ). For the latter, data augmentation (Thulasidasan et al., ; Müller et al., ) and modified versions of the cross-entropy loss (Wang et al., ) have been shown to lead to better calibrated models.

Calibration and proper scoring rules. Divergences obtained from strictly proper scores such as negative log-likelihood (NLL) and mean-squared error (MSE) often serve as metrics for quantifying generalization. A predictor that is optimal with respect to a strictly proper scoring rule has recovered the ground-truth conditional distribution, and is therefore necessarily calibrated. However, requiring optimality with respect to a proper scoring rule is a stronger condition than requiring calibration, and several works have thus explored how to decompose proper scoring rules into a calibration term and a sharpness/resolution term (Murphy, ; Gneiting et al., ; Bröcker, ; Kull & Flach, ; Pohle, ). These works are either at the specificity of a particular scoring rule (Murphy, ) or at the generality of strictly proper scoring rules satisfying certain consistency conditions (Pohle, ). In this work we focus on the in-between regime of Bregman divergences, for which we can use the additional structure to prove novel connections to the calibration definitions in the machine learning literature.

## 2 Preliminaries

Notation. We use $\overline{\mathbb{R}}$ to denote the extended real line. We use $e_{i}$ to denote the standard basis vector in $\mathbb{R}^{d}$ with non-zero $i$ coordinate. Given $n\in\mathbb{N}$, we use $[n]$ to denote the set $\{1,2,...,n\}$. For a function $g:\mathbb{R}^{n}\to\mathbb{R}^{m}$ we use $g^{i}(x)$ to denote the $i^{\text{th}}$ coordinate function of $g$. We use $\Delta^{k-1}$ to denote the $(k-1)$-dimensional probability simplex in $\mathbb{R}^{k}$. For a probability distribution $\pi$ we use $\mathrm{supp}(\pi)$ to denote its support. Additionally, if $\pi$ corresponds to the joint distribution of two random variables $X$ and $Y$ (e.g. data and label), we use $\pi_{X}$ and $\pi_{Y}$ to denote the respective marginals and $\pi_{Y\mid X}$ to denote the regular conditional distribution of $Y$ given $X$. When $Y$ takes values over a finite set, we will identify $\pi_{Y}$ and $\pi_{Y\mid X=x}$ with vectors in $\Delta^{k-1}$, and similarly identify $\pi_{Y\mid X}$ with the corresponding function from $\mathbb{R}^{d}$ to $\Delta^{k-1}$. For a random variable $X$ that has a density with respect to the Lebesgue measure, we use $p_{X}(x)$ to denote its density. We use $\sigma(X)$ to denote the sigma-algebra generated by the random variable $X$.

Calibration. We restrict our attention to the classification setting, in which there exists a ground-truth distribution $\pi$ on $\mathbb{R}^{d}\times[k]$ and our goal is to recover the conditional distribution $\pi_{Y\mid X}$. We say a predictor $g:\mathbb{R}^{d}\to\Delta^{k-1}$ is fully calibrated if it satisfies the condition

$$ $\displaystyle\mathbb{P}(Y\mid g(X)=v)=v,$ (2.1) $$

where $\mathbb{P}(Y\mid g(X)=v)$ is the regular conditional distribution of $Y$ given $g(X)$ at $g(X)=v$. Informally, the conditional distribution of the label given our prediction matches our prediction.

In the case where $k=2$ (binary classification), we can identify $g(X)$ with a single scalar and the condition (2.1) is easy to (approximately) verify as it amounts to estimating a 1-D conditional expectation $\mathbb{E}[Y\mid g(X)]$. On the other hand, when $k$ is large and $g(X)$ has a density with respect to the Lebesgue measure on $\mathbb{R}^{k}$, the estimation problem becomes significantly more difficult due to the curse of dimensionality.

For such cases, the typical approach taken in practice is to weaken (2.1) to a lower dimensional condition that is easier to work with. To describe such approaches, we adopt the general framework of Gupta & Ramdas (). Namely, given a predictor $g$ as before, we consider a classification function $c:\Delta^{k-1}\to[k]$ and a confidence function $h:\Delta^{k-1}\to[0,1]$ that are used to post-process $g$. For such $c$ and $h$, we can define the weaker notion of confidence calibration (Kull et al., ) (also sometimes referred to as top-class or top-label calibration):

$$ $\displaystyle\mathbb{P}(Y=c(g(X))\mid h(g(X))=p)=p.$ (2.2) $$

We refer to the specific case of $c(z)=\operatorname*{argmax}_{i}z_{i}$ (assuming arbitrary tie-breaking) and $h(z)=\max_{i}z_{i}$ as standard confidence calibration, since this is usually how confidence calibration appears in the literature. Additionally, to keep notation uncluttered, we will simply use $c(X)$ and $h(X)$ to denote $c(g(X))$ and $h(g(X))$ when $g$ is understood from context in the remainder of the paper. Confidence calibration is by far the most used notion of calibration for multi-class classification in the literature, and we will thus mostly focus our attention on the condition (2.2) moving forward. Alternative notions are discussed in detail in Kull et al. (); Gupta & Ramdas (); Gopalan et al. ().

To evaluate how close a tuple $(c,h,g)$ is to satisfying (2.2), we need a notion of calibration error. As mentioned earlier, the most common choice of calibration error is the Expected Calibration Error (ECE), which is simply the absolute deviation between the left and right-hand sides of (2.2):

$$ $\displaystyle\mathrm{ECE}_{\pi}(c,h,g)=\mathbb{E}\left[\absolutevalue{\mathbb{ P}(Y=c(X)\mid h(X)=p)-p}\right].$ (2.3) $$

This version of ECE is also referred to as the $L^{1}$ ECE; raising the term inside the expectation to $q>1$ yields the $L^{q}$ ECE raised to the power $q$. Intuitively, ECE measures how much our classification accuracy conditioned on our confidence differs from our confidence. In order to estimate the ECE, it is necessary to estimate the conditional probability $\mathbb{P}(Y=c(X)\mid h(X)=p)$. This is done using binning estimators (Naeini et al., ; Nixon et al., ) and more recently using kernel regression estimators (Popordanoska et al., ; Błasiok & Nakkiran, ; Chidambaram et al., ).

Proper scoring rules. Alternatives to ECE for measuring calibration error include divergences obtained from proper scoring rules, which are described in full detail in Gneiting & Raftery (). For our purposes, it suffices to consider only the case of scoring rules $\mathcal{S}:\Delta^{k-1}\times\Delta^{k-1}\to\overline{\mathbb{R}}$, in which case $\mathcal{S}$ is called proper if $\mathcal{S}(u,u)\geq\mathcal{S}(u,v)$ for $u\neq v$ and strictly proper if equality is only achieved when $v=u$. The divergence $d_{\mathcal{S}}$ associated with the scoring rule is then defined to be $d_{\mathcal{S}}(u,v)=\mathcal{S}(u,u)-\mathcal{S}(u,v)$ and is guaranteed to be nonnegative so long as $\mathcal{S}$ is proper.

Perhaps the most popular divergences obtained from (strictly) proper scoring rules in machine learning are the mean squared error (MSE, also referred to as Brier score) and the KL divergence (or just NLL); minimizing either one empirically ensures that $g$ recovers the ground-truth conditional distribution $\pi_{Y\mid X}$ given sufficiently many samples and appropriate regularity conditions. As mentioned, this is stronger than necessary for achieving (2.2), which is partly why calibration errors such as ECE are appealing as they directly target the condition (2.2).

## 3 Pitfalls in Calibration Reporting

We begin by first pointing out the well-known fact that even the full calibration condition of (2.2) can be achieved by trivial choices of $g$. Indeed, the choice $g(X)=\pi_{Y}$ satisfies (2.2) despite the fact that $g$ is a constant predictor.

A similar construction is possible for confidence calibration. We can define the confidence function $h$ to be such that $h(z)=\mathbb{P}(Y=\operatorname*{argmax}_{i}g^{i}(X))$, i.e. $h$ is a constant equal to the test accuracy of $g$. Taking $c(z)=\operatorname*{argmax}_{i}z_{i}$ as in the standard case, we once again have that $\mathrm{ECE}_{\pi}(c,h,g)=0$, since:

$$ $\displaystyle\mathbb{P}(Y=c(X)\mid h(X))=\mathbb{P}(Y=c(X))=h(X)$ (3.1) $$

by construction. Of course in practice, we do not actually know $\mathbb{P}(Y=\operatorname*{argmax}_{i}g^{i}(X))$, but we can estimate it on a held-out calibration set and set $h$ to be this estimate. We refer to this approach as mean replacement recalibarion (MRR), and it can be viewed as a special case of the modified histogram binning procedure of Gupta & Ramdas (). Since MRR is defined purely through a modified $h$, there is no clear way for getting a vector in $\Delta^{k-1}$ for computing metrics such as NLL or MSE; for such cases, we simply set the non-predicted class probabilities to be $(1-h(x))/(k-1)$.

The ramifications of the MRR strategy seem to be under-appreciated in the literature - we have minimized calibration error without affecting the prediction of $g$ by using a constant confidence function $h$. By separating the confidence function from the classification function, we have made it so that the test accuracy remains unchanged, so that this kind of trivial confidence behavior (trivial in a sense that is made rigorous in Section 4) is undetectable by just reporting calibration error and accuracy.

To what extent is this a problem in the literature? Although many papers do report multiple calibration and generalization metrics, ECE and accuracy are often the main (or even only) reported metrics in the main body of these papers. For example, even the influential empirical analysis of Guo et al. () focuses entirely on ECE results in the main paper (NLL results are, however, available in the appendix). This is also largely true of the follow-up re-assessment of deep learning model calibration of Minderer et al. (), which focuses on the relationships between test accuracy and ECE for different model families.

For works regarding the improvement of calibration, the work of Thulasidasan et al. () (which motivated the study of Mixup for calibration) reports only test accuracy, ECE, and a related overconfidence measure throughout the whole paper. Similarly, the works of Zhang et al. () and Wen et al. () analyzing how ensembling strategies can affect calibration also only report test accuracy, ECE, and some ECE variants throughout their whole papers. Calibration has also been an important topic in the context of large language models (LLMs), and initial investigations into the calibration of LLMs for question-answering (Jiang et al., ; Desai & Durrett, ) also only reported test accuracy and ECE.

The above listing of papers is of course non-exhaustive; we have focused on a handful of influential papers (all have at least 100 citations) to merely point out that reporting (or at least focusing on) only ECE/similar and test accuracy is common practice. That being said, we are not at all calling into question the advances made by the above papers - many of their findings have been repeatedly corroborated by follow-up work. On the other hand, for new work on calibration we strongly advocate for always reporting errors derived from proper scoring rules (i.e. NLL or MSE) alongside pure calibration metrics such as ECE (we put forth a methodology for doing so in Sections 4 and 5).

Experiments. To drive home the point, we revisit the experiments of Guo et al. (), but focus on one of the more modern architectural choices of Minderer et al. (). Namely, we evaluate the most downloaded pretrained vision transformer (ViT) model(^1^11The model card is available at: [https://huggingface.co/timm/vit_base_patch16_224.augreg2_in21k_ft_in1k](https://huggingface.co/timm/vit_base_patch16_224.augreg2_in21k_ft_in1k).) (Dosovitskiy et al., ; Steiner et al., ) available through the timm library (Wightman, ) with respect to binned ECE, binned ACE (Nixon et al., ), SmoothECE (Błasiok & Nakkiran, ), negative log-likelihood, and MSE on ImageNet-1K-Val (Russakovsky et al., ). We split the data into 10,000 calibration samples (20% split) and 40,000 test samples, and compare the unmodified test performance to temperature scaling (TS), histogram binning (HB), isotonic regression (IR), and our proposed MRR. We follow the same TS implementation as Guo et al. () and also use 15 bins for the binning estimators (ECE, ACE, HB) to be comparable to the results in their work.

**Table 1: Comparison of different recalibration methods applied to pretrained ViT model on ImageNet-1K-Val. All metrics are scaled by a factor of 100 for readability. Histogram binning and isotonic regression have unbounded NLL as they can predict zero probability values for some classes.**
| Model | Test Accuracy | ECE | ACE | SmoothECE | NLL | MSE/Brier Score |
| --- | --- | --- | --- | --- | --- | --- |
| ViT (Baseline) | 85.14 | 9.42 | 9.44 | 9.44 | 65.35 | 22.73 |
| ViT + TS | 85.14 | 2.59 | 5.46 | 2.60 | 56.83 | 21.95 |
| ViT + HB | 82.03 | 5.06 | 11.97 | 4.03 | $\infty$ | 27.17 |
| ViT + IR | 83.82 | 4.53 | 8.13 | 4.48 | $\infty$ | 24.13 |
| ViT + MRR | 85.14 | 0.18 | 0.18 | 0.18 | 144.66 | 27.51 |

###### Remark 3.1 .

It is possible to detect the specific instances of trivial calibration discussed above using alternatives to proper scoring rules, such as ROC-AUC applied to the confidence calibration problem. However, the confidence calibration problem can behave very differently than the overall multi-class classification problem (illustrated in Section 4.2), and typically it is very efficient to compute the proper scoring rules applied to the multi-class problem directly.

###### Remark 3.1 .

## 4 Calibration-Sharpness Decomposition for Bregman Divergences

As can be seen in Table 1, the MRR strategy dominates in terms of all of the pure calibration metrics, but leads to large jumps in NLL and MSE. In the specific case of Table 1, either NLL or MSE alone would have been sufficient to detect the trivial behavior of MRR. We now address the more general question: which additional generalization metrics should we report to prevent misleading calibration results? Our answer relies on the fact that such metrics are usually Bregman divergences, and we prove a decomposition of Bregman divergences that relates calibration and predictive power.

### 4.1 General Theory

Let us use $\phi:\Delta^{k-1}\to\overline{\mathbb{R}}$ to denote a continuously differentiable, strictly convex function. We recall that the Bregman divergence $d_{\phi}$ associated with $\phi$ is defined to be:

$$ $\displaystyle d_{\phi}(x,y)=\phi(x)-\phi(y)-\nabla\phi(y)^{\top}(x-y).$ (4.1) $$

In many machine learning tasks the goal is to minimize the expectation of a conditional Bregman divergence; for example, in multi-class classification we take $\phi(x)=\sum_{i}x_{i}\log x_{i}$ to obtain the KL divergence and then attempt to minimize $\mathbb{E}[d_{\phi}(\pi_{Y\mid X},g(X))]$ from samples. We now show that every $d_{\phi}$ can be decomposed into a calibration error term and what we refer to as a sharpness gap term.

###### Lemma 4.1 .

[Bregman Divergence Decomposition]
For $d_{\phi}$ defined as in (4.1) and two integrable random variables $Z$ and $X$ defined on the same probability space, it follows that:

$$ $\displaystyle\mathbb{E}[d_{\phi}(Z,X)]=\underbrace{\mathbb{E}[\phi(Z)]-\mathbb {E}[\phi(\mathbb{E}[Z\mid X])]}_{\text{Sharpness Gap}}+\underbrace{\mathbb{E}[ d_{\phi}(\mathbb{E}[Z\mid X],X)]}_{\text{Calibration Error}}.$ (4.2) $$

###### Proof.

We observe that by (4.1), we have:

$$ $\displaystyle\mathbb{E}[d_{\phi}(\mathbb{E}[Z\mid X],X)]$ $\displaystyle=\mathbb{E}[\phi(\mathbb{E}[Z\mid X])]-\mathbb{E}[\phi(X)]+ \mathbb{E}[\nabla\phi(X)^{\top}(\mathbb{E}[Z\mid X]-X)]$ $\displaystyle=\mathbb{E}[\phi(\mathbb{E}[Z\mid X])]-\mathbb{E}[\phi(X)]+ \mathbb{E}[\nabla\phi(X)^{\top}(Z-X)].$ (4.3) $$

Where the last line follows from the fact that $\mathbb{E}[Y\mathbb{E}[Z\mid X]]=\mathbb{E}[YZ]$ for any $X$-measurable random variable $Y$. Equation (4.2) then immediately follows from applying definition (4.1).
∎

Although bias-variance decompositions have appeared for Bregman divergences (Pfau, ) and calibration-sharpness decompositions have appeared for proper scoring rules (Kull & Flach, ; Pohle, ), we are not aware of Lemma 4.1 being used in the literature. We note that both the sharpness gap term and the calibration term in (4.3) are nonnegative, by Jensen’s inequality.

Lemma 4.1 has several consequences. Firstly, we obtain a notion of calibration error from any choice of Bregman divergence, since the calibration term in (4.2) is 0 if and only if $E[Z\mid X=x]=x$ a.e. This means when we specify a (Bregman) loss, we are implicitly also specifying a calibration error, and vice versa. We can thus use the overall loss associated with a predictor that achieves zero calibration error to detect “trivial calibration”. To illustrate this, we can show that the MRR strategy from the previous section - which produces a constant calibrated predictor - is in fact the worst possible perfect calibration strategy from the perspective of expected loss.

###### Theorem 4.2 .

Let $\pi$ correspond to the joint distribution of data and label $(X,Y)$ on $\mathbb{R}^{d}\times[k]$. Then every predictor $g$ that is calibrated in the sense of (2.1) satisfies:

$$ $\displaystyle\mathbb{E}[d_{\phi}(\pi_{Y\mid X},g(X))]\leq\mathbb{E}[d_{\phi}( \pi_{Y\mid X},\pi_{Y})].$ (4.4) $$

The proof of this result requires the following proposition, a version of which also appeared in Pohle () for the decomposition therein.

###### Proposition 4.3 .

For $g_{1},g_{2}:\mathbb{R}^{d}\to\Delta^{k-1}$ and $\pi$ as in Lemma 4.2, if $\sigma(g_{1}(X))\subseteq\sigma(g_{2}(X))$, then:

$$ $\displaystyle\mathbb{E}[\phi(\mathbb{E}[\pi_{Y\mid X}\mid g_{1}(X)])]\leq \mathbb{E}[\phi(\mathbb{E}[\pi_{Y\mid X}\mid g_{2}(X)])].$ (4.5) $$

###### Proof.

By Jensen’s inequality and the tower property of conditional expectation, we have:

$$ $\displaystyle\mathbb{E}[\phi(\mathbb{E}[\pi_{Y\mid X}\mid g_{2}(X)])]$ $\displaystyle=\mathbb{E}[\mathbb{E}[\phi(\mathbb{E}[\pi_{Y\mid X}\mid g_{2}(X) ])\mid g_{1}(X)]]$ $\displaystyle\geq\mathbb{E}[\phi(\mathbb{E}[\mathbb{E}[\pi_{Y\mid X}\mid g_{2} (X)]\mid g_{1}(X)])]$ $\displaystyle=\mathbb{E}[\phi(\mathbb{E}[\pi_{Y\mid X}\mid g_{1}(X)])].$ $$

∎

###### Proof of Theorem 4.2 .

Firstly, we observe that for any calibrated predictor we have $\mathbb{E}[d_{\phi}(\mathbb{E}[\pi_{Y\mid X}\mid g(X)],g(X))]=0$. Next, we note that for every $g:\mathbb{R}^{d}\to\Delta^{k-1}$, $g(X)$ is measurable with respect to the $\sigma$-algebra generated by the constant predictor $\pi_{Y}$ (since this is the trivial $\sigma$-algebra). The inequality (4.4) then follows by applying Proposition 4.3 to the decomposition from Lemma 4.1.
∎

Practical ramifications. The point of proving Theorem 4.2 is to show that if we have an appropriate Bregman divergence $d_{\phi}$ that is associated with our calibration error, we can compare calibrated models using $d_{\phi}$ to detect differences that metrics that depend only on $c(X)$ will not be sensitive to. Furthermore, Proposition 4.3 shows that the sharpness gap term in Lemma 4.1 captures the intuitive idea that the more “fine-grained” a calibrated model is, the better its generalization.

As mentioned earlier, the most reported calibration errors are versions of the ECE. It is easy to see from Lemma 4.1 that the squared $L^{2}$ ECE is the calibration error induced by MSE/Brier score, i.e. $d_{\phi}(x,y)=\norm{x-y}^{2}$. There is however, no straightforward correspondence for the $L^{1}$ ECE (since absolute value is not a Bregman divergence). Based on this we can make the following recommendation: if choosing to report ECE, it makes more sense to report the $L^{2}$ ECE alongside MSE/Brier score (or just the leftover sharpness gap).

###### Lemma 4.1 .

###### Proof.

###### Theorem 4.2 .

###### Proposition 4.3 .

###### Proof.

###### Proof of Theorem 4.2 .

### 4.2 Adapting to Confidence Calibration, and Additional Pitfalls

The above discussion relies on the full calibration notion of (2.1), as the calibration term in Lemma 4.1 introduces $\mathbb{E}[Y\mid g(X)]$. However, as we have mentioned, for multi-class classification we rely on the notion of confidence calibration for efficiency reasons. Thus, it is natural to ask how to best adapt the previous observations to the confidence calibration setting.

One approach is to apply a 1-D version of our choice of $d_{\phi}$ to the binary classification problem derived from applying the standard confidence calibration transformation, so that all of the previous results directly translate. More precisely, we replace the multi-class label $Y$ with the binary label $\mathbbm{1}_{Y=c(X)}$ and we replace the probability vector $g(X)$ with the scalar confidence $h(X)$. In practice, this is estimated by computing the mean of $d_{\phi}$ on (accuracy, predicted confidence) tuples obtained from test data.

This approach appears in the literature; for example, in the very recent work of Tian et al. () surveying strategies for eliciting confidence scores from LLMs. Unfortunately, we point this out as another pitfall - the loss $d_{\phi}$ incurred on the confidence calibration problem can be arbitrarily small for a predictor that is always wrong despite such a predictor having true loss on the multi-class classification problem bounded below by a constant. The next proposition illustrates this for MSE.

###### Proposition 4.4 .

Suppose $\pi$ satisfies the property that there exists $y^{*}:\Delta^{k-1}\to[k]$ such that $\pi_{Y\mid X=x}(y^{*}(x))=1$ for $\pi_{X}$-a.e. $x$. Now consider any function $\tilde{y}:\Delta^{k-1}\to[k]$ satisfying $\tilde{y}(x)\neq y^{*}(x)$ for $\pi_{X}$-a.e. $x$. Then the “always wrong” predictor defined as $g^{\tilde{y}(x)}(x)=1/k+\epsilon$ and $g^{y}(x)=1/k-\epsilon/(k-1)$ for all $y\neq\tilde{y}(x)$ with $\epsilon=O(1/k)$ satisfies

$$ $\displaystyle\mathbb{E}\left[\left(\mathbbm{1}_{Y=c(X)}-h(X)\right)^{2}\right] =O(1/k)\quad\text{but}\quad\mathbb{E}\left[\norm{\pi_{Y\mid X}-g(X)}^{2}\right ]=\Omega(1)$ (4.6) $$

for the standard confidence calibration choices $c(z)=\operatorname*{argmax}_{i}z_{i}$ and $h(z)=\max_{i}z_{i}$.

The proof follows from directly evaluating (4.6). Fortunately, in almost all cases of interest, estimating $\mathbb{E}[d_{\phi}(\pi_{Y\mid X},g(X))]$ is computationally efficient. We thus advocate for reporting the divergence in the multi-class setting and then the calibration error in the confidence calibration setting, which is also a relatively standard practice. This is further justified in that, under reasonable conditions on $d_{\phi}$ and its 1-D counterpart, the confidence calibration error is a lower bound on the full calibration error in the decomposition from Lemma 4.1.

###### Lemma 4.5 .

For any Bregman divergences $d_{\phi}:\Delta^{k-1}\to\overline{R}$ and $d_{\varphi}:[0,1]\to\overline{\mathbb{R}}$ satisfying $d_{\phi}(x,y)\geq d_{\varphi}(x_{i},y_{i})$ for all $i\in[k]$, it follows that:

$$ $\displaystyle\mathbb{E}[d_{\phi}(\mathbb{E}[\pi_{Y\mid X}\mid g(X)],g(X))]\geq \mathbb{E}[d_{\varphi}(\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)],h(X))].$ (4.7) $$

###### Corollary 4.6 .

The inequality (4.7) still holds under the conditions that $d_{\phi}$ satisfies the data-processing inequality and $d_{\varphi}$ is obtained by applying a transition kernel to the arguments of $d_{\phi}$.

The proof of the above relies on similar techniques to that of Lemma 4.1, i.e. a careful analysis of the conditional expectation terms. Lemma 4.5 covers MSE/Brier score since we can take $\phi(x)=\norm{x}^{2}$ and $\varphi(x)=x^{2}$, while Corollary 4.6 covers KL since the logistic loss $\varphi(x)=x\log(x)+(1-x)\log(x)$ can be obtained from applying a transition kernel depending only on a chosen coordinate of $x$.

###### Proposition 4.4 .

###### Lemma 4.5 .

###### Corollary 4.6 .

## 5 Calibration-Sharpness Diagrams

To summarize our observations thus far, we have recommended that calibration should be compared using the calibration metric associated with the Bregman divergence for which the models were optimized, and that both should be reported together to avoid trivial cases of calibration. It remains to address how to similarly modify the visualization of (confidence) calibration, which is typically done via reliability diagrams that plot $\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)]$ for different values of $h(X)$. Our goals are two-fold: we want a visualization that is efficient to compute, and also makes it obvious whether one model is better calibrated and/or has better overall divergence than another model.

The approach we take is to augment the plot of $\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)]$ with a surrounding band whose length $\rho(h(X))$ corresponds to the sharpness gap from Lemma 4.1 at $h(X)$, which we refer to as calibration-sharpness diagrams. Now letting $d_{\phi}$ denote our Bregman divergence and $d_{\varphi}$ denote its appropriately defined 1-D counterpart as in the previous section,

$$ $\displaystyle\rho(h(X))=\mathbb{E}\left[d_{\phi}(\pi_{Y\mid X},g(X))\mid h(X) \right]-d_{\varphi}\left(\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)],h(X)\right).$ (5.1) $$

In the binary classification case, (5.1) exactly corresponds to a pointwise version of the sharpness gap term from Lemma 4.1. In the multi-class setting, it no longer has the same interpretation since we are subtracting the confidence calibration error as opposed to the full calibration error. However, we are guaranteed that the band length is nonnegative (at least for standard choices of $\phi$) thanks to Lemma 4.5, and in this setting the band can be interpreted as capturing both the sharpness gap as well as the difference between full and confidence calibration. The benefit of the formulation in (5.1) is that both terms require estimating only 1-D conditional expectations, which can be done efficiently.

For our estimation procedure, we use Nadaraya-Watson kernel regression (Nadaraya, ; Watson, ) with a kernel $K$ and bandwidth hyperparameter $\sigma$ following the estimation approaches of Błasiok & Nakkiran () and Chidambaram et al. (). We recall that given $n$ data points $(x_{i},y_{i})\in\mathbb{R}\times\mathbb{R}$ the kernel regression estimator of $\mathbb{E}[Y\mid X=x]$ is defined as:

$$ $\displaystyle\hat{m}_{\sigma}(x)=\frac{\sum_{i=1}^{n}\frac{1}{\sigma}K\left( \frac{x-x_{i}}{\sigma}\right)}{\sum_{i=1}^{n}\frac{1}{\sigma}K\left(\frac{x-x_ {i}}{\sigma}\right)}=\frac{\sum_{i=1}^{n}K_{\sigma}(x-x_{i})}{\sum_{i=1}^{n}K_ {\sigma}(x-x_{i})}.$ (5.2) $$

Previous work (Zhang et al., ; Popordanoska et al., ; Chidambaram et al., ) has shown that we can obtain consistent estimators of $L^{p}$ ECE using (5.2). We extend these results to calibration errors derived from Bregman divergences. Due to the technical nature of some of the assumptions necessary on $K_{\sigma}$ for this result, we defer a proper presentation to Section A.2 and present only an informal version of the result below. The proof relies on uniform convergence results for kernel regression applied to the individual terms in (4.1).

###### Theorem 5.1 .

Under suitable conditions on $K$ and the sequence of bandwidths $\sigma_{n}$, the plugin estimate using $\hat{m}_{\sigma_{n}}(h(x))$ of the confidence calibration error with respect to $d_{\varphi}$ is consistent so long as $h(X)$ has a density bounded away from 0 and $\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)]$ is continuous.

Estimation and plotting details. We estimate the term $\mathbb{E}\left[d_{\phi}(\pi_{Y\mid X},g(X))\mid h(X)\right]$ in (5.1) by replacing the $(x_{i},y_{i})$ data point pairs with $(x_{i},d_{\phi}(e_{y_{i}},g(x_{i})))$ (i.e. the divergence of $g(x_{i})$ from the one-hot encoded label $y_{i}$) and then using (5.2). The same is done with $\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)]$, except the label is replaced with pointwise accuracy. We also estimate the density $p_{h(X)}$ using a kernel density estimate (denominator of (5.2)) with the same kernel, and refer to this estimate as $\hat{p}_{h(X)}$.

We then plot the band $\mathbb{E}[\mathbbm{1}_{Y=c(x)}\mid h(x)]\pm\hat{p}_{h(X)}(h(x))\rho(h(x))/2$ at uniformly spaced values of $h(x)$, and also overlay the plot of $\hat{p}_{h(X)}(h(x))$ after normalizing so that the maximum kernel density value is 1. Scaling (5.1) by $\hat{p}_{h(X)}(h(x))$ is important for making it visually obvious where most of the sharpness error is concentrated, and the overlayed density plot allows the same for the calibration error. We point out that another common pitfall in several prior works is to omit the confidence histograms or density plots when using reliability diagrams to visualize calibration, and this makes it not possible to accurately compare the calibration of two models.

Experiments. To illustrate our method, we revisit the experiments of Section 4.2. In Figure 1 we display the calibration-sharpness diagrams for the baseline ViT model as well as each recalibration method, under the exact same settings as Section 4.2, for the choice of MSE/Brier score since some of the recalibration approaches have unbounded KL. Our kernel regression estimates were computed using a Gaussian kernel with $\sigma=0.05$; we discuss different choices of kernel and bandwidth in Appendix B. Due to the size of the dataset, we also replace the full kernel regression estimate of (5.2) with a mean over 10 estimates in which we randomly subsample the data to 5000 data points, so as to fit the entire computation into memory (we use a single A5000 GPU). The standard deviations of these estimates is shown alongside the mean calibration error scaled by 100 ($d_{\varphi,\mathrm{CAL}}$ in the plot); in all cases they are negligible, and we checked that subsampling loses virtually nothing. We also display the estimate of the full divergence ($d_{\phi,\mathrm{TOT}}$), which is computed without subsampling. Lastly, for stylistic reasons, we opt to threshold the curve defining the bottom of the sharpness band at 0, but do not threshold the top curve at 1.

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/vit_brier/baseline.jpg

###### Theorem 5.1 .

## 6 Conclusion

In this work, we have reviewed the reporting of calibration metrics in the recent literature and identified several pitfalls that appear even in well-known works. To address the pointed out issues, we have proposed a reporting methodology based on proper scoring rules that are Bregman divergences, and shown in both theory and practice how our approach fits alongside the popular notion of confidence calibration in the literature. In developing our methodology, we have also introduced a new extension of reliability diagrams for visualizing calibration.

Limitations. Our work has advocated for the reporting of proper scoring rules and calibration metrics implied by such rules. However, we have not addressed the question of which rules are most appropriate for which settings, i.e. MSE/Brier score vs. KL divergence. An investigation into the trade-offs between these and similar choices would be an interesting avenue for future work. Furthermore, we have provided only one implementation of our viewpoint in Section 5, where we estimate calibration and sharpness error using kernel regression and visualize both in a reliability diagram format. We believe constructing good visualizations for calibration and related quantities is still an area that could be developed further. Lastly, while we prove a consistent estimation result in the form of Proposition 5.1, there is still much work to be done on analyzing optimal convergence rates for estimators of calibration error.

Broader Impacts. While calibration has become an increasingly important topic given the use of machine learning models for decision-making, our work concerns only the theory and practice of reporting calibration. As a result, we do not anticipate any negative societal impacts as immediate consequences of this work.

## Acknowledgements

Rong Ge and Muthu Chidambaram are supported by NSF Award DMS-2031849 and CCF-1845171
(CAREER).

## Appendix A Omitted Results and Proofs

Here we include all technical results and proofs omitted from the main text.

### A.1 Proofs for Section 4.2

See 4.4

###### Proof.

Observing that $\mathbbm{1}_{Y=c(X)}=0$ and $h(X)=1/k+\epsilon$ gives the first part of (4.6). On the other hand, the leading term of $\mathbb{E}[\norm{\pi_{Y\mid X}-g(X)}^{2}]$ is $(1-1/k+\epsilon/(k-1))^{2}$, which is $\Omega(1)$.
∎

See 4.5

###### Proof.

Firstly, recalling that $e_{c(X)}$ denotes the basis vector in $\mathbb{R}^{k}$ with non-zero index $c(X)$,

$$ $\displaystyle\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid g(X)]$ $\displaystyle=\mathbb{E}[\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid X]\mid g(X)]$ $\displaystyle=\mathbb{E}[e_{c(X)}^{\top}\pi_{Y\mid X}\mid g(X)]$ $\displaystyle=e_{c(X)}^{\top}\mathbb{E}[\pi_{Y\mid X}\mid g(X)],$ (A.1) $$

where the last line follows due to the measurability of $e_{c(X)}$ with respect to $g(X)$. By the assumptions on $d_{\phi}$ and $d_{\varphi}$ and the fact that $h(X)=e_{c(X)}^{\top}g(X)$, we have:

$$ $\displaystyle\mathbb{E}[d_{\phi}(\mathbb{E}[\pi_{Y\mid X}\mid g(X)],g(X))]\geq \mathbb{E}[d_{\varphi}(\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid g(X)],h(X))].$ (A.2) $$

The desired (4.7) then follows by noting that

$$ $\displaystyle\mathbb{E}[d_{\varphi}(\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid g(X)], h(X))]$ $\displaystyle=\mathbb{E}[\varphi(\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid g(X)])]- \mathbb{E}[\varphi(h(X))]$ $\displaystyle\quad+\mathbb{E}[\varphi^{\prime}(h(X))(\mathbb{E}[\mathbbm{1}_{Y =c(X)}\mid g(X)]-h(X))]$ $\displaystyle\geq\mathbb{E}[\varphi(\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)]) ]-\mathbb{E}[\varphi(h(X))]$ $\displaystyle\quad+\mathbb{E}[\varphi^{\prime}(h(X))(\mathbb{E}[\mathbbm{1}_{Y =c(X)}\mid h(X)]-h(X))]$ (A.3) $$

due to Jensen’s inequality and $h(X)$-measurability of $\varphi^{\prime}(h(X))$.
∎

See 4.6

###### Proof.

The proof follows identical steps to that of Lemma 4.5, except that we apply the data processing inequality to obtain (A.2), which is justified since $c(X)$ is fixed after conditioning on $g(X)$.
∎

###### Proof.

###### Proof.

###### Proof.

### A.2 Consistency of Calibration Error Estimation

To state and prove a formal version of Theorem 5.1, we need a result of Devroye (). We first state the necessary kernel and distributional assumptions for this result. We state everything in the generality of $\mathbb{R}^{d}$ as that is how they are presented in Devroye (), but for our particular result we only need the 1-D analogues.

###### Assumption A.1 (Kernel Assumptions) .

We assume the kernel $K:\mathbb{R}^{d}\to\mathbb{R}$ satisfies the following:

- 1.
$K(x)\in[0,K^{*}]$ for some $K^{*}<\infty$.
- 2.
$K(x)=L(\norm{x})$ for some nonincreasing function $L$.
- 3.
$\lim_{u\to\infty}uL(u)=0$.
- 4.
$L(u^{*})>0$ for some $u^{*}>0$.

###### Assumption A.2 (Distributional Assumptions) .

We assume the joint distribution $\pi$ of $(X,Y)$ on $\mathbb{R}^{d}\times\mathbb{R}$ satisfies:

- 1.
$X$ has compact support and a density $\pi_{X}$ that is bounded away from 0.
- 2.
$\absolutevalue{Y-\mathbb{E}[Y\mid X]}$ is almost surely bounded.
- 3.
A version of $\mathbb{E}[Y\mid X]$ is bounded and continuous on $\mathrm{supp}(\pi_{X})$.

In some cases above, we have stated slightly stronger forms of the assumptions in Devroye () for brevity, and also because our application is relatively simple and works under these stronger assumptions.

###### Theorem A.3 (Theorem 2 in Devroye ( 1978 ) , Paraphrased) .

Let $K$ be a kernel satisfying Assumption A.1 with a sequence of bandwidths $\sigma_{n}$, and suppose $\pi$ satisfies Assumption A.2. Then if $\sigma_{n}\to 0$ and $n\sigma_{n}^{2d}/\log n\to\infty$, we have uniform convergence of the kernel regression estimator $\hat{m}_{\sigma_{n}}$:

$$ $\displaystyle\operatorname*{ess\,sup}_{x\in\mathrm{supp}(\pi_{X})} \absolutevalue{\hat{m}_{\sigma_{n}}(x)-\mathbb{E}[Y\mid X=x]}\to 0\text{ a.s.}$ (A.4) $$

We now state and prove the formal version of Theorem 5.1.

###### Theorem A.4 .

Let $\hat{m}_{\sigma}$ be as in (5.2). Given a sequence of bandwidths $\sigma_{n}$, we define the plugin estimator $\hat{d}_{\varphi,n}$ as follows:

$$ $\displaystyle\hat{d}_{\varphi,n}=\frac{1}{n}\sum_{i=1}^{n}\varphi\big{(}\hat{m }_{\sigma_{n}}(h(x_{i}))\big{)}-\varphi\big{(}h(x_{i})\big{)}-\varphi^{\prime} \big{(}h(x_{i})\big{)}\big{(}\mathbbm{1}_{y_{i}=c(x_{i})}-h(x_{i})\big{)}.$ (A.5) $$

Suppose $K$ satisfies Assumption A.1 and $\sigma_{n}$ satisfies $\sigma_{n}\to 0$ and $n\sigma_{n}^{2}/\log n\to\infty$. If we additionally have that $E[\mathbbm{1}_{Y=c(X)}\mid h(X)=h(x)]$ is continuous in $h(x)$ and that $h(X)$ has a density bounded away from zero, it follows that:

$$ $\displaystyle\hat{d}_{\varphi,n}\to d_{\varphi}\left(\mathbb{E}[\mathbbm{1}_{Y =c(X)}\mid h(X)],h(X)\right)$ (A.6) $$

in probability.

###### Proof.

By definition and properties of conditional expectation (covariance matching, the same trick we used in the proof of Lemma 4.1), we have that:

$$ $\displaystyle\mathbb{E}\left[d_{\varphi}\left(\mathbb{E}[\mathbbm{1}_{Y=c(X)} \mid h(X)],h(X)\right)\right]$ $\displaystyle=\mathbb{E}[\varphi\big{(}\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X )]\big{)}]-\mathbb{E}[\varphi\big{(}h(X)\big{)}]$ $\displaystyle\quad-\mathbb{E}[\varphi^{\prime}(h(X))(\mathbbm{1}_{Y=c(X)}-h(X) )].$ (A.7) $$

It is immediate from the law of large numbers that the second and third terms in (A.5) converge to their counterparts in (A.7). It remains to show the convergence of the first term of (A.5).

We observe that since $\mathbbm{1}_{Y=c(X)}\leq 1$, along with the fact that we have assumed $\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)=h(x)]$ is continuous in $h(x)$ and that $h(X)$ has a density bounded away from zero, we satisfy all of the conditions of Assumption A.2. Thus we have uniform convergence of $\hat{m}_{\sigma_{n}}$ from Theorem A.3.

It follows from uniform convergence and the boundedness of $\mathbb{E}[\mathbbm{1}_{Y=c(X)}\mid h(X)]$ that $\hat{m}_{\sigma_{n}}(h(X))$ is constrained to a compact set for $n$ sufficiently large. Since $\varphi$ is uniformly continuous on a compact set, we then have that:

$$ $\displaystyle\mathbb{E}\left[\frac{1}{n}\sum_{i=1}^{n}\varphi\big{(}\hat{m}_{ \sigma_{n}}(h(x_{i}))\big{)}\right]=\mathbb{E}[\varphi\big{(}\mathbb{E}[ \mathbbm{1}_{Y=c(X)}\mid h(X)]\big{)}]+\delta_{n}$ (A.8) $$

for some $\delta_{n}\to 0$ as $n\to\infty$. The result A.6 then immediately follows.
∎

###### Assumption A.1 (Kernel Assumptions) .

###### Assumption A.2 (Distributional Assumptions) .

###### Theorem A.3 (Theorem 2 in Devroye ( 1978 ) , Paraphrased) .

###### Theorem A.4 .

###### Proof.

## Appendix B Additional Experiments

Here we examine the importance of the hyperparameters (choice of kernel and kernel bandwidth) in the visualizations of Section 5.

### B.1 The Impact of Kernel Bandwidth

We first consider the same Gaussian kernel used in Section 5 but vary the bandwidth between $0.01$ and $0.25$. We find that values that are less than $0.01$ lead to significant under-smoothing, and values that are larger than $0.1$ lead to over-smoothing. Values in the range $[0.01,0.05]$ appear to work best. We visualize the choices of $0.01,0.03,0.1$, and $0.25$ in Figures 2 to 5 respectively.

We note that when we over-smooth, the ranking of calibration error can change across methods (as shown in Figures 4 and 5). This is similar to known issues with reporting binned ECE in which only a small number of bins are used.

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/gaussian_0.01/baseline.jpg

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/gaussian_0.03/baseline.jpg

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/gaussian_0.1/baseline.jpg

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/gaussian_0.25/baseline.jpg

### B.2 The Impact of Kernel Choice

We also consider the impact of changing the kernel used for the visualizations of Figure 1. In particular, we consider the popular choice of the Epanechnikov kernel, which is $K(u)=(3(1-u^{2})/4)\mathbbm{1}_{\absolutevalue{u}\leq 1}$ in the 1D setting. Results using this kernel with a bandwidth of 0.03 and 0.05 are shown in Figures 6 and 7.

As can be seen from the results, changing the kernel does not change the ranking of the recalibration methods, although it does impact the actual reported calibration error. We find that the range of kernel bandwidths suitable in the Gaussian case also applies here.

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/epan_0.03/baseline.jpg

Figure: (a) ViT (Baseline)
Refer to caption: extracted/5648840/plots/epan_0.05/baseline.jpg

## Peer Reviews

confidence: 2
contribution: 2
initial_rating: 6
presentation: 3
questions: n/a
soundness: 3
strengths: 1. This paper studies a fundamental question in the ML calibration literature: how to compare and assess the model calibration performance. This is a very important question.
2. This paper is easy to follow, and the main take-away is very clear.
3. This paper points out "pitfalls" regarding calibration reporting in the current literature clearly.
4. The proposed calibration-sharpness digram is interesting and novel.
5. This paper is theoretically sound.
summary: The paper critically examines current practices in evaluating model calibration, particularly for deep learning. It highlights flaws in reporting calibration metrics. The authors propose a new methodology based on the calibration-based decomposition of Bregman divergences and introduce new diagrams. These diagrams visualize calibration and generalization error jointly, allowing a more nuanced assessment. Additionally, the paper provides theoretical insights.
weaknesses: 1. The experiment section is relatively weak. Only one dataset was examined. 
2. It would be great if the authors could open-source the code and make the new diagrams easier to use for other ML practitioners.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: Based on the above Weakness points, I would like to ask the following questions. If appropriate and sufficient discussion is provided on these points, I would be pleased to consider raising my score.

- Could you provide specific examples or a more detailed workflow for selecting calibration metrics based on common generalization metrics? A decision flowchart or table mapping generalization metrics to recommended calibration metrics would also be helpful for practitioners applying the proposed framework.
-  How could the arbitrariness in selecting kernel types and hyperparameters for calibration-sharpness diagrams be minimized? Could you suggest specific strategies, such as cross-validation approaches or sensitivity analyses, to guide these choices? Additionally, are there recommended default choices for kernels and hyperparameters that perform robustly across various scenarios?
- Given the variability in calibration performance across different kernel types and hyperparameter settings (as shown in the Appendix), could you provide more guidance on appropriate criteria for kernel selection and hyperparameter tuning? This would strengthen the reliability of calibration assessments based on the proposed diagrams.
- Could you clarify the relationship between some theorems and the main discussion, e.g.,  regarding the “always wrong predictor” in Proposition 4.5 and its implications? An example or illustration of how the “always wrong predictor” relates to real-world calibration scenarios would be helpful. Additionally, could you explain how this proposition supports or challenges the main arguments of the paper?
- Could you expand on the motivation behind choosing Bregman divergences for calibration metrics? Specifically, what factors led to the choice of Bregman divergences over other potential metrics? Additional context on this decision-making process would be helpful.
  - Related to the above question, would you consider adding a brief explanation of Bregman divergences and their relationship to calibration metrics in Section 2? I believe this might improve the flow from Section 3 to Section 4 and provide readers with a clearer understanding of the theoretical foundation.
- I may have overlooked or misunderstood certain aspects, but could you provide a more detailed guide on how to interpret the components of experimental figures like Figure 1? Specifically, explanations on how to read the sharpness band, density plot, and calibration curve, and what each represents in terms of model performance, would be helpful. Adding some sentences in the caption part of the figures or including a “How to read this figure” section in the paper could also improve accessibility.
- Although it might slightly deviate from the core contributions of this paper, would it be valuable to provide empirical discussions on the bias of the Nadaraya-Watson estimator? For instance, as demonstrated in [Jiang et al., ICML 2020], would it be possible to use a synthetic data setup to empirically evaluate the bias of the Nadaraya-Watson estimator by estimating the true pointwise sharpness gap with Monte Carlo estimation and comparing it to the Nadaraya-Watson estimator? If this is not feasible within the setup of [Jiang et al., ICML 2020], could a simpler experimental setting be devised where the true values of the pointwise sharpness gap are estimable?

### Citation:
[Jiang et al., ICML 2020]: Jize Zhang, Bhavya Kailkhura, and T. Yong-Jin Han. Mix-n-Match: Ensemble and Compositional Methods for Uncertainty Calibration in Deep Learning. ICML2020. (https://arxiv.org/abs/2003.07329).
soundness: 3
strengths: - The paper systematically identifies critical issues in current reporting practices for calibration and prediction accuracy, highlighting the limitations of relying solely on metrics like ECE and accuracy.
- By utilizing Bregman divergences, the authors develop a unified framework that aligns calibration metrics with generalization metrics. This theoretical approach offers valuable insights for the development and evaluation of new calibration methods.
summary: - The authors identify key issues in current calibration performance reporting in machine learning literature, emphasizing that focusing solely on calibration error (e.g., ECE) and accuracy can lead to misleading conclusions.
- They show that simple recalibration strategies may outperform commonly used methods if calibration metrics are not presented alongside generalization metrics, such as negative log-likelihood (NLL).
- The authors develop a theoretical framework that aligns calibration metrics with generalization metrics using Bregman divergences, proposing that calibration measures should be selected based on the chosen generalization metric. They establish novel connections between full calibration error and confidence calibration error.
- They introduce “calibration-sharpness diagrams” as an extension to traditional reliability diagrams, allowing for a joint visualization of calibration and generalization errors and providing a more detailed view of the trade-offs between calibration and model sharpness.
weaknesses: ### Concerns for Unclear Guidelines for Selecting Calibration Metrics:
- While the paper proposes selecting calibration metrics based on generalization metrics, it does not provide clear guidelines or step-by-step procedures for applying this principle in practice. From a practical perspective, providing concrete examples and a well-defined workflow for implementing the proposed framework would enhance the paper’s contribution and make its practical applications more accessible.

### Sensitivity of Calibration-Sharpness Diagrams to Kernel and Hyperparameter Selection:
- In calibration-sharpness diagrams based on kernel regression estimators, the choice of kernel type and hyperparameter values appears to significantly influence the results. This concern is relevant not only to the proposed method but also to other calibration error evaluations based on Nadaraya-Watson estimators, such as smooth ECE. However, these parameters pose a risk of being adjusted arbitrarily to produce favorable calibration performance. A more in-depth discussion on minimizing this arbitrariness would help ensure fair calibration evaluation.
- Additionally, the Appendix reveals considerable variability in calibration performance across different kernel types and hyperparameter settings, raising concerns about the reliability of calibration-sharpness diagrams produced by the proposed framework. If calibration performance assessments based on these diagrams are highly sensitive to such choices, further discussion on criteria for kernel selection and strategies for tuning hyperparameters would strengthen the paper’s contributions.
	
### Concerns for Readability and Presentation Clarity:
- The presentation of certain theoretical elements in the paper could benefit from added clarity, as the connection between some propositions and the main text is not always apparent. For example, in Proposition 4.5, a more detailed explanation of the “always wrong predictor” and its implications could improve understanding. This may stem from a lack of detailed exposition rather than the inherent complexity of the material, but additional clarification would enhance accessibility.
### Concerns for Relatively Weak Explanation for the Motivation Behind Using Bregman Divergences:
- While the paper establishes useful calibration metrics based on Bregman divergences, it does not clearly explain why the authors hypothesized that Bregman divergence-based metrics would be effective for calibration. Specifically, the rationale behind selecting Bregman divergences over other possible metrics remains unclear, making it challenging to fully understand the motivation for the proposed framework. Although the benefits of this choice are evident in the theoretical results, a more explicit discussion on why Bregman divergences were chosen would provide valuable context.
- I understand that the authors’ main motivation for adopting Bregman divergences could be that they provide a general metric encompassing several proper scoring rules, allowing for a unified approach to selecting calibration evaluation metrics. Emphasizing this reasoning could facilitate a smoother transition from Section 3 to Section 4. While this is a personal suggestion and not strictly necessary, including a brief explanation in Section 2 on the basic properties of Bregman divergences and their relationship to calibration metrics might improve the clarity and flow of the presentation.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: ### Major comments
- Are some of the findings of this paper related to those of Prez-Lebel et al. (2023)?

Alexandre Perez-Lebel, Marine Le Morvan, and Gaël Varoquaux. BEYOND CALIBRATION: ESTIMATING THE GROUPING LOSS OF MODERN NEURAL NETWORKS. ICLR, 2023.

- Corollary 4.7 should be more formally stated.

- I could not understand the condition $d_{\phi}(x, y) \ge d_{\psi}(x_i, y_i)$.

- Is there any justification for thinking about the band proposed in lines 419-425? Also, the description here is not very clear to me despite its importance.

- There should be a part explaining how to read the plots. What are the read curves, red areas, and blue areas? Then, there should be explanations about how to evaluate them such as what kind of curves and areas are supposed to be good. Some explanations of them are mixed with the interpretations of the results, which is making the section difficult to read.

### Minor comments
- The notation in Eq. (2.1) feels strange. If $\mathbb{P}( \cdot | \cdot )$ denotes the regular conditional distribution, it should take an event in the first argument. It is also strange that it returns a vector, assuming $v \in \mathbb{R}^m$. Could the authors check the definition again?

- I think the sign is not correct in (A.1).

- The part of the proof obtaining (B.2) should be explained more clearly.

- The proof of Corollary C.1 could be more precise.

- Could the authors add a clear description about the standard reliability diagram?

- I suggest the authors explicitly explain all the acronyms in the paper.
soundness: 3
strengths: - Theorems and propositions are interesting and seem correct. They are supported by rigorous proofs.
- The paper studies an important problem of calibration.
- The paper provides a good literature review, which motivates the direction of this work well.
summary: This paper studies the task of calibration: measuring how well a model predicts the class probability and improving the quality.
It begins with studying the Expected Calibration Error (ECE), a popular metric of how well a model predicts the class probability.
The authors point out that the ECE can be improved by a trivial modification to the confidence function. The authors present experiments (Table 1) showing how this metric differs from proper scoring rules such as the Mean Squared Error (MSE) and the Negative Log Loss (NLL).

The paper then moves on to the study about proper scoring rules induced by Bregman divergences. The authors explain the gap between a proper scoring rule and the calibration error using a decomposition of Bregman divergences (Lemma 4.1) with some properties of this gap (Proposition 4.2 and 4.3). The pointwise variant of the gap is also defined (Eq. (4.7)).

The authors also show that the gap between the full calibration error and its one-dimensional counterpart.

Finally, the paper presents visualization results based on the proposed metric (4.7).
weaknesses: - The paper explains ECE can be improved by a trivial modification to the confidence function but does not explain why it is a bad thing. If estimating the whole class probabilities is not the objective and we only care about the confidence of the predicted class, this solution could be just fine.

- The descriptions of the method and the results are not clear to me.

- The benefits of the visualization are not clear from the results. In particular, I do not agree with the claim that "looking at the calibration-sharpness diagrams the differences between the two approaches becomes more clear."

- The notation in some parts is a little confusing.

- Some of the proofs lack details, and there are also some writing mistakes. These make the proofs a little difficult to follow.

Meta-review: This work proposes new methods for evaluating calibration in ML. The authors were able to address all issues raised by the reviewers. All reviewers except one were positive about the work. The authors prepared extensive updates and addressed the issues raised by this last reviewer, who however was not able to respond. Since all issues have been resolved, I believe the paper would be a valuable contribution.

Decision: Accept (Poster)