Learning Optimal Conformal Classifiers
Authors: David Stutz
Krishnamurthy Dj Dvijotham
Ali Taylan Cemgil
Arnaud Doucet
Venue: ICLR 2022 Spotlight (2022)
Keywords: conformal prediction
conformal classification
uncertainty estimation

Abstract: Modern deep learning based classifiers show very high accuracy on test data but this does not provide sufficient guarantees for safe deployment, especially in high-stake AI applications such as medical diagnosis. Usually, predictions are obtained without a reliable uncertainty estimate or a formal guarantee. Conformal prediction (CP) addresses these issues by using the classifier's predictions, e.g., its probability estimates, to predict confidence sets containing the true class with a user-specified probability. However, using CP as a separate processing step after training prevents the underlying model from adapting to the prediction of confidence sets. Thus, this paper explores strategies to differentiate through CP during training with the goal of training model with the conformal wrapper end-to-end. In our approach, conformal training (ConfTr), we specifically "simulate" conformalization on mini-batches during training. Compared to standard training, ConfTr reduces the average confidence set size (inefficiency) of state-of-the-art CP methods applied after training. Moreover, it allows to "shape" the confidence sets predicted at test time, which is difficult for standard CP. On experiments with several datasets, we show ConfTr can influence how inefficiency is distributed across classes, or guide the composition of confidence sets in terms of the included classes, while retaining the guarantees offered by CP.

Published as a conference paper at ICLR 2022
LEARNING OPTIMAL CONFORMAL CLASSIFIERS
David Stutz! Krishnamurthy (Dj) Dvijotham', Ali Taylan Cemgil', Arnaud Doucet! DeepMind, Max Planck Institute for Informatics, Saarland Informatics Campus
ABSTRACT
Modern deep learning based classifiers show very high accuracy on test data but this does not provide sufficient guarantees for safe deployment, especially in high- stake AI applications such as medical diagnosis. Usually, predictions are obtained without a reliable uncertainty estimate or a formal guarantee. Conformal pre- diction (CP) addresses these issues by using the classifier's predictions, egg., its probability estimates, to predict confidence sets containing the true class with a user-specified probability. However, using CP as separate processing step after training prevents the underlying model from adapting to the prediction of confi- dence sets. Thus, this paper explores strategies to differentiate through CP during training with the goal of training model with the conformal wrapper end-to-end. In our approach, conformal training (ConfTr), we specifically "simulate" con- formalization on mini-batches during training. Compared to standard training, ConfTr reduces the average confidence set size (inefficiency) of tfate-of-the-art CP methods applied after training. Moreover, it allows to "shape" the confidence sets predicted test time, which difficult for standard CP. On experiments with several datasets, we show ConfTr can influence how inefficiency is distributed across classes, or guide the composition of confidence sets in terms the in- cluded classes, while retaining the guarantees offered by CP.
INTRODUCTION
In classification tasks, for input x. we approximate the posterior distribution over classes E [K] {I..... K.. denoted (x(x)) s P(Y = y|X = x). Following Bayes' decision rule, the single class with highest posterior probability is predicted for optimizing a 0-1 classification loss. This way, deep networks (x) with parameters achieve impressive accuracy on held-out test sets. However, this does not guarantee safe deployment. Conformal prediction (CP) (Vovk et al. 2005) uses a post- training calibration step to guarantee user-specified coverage: by allowing to predict confidence sets C(X) C [K], CP guarantees the true class Y to be included with confidence level i.e. P(Y E C(X)) 2 1 a when the calibration examples (X,, Y.), i E Jeal are drawn exchangeably from the test distribution. This is usually achieved in two steps: In the prediction step, so-called conformity scores (w..t. to a class k E [K] are computed to construct the confidence sets C(X). During the calibration step, these conformity scores on the calibration
w.r.t. the true class Y, are ranked to determine a cut-off threshold r for the predicted probabilities To (xx guaranteeing coverage a-a. This called marginal coverage taken not only w.r.t. (X, Y) but also over the distribution of all possible calibration sets, rather than w.r.t. the conditional distribution p( (
holds only unconditionally, i.e., the expectation being
CP also outputs intuitive uncertainty estimates: larger confidence sets IC(X) generally convey higher uncertainty. Although CP is agnostic details the underlying model mo (z), the obtained uncertainty estimates depend strongly on the model's performance. If the underlying classifier is poor, CP results too large and thus uninformative confidence sets. "Uneven" coverage is also a common issue, where lower coverage is achieved on more difficult classes. To address such prob- lems. the threshold CP method of (Sadinle et al., 2019) explicitly minimizes inefficiency. [Romano] et al. (2020) and Cauchois et al. (2020) propose methods that perform favorably in terms of (approx- imate) conditional coverage. The adaptive prediction sets (APS) method of Romano et al. (2020) is further extended by AAngelopoulos et al. (2021) to return smaller confidence sets. These various objectives are typically achieved by changing the definition of the conformity scores. In all cases, CP is used as a post-training calibration step. In contrast, our work does not focus advancing CP

---

Published as a conference paper at ICLR 2022
Conformal training:
Calibration Beal
inputa
B
1
( 11 (=2)
SMOOTHCA (x;) 9/) ) cal' o)
50%
2F
diff. w.r.t. 0 through m
Model 8
Ca SMooT) (#0 r)
diff. w.r.t. 0 through Tg (z;) and
50%
class. loss
Exxemple: Penalize vahiclos Cot
+ size loss &
Co(ey) =(eat, deg, track)
gradient 0 (C+
pred.
pred
probs.
loes
2 70
Prediction
<ise =1G
Pir meat
Figure I: Illustration of conformal training (ConfTr): We develop differentiable prediction and calibration steps for conformal prediction (CP). SMOOTHCCAL and SMOOTHPRED. During training. this allows ConfTr to "simulate" CP on each mini-batch B by calibrating on the first half Bea and predicting confidence sets on the other half ppdd (c.f. @). ConfTr can optimize arbitrary losses on the predicted confidence sets, e.g., reducing average confidence set size (inefficiency) using size loss penalizing specific classes from being included using a classification loss L (c.f- b.. After training using our method, any existing CP method can be used to obtain a coverage guarantee.
itself, egg., through new conformity scores, but develops a novel training procedure for the classifier After training, any of the above CP methods can readily be applied.
Indeed, while the flexibility of CP regarding the underlying model appears attractive, it is also vere limitation: Learning the model parameters 0 is not informed about the post-hoc "conformaliza- tion", i.e., they are are not tuned towards any specific objective such as reducing expected confidence set size (inefficiency). During training, the model will typically be trained to minimize cross-entropy loss. At test time, in contrast, is used to obtain set predictor C(X) with specific properties such as low inefficiency. In concurrent work, [Bellott] (2021) addresses this issue by learning a set pre- dictor C(X) through thresholding logits: Classes with logits exceeding are included in C(X) and training aims minimize inefficiency while targeting coverage 1 - In experiments using linear models only, this approach is shown to decrease inefficiency. However, (Belloti) 2021) ignores the crucial calibration step of CP during training and does not allow optimize losses beyond marginal coverage or inefficiency. In contrast, our work subsumes (Bellotti) 202T). but additionally considers the calibration step during training. which is crucial for further decreasing inefficiency. Furthermore, we aim to allow fine-grained control over class-conditional inefficiency or the composition of the confidence sets by allowing to optimize arbitrary losses defined on confidence sets.
Our contributions can be summarized as follows:
1. We propose conformal training (ConfTr), procedure allowing to train model and conformal wrapper end-to-end. This is achieved by developing smooth implementations of recent CP methods for use during training. On each mini-batch. ConfTr "simulates" conformalization, using half of the batch for calibration, and the other half for prediction and loss computation, c.f. Fig. @. After training, any existing CP method can provide coverage guarantee.
2. In experiments, using ConfTr for training consistently reduces the inefficiency of conformal predictors such threshold CP (THR) (Sadinle et al. 2019) APS (Romano al. 2020) applied after training. We further improve over (Bellotti (021). illustrating the importance of the calibration step during training.
3. Using carefully constructed losses, ConfTr allows to "shape" the confidence sets obtained at test time: We can reduce elass-conditionaa inefficiency or "coverage confusion", iee. the likelihood of two or more classes being included in the same confidence sets, c.f. Fig. I Generally, in contrast to (Bellotti 202T), ConfTr allows to optimize arbitrary losses on the confidence sets.
Because ConfTr is agnostic to the CP method used at test time, our work is complementary to most related work, i.e., any advancement in terms of CP is directly applicable ConfTr. For example, this might include conditional or application speciffc guarantees as (Sadinle et al. 2016;) Bates] et al. 202T). Most importantly, ConfTr preserves the coverage guarantee obtained through CP.
2

---

Published as a conference paper at ICLR 2022
CP Baseline Comparison by Ineff
CIFAR10: Inefficiency by Class for Baseline+
Dataset,
THRL
THR
APS
RAPS
CIFARIO, 0.05
2.22
1.64
2.06
1.74
(IFARIO, 0.01
3.92
2.93
3.30
3.06
CIFARIOO, 100, 0.01
19.22
10.63
16.62
14.25
Class
Figure 2:
Baseline CP Results on CIFAR: Left: Inefficiency (Ineff, lower is better) for the CP Coverage (Cover), omitted here, is empirically close to 1 - a. THR clearly outperforms all approaches w.r.t. inefficiency. Right: Inefficiency distribution across CI- FAR10 classes (for a=0.01) is plotted, with more difficult classes yielding higher inefficiency.
methods discussed in Sec. 2
2 DIFFERENTIABLE CONFORMAL PREDICTORS
We are interested in training the model Ta end-to-end with the conformal wrapper in order to allow fine-grained control over the confidence sets C(X). Before developing differentiable CP methods for training in Sec. [.2] we review two recently proposed conformal predictors that we use at test time. These consist of two steps, see Sec. [2.] for prediction (on the test set) we need to define the confidence sets (T) which depend on the model parameters 0 through the predictions wa and where the threshold 7 is determined during calibration on held-out calibration set (X,, Y,), i E Leal in order to obtain coverage.
2.1 CONFORMAL PREDICTORS
The threshold conformal predictor (THR) (Sadinle et al., 2019) constructs the confidence sets by thresholding probabilities: Cg(2;; == (k (x) =: Eg(x, k) 2 7]. Here, the subscript Co makes the dependence on the model and its parameters 0 explicit. During calibration, is computed as the a(1 + //uual)-quantile of the so-called conformity scores (I y1) ne.,, (z+). The conformity scores indicate, for each example, the threshold that ensures coverage. Marginal coverage of (1 a) is guaranteed on a test example (X, Y). In practice, THR can also be applied on logits (TURL) or log-probabilities (TURLP) instead of probabilities.
Adaptive Prediction Sets (APS) (Romano et al. 2020) constructs confidence sets based on the ordered probabilities. Specifically, Co(x;T) = {A= Es(a, k) S ] with:
(I) no (x) and U is uniform random variable in [0, 1] break ties. Similar to THR, the conformity scores Ex y.) w.r.t. the true classes y: are used for calibration, but the (1 - (1 + 1/1aail)-ggu quaantle is required to ensure marginal coverage on test examples.
Eg(I,k) k) = a (x) + ... + Ta 1 (x) + U ( (I),
where o (z) 2 ... 2 T
Performance of CP is then measured using two metries: (empirical and marginal) coverage (Cover) as well as inefficiency (Ineff). Letting Iustt be a test set of size [Teal) these metrics are computed as
Cover:=
Σ VEl.c
8ly: C(a;)] and Ineff
Σ [C(x:))
[Test]
[Test] EE!...
where 5 denotes an indicator function that is when its argument true and 0 otherwise. Due the marginal coverage guarantee provided by CP (c.f. (Romano et al. 2020) or App. the empirical coverage, when averaged across several calibration/test splits, is Cover trate on inefficiency as the main metric to compare across CP methods and models. With accuracy, we refer to the (top-1) accuracy with respect the arg max- maxx-predictions, i.e., arg max, πT (x), ob- tained by the underlying model и. As shown in Fig. 2 APS w.r.t. inefficiency (lower is better) averaged across random Tea// splits (details Sec. F.
a. Thus, concen-
(left), THR clearly outperforms THRL and
CP is intended to be used as "wrapper" around xg. "Better" CP methods generally result in lower inefficiency for a fixed model тy. For example, following Fig. (left,, regularized APS (RAPS) (Aneeoopouoss et al.) 2021) recently showed how to improve inefficiency compared to APS by modifying the conformity score without outperforming THR, however. Fine- aine-grained control over inefficiency, e.g., conditioned on the class or the composition of the C(X) is generally not possible. Integrating CP into the training procedure promises a higher degree of control, however, requires differentiable CP implementations, e.g., for THR or APS.
3

---

Published as a conference paper at ICLR 2022
1: function (xEDICI(T+(t),.)
function CONFORMALTRAININGGG.. A=1)
compute (2, kē[K]
2:
for mini-batch B do
3:
return
3: randomly split batch Baal H Byent = B
4:
("On-the-fly" calibration
Beal=)
1: function CALIBRATE([ (2;), 3.
T= SMOOTHCAL(( (z:);
Mi (To)))) ve) (Prediction only on i Bpedi)
2: compute Es (xi, i=1,
6:
3:
return QUANTILE( (o a a(1++)))))))))))))
7:
Co(2;;;) SMOOTHPRED(TA (T.)) ()
8:
(Optional classification loss:)
1: function SMooTHPREDX T=1)
9:
LB 0 Eie ((Co(T):))))))
2: return Co,((z;)) ( ke (K)
10:
DB Eie ((Co(1
3: function SMOOTHCAL )=
11: A - B (CB + Xlta)
4: return SMOOTHQUANT( Pg (2,, U1 b. a(1+
12: update parameters @ using A
Algorithm 1: Smooth CP and Conformal Training (ConfTr): Top left: At test time, for THR,
PREDICT computes the conformity scores Ea(x, k) for each k[[K] and constructs the confidence sets Ca( by thresholding with т. CALIBRATE determines the threshold T as the a(1 + 1/n)- quantile of the conformity scores w.r.t. the true classes y/ on calibration set {(11) 31}} of size Leal) THR and APS use different conformity scores. Right and bottom left: ConfTr calibrates on part of each mini-batch, Beal. Thereby, we obtain guaranteed coverage on the other part, Bprdd (in expectation across batches). Then, the inefficiency on Bpred is minimized to update the model parameters Smooth implementations of calibration and prediction are used.
2.2 DIFFERENTIABLE PREDICTION AND CALIBRATION STEPS
Differentiating through CP involves differentiable prediction and calibration steps: We want Co(a;;) to be differentiable w.r.t the predictions To (z),, and to be differentiable w.r.t to the predictions (2;). E Leal used for calibration. We emphasize that, ultimately, this allows to differentiate through both calibration and prediction w.r.t. the model parameters 8, which the predictions (I( and thus the conformity scores Fo k) depend. For brevity, we focus on THR, Alg. I and discuss APS in App. [
Prediction involves thresholding the conformity scores Ea k), which can be smoothed using the sigmoid function (=) 1/1+exp(-2) and temperature hyper-parameter T: (x; == (()) Essentially, Ca. E [0, 1] represents a soft assignment of class k to the confidence set, ie., can be interpreted as the probability of & being included. For T 0, the "hard" confidence set will be recovered, i.e., (x; = 1 for k E Co(x; T) and O otherwise. For THR, the conformity scores are naturally differentiable w.r.t. to the parameters because Exx, k) No, (z).
As the conformity scores are already differentiable, calibration merely involves a differentiable quantile computation. This can be accomplished using any smooth sorting approach (Blondel al, 2020 Cuturi et al.) 2019: Williamson| (020)). These often come with a "dispersion"
such that smooth sorting approximates "hard" sorting for + 0. Overall, this results in the threshold 7 being differentiable w.r.t. the predictions of the calibration examples ((To(I:)) M4 hie and the model's 's parameters A.
As this approximation is using smooth operations, the coverage guarantee seems lost. However, in the limit of T, E + we recover the original non-smooth computations and the corresponding coverage guarantee. Thus, it is reasonable assume that, in practice, empirically obtain coverage close to (1 - a). We found that this is sufficient because these smooth variants are only used during training. At test time, use the original (non-smooth) implementations and the coverage guarantee follows directly from (Romano et al. 2020; Sadinle et al. 2019).
CONFORMAL TRAINING (CONFTR): Learning CONFORMAL PREDICTION
The key idea of conformal training (ConfTr) is to "simulate" CP during training, i.e., performing both calibration and prediction steps each mini-batch. This is accomplished using the differ- entiable conformal predictors as introduced in Sec. 2.2 ConfTr can viewed as generalization of (Bellotti. 2021) that just differentiates through the prediction step with fixed threshold, with- out considering the crucial calibration step, see App. [ both cases, only the training procedure changes. After training, standard (non-smooth) conformal predictors applied.
4

---

Published as a conference paper at ICLR 2022
3.1 CONFTR BY OPTIMIZING INEFFICIENCY
ConfTr performs (differentiable) CP on each mini-batch during stochastic gradient descent (SGD) training. In particular, as illustrated in Fig. [ @ we split each mini-batch in half: the first half is used for calibration, Beal, and the second one for prediction and loss computation, Bped- That is, on Beal. we calibrate т by computing the a(1 + ( differentiable manner. It is important to note that compute T);;;; only for i E Bred and not for i E Beal- Then, in expectation across mini-batches and large enough |Bail for T. C - 0, CP guarantees coverage 1 -a a Bredd Assuming empirical coverage be close to (1 a) in practice, we only need to minimize inefficiency during training:
of the conformity scores in a
K Co.a(2; -) x)
min log (X(C)(X;+)) with (2(Co(z:))) max 0. 6
(3)
We emphasize that ConfTr optimizes the model parameters @ on which the confidence sets Ce de- pend through the model predictions Tg. Here, Ω is a "smooth" size loss intended to minimize the expected inefficiency, i.e., [T) not to be confused with the statistic in Eq. ( used for evaluation. Remember that 7+,+(a;7) can be understood as a soft assignment of class i to the confidence set Co(2; T). By default, we E {0, } can generally be treated as hyper--arameter. After training, any CP method can be ap- plied to re-calibrate T on held-out calibration cea as usual, i.e., the thresholds obtained during training are not kept. This ensures that we obtain a coverage guarantee of CP.
= 1 in order not penalize singletons. However,
3.2 CONFTR WITH CLASSIFICATION LOss
In order obtain more control over the composition of confidence sets Co(X;:) at test time, ConfTr can be complemented using generic loss L:
njm min log (E [CC((((X)))))) + XN(Co((;)T)))
While L can be any arbitrary loss defined directly on the confidence sets Cp. we propose to use a "configurable" classification loss Celass. This classification loss is intended to explicitly enforce coverage, i.e., make sure the true label Y is included in Co (X;T), and optionally penalize other To this end, we define
classes I not to be included in Co. as illustrated in Fig. 1 (
Letass (Co(a;
Lynb Co, 8ly k] + (0
(5)
enforce to he in
penalize class kyy not be in C
As above, Co (2 T) [0. 1] such that 1 - (z; can be understood the likelihood of k not being in Ce(x;;), T). In Eq. (5), the first term is used to encourage coverage, while the second term can be used avoid predicting other classes. This is governed by the loss matrix L: For L. Tk. Lee, the identity matrix with K rows and columns, this loss simply enforces coverage (perfect coverage if Lelass 0). However, setting any Ly,k > for y # l penalizes the model from including class k in confidence sets with ground truth y. Thus, cleverly defining L allows to define rather complex objectives,
will explore next. ConfTr with (optional) classification loss is summarized in Alg. I (right) and Python code can be found in App.
3.3 CONFTR WITH GENERAL AND APPLICATION-SPECCIAE LOSSES
We consider several use cases motivated by medical diagnosis, e.g., breast cancer screening (McK- inney et al. 2020) or classification of dermatological conditions (Liu et al. [0200] Roy et al. 2021 Jain et al. 2021). In skin condition classification, for example, predicting sets of classes, e,g., the top-k conditions, is already common strategy for handling uncertainty. In these cases, we not only care about coverage guarantees but also desirable characteristics of the confidence sets. These constraints in terms of the predicted confidence sets can, however, be rather complicated and pose difficulties for standard CP. We explore several exemplary use cases to demonstrate the applicability of ConfTr, that also relevant beyond the considered use cases in medical diagnosis.
5

---

Published as a conference paper at ICLR 2022
First, consider "shaping" class-conditional inefficiency, formally defined
Ineff[y = =y] ==
Σ NE Iua
8ly, -31[Cxx))))
(6)
iE Tea Oly:
Similarly, we define inefficiency conditional reduce inefficiency, ie., uncertainty, on "low-risk" diseases at the expense of higher uncertainty on "high-risk" conditions. This can be thought of re-allocating time spent by doctor towards high-risk cases. Using ConfTr, we can manipulate group- or class-conditional inefficiency using weighted size loss ())(():)) with == w(Y) depending the ground truth Y in Eq. (3).
group of classes. For example, could
Next, we consider which classes are actually included in the confidence sets. CP itself does not enforce any constraints on the composition of the confidence sets. However, with ConfTr, we can penalize the "confusion" between pairs of classes: for example if two diseases are frequently con- fused by doctors, it makes sense to train models that avoid confidence sets that contain both diseases. To control such cases, we define the coverage confusion matrix as
Ey.k: =
5ig1 = (a=-ykke(r))
Leesel
EE Fist
The off-diagonals, i.e., Mg for y + k. quantify how often class k is included in confidence sets with true class y. Reducing Σy,k can be accomplished using positive entry Ly.k > 0 in Eq. (5).
Finally, we explicitly want to penalize "overlap" between groups of classes in confidence sets. For example, we may not want to concurrently include very high-risk conditions among low-risk ones in confidence sets, to avoid unwanted anxiety tests for the patient. Letting Ko Ki being two disjoint sets of classes, we define mis-coverage as
MisCovero-+1 Eielo 5'y: Kol
Σ ie
8'ys Ko (Ek E K₁ k C(z))).
(8)
Reducing MisCovero-+1 means avoiding classes K₁ being included in confidence sets of classes Ko- Again, we use Ly.k for y Ku, k K₃ to approach this problem. MisCover is defined analogously and measures the opposite, i.e., classes Ky being included in confidence sets of K1.
EXPERIMENTS
demonstrate that ConfTr reduce inefficiency of THR and APS compared to CP applied to a baseline model trained using cross- entropy loss separately (see Tab. T for the main results). Thereby, we outperform concurrent work Beelottt 2021). Second, in Sec. 4.2 we show how ConfTr can be used to "shape" confidence sets, i.e., reduce class-conditional inefficiency for specific (groups of) classes or coverage confusion of two or more classes, while maintaining the marginal coverage guarantee. This is impossible using (Bellotti 202T and rather difficult for standard CP.
We present experiments in two parts: First, in Sec. 4.1
We consider several benchmark datasets as well as architectures, c.f. Tab. A and report metrics averaged across 10 random calibration/test splits for 10 trained models for each method. We focus on (non-differentiable) THR and APS as CP methods used after training and, thus, obtain the cor- responding coverage guarantee. THR, in particular, consistently achieves lower inefficiency for fixed confidence level than, e.g., THRL (i.e., THR on logits) RAPS, see Fig. [ (left). We set a = 0.01 and use the same a during training using ConfTr. Hyper-parameters are optimized for THR or APS individually. We refer App. F for further details on datasets, models, evaluation paper-parameter protocol and hyper- parameter optimization.
4.1 REDUCING INEFFICIENCY WITH CONFTR
In the first part, we focus on the inefficiency reductions of ConfTr in comparison to a standard cross- entropy training baseline and (Bellotti 2021) (Bel). After summarizing the possible inefficiency reductions, we also discuss which CP method to use during training and how ConfTr can be used for ensembles and generalizes to lower

---

Published as a conference paper at ICLR 2022
Table 1: Main Inefficiency Results, comparing (Bellotti 2021) (Bel, trained with THRL) and Con- ITr (trained with THRLP) using THR or APS at test time (with a=0.01). We also report improve- ments relative to the baseline, i.c., standard cross-entropy training, in percentage in parentheses. ConfTr results in consistent improvement of inefficiency for both THR and APS. Training with Leass using L = Ix. generally works slightly better. On CIFAR, the inefficiency reduction is smaller compared to other datasets as ConfTr is trained on pre-trained ResNet features, see text.
More results can be found in App. g
Inefficiency 4. ConfTr (trained w/ THRLP), a = 0.01
THR
APS
Dataset
Basel.
Bel
ConfTr
+ +e
Basel.
ConfTr
+ +
MNIST
2.23
2.70
2.18
2.11
(-5,4%)
2.50
2.16
2.14 (-14,4%)
F-MNIST
2.05
1.90
1.69
1.67 (-18.5%)
2.36
1.82
1.72 (-27.1%)
EMNIST
2.66
3.48
2.66
2.49 (-6,4%)
4.23
2.86
2.87 (-32.2%)
CIFARIO
2.93
2.93
2.88
2.84 (-3.1%)
3.30
3.05
2.93 (-11.2%)
C0F
10.63
10.91
10.78
10.44 (-1.8%)
16.62
12.99
12.73 (-23.4%)
Main Results: In Tab [ we summarize the inefficiency reductions possible through ConfTr (trained with THRLP) in comparison to Bel (trained with THRL) and the baseline. Bel does not consistently improve inefficiency on all datasets. Specifically, on MNIST, EMNIST or CIFAR 100, inefficiency actually worsens. Our ConfTr, in contrast, reduces inefficiency consistently, not only for THR but also for APS. Here, improvements on CIFAR for THR are generally less pronounced. This is likely because we train linear models on top of a pre-traiin gre-trained ResNet (He et al. 2016) where features are not taking into account conformalization at test time, see App. For APS, in contrast, improvements still significant. Across all datasets, training with Letsss generally performs slightly better, especially for datasets with many classes such EMNIST (K=52) CIFAR 100 (K=100).. Overall, ConfTr yields significant inefficiency reductions, independent of the CP method used at test time.
Conformal Predictors for Training: In Tab. 1 use THRLP during training. inrespective of the CP method used at test time. This is counter-intuitive when using, e.g., APS at test time. However, training with THR and APS is rather difficult, limited gradient flow as both THR and APS are defined on the predicted probabilities instead of pog-robbabilities as used for THRLP or in cross-entropy training. Morcover, re-formulating the conformity scores of APS in Eq. (11 to use bog-probabilities is non-trivial. In contrast, Bel has to be trained using THRL as a fixed threshold r is used during training. This is because the calibration step is ignored during training. Also, fixing T is not straightforward for THR due to the limited range of the predicted probabilities (x) E [0, 1], see App. E We believe that this contributes to the poor performance of Bel on several datasets. Finally, we found that Bel or ConfTr do not necessarily recover the accuracy of the baseline. Remember that we refer to the accuracy in terms of the arg max- mmax-prediction of πy. When training from scratch, accuracy can be 2-6% lower while still reducing inefficiency. This is interesting because ConfTr is still able to improve inefficiency, highlighting that cross-entropy training is not appropriate for CP.
diseussed in App. D This is likely caused by
Further Results: Tab. 2 includes additional results for ConfTr to "conformalize" ensembles on CIFARIO (left) and with lower confidence levels a on EMNIST (right). In the first example, we consider applying CP to an ensemble of models. Ensemble CP methods such as (Yang & Kuchib- hotla 202l) cannot improve Ineff over the best model of the ensemble, i.e., 3.10 for THR. Instead,
Table 2: Ensemble Results and Lower Confidence Levels a: Left: "Conformalization" of ensem- bles using a 2-layer MI.P trained on logits, either normally or using ConfTr. The ensemble contains 18 models with accuracies in between 75.10 and 82.72%. Training model top of the ensemble clearly outperforms the best model of the ensemble; using ConfTr further boosts Ineff. Right: The inefficiency improvements of Tab. generalize to lower confidence levels a on EMNIST, although ConfTr is trained with a=0.01.
CIFAR10: Ensemble Results
EMNIST: Confidence Levels
Test
THR
Method
Basel.
ConfTr
Method
(Modcls)
+MLP
+ConfTr
Test
THR
Avg. Ineff
3.10
2.40
2.35
Ineff, a= 0.005
4.10
3.37 117.8%)
Best Ineff
2.84
2.33
2.30
Ineff, 00001
15.73
13.65 (-13.2%)
7

---

Published as a conference paper at ICLR 2022
CIPAR10: Ineff improvement by Class
CIPAR10: Ineff Reduction by Group
CIF AR100: Ineff Improvement by Group
Nilbive Change (8)
heletire Chunge (S}
-10
-20
-20
0.0
2.5
5.0
7.5
10.0
125
15.0
17.5
Figure 3: Shaping
Inefficiency on CIFAR: Possible inefficiency reductions, in percentage change, per class (blue) and the impact the overall, average inefficiency across classes (green). Left: Significant inefficiency reductions are possible for all classes on CIFAR 10. Middle: The same strategy applies to groups of classes, e.g., "vehicles" vs "animals", as well. Right: Similarly, on CIFARIOG 100, we group classes by their coarse class (20 groups à 5 classes), see Krizhevsky 2009), allowing inefficiency improvements of more than 30% per individual group.
training an MLP on top of the ensemble's ' logits can improve Ineff to 2.40 and additionally using ConfTr to 2.35. The second example shows that ConfTr, trained for a=0.01,, generalizes very well to significantly smaller confidence levels, e.g., a=0.001 on EMNIST. In fact, the improvement of ConfTr (without ) in terms of inefficiency is actually more significant for lower confidence levels. We also found ConfTr to be very stable regarding parae--araettrrs see App. H Only too small batch sizes (e.g.. 100 on MNIST) prevents convergence. This is likely because of too few examples (BBaal=50) for calibration with a=0.01 during training. More results, e.g., on binary datasets or including additional hyper-paramete ablation can be found in App. !
4.2 CONFORMAL. TRAINING FOR APPLICATIONS: CASE STUDIES
For the second part, we focus on ConfTr trained with THRLP and evaluated using THR. We follow Sec. 3.3 and start by reducing class- or group-conditional inefficiency using ConfTr (without Celass), before demonstrating reductions in coverage confusion of two or more classes and avoiding mis- coverage between groups of classes (with Leisss). ). Because this level of control over the confidence sets is not easily possible using Bel or standard CP, we concentrate on ConfTr only:
Shaping Conditional Inefficiency:
We use ConfTr to reduce class-conditional inefficiency for spe- cific classes or group of classes, as defined in Eq. (6). In Fig. 2 inefficiency is shown to vary widely across classes: On CIFARIO, the more difficult class 3 ("cat") obtains higher inefficiency than the easier class 1 ("automobile")). Thus, in Fig. we use w=10 as described in Sec. 3.3 to reduce class- or group-conditional inefficiency. We report the relative change in percentage, show- ing that inefficiency reductions of 20% or more are possible for many classes, including "cat" on CIFAR1O (left, blue). This is also possible for two groups of classes, "vehicles" vs. "animals" (mid- dle). However, these reductions usually come the cost of slight increase in average inefficiency across all classes (green). On CIFAR 100, we consider 20 coarse classes, each containing 5 of the 100 classes (right). Again, significant inefficiency reductions per coarse class are possible. These observations generalize to all other considered datasets and different class groups, see App.
Avoiding Coverage Confusion: Next, we use ConfTr to manipulate the coverage confusion matrix as defined in Eq. 7 Specifically, we intend to reduce coverage confusion of selected sets of classes.
Oay Contaston Change (1)
F-MNIST: Reducing Cov Confusion 4-6
Contusion Change 196)
F-MNIST: Reducing Cov Confusion 2-4-6
F-MNIST: Reducing Cov Confusion Class
Dhe Contaztion Change
0.5
0.0
-1
-0.5
0.0
0.4
0.6
1.0
-1.0
0.4
1.0
Off-Diagonal Weight
OfT-Diagonal Weight
Off-D Dia.aaaanaalaamm Weight
Figure 4: Controlling Coverage Confusion: Controlling coverage confusion using ConfTr with Lelass and an increasing penalty Lyg. >> 0 on MaShion-MNIST. For classes 4 and 6 ("coat" and "shirt"), coverage confusion Σy, and Σx.y decreases significantly (blue and green). However, con- fusion of class 4 with class 2 ("pullover") might increase (gray). ConfTr can also reduce coverage confusion of multiple pairs of classes (e.g., additionally considering class 2). Instead, we can also penalize confusion for each pair (y, k)), k [K], e.g., y == 6. Here, Ly.k > 0, but Ly = 0, iee Cover confusion is not reduced symmetrically.
[K].e.g.
8

---

Published as a conference paper at ICLR 2022
WineQuality: Reducing Inaff of Class O
CIFARIO; Ko 3 ("eat") vs. K1= Others
Irafff
2.0
CIFAR100 Ko= "human-made vs. K1 "natural"
Size
CIFARTO
CIFARTOO
2.5
10
MisCover
4
MisCover
Size Weight Class
Method
Ineff
0-+1
1->0
Ineff
0-+1
1->0
Cov Confusion
Change (K]
WineQuality: Importance Class
ConfTr
2.84
98.92
36.52
10.44
40.09
29.6
10
D-0
1-0
LKo.K; =1 2.89
91.60
34.74
16,50
15.77
70.26
LKI.No=1 =1 2.92
97.36
26.43
11.35
45.37
17.56
On-Diagonal Weight
3.3 ConfTr allows to reduce mis- coverage on CIFAR. We consider (3=(3} (i.e., "cat") vs. all other classes on CIFARIO (left) and "human-made" vs. "natural" on CIFAR100 (Kool=33 |K||=55 right). On CIFAR10, both MisCovero-:1 and MisCover can be reduced significantly without large impact on inefficiency. For CIFARIO0, in contrast, Ineff increases more significantly. Right: Binary Condiiooniiii Inefficiency and Coverage: We plot inefficiency by class (top) and coverage confusion (bottom) on WineQuality. We can reduce inefficiency for class 0 ("bad"",, the minority class, at the expense of higher inefficiency for class ("good") and boost class- conditiooa coverage for class 0.
Figure 5: Left: Reducing Mis- Mis-Coverage: Following Sec.
Using non-zero entry Ly.k > 0. y of k in Letass, as described in Sec. 3.3 Fig. (left) shows that cov- erage confusion can be reduced significantly for large enough Ly. on Mashion-MNIST: Considering classes 4 and 6 ("coat" and "shirt") confusion can be reduced by roughly 1%. However, as accuracy stays roughly the same and coverage is guaranteed, this comes at the cost of increasing coverage confusion for other class pairs, e.g.. 2 ("pullover") and 4. ConfTr can also be used to reduce cover- age confusion of multiple class pairs (middle) or whole row in the coverage confusion matrix yy, with fixed and y Fig. 4 (right) shows the results for class 6: coverage confusion with, e.g., classes 0 ("t-shirt")), 2 or 4 (blue, green and violet) is reduced roughly 0.5% each at the cost of increased confusion of classes 2 and 4 (in gray). These experiments can be reproduced on other datasets, e.g., MNIST or CIFARIO in App. M
Reducing Mis-Coverage: We can also address unwanted "overlap" of two groups of classes using ConfTr and Celass In Fig. F (left) we explicitly measure mis-coverage as defined in Eq. (8) First, on CIFAR1O, we consider singleton group (3= ("cat") and K|=[K]) \ {3}: The ConfTr baseline MisCovero-11 tells us that 98.92% of confidence sets with true class also contain other classes. Given an average inefficiency of 2.84 this is reasonable. Using Ls,* = 1, k + 3, this can be reduced to 91.6%. Vice-versa, the fraction of confidence sets of class y#3 containing class can be reduced from 36.52% to 26.43%. On CIFARI00 this also allows to reduce overlap between "human-made" (35 classes) and "natural" (65 classes) things, e.g., MisCoverg-11 reduces from 40.09% to 15.77%, at the cost of slight increase in inefficiency. See App. for additional results.
Binary Datasets: Finally, in Fig. (right), we illustrate that the above conclusions generalize to the binary case: On WineQuality, we control inefficiency of class 0 ("bad wine", minority class with ~37% of examples) at the expense of increased inefficiency for class 1 ("good wine", top). Similarly, we (empirically) improve class-conditional coverage for class 0 (bottom) or manipulate coverage confusion of both classes, see App. O
5 CONCLUSION
We introduced conformal training (ConfTr), a novel method to train conformal predictors end- lo-end with the underlying model. This addresses a major limitation of conformal prediction (CP) in practice: The model is fixed, lcaving CP little to no control over the predicted confidence sets. In thorough experiments, we demonstrated that ConfTr can improve inefficiency of state-of-the-art CP methods such as THR (Sadinle et al. 2019) or APS (Romano et al. 2020). More importantly, motivated by medical diagnosis, we highlighted the ability of ConfIr to manipulate the predicted confidence sets in various ways. First, ConfTr can "shape" the tribution, i.e., reduce inefficiency on specific classes at the cost of higher inefficiency for others. Second, ConfTr allows to control the coverage-confusson matrix by, e,g., reducing the probability of including classes other than the ground truth in confidence sets. Finally, this can be extended to explicitly reduce "overlap" between groups of classes in the predicted confidence sets. In all cases, ConfTr does not lose the (marginal) coverage guarantee provided by CP.
inefficiency dis-

---

Published as a conference paper at ICLR 2022
ETHICS STATEMENT
Recent deep learning based classifiers, as used in many high-stakes applications, achieve impressive accuracies on held-out test examples. However, this does not provide sufficient guarantees for safe deployment. Conformal prediction (CP), instead, predicts confidence sets equipped with a guaran- tee that the true class is included with specific, user-specified probability. These confidence sets also provide intuitive uncertainty estimates. We specifically expect CP to be beneficial in the medi- cal domain, improving trustworthiness among doctors and patients alike by providing performance guarantees and reliable uncertainty estimates. Yet. the current work does not contain experiments with personal/sensitive medical data. The presented results are on standard benchmark datasets only.
However, these benefits of CP may not materialize in many applications unless CP can be better integrated into existing classifiers. These are predominantly deep networks, trained end-to-end to, e.g., optimize classification performance. CP, in contrast, is agnostic to the underlying model, being applied as "wrapper" post-training, such that the obtained confidence sets may not be optimal, e.g., in terms of size (inefficiency) composition (i.e., the included classes). Especially in the medical domain, constraints on the confidence sets can be rather complex. Our conformal training (ConfTr) integrates CP into the training procedure, allowing to optimize very specific objectives defined on the predicted confidence sets without losing the guarantees. In medical diagnosis, smaller confi- dence sets may avoid confusion or anxiety among doctors or patients, ultimately leading to better diagnoses. For example, we can reduce inefficiency (i.e., the ambiguity of predicted conditions) for conditions that are particularly difficult for doctors to diagnose. Alternatively, ConfTT allows to avoid confusion between low- and high-risk conditions within the confidence sets.
Generally, beyond medical diagnosis, we believe ConfTr have positive impact settings where additional constraints on confidence sets are relevant in addition to the guarantees and uncertainty estimates provided by CP.
REPRODUCIBILIIY STATEMENT
In order to ensure reproducibility, we include detailed description of our experimental setup in App. We discuss all necessary information for conformal training (ConfTr) as well as our baselines. This includes architectures, training procedure and hyper-parameters, as well as pre- processing/data augmentation if applicable. Furthermore, we describe our evaluation procedure which includes multiple calibration/test splits for conformal prediction (CP) at test time as well as multiple training runs to capture randomness in the used calibration examples and during training. To this end, Tab. [Areports the rraiiin/calibraatoonnest splits of all used datasets and Tab. the used hyper-parameters for ConfTr. While Alg. [ already summarizes the used (smooth) threshold CP methods and our ConfTr, App. P (specifically Alg. B lists the corresponding Python implementa- tion of these key components.
REFERENCES
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wat- tenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learn- ing heterogeneous systems, 2015. URL https: /wwp://wwww.om www.orflww..oooooo org/ Software available from tensorftow.org.
Anastasios Nikolas Angelopoulos, Stephen Bates, Michael Jordan, and Jitendra Malik. Uncertainty sets for image classifiers using conformal prediction. In Proc. of the International Conference on Learning Representations (ICLR), 2021.
Rina Foygel Barber, Emmanuel Candès, Aaditya Ramdas, and Ryan J. Tibshirani. Predictive inference with the jackknife+. arXiv.org, abs/1905 htss/9955.0928, 2019a.
10

---

Published as a conference paper at ICLR 2022
Rina Foygel Barber, Emmanuel J. Candès, Aaditya Ramdas, and Ryan J. Tibshirani. The limits of distribution- conditional predictive inference. arXivorg, abs/1903.04684, 2019b.
Stephen Bates, Anastasios Angelopoulos, Lihua Lei, Jitendra Malik, and Michael I. Jordan. Distribution-free, cont-cong prediction sets. arXiv.org, abs/2101.02703. 2021.
Babak Ehteshami Bejnordi, Mitko Veta, Paul Johannes
Diest, Bram Ginneken, Nico Karssemeijer, Geert S. Litjens, Jeroen A. van der Laak, Meyke Hermsen, Quirine F Manson, Maschenka C. A. Balkenhol, Oscar G. F. Geessink, Nikolaos Stathonikos, Marcory Crf van Dijk, Peter Bult, Francisco Beca, Andrew H. Beck, Dayong Wang, Aditya Khosla, Rishab Gargeya, Hu- mayun Irshad, Aoxiao Zhong, Qi Dou, Quanzheng Li, Hao Chen, Huang Lin, Pheng-Ann Heng, Christian Hass, Elia Bruni, Quincy Wong, Ugur Halici, Mustafa Umit Öner, Rengul Cetin-Atalay, Matt Berseth, Vitali Khvatkov, A F Vylegzhanin, Oren Z. Kraus, Muhammad Shaban, Nasir M. Rajpoot, Ruqayya Awan, Korsuk Sirinukunwattana, Talha Qaiser, Yee-Wah Tsang. David Tellez, Jonas Annuscheit, Peter Hufnagl, Mira Valkonen, Kimmo Kartasalo. Leena Latonen, Pekka Ru- usuvuori, Kaisa Limmatainen, Shadi Albargouni, Bharti Mungal, Ami George, Stefanie Demirci, Nassir Navab, Seiryo Watanabe, Shigeto Seno, Yoichi Takenaka, Hideo Matsuda, Hady Ahmady Phoulady, Vassili A. Kovalev, Alexander Kalinovsky, Vitali Liauchuk, Gloria Bueno, M. del Mila- gro Germnndz--Caroblle Ismael Serrano, Oscar Deniz, Daniel Racoceanu, and Rui Venâncio. Di- agnostic assessment of deep learning algorithms for detection of lymph node metastases in women with breast cancer. Journal of the American Medical Association (JAMA), 318:2199-221 2200220000220 2017.
Anthony Bellotti. Optimized conformal classification using gradient descent approximation. arXiv.org, abs/2105.1 1255, 2021.
Mathieu Blondel, Olivier Teboul, Quentin Berthet, and Josip Djolonga. Fast differentiable sorting and ranking. In Proc. of the International Conference on Machine Learning (ICML). 2020.
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman- Milne,, and Qiao Zhang. JAX: composable transformations Python+NumPy programs, 2018. URL http:
//github.com gotpo///oogoll//aaaoaa/
Maxime Cauchois, Suyash Gupta, and John Duchi. Knowing what you know: valid and validated confidence sets in multiclass and multilabel prediction. arXiv:org, abs/2004.101s 10181, 2020.
Gregory Cohen, Saeed Afshar, Jonathan Tapson, and André van Schaik. EMNIST: an extension of MNIST to handwritten letters. arXiv.org, fas//1702.05373 2017.
Paulo Cortez, António Cerdeira, Fernando Almeida, Telmo Matos, and José Reis. Modeling wine preferences by data mining from physicochemical properties. Decision Support Systems, 47(4): 547-553, 2009.
Ekin Dogus Cubuk, Barret Zoph, Dandelion Mané, Vijay Vasudevan, and Quoc V. Le. Autoaugment: Learning augmentation policies from data. arXiv.org, 0bs/1805.00501, 2018.
Marco Cuturi, Olivier Teboul, and Jean-Philippe Vert. Differentiable ranking and sorting using optimal transport. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
Terrance Devries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv.org, abs/1 017700885555 2017.
Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL httlhtt/pa/ccivee icss Rcs.uci.u edu/mll
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In Proc. of the International Conference on Machine Learning (ICML),
Abner Snvzmán-Rivera Dhruv Batra, and Pushmeet Kohli. Multiple choice learning: Learning to produce multiple structured outputs. In Advances in Neural Information Processing Systems (NeurIPS), 2012.
Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Proc. of the IEEE Conference Computer Vision and Pattern Recognition (CVPR), 2016.
11

---

Published as a conference paper at ICLR 2022
Yotam Hechtlinger, Barnabás Póezos, and Larry A. Wasserman. Cautious deep learning. arXiv.org, abss/100500946, 2018.
Tom Hennigan, Trevor Cai, Tamara Norman, and Igor Babuschkin. Haiku: Sonnet for JAX, 2020.
URL httpttttt/gghhbbbbbbbbb com/ detpm//deeennd///eeemmemmm heteemiinddddmaaaaeeeeeeeee dm-haimaaklaa
Matteo Hessel, David Budden, Fabio Viola, Mihacla Rosca, Eren Sezener, and Tom Hennigan.
Optax: composable gradient transformation and optimisation, in jax!, 2020. URL http://
g github. wtc.c///deemmmm//////oooo
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. Proc. of the International Conference on Machine Learning (ICML), 2015.
Ayush Jain, David H. Way, Vishakha Gupta, Yi Gao, Guilherme de Oliveira Marinho, Jay Hart- ford, R. Sayres, K. Kanada, C. Eng. Kunal Nagpal, K. Desalvo, Greg Corrado, Lily Peng, Dale R. Webster, R. C. Dunn, David Coz, Susan J. Huang, Yun Liu, Peggy Bui, and Yuan Liu. Development and assessment of an artificial intelligence-baee tool for skin condition diagnosis by primary care physicians and nurse practitioners in teledermatology practices. Journal of the American Medicul Association (JAMA), 4, 2021.
A. Krizhevsky. Learning multiple layers of features from tiny images. 2009.
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recogmition. In Proceedings of the IEEE, volume 86, pp. 2278-2324, 1998.
Jing Lei, Alessandro Rinaldo, and Larry Wasserman. A conformal prediction approach to explore functional data. Annals of Mathematics and Artificial Intelligence, 74:29-43, 2013.
Yuan Liu, Ayush Jain, Clara Eng, David H. Way, Kang Lee, Peggy Bui, Kimberly Kanada, Guil- herme de Oliveira Marinho, Jessica Gallegos, Sara Gabriele, Vishakha Gupta, Nalini Singh, Vivek Natarajan, Rainer Hofmann- -ellenno,,,,, Gregory S. Corrado, Lily H. Peng, Dale R. Webster, Den- nis Ai, Susan Huang, Yun Liu, R. Carter Dunn, and David Coz. A deep learning system for differential diagnosis of skin diseases. Nature Medicine, 26:900-908, 2020.
Scott Mayer McKinney, Marcin Sieniek, Varun Godbole, Jonathan Godwin, Natasha Antropova, Hutan Ashrafian, Trevor Back, Mary Chesus, Greg Corrado, Ara Darzi, Mozziyar Etemadi, Flo- rencia Vareia-Vicente, Fiona J. Gilbert, Mark D. Halling-Browe Demis Hassabis, Sunny Jansen, Alan Karthikesalingam, Christopher J. Kelly, Dominic King. Joseph R. Ledsam, David S. Mel- nick, Hormuz Mostofi, Lily H. Peng, Joshua Jay Reicher, Bernardino Romera-Paredes Richard Sidebottom, Mustafa Suleyman, Daniel Tse, Kenneth C. Young. Jeffrey De Fauw, and Shravya Shetty. International evaluation of ai system for breast cancer screening. Nature, 577:89 -94, 2020.
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proc. of the International Conference on Machine Learning (ICML).
Yaniv Romano, Evan Patterson, and Emmanuel J. Candès. Conformalized quantile regression. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
Yaniv Romano, Matteo Sesia, and Emmanuel Candès. Classification with valid and adaptive coverage. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
Abhijit Guha Roy. Jie Ren, Shekoofeh Azizi, Aaron Loh, Vivek Natarajan, Basil Mustafa, Nick Pawlowski, J. Freyberg. Yuan Liu, Zach Beaver, Nam Vo, Peggy Bui, Samantha Winter, Patricia MacWilliams, Greg S Corrado, Umesh Telang, Yun Liu, Taylan Cemgil, A. Karthikesalingam, Balaji Lakshminarayanan, and Jim Winkens. Does your dermatology classifier know what doesn't know? detecting the long-tail of unseen conditions. arXiv.org, abs/2104.03829, 2021.
Mauricio Sadinle, Jing Lei, and Larry A. Wasserman. Least ambiguous set-valued classifiers with bounded error levels. arXiv.org, abs/ 1009600051111 2016.
12

---

Published as a conference paper at ICLR 2022
Mauricio Sadinle, Jing Lei, and Larry Wasserman. Least ambiguous set-valued classifiers with bounded enror levels. Journal of the American Statistical Association (JASA), 1144525);223-2344 2019.
Vladimir Vovk. Conditional validity of inductive conformal predictors. In Proc. of the Asian Con- ference on Machine Learning (ACML). 2012.
Vladimir Vovk. Cross-conformal predictors. Annals of Mathematics and Artificial Intelligence, 74: 9-28, 2013.
Vladimir Vovk, Alex Gammerman, and Glenn Shafer. Algorithmic Learning in a Random World. Soringer-Verlag. Berlin, Heidelberg, 2005.
Bryan Wilder, Eric Horvitz, and Ece Kamar. Learning complement humans, In Proc. of the International Joint Conference on Artificial Intelligence (IJCAI), 2020.
John H Williamson. Differentiable parallel upproximate sorting networks, 2020. URL https: md. html
//johnhw h/johhww.iitha..bb..... ott.ebab..boodfffeeeee..eieeee.o
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: novel image dataset for bench-
marking machine learning algorithms. arXivorrg abs/1708.07747, 2017.
Yachong Yang and A. Kuchibhotla. Finite-sample efficient conformal prediction. arXiv.org, 13877, 2021.
13

---

Published as a conference paper at ICLR 2022
A OVERVIEW AND OUTLINE
In the appendix, we discuss an additional baseline, called coverage training (CoverTr), provide additional details on our experimental setup and include complementary results. Specifically, the appendix includes:
Additional discussion of related work in Sec. B
Formal statement of the coverage guarantee obtained through conformal prediction (CP) in Sec. C
Differentiable implementation of APS in Sec. D
Discussion of coverage Iraining (CoverTr) and (Bellotti 2021 in Sec.
Details experimental setup, including dataset splits, model details and used hyper- parameters for ConfTr, in Sec. F
Experiments regarding random training and test trials in Sec. G
Hyper-parameter ablation on MNIST in Sec.
CoverTr and ConfTr ablation on MNIST and Pashion-MNISS in Sec.
Complete inefficiency (Ineff) results on all datasets in Sec. J
Effect of (standard) ConfTr on class-conditional inefficiency and coverage (Cover) confu- sion in Sec. K
Additional results for ConfTr shaping the class-conditional inefficiency distribution in
Sec. L
More experiments for ConfTr manipulating coverage confusion in Sec. M
Complementary results for ConfTr reducing coserrve (MisCover) Sec.
cladsiconditional inefficiency and coverage confusion on binary datasets in Sec.
Python- and Jax (Bradbury et al. 2018) code for ConfTr Sec.
B RELATED WORK
Conformal prediction (CP) builds on early work by Vovk et al. (2055) considering both regression, see e.g., (Romano al. 2019) for references, and classification settings, e.g. (Romano et al. 2020
Angelopoulos et al.) 2021| Cauchois et al. 2020) Hechtlinger et al. (018). Most of these approaches follow split CP approach (Lei et al.) 2013) where held-out calibration set is used, as in the main paper, however, other variants based on cross-validation (Vovk) 2013) or jackknife (i.e., leave-one- out) (Barber et al. 2019a) are available. These approaches mostly provide marginal coverage. Vovk Barber al. (2019b) suggest that it is generally difficult or impossible to obtain conditional coverage. However, Romano et al. (2020) work towards empirically better conditional coverage and Sadinle et al. (2019) show that efficient class-conditional coverage is possible. Angelopoulos jet al. (222)) extend the work by |Romano et al.] (2020) to obtain smaller confidence sets at the expense of the obtained empirical conditional coverage. CP has also been studied in the context of ensembles (Yang & Kuchibhotla| [202I), allowing to perform model selection based on inefficiency while keeping coverage guarantees. The work of Bates al. (202T) can be seen as a CP extension in which a guarantee on an arbitrary. user-specified risk can be obtained, using a conformal predictor similar (Sadinle et al. 2019). Our conformal training (ConfTr) follows the split CP approach and is specifically targeted towards classification problems. Nevertheless, extensions to regression, or other CP formulations such as (Bates et al., 202T) during training, are possible. Beyond that, ConiTr is agnostic to the CP method used at test time and can thus be seen complementary to the CP methods discussed above. This means that ConfTr can easily be combined with approaches such (Btte et al. 2021) class-conditional conformal predictors (Sadinle et al. 2019) at test time.
In terms learning to predict confidence sets, our approach has similarities to the multiple choice learning of "Guzmán-Rivee Rivera et al. (2012) which yields multiple possible outputs in structured predic- tion settings (e.g., image segmentation). However, the obtained prediction sets are fixed size and no coverage guarantee is provided. Concurrent work by Bellotti (2021) is discussed in detail in App.
14

---

Published as a conference paper at ICLR 2022
C COVERAGE GUARANTEE
Following Romano et al. 22200). we briefly state the coverage guarantee obtained by CP in formal terms: Given that the learning algorithm used is invariant permutations of the training examples, and the calibration examples f(x,, He are exchangeably drawn from the same distribution encountered at test time, the discussed CP methods satisfy
P(Y C(X)) 2 a1-a.
As highlighted in (Romano et al. 2020), this bound near tight if the scores B(xx) almost surely distinct:
P(Y E C(X)) & - Teal +1
(10)
Note that this is the case for APS due to the uniform random variable in Eq. (1I).
(Romano
al. 2020) notes that there is generally no guarantee on conditional coverage, as this requires addi- tional assumptions. However, class-conditional coverage can be obtained using THR as outlined in
Sadinle et al., 2019)). Moreover, Sadinne al. (2019) show that THR is the most efficient conformal predictor given fixed model rTs Le., minimizes inefficiency. We refer to (Sadinle et al. 2019) for exact statements of the latter findings.
D DIFFERENTIABLE APS
Our differentiable implementation closely follows the one for THR outlined in Sec. 2.2 The main difference is the conformity score E(x, k) computation, i.e.,
Eo k) = a (x) + +... + Ta i (x) + U UT, (g (Ir),
(11)
where (1) (x) ... Te (k) (a)) and U is uniform random variable in [0, 1] break ties. As in the calibration step, we use an arbitrary smooth sorting approach for this. This implementation could easily be extended include the regularizer of Angeelooossss al. (202I), as well.
COVERAGE TRAINING
As intermediate step towards conformal training (ConfTr), we can also ignore the calibration step and just differentiate through the prediction step, i.e., C)) This can be accomplished by fixing the threshold т. Then, ny essentially learns to produce probabilities that yield "good" confidence sets Ce for the chosen threshold Following Alg. Alg.(Al coverage training (CoverTr) computes Cx;;7) on each mini-batch using a fixed т. The model's 's parameters are obtained by solving
min log (E (C(C((X;T)) + X((Co(X;T)))
(12)
Again, C is the classification loss from Eq. 55 and Ω the size loss from Eq. (3) The classification loss has ensure that the true label y is in the predicted confidence Co (X:7) the calibration step is missing. In contrast to Tonf CoverTir strictly requires both classification and size loss dur- ing training. This is because using fixed threshold 7 yields trivial solutions for both classification and size loss when used in isolation (i.e., L is minimized for Co(X; [K] and Ω is minimized for 7 = 0). Thus, balancing both terms Eq. [2) using À is crucial during training. As with ConfTr, the threshold is re-calibrated at test time obtain coverage guarantee. Choosing T for training, in contrast, can be difficult: First, 7 will likely evolve during training (when Te gets
1: function SYVVERAGETRAIINNGE X)
Algorithm A: Coverage Training (CoverTr): Compared to Alg. [ ConfTr, CoverTr sim- plifies training by not differentiating through the calibration step and avoiding splitting the batch B in half. However, fixing the threshold can be problem and training requires both coverage and size loss.
2: for mini-batch B do C(z;;) SMOOTTHREDD(T((1)..o
Ce := DiED ((Co(aH))
5: Op E DieB ((Co(an)))
6: A == Vot/IB (Ls + A(t)
7: update parameters 0 using A
15

---

Published as a conference paper at ICLR 2022
Table A: Used Datasets: Summary of train/calibrationness splits, epochs and models used on all datasets in our experiments. The calibration set is usually less than 10% of the training set. On most datasets, the test set is roughly two times larger than the calibration set. When computing random calibration/test splits for evaluation, see text, the number of calibration and test examples stays constant. On Camelyon, we use features provided by |Wilder et al.] (2020) instead of the
original images. ** For EMNIST, we use custom subset of the "byClass" split.
Dataset Statistics
Dataset
Train
Cal
Test
Dimensions
Classes
Epochs
Model
Camelyon2016* (Bejnordi et al.
2017)
280
100
17
31
2
100
I-layer MLP
GermanCredit (Dua & Graff 2011
700
100
200
24
2
100
Linear
WineQuality (Cortez et al. 2009)
4500
500
898
2
100
2-layer MLP
MNIST (LeCun et al. 1998)
55k
5k
10k
28
x 28
10
50
Linear
EMNIST** (Cohen et al. 2017)
98.8k
5.2k
18.8k
28
28
52
75
2-layer MLP
Fashion-MNisT -NNITT [Xtao et al. 20077
55k
5k
10k
28
x 28
10
150
2-layer MLP
CIFAR10 Krizhevsky 2009
45k
5k
10k
32 x
32
x 3
10
1.50
ResNet-34
CIFAR100 Krizhevsky 2009
45k
5k
10k
32
x
32
x 3
100
150
ResNet-50
more and more accurate) and, second, the general ballpark of reasonable thresholds T depends on the dataset as well as model and is difficult to predict in advance.
In concurrent work by Bellotti (2021) (referred to as Bel), the problem with fixing a threshold is circumvented by using THRL during training. i.e., THR on logits. As the logits are unbounded, the threshold can be chosen arbitrarily, e-g.. T 1. As Bel also follows the formulation of Eq. [12). the approach can be seen as a special case of CoverTrr However, less flexible coverage loss is used during training: Instead of Letass: the loss is meant to enforce a specific coverage level (1 - a) on each mini-batch. This is done using a squared loss on coverage:
[(
Leov =
Σ EEB
Co (B1:T) - (1 a1)
(13)
B
for a mini-batch B of examples. In contrast to Eq. 12 Leo is applied per batch and not per example. For the size loss, [Bllotti] (2021) uses 6 control over the confidence sets, Leo also encourages coverage (1 aa) instead of perfect coverage. Nevertheless, this approach is shown improve inefficiency of THRL on various UCI datasets (Dual 2017) using linear logistic regression models. The experiments in the main paper show that this generalizes to non-linear models and more complex datasets. Nevertheless, Bel is restricted to THRL which is outperformed significantly by both THR and APS. Thus, Bel is consistently outperformed by ConfTr in terms of inefficiency improvements. Moreover, the approach cannot be used for any of the studied use cases in Sec. 3.3
Eq. (3). Besides not providing much
& Graff (017))
Using CoverTr with THR and APS remains problematic. While we found [0.9, 0.99] (or -0.01 for THRLP) to work reasonably some datasets, we had difficulties on others, as highlighted in Sec. ! Moreover, as CoverTr requires balancing coverage and size loss Q. hyper- parameter optimization is more complex compared to ConfTr. By extension, these problems also limit the applicability of Bel. Thus, we would ideally want to re-calibrate the threshold r after each larger, held-out calibration set, however, wastes valuable train-
model update. Doing calibration ing examples and compute resources. Thus, ConiTr directly calibrates on each mini-batch and also differentiates through the calibration step itself to obtain meaningful gradients.
F EXPERIMENTAL SETUP
Datasets and Splits: We consider Camelyon2016 (Bejnordi et al. 2017). GermanCredit (Dua & Graff 2017), WineQuality (Cortez et al. 2009, MNIST (LeCun et al. 1998). EMNIST (Cohen (Cohen et al. (017)) 7 and CIFAR (Krizhessyy 2009) with a fixed split of training, calibration and test examples. Tab. A summarizes key statistics of the used datasets which we elaborate on in the following. Except Camelyon, all datasets are provided by Tensorflow Abadi et al. 2015 For Camelyon, we use the pre-computed features of Wilder et al. (2020) which
al. 2017),
https:/ hwwps:///www../ www.:ttsssrfow.orrrgogom
16

---

Published as a conference paper at ICLR 2022
are based on open source code from the Camelyon2016 challenge For datasets providing a default training/test split, we take the last 10% of training examples as calibration set. On Camelyon, we use the original training set, but split test examples into 100 validation and 17 test examples. This is be- cause less than 100 calibration examples are not meaningful for a=0.55. As we evaluate 10 random calibration/test splits, the few test examples are not problematic in practice. On GermanCredit and WineQuality,, we manually created training/calibraiionness splits, roughly matching 70%//0%%/20% We use the "white wine" subset for WineQuality; with quality 6 or higher is categorized as "good wine" (class 1). following (Bellotti (02T]. Finally, for EMNIST, we consider a subset of the "byClass" split that contains 52 = 2- 26 classes comprised of all lower and upper case letters. We take the first 122.8k examples, split as in Tab. A
create binary classification problem, wine
Models and Training: We consider linear models, multi-layer perceptrons (MLPs) and ResNets (He et al. 2016) as shown in Tab. A Specifically, we use linear model on MNIST and German- Credit, 1- or 2-layer MLPss on Camelyon2016, WineQuality and Fashion-MNISS and ResNet-34/50 (He al. 2016) on CIFAR 10/100. Models and training are implemented in Jax (Bradbury et al. 2018 and the ResNets follow the implementation and architecture provided by Haiku (Hennigan et al. 2020 Our I-layer MLPs comprise 1 hidden layers. We use 32, 256, 128, 64 units per hidden layer on Camelyon. WineQuality, EMNIST and Fashion-MNIST, respectively. These were chosen by grid search over {16, 32, 64, 128, 256). In all cases, we use ReL.U activations (Nair & Hinton) and batch normalization (Toffe & Szegedy 2015). We train using stochastic gradient descent (SGD) with momentum 0.0005 and Nesterov gradients. The baseline models are trained with cross-entropy loss, while ConfTr follows Alg. D and CoverTr follows Alg. [A] Learning rate and batch size are op- timized alongside the ConfTr hyper-parameters using grid search, see below. The number of epochs are listed in Tab. A and we follow a multi-step learning rate schedule, multiplying the initial learn- ing rate by 0.1 after 2/s, 3/s and 4/5 of the epochs. We use Haiku's 's default initializer. On CIFAR, we apply whitening using the per-channel mean and standard deviation computed on the training set. On the non-image datasets (Camelyon, GermanCredit, WineQuality), we whiten each feature individually. On MNIST, EMNIST and Fashion- -NIST, the input pixels are just scaled to [-1, 1]. Except on CIFAR, see next paragraph. we do not use any data augmentation. Finally, we do not use Platt scaling (Guo et al. 2017) as used in (Angelopoulos al. 2021
Fine- TunneTTniggon on CIFAR: On CIFARIO and CIFAR100, we train base ResNet-34/ResNe which are then fine-tuned using Bel, CoverTr or ConfTr. We specifically a ResNet-34 with only 4 base channels to obtain an accuracy of 82.6%, using only random flips and crops as data augmen- tation. The rationale to focus the results for CP test time, without optimizing accuracy of the base model. On CIFAR 10, we use 64 base channels for the ResNet-50 and additionally employ AutoAugment (Cubuk et al. 2018) and Cutout (Devries & Taylor 2017) as data augmentation. This model obtains 73.64% accuracy. These base models are trained on 100% of the training examples (without calibration examples). For fine-tuning, the last layer (i.e., logit layer) is re-initialized and trained using the same data augmentation applied for the base model, subject to the random train- ing trials described below. We also consider "extending" the ResNet by training a 2-layer MLP with 128 units per hidden layer on top of the features (instead of re-initializing and fine-tuning the logit layer). All reported results either correspond to fine-tuned (i.e., linear model on features) or extended models (i.e., 2-layer MLP on features) trained on these base models.
models
The final hyper- parameters selected for ConfTr (for THR at test time) on all datasets are summarized in Tab. B These were obtained using grid search over the fol- lowing
batch size in {1000, 500, 100} for WineQuality, MNIST, EMNIST, Fashion-MNIST and CIFAR, (300, 200, 100, 50) on GermanCredit and (80, 40, 20, 10) on Came- lyon; learning rate in (0.05, 0.005]: temperature T E {0.01, 0.1, 0.5, 1}; size weight x E {0.0001, 0.0005, 0.001, 0.005, 0.01, Eq. Grid search was done for each dataset individually on 100% of the training examples (c.f. Tab. Ab. That is, for tlper--prameee as described next. The best hyper-parameter according to inefficiency after evaluating 3 random calibration/test splits were selected, both for THR and APS at test time, with and without Letass
1, 5, 10) (c.f. Eq. 1. right); and E 1) (cf.
optimization we did not perform random training trials
htteee///ghauuuccm////ruuuuaaaat http:///gftthbb.com/d/eeemm hu
17

---

Published as a conference paper at ICLR 2022
Table B: Used ConfTr Hyper-Parametter with and without Leass for THRLP during training and THR at test time. The Hlper-parameete for APS at test time might vary slightly from those reported here. The exact grid search performed to obtained these hyper-parameters can be found in the text. Note that, while hyper-parameters fluctuate slightly, À needs to be chosen higher when training with Leass. Additionally, and in contrast to Bel, x = 1 in Eq. (3) performs better, especially combined with Lelass. Note that dispersion for smooth sorting is fixed e 0.1.
ConfTr Hyper- Paper-Parrmeters (for THRLP during training and THR at test time)
Batch
Learning
Temp.
Size
Dataset, Method
Eq.
Size
rate
T
weight À
Camelyon. ConfTr
20
0.005
0.1
5
Camelyon, ConfTr +Laass
10
0.01
0.01
5
GermanCredie ConfTr
200
0.05
5
GermanCredit, ConfTr +
400
0.05
0.1
5
QineQuality, ConiTr
100
0,005
0.5
0.05
WineQuality, ConfTr +.Caus
100
0.005
0.1
0.5
MNIST, ConfTr
500
0.05
0.5
0.01
MNIST, ConfTr +catss
100
0.01
0.5
EMNIST. ConfTr
100
0.01
0.01
EMNIST, ConfTr +cetsss
100
0.01
5
Fashion -NNIST, ConfTr
100
0.01
0.1
0.01
Fashion-MNIST.. ConfTr +alass
100
0.01
0.1
0.5
CI fine-tune ConfTr
500
0.01
0.05
CIFAR 10, fine-tune Conf + Lchas
500
0.05
0.1
1
1O, "exttnd" ConfTr
100
0.01
0.005
CIFARIO, "extend" ConfTr + Cclass
500
0.05
0.1
0.1
CIFARIO0, fine-tune ConfTr
100
0.005
0.005
CIFARION 100, fine-tune ConfTr + Calass
100
0.005
0.01
We report coverage and inefficiency with the correspond- ing standard deviation across 10 fest (left) and 10 training trials (right). ConfTr was trained using THRLP if not stated otherwise. For test trials, a fixed model is used. Results for training trials ad- ditionally include 10 test trials, but the standard deviation reported only across the training trials. These results help to disentangle the impact of test and training trials. For example, while ConfTr with APS (during training) works in the best case, the standard deviation of 3.1 across multiple training trials indicates that training is not stable.
Table C: Importance of Random Trials:
MNIST:
test trials, Cover/Ineff for THR
MNIST: Training trials, Cover/Ineff for THR
Method
Acc
Cover
Ineff
Method
Acc
Cover
Ineff
Baseline
92.45
99.09+0.2
2.23+-0.15
Baseline
92.4++0.06
99.09-0.8
2.23++0.01
ConfTr
90.38
2.14 99.05
ConfTr
90.2:1012
99.03=1..22
2.18:00025
ConfTr dl
91.14
99.03++0.19
2.09
ConfTr
91.2++0.05
99.05++0.21
2.1140.028
ConfTr with APS
87.9+44.81
99.09-10.29
5.7943.1
Tab. B allows to make several observations. First, on the comparably small (and binary) datasets Camelyon and GermanCredit, the size weight X = 5 is rather high. For ConfTr without Leass- this just indicates that a higher learning rate could be used. Then using Celasss however, this shows that the size loss is rather important for ConfTr, especially on binary datasets. Second, we found the temperature T' to have low impact on results, also see Sec. H On multiclass datasets, the size weight A is usually higher when employing Cetass. Finally, especially with Leasss, using "valid" size loss, i.e., K to not penalize confidence sets of size 1, works better than k =
Random Training and Test Trials: For statistically meaningful results, we perform random test and training trials. Following common practice (Angelopoulos et al.) 2021), we evaluate CP meth- ods at test time using 10 random calibration/test splits. To this end, we throw all calibration and test examples together and sample a new calibration/test split for each trial, preserving the original cali- bration/test composition which is summarized in Tab. A Metrics such as coverage and inefficiency are then empirically evaluated as the average across all test trials. Additionally, and in contrast to (Bellotti 2021). we consider random training trials: After syper-parameters optimization training examples, we train 10 models with the final pprameerrseterrs on a new training set obtained by sampling the original one with up to 5 replacements. For example, MNIST, with 55k training
all
18

---

Published as a conference paper at ICLR 2022
For ConfTr without Laaass, we report inefficiency and accuracy when varying hyper-parameters individually: batch size/learning rate, size weight X, temperature T and confidence level a. While size weight À and temperature T have insignificant impact, too small batch size can prevent ConfTr from converging. Furthermore, the chosen hyper- parameters do not generalize well to higher confidence levels a E {0.1, 0.05).
Table D: Hyper-Parammter Ablation on MNIST:
Batch Size and Learning Rate
Batch Size
1000
1000
1000
500
500
500
100
100
100
Learning Rate
0.05
0.01
0.005
0.05
0.01
0.005
0.05
0.01
0.005
Ineff
2.27
2.24
2.24
2.18
2.18
2.17
8.04
7.32
9.66
Acc
89.05
89.18
89.06
90.23
90.22
90.27
11.5
22.46
12.13
Size
Weight X
0.001
0.005
0.01
0.05
0.1
10
Ineff
2.18
2.18
2.18
2.19
2.19
2.19
2.16
Acc
90.2
20.23
90.23
90.2
90.25
90.23
90.26
Temperature T
T
0.01
0.05
0.1
0.5
Ineff
2.39
2.23
2.2
2.19
2.18
2.2
2.29
Acc
88.54
89.94
90.02
90.24
90.28
90.05
89.63
Confidence
Level (during training)
0.1
0.05
0.01
0.005
Ineff
8.07
7.23
2.18
2.17
Acc 12.88
39.82
90.23
89.47
examples, we randomly sample 10 training sets of same size with each, on average, containing only 668 unique examples from the original training set. Overall, this means that we report, egg., inef- ficiency as average over a total of 10 10 100 random training and test trials. As consequence, our evaluation protocol accounts for randomness at test time (i.e., regarding the calibration set) and at training time (i.e., regarding the training set, model initialization, etc.).
G IMPORTANCE OF RANDOM TRIALS
In Tab. C we highlight the importance of random training and test trials for evaluation. On the left, we show the impact of trials at test time, i.e., 10 random calibration/test splits, for a fixed model on MNIST. While the standard deviation of coverage is comparably small, usually S 0.2%, standard deviation of inefficiency is higher in relative terms. This makes sense as coverage is guaranteed, while inefficiency depends more strongly the sampled calibration set. The right table, in contrast, shows that training trials exhibit lower standard deviation terms of inefficiency. However, training with, e-g-, APS will mainly result in high inefficiency, on average, because of large standard devia- tion. In fact, ConfTr with APS or THR at training time results in worse inefficiency mainly because training is less stable. This supports the importance of running multiple training trials for ConfTr.
H IMPACT OF HYPER-PARAMETTE PARAMETERS
In Tab. D we conduct ablation for individual hyper-parameters of ConfTr with THRLP and without Lesss on MNIST. The hyper-parameter used in the main paper, cff. Tab. B are highlighted in bold. As outlined in Sec. pyper-parameter optimization was conducted on 100% training examples with only 3 random test trials, while Tab, shows results using random training and test trials. We found batch size and learning rate to be most impactful. While batch sizes 1000 and 500 both work, batch size 100 prevents ConfTr from converging properly. This might be due to the used a = 0.01 which might be too low for batch size 100 where only 50 examples are available for calibration during training. Without Lelnss. the size weight À merely scales the learning rate and, thus, has little to no impact. For ConfTr with Celass we generally found the size weight À to be more important for balancing classification loss L and size loss Ω in Eq. (4). Temperature has significant impact, although a temperature of 0.5 or 1 works best. Finally, the parame-rs do generalize to a lower confidence level 0.005. Significantly lower values, e.g., 0.001, are, however,
19

---

Published as a conference paper at ICLR 2022
Table E: Ablation for CoverTr and ConfTr on MNIST and Fashion-MNIST: We report ineffi ciency and accuracy for (Bellotti 2021) (Bel), CoverTr and ConfTr considering various CP methods for training and testing. Bel outperforms the baseline when using THRL, but does not do so for THR on MNIST. CoverTr with THR APS during training is challenging. resulting in high inefficiency (mainly due to large variation among training trials, c.f. Tab. C justifying our choice of THRLP for ConfTr. Also CoverTr is unable to improve over the THR baseline. Similar observations hold on Fashion-MNIST where, however, CoverTi with THR or APS was not possible.
MNIST: Ablation for CoverTr and ConfTr
Method
Baseline
Bel
CoverTr
ConfTr
Train
THRL
THR
APS
THRLP
THRLP
THRLP
+Lellss
Test
THRL
THR
APS
THRL
THR
THR
APS
THR
APS
THR
APS
THR
APS
Avg. Ineff
3.57
2.23
2.5
2.73
2.7
6.34
4.86
2.5
2.76
2.18
2.16
2.11
2.14
Avg. Acc
92.39
92.39
92.39
81.41
90.01
83.85
88.53
92.63
92.63
90.24
90.21
91.18
91.35
Mushion-MNISTE Ablation for CoverTr and ConfTr
Method Train
Baseline
Bel
CoverTr
ConfTr
THRL
THR
THRLP
THRLP
THRLP
+Lelsss
Test
THRL
THR
APS
THRL
THR
THR
THR
THR
APS
THR
APS
Ineff
2.52
2.05
2.36
1.83
1.9
4.03
2.69
1.69
1.82
1.67
1.73
Acc
89.16
89.16
89.16
84.29
84.61
89.23
87.48
88.86
87.43
89.23
88.69
not meaningful due to the batch size of 500. However, significantly higher confidence levels, e.g., 0.1 or a 0.05, require re-optimizing the other hyper-paraan parameters.
I COVERTR AND CONFTR ABLATION ON MNIST AND FASHION-MNIST
In Tab. E. we present an ablation for CoverTr, see Sec. and ConfTr on MNIST, using a linear model, and Fashion-MNIST, using 2-layer MLP. Bel generally able to improve inefficiency of THRL. Using THR, however, Bel worsens inefficiency on MNIST sigmificantly, while improving slightly over the baseline on Fashion-MNIST As result, the improvement of ConfTr over Bel also less significant on Fashion-MNIST. Using CoverTr with THR or APS during training works poorly. As described in Tab. C this mainly due to a high variation across training runs, ie., individual models might work well, but training is not stable enough to get consistent improvements. Thus, on MNIST, inefficiency for CoverTr with THR and APS is very high. Moreover, on Fashion- MNIST, we were unable to train CoverTrr with THR and APS. Using THRLP, training with CoverTr works and is reasonably stable, but does not improve over the baseline. It does improve over Bel on MNIST though. As described in the main paper, we suspect the fixed threshold to be problematic. Overall, however, only ConfTr is able to outperform the THR baseline on both datasets. Here, ConfTr with Lasss works slightly better than without.
J ALL INEFFICIENCY RESULTS
Tab. shows complementary results for ConiTr CIFARIO, EMNIST and CIFAR100. For results on MNIST and Pashion-MNIsT see Tab. D On CIFAR1O, we also include ConfTr using a 2-layer MLP top of ResNet features instead of the linear model used in the main paper. In Tab. F this is referred to as "extending". . However, inefficiency increases slightly compared to re-initializing and training just the (linear) logit layer. This shows that the smaller inefficiency improvements on CIFAR shown in the main paper are not due to the linear model used, but rather caused by the features themselves. We suspect that this is because the features are trained to optimize cross-entropy loss, leaving ConfTr less flexibility to optimize inefficiency. In Tab. G we consider three binary datasets, iee., WineQuality, GermanCredit and Camelyon. On binary datasets, THRL. THR and APS perform very similar. This already suggests that there is little room for inefficiency improvements. Indeed, ConfTr is not able to improve inefficiency significantly. However, this is partly due to our thorough evaluation scheme: On Camelyon (using 0.055, we do not report averages across all training trials, but the results corresponding to the best model. This is because sub-sampling the training examples is unreasonable given that there only 280 of them. Thus, Camelyon shows that ConfTr can improve inefficiency. On WineQuality or GermanCredit,, however, this is "hidden" in reporting averages across 10 training runs.
20

---

Published as conference paper at ICLR 2022
Table F: Inefficiency and Accuracy on Multiclass Datasets: Complementing Tab. | in the main paper, we include results for CoverTr on CIFARIO. Furthermore, consider training non-linear 2-layer MLP on the ResNet features on CIFARIO, cff. Sec. alongside the ensemble results from the main paper. We report inefficieney and accuracy in all cases, focusing ConfTr in comparison to Bel. On EMNIST, we additionally consider a = 0.005, 0.001 (for the baseline and ConfTr only). As in the main paper, ConfTr consistently improves inefficiency of THR and APS.
CIFARIO: Fine-Tuning and "Extending"
Fine-tuning
"Extend"
Method
Baselines
Bel
CoverTr
ConfTr
Conf
Train
THRL
THRLP
THRLP
THRLP
+Lolas
THRLP
+ +
Test
THRI.
THR
APS
THR
ThR
THR
APS
THR
APS
ThR
THR
Ineff Acc
3.92
2.93
3.3
2.93
2.84
2.88
3.05
2.84
2.93
2.89
2.96
82.6
82.6
82.6
82.18
82.36
82.32
82.34
82.4
82.4
82.3
82.23
CIFARI0: Ensemble Results
Ensemble +ConfTr
Method
(Ensemble Models)
Ensemblc+MI.P
Train
THRLP
Test
THRI.
THR
APS
THRL
THR
APS
THR
Avg. Ineff
4.19
3.48
3.12
2.4
2.77
2.35
Best Ineff
3.74
2.84
3.17
3.0
2.33
2.71
2.3
Avg. Acc
80.65
80.65
80.65
85.88
85.88
85.88
85.88
Best Acc
82.58
82.58
82.58
86.01
86.01
86.01
86.02
EMNIST
Method
Baselines
Bel
ConfTr
Train
THRL
THRL
THRLP
THRLP
+
Test
THRL
THR
APS
THRL
THR
THR
APS
THR
APS
Ineff
5.07
2.66
4.23
3.95
3.48
2.66
2.86
2.49
2.87
Ineff, 0.005
9.23
4.1
6.04
3.37
Inetf, a 0. 0.001
23.89
15.73
19.33
13.65
Acc
83.79
83.79
83.79
80.69
80.69
77.1
77.43
77.49
78.09
CIFARI00
Method Train
Baselines
Bel
ConfTr
THRL
THRLP
THRLP
+Lelis
Test
THRL
THR
APS
THR
THR
APS
THR
APS
Ineff
19.22
10.63
16.62
10.91
10.78
12.99
10.44
12.73
Acc
73.36
73.36
73.36
72.65
72.02
72.78
73.27
72.99
K EFFECT OF CONFTR ON COVERAGE CONFUSION
INEFFICIENCY AND
Fig. G shows that standard ConfTr (without Letass) does have significant influence on the class- conditional inefficiency distribution compared to the baseline. Similarly, ConfTr with Lelass and identity loss matrix L IK does not influence coverage confusion besides reducing overall inef- ficiency. Specifically, on MNIST, inefficiency distribution (left) as well as the coverage confusion matrices (middle and right) for the baseline and ConfTr. On the left, we consider ConfIr without Letass and on the right with Letss- As can be seen, only an overall reduction of inefficiency is visible, the distribution of Ineff y c.f. Eq. (6). across classes y remains roughly the same. For coverage confusion Σ from Eq. Z. the same observation can be made, i.e., an overall reduction of inefficiency also reduces confusion, but the spatial pattern remains the same. Thus, in the main paper and the following experiments, al- ways highlight the improvement over standard ConfTr, without Lass for reducing class classcconttiional inefficiency and with Letus for changing coverage confusion improving MisCover.
Mishion-MNISS and CIFARIO, we show the class-conditions
21

---

Published as a conference paper at ICLR 2022
Table G: Inefficiency and Accuracy on Binary Datasets. Experimental results on the binary datasets WineQuality, GermanCredit and Camelyon. While include APS on WineQuality, we focus on THR on GermanCredit and Camelyon due to slightly lower inefficiency. However, THRL, THR and APS perform very similarly on all tested binary datasets. Generally, ConfTr does not im- prove significantly over the baseline. On Camelyon, we report the best results without training trials as sub-sampling the 280 training examples prohibitively expensive.
WineQuality
Methad
Baselines
Bel
CoverTr
ConfTr
Train
THRL.
THRLP
THRLP
THRLP
+ +L
Test
THRL
THR
APS
THR
THR
THR
APS
THR
APS
Ineff, a= 0.01
1.76
1.76
1.79
1.77
1.81
1.75
1.82
1.74
1.77
Ineff, 0005
1.48
1.49
1.53
1.57
1.50
1.51
1.52
Acc
82.82
82.82
82.82
71.3
81.5
73.8
74.24
73.91
73.91
GermanCredit
Method Train
Basclines
Bel
ConfTr
THRL
THRLP C
Test
THRL
THR
APS
THR
THR
THR
Ineff
1.89
1.86
1.90
1.85
1.88
1.77
Acc
74.4
74.4
74.4
72.35
72.81
69.5
Camelyon * 000.55
Method
Baselines
Bel
ConfTr
Train
THRR.
THRLP +Lolss
Test
THRL
THR
APS
THR
THR
THR
Best Ineff
1.41
1.47
1.59
1.25
1.2
1.25
Best Ace
88
88
88
92
91.5
85
L SHAPING CLASS-CONDITIONN INEFFICIENCY ON OTHER DATASETS
Fig. A and B provide complementary results demonstrating the ability of ConfTr to shape the class- or condppccnni inefficiency distribution. First, Fig. plots inefficiency for individual classes on CIFARIO and coarse classes on CIFAR100. In both cases, significant inefficiency reductions possible for high weights w in Eq. 3 irrespective or whether the corresponding (coarse) class has above-average inefficiency to begin with. This means that inefficiency reduction is possible for easier and harder classes alike. Second, Fig. plots the relative inefficiency changes, in percentage, possible per-class or group on MNIST, Mashion-MNIST and CIFAR 100. For CIFARION 100, we show only the first 10 classes for brevity. In all cases, significant inefficiency reductions are possible, the expense of slight increases in average inefficiency across all classes, Here, MNIST is considerably
CI Reducing Ineff of Class
CIFARL0: Reducing lnoff Class
CIFAR190: Reducing Ireft Group
CIARIEE: Reducing lnatt of Group 15
Chiss Avg. noft
leaff Chuss
Aug. neff
Figure A: Reducing Class- and Weight Class
Sixc Class
Sio Meegett Group
Wespa dronp
Inefficiency on CIFAR. Results, complemen- tary to Fig. 3 showing the impact of higher size weights w in Eq. 3 for classes and ("airplane" and "cat") CIFARI0 and coarse classes 9 and 15 ("large man-made outdoor things" and "rep- tiles") on CIFARIO0 100. ConfTr allows to reduce inefficiency (blue) in all cases, irrespective of whether inefficiency is generally above or below average (green).
NReST ineff improvement by class
MNIST: Ineff Reduction by Group
CIPARO00 improvement by Cluzs
Figure B: Relative Class and Group-Conditiona. Inefficiency Improvements: Complementing the main paper, we plot the possible (relative) inefficiency reduction by class or group ("odd" vs "even") on MNIST and Fashion-MNIST. On CIFAR100, we consider the first 10 classes for brevity. In all cases, significant per-class or -group inefficiency reductions are possible.
22

---

Published as a conference paper at ICLR 2022
Figure C: Full Coverage Confusion
Matrix on CIFARIO: We plot the
full coverage confusion matrices E from Eq. 7 on CIFARIO for the
12
ConfTr baseline (with Colass, left) and
ConfTr with Ly = 1 in Eq. (5) for
classes y, k {4, 5, 77 (right, high-
lighted in red).
6:4
Faalfor MELITT Reduaing Car Cordaston Clsciftar
CIARIE
Cauchen
CIFARIO P.NNIST
4.6
4.07
4.72
4.25
4.21
4.10
1:44
3:10
$4
4:00
3.49
3.50
3.40
1.33
2.87
2.02
3.5
5:31
5.82
5.81
5.80
5.61
6.30
53
9:24
8:26
8:20
8.13
7.77
7.56
5.01
0.05
5.3
0.5
Diagennl Weight
Figure D: Coverage Confusion Changes Fashion-MNIST and CIFARIO: Left: coverage con- fusion change when targeting classes 4 and 6 ("coat" and "shirt") on Fashion-MNIST and 3 and 5 ("cat" and "dog") on CIFARIO. The separate cell on the left is the ConfTr baseline which is, up to slight variations, close to L = O. Middle and right: coverage confusion for a whole row, ie., Eyg. with fixed class y and all k * y. We show row 6 on FashIon-MNIST and 3 on CIFAR1O. In both cases, coverage confusion can be reduced significantly.
easier than MNNITT higher inefficiency reductions are possible per class and the cost in terms of average inefficiency increase is smaller. On CIFAR 100, inefficiency reductions of 40% or more are possible. This is likely because of the high number of classes, i.e., ConfTr has a lot of flexibility to find suitable trade-offs during training.
M MANIPULATING COVERAGE CONFUSION ON OTHER DATASETS
Fig. Coo E provide additional results for reducing coverage confusion using ConfTr. First, in Fig. C we show the full coverage confusion matrices for the ConfTr baseline (with Celass left) and ConfTr with Ly,,
1, y j k (4,5, 7} (right, marked in red) on CIFARIO. This allows to get the complete picture of how coverage confusion changes and the involved trade-offs. As demonstrated in the main paper, coverage confusion for, e.g.. classes 4 and ("deer" and "dog") reduces. However, coverage confusion for other class pairs might increase slightly. Then, supplementary to Fig. 4 in the main paper, we provide the actual numbers in Fig. D particular, we visualize how the actual coverage confusion entries (left) or rows (right) change depending on the off-diagonal weights Ly.k- Finally, Fig. D presents additional results on MNIST and CIFAR 10. From these examples it can be seen that reducing coverage confusion is easier on MNIST, reducing linearly with the corresponding penalty Ly.k- Moreover, the achieved reductions are more significant. On CIFARIO 10, in contrast, coverage confusion reduces very quickly for small Ly.k before stagnating for larger Ly,k- At the same time, not all targeted class pairs might yield significant coverage confusion reductions.
MRaS Reducing Cav Confusias 6:34
MMIST: Reducing Confusion Class
CIRAR10: Reducing Confusion 6-5-7
ORARIE: Reducing Cov Confudion Class
Crtlatt Crange
6.
6.5
3.3
CA 0.5
3.4 65
Figure E: Coverage Confusion Reduction on MNIST and CIFAR10: Controlling coverage con- fusion for various class pairs. On MNIST, coverage confusion reduction is usually more significant and the reduction scales roughly linear with the weight Ly,k- On CIFAR10, in contrast, coverage confusion cannot always be reduced for multiple class pairs at the same time (see light gray).
23

---

Published as a conference paper at ICLR 2022
Table H: Mis-Coverage on MNIST, Fashion-MNIST and CIFARIO: We present inefficiency and mis-coverage for various cases: On MNIST, we consider 2 vs. other classes as well as even vs. odd classes. In both cases, mis-coverage can be reduced significantly. As in the main paper, however, reducing M usually increases MisCover and vice-versa. On Fashion-MNIST,, we consider 6 ("shirt") vs. other classes. Only on CIFARIO, considering "vehicles" vs. "animals", mis- coverage cannot be reduced significantly. In particular, we were unable to reduce MisCover
Kg 2 vs. K
Others
Ko= Even vs. K Odd
MNIST
MisCover
L
MNIST
MisCover $
Method
Ineff
0->1
1-:0
Method
Ineff
0->1
1-00
ConfTr
2.11
49.68
14.74
ConfTr
2.11
38.84
38.69
K
2.15
36.63
17.42
LKn.K1
2.16
29.36
49.08
Kg
2.09
51.54
7.62
Kg =1
2.09
44.3
26.08
Ko= 6 ("shirt") vs. =1= Others
Kg= "vchicles" vs. K₁ = "animals"
F-MNIST
MisCover
CIFARTO
MisCover +
Method
Ineff 0->1
1->
Method
Ineff
0-+1
1->0
ConfTr
1.67 80.28
20.93
ConfTr
2.84
22.22
16.45
1.70 72.58
25.81
LKg,K,
2.92
20.00
22.69
Ko =1
1.72 81.18
17.66
Lo
2.87
24.76
16.73
N MISCOVER RESULTS ON ADDITIONAL DATASETS
Tab. H provides mis-coverage results for different settings on MNIST, Fashion-MNIST and CI- FARTO As in the main paper, we are able to reduce mis-coverage significantly on MNIST and Fashion-MNIST. Only on CIFARIO, considering "vehicles" vs. "animals" as on CIFARI00 in the main paper, we are unable to obtain significant reductions. While, we are able to reduce MisCovero-11 slightly from 22.22% 20%. MisCover increases slightly from 16.45% to 16.73% even for high off- off-diagonal weights used in L. Compared to CIFARI00, this might be due to less flexibility to find suitable trade-offs as CIFARIO has only 10 classes. Moreover, mis-coverages on CIFARIO are rather small to begin with, indicating that vehicles and animals do not overlap much by default.
O ADDITIONAL RESULTS ON BINARY DATASETS
Fig. F shows results complementing Fig. 5 (right) in the main paper. Specifically, we show that reducing inefficiency for class 1 ("good wine") is unfortunately not possible. This might also be due to the fact that class 1 is the majority class, with ~63% of examples. However, in addition to improving coverage conditioned on class O, we are able to reduce coverage confusion Σg, cf- Sec. 3.3 We found that these results generalize to German Credi,, however. being less pronounced, presumably because of significantly fewer training and calibration examples.
Wiseluuttt::: Reducing tseff of Class
Con Contandee
Class Meight 235
CN Contander
CoN Conthalinn Class Miright 6.90
Size Weight Clsso
WineOuality: Reducing teeff Class
Weigstt BLOG
Wengont
2.
Sze Cless
Figure F: Manipulating Inefficiency and Coverage Confusion on WineQuality: Complementing Fig. (right) in the main paper, we plot the possible inefficiency reduction for class ("good wine". left) and full coverage confusion matrices for increased To,0 > and I > 0 (right, top and bottom, respectively). While we can reduce inefficiency for class 0 ("bad wine"), this is not possible for class 1. However, cans-conniiional coverage for class can be improved significantly and we can reduce coverage confusion Σa,1.
24

---

Published as a conference paper at ICLR 2022
P PSEUDO CODE
Alg. presents code in Python, using Jax (Bradbury et al. 2018). Haiku (Hennigan et al. 2020)
and Optax (Hessel al. 2020). We assume access smooth sorting routine that allows to compute quantiles in a differentiable way: smooth_quant ile. Specifically, Alg. B provides an exemplary implementation of ConfTr with (smooth) THR and Leasss as outlined Alg. in the main paper. smooth srrooth_predictt httpppeeeeeeeshheeeeeeeee threshold and ammoth__cliibeee www.aaaateetereeeeeeeeaeeeeeeeee thresho d implement differentiable prediction and calibration steps for THR. These implementations are used in compute_loss loss__nd_erroo to "simulate" CP mini-batches during train- ing. Size loss from Eq. (3) and classification loss from Eq. (5) are implemented in compute_stt Sempute_size_los__ _oss and definition compute_lost saartte___ss_aaare __an__errorr____ fixed _arad_aaams,, allowing fine-tune pre-trained model.
Note that the eerror distinguishes between trainable params and
25

---

Published as a conference paper at ICLR 2022
MNIST: Taseline+Thr
VINITI Covertoy Contusion Nabric Repeline
NINISTI
Portre Condity
Inafficancyy 6
$00
2
63P
3:4
050
0M1
5541
DAX
5:12
1:24
1.50
Class
2:0
A/Y
1.2
MNIST: Tonf
CCB
OUT
L2L
8:30
Inernccncy
643
L12
344
1:D
C27
+
Class
85
PrefctedCoom
F-MNIST: Taseline+Thr
P-MMEST: Coverage Contusten Hatrix Sumelliee
Inefficleccy
G47
0.52
2-B
LVD
The
C82
0.20
5:2
042
SC.2P
F-MNIST: ConfTr+
322
0:21
Ineftclancy
2
510
125
27
0.1
1:13
0.65
372
SJR
CAU
S:N
0:00
Class
Ped Clas
CIFAR10: Baseline+Thi Thr
CIFAR36: Contuaton Matric Susnliie The
CIPAA Caveriage Confustos Natria for Contiiie
Inefiiiency
LST
Loi
2.21
651
415
J41
0:
PGB
4:41
200
1/1
TL Oue
Class
CIFARIO: ConfTr+Thr
CB2
C:4
040
2:13
Ineftiiency
2:7
4:49
9:00
1:2
1:
1.2
3411
3.5
1:09
AMN
0.50
6.0
4
8
Class
Figure G: Class Cansiiondiiio Inefficiency and Coverage Confusion: Comparison between base- line and ConfTr regarding class-conditional inefficiency and coverage confusion E, c.f. See. 3.3 For the inefficiency comparison, we consider ConfTr without Letass, while for coverage confusion, Con- fTr was trained with Lesss- As ConfTr reduces overall inefficiency quite significantly on MNIST and Fashion-MNIST, class-conditional inefficiency is also lower, average. But the distribution across classes remains similar. The same holds for coverage confusion, where lower overall inefficiency reduces confusion across the matrix, but the "pattern" remains roughly the same. On 10, ConfTr does not improve average inefficiency significantly, such that the confusion matrix remains mostly the same.
26

---

Published as a conference paper at ICLR 2022
Algorithm B Python Pseudo-Code for ConfTr: implementation of ConfTr. In particular, include smooth calibration and prediction steps for THR as well as the classification loss Lelss and the size loss Ω. Instead of including a full train- ing loop, compute_loss using jax. value_ande _ad___a_nddraddde for training using Optax. Hyper-parameters, including alpha, dispersion, size_we weweweiiieeeeee ght, remperature loss_mt Loss_matrix
We present code based on our Python and Jax
error shows how to compute the loss which then be called
has_aux (e__aux-Truee and used
size_weights and weight_dees are not defined ex- quant ile is assumed to be provided differentiable quantile com- putation method. Finally, model can be any Jax/Haiku model.
plicitly for brevity. smooth, smooth_quant
import jax import jax.mumpt as jap import haiku
amooth arredict_ttrrshhale
rtobabilltiess ndarray,, taus float, temperature: float) jnp.ndazray: Snoomo implementation prediction step for Thr, jax.nn.signaan sigmoid! (probabilities tau) temperature)
11
probabilities: jap. ndarsey,, labels: jng.ndarray,
12
alpha: float, disperston: float) -> float:
13
*** S"ooth implementation of the calibration step for The, ane
14
conformity_scoree prchabilisies
(pc (jap..raageee (probabilities (hobabbliiiessshpp[[0 [0]), Labels.estyre (int))
return mmoth_guantileearssy. dispersion,
1./arrey shapee alpha)
16
18
confidence_ede sats: jap. rdaardy sabels: inp.ndarray, jose_matrix: jnp.ndarray) jnp.ndarray:
19
20
""*Comuute the elassification loss Iclass the given confidence sets. *e*
21
one cne_hot_labels jax. no..nn.ooe one__hot flabeis, confidence_sets, shatseh confidenca_setteeee
one_hot_labeiz "osa_ [as_matrix[labaa confidence_ss seancesstaa__a (1 hot_hhoo_aaallaa
coc__matrix(Labele
23
jmp. cum ttnp.comiing..mmmmmmmnn. maximum return jap.mean (less)
jmp. zeros_ axis=1)
25
26
27 def compute_size sareutt___ii______ (
28 confidence_sstte jup.nderray, target_size: int, weights: jap.ndarray. +> jap.ndarray: loas. ***
""*ooppute
(jp.maxiinnnjjeeaumoooo return mep.mean(weighh 30
(1n9. httbbeammmtottideeeeesttttt axla=1) target_size, 0)1
32 Fl PlatMapping Union [nkon|ik.h] Params, hk.State]
[hk,
33 def tcainabie_parems: #latXapping, fixeć_params: FlatNapping, inputs: inp.ndarray, labels: jap. indrrry,, podel_statas FlatMopping, training: bool, rngt inp.ndarray,
34
35
36 Tople(jnp. Iddaarraa,,,,,,,, FlatMapping]:
37
***compute ciasslfication and size loss through felibration/pceddittte
parans dtttaasttructures.ooo (reingetrainbiee_parre 39 # Model Halke model,
parems)
Restlet or MLP.
40
logits, new_model state appll (pecams, model_state, eng, inputs, training-tzaining) probabilities
www.mn..osttaxxxeeeeeee axis=l)
42
val_split (0.5 probabilitiea
44
vel val_probabilities
val_iabels [
46
Lest_preoabilllies probabilities [val_eee______pii
47
test_labeis labels Calibrate [abels(val_split:! colibration prohabilities with ground truth labels:
48
val val_tas smooth_oa 49
prwpaoodddil_ppaaaliiaaaaat ities, val_labels, alpha, disperator)
51
# Predict on the test probabilities:
52
test_con _tt.coiiiedne_eetsaasoos
val_tau, sng)
53
# Compute the classification loss Leless with fixed loss matrix b: classification_loss
54
imputt_gmmsri__claiifi
test
labela, lass_matrixi
56 a Optionnally aec size weights determined by ground truth labels:
weights eize_weights[tes
58 + Compute size loss muitiplied by size weight:
size_lost loss size size_weiigt ccmpate_size_lont lconfidence_sette weights)
61 t Camputo the log of classification and size loss:
loas Inp. iclatcaat asai ceaification lostoo sizee_los
63 loss 1- weight_decay sumi jop. sum (jnp. aquaze (parami) for pazam in serecceeeeleeeee (parama))
65
return loss, staee
27


Reviews:
[{"review_id": "mC0FnGcs4F", "reviewer": "Reviewer_8BvY", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Strengths\n\n1. The proposed method addresses an important problem and the associated technical area has seen a surge in publications including a workshop at ICML 2021.\n\n2. The proposed method combines several novel elements and appears to be theoretically sound.\n\n3. The proposed method is shown to outperform a competing method by Belloti in terms of the inefficiency measure (for the same coverage guarantee) on 5 public multi-class datasets (including CIFAR100) and a binary dataset (wineQuality).\nThe authors attribute this to the fact that Belloti's method does not incorporate the calibration step within the overall training process.\n\n4. The authors convincingly demonstrate how the size loss term's weight can control the class-conditional inefficiency in Fig. 3 and how the \"configurable\" classification loss can control coverage confusion and mis-coverage in Fig. 5\n\n5. The thorough appendices cover important aspects as impact of hyperparameters, random trials, python source, etc.\n\nWeaknesses\n\nThe weaknesses are relatively minor and mainly related to clarity or typos:\n\n1.  In Table 1, the authors report additional inefficiency improvements over ConfTR with the configurable L_{class}, but they don't seem to provide the configuration parameters for L_{class}.\n\n2. In the text below Table 1, the authors mention: \"we found that Bel or ConfTr do not necessarily recover the accuracy of the baseline\". It would be nice if the authors report the actual accuracies in a table (with the specified value of \\alpha) and also define exactly how the accuracy given a predictive set was computed (presumably only singleton sets could count towards accurate predictions).\n\n3. Mis-spelling: \"CIRFAR10\" in Table 2\n\n4. Grammar / wording in a sentence in Sec. 4.2 can be improved: ... the more difficult class 3 (“cat”) obtains higher inefficiency than to the easier class ...\n", "summary_of_the_paper": "Conformal prediction methods generally operate via post-processing on black-box classifiers to produce a confidence set. In this paper, the authors integrate this post-processing step into the training procedure in order to reduce the inefficiency of conformal prediction while providing the same coverage guarantee.\nThe proposed method uses soft thresholding and differentiable sorting to convert two popular conformal post-processing method classess (THR - Sadinle et al. and APS - Romano et al.) into differentiable modules, although they only use THRLP (the method from Sadinle et al. applied to log-probabilities) in the training process for the results (in Table 1).  Additionally, they propose the use of weighted inefficiency regularization (also termed the size loss) and a \"configurable\" classification loss that can yield desirable behavior w.r.t. class-conditional inefficiency and mis-coverage (or coverage confusion) respectively. \nThe proposed method is shown to outperform a competing method by Belloti on 5 public multi-class datasets (including CIFAR100) and a binary dataset (wineQuality).", "summary_of_the_review": "The authors propose a novel, impactful and theoretically sound method for conformal training and convincingly demonstrate its efficacy.\nThis reviewer has some minor concerns regarding clarity that can be readily addressed. Therefore, I recommend acceptance.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "HD9GrnaZmjK", "reviewer": "Reviewer_1Awq", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "**Strong points:**\n* The idea of putting conformal inference into the neural network training loop is interesting.\n* The goal of reducing confidence set size is important.\n\n**Weak points:**\n* The improvements (e.g., in Tables 1,2) seem somewhat minor to me.  Am I missing something?\n* It's actually not totally clear to me that you get coverage at the nominal level -- can you justify that?\n* I don't really see what the proposal here offers over Bates et al. (2021) -- can you explain?\n* I found the paper somewhat hard to read -- I think things could have been explained a bit better in places.  But also notation was often used without defining it first, and some non-standard terminology was used.\n\n**Questions:** see my \"Weak points\" and \"Additional feedback\" sections.\n\n**Additional feedback:**\n* How do the results change as you vary the mini-batch size?\n* Eq 3 -- I think you forgot to put $|\\cdot|$ around the confidence sets inside the max?\n* You appear to use $E_\\theta$ before defining it.", "summary_of_the_paper": "**Summary:**\n* The paper considers putting conformal inference into the process of fitting deep neural networks, i.e., the paper considers \"differentiable conformal prediction\" / back-prop'ing through conformal inference.\n* The goal is to reduce the size of the prediction sets generated by conformal inference -- and more specifically to reduce the size variably in different parts of the input space.\n* Some experiments are given to show that the confidence set sizes are indeed smaller w/ the proposal than w/o it.\n", "summary_of_the_review": "**Recommendation:** reject.  I have some questions about the novelty of the empirical results and the methodology.  Happy to change my mind if I missed something.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "Fd1Id_DeEx", "reviewer": "Reviewer_uxwS", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "I think the paper intent is very interesting, as it would clearly be interesting to learn optimal conformal predictors rather than plugging them in once the model is learned, possibly using a loss function not entirely correlated to the purpose of providing set-valued calibrated predictions. \n\nI cannot say that I was able to fully follow the development of the proposed method, as it is densely presented in 2 pages. I would have appreciated some more elaborated examples or illustration of how the derived loss function and subsequent techniques approximate the whole conformal prediction framework, but even the (many) appendices did not provide additional intuition for the less expert read, and focused mostly on providing additional experimental results. In terms of accessibility to a larger audience, this is clearly a weakness that could be resolved by being more pedagogical (possibly in the appendices). \n\nThis said, I still have a couple of questions about the developed method:\n\n* A first one is that it is claimed that the proposed approach retains the conformal guarantees. However, I am not sure I fully understand why this should be the case theoretically, as what is used in the paper are differentiable approximations of the classical approaches. If those are approximations, why should those retain the same theoretical properties of calibration as the initial procedure? What guarantees, theoretically, that we will not be too far from the calibrated results? If there is no such guarantees, then at least some empirical calibration lines (in the appendices?) should be provided to see if indeed validity is still reasonably preserved. \n\n* A second one is that it is often claimed in the paper that conformal prediction is unable to handle class-wise issues, which is partially untrue  as such problems can be handled, for instance, by using so-called Mondrian conformal predictors over various categories, that can be user-defined and is typically used to have class-wise conformal guarantees. Could it be explained how the presented framework would handle such an issue? Indeed, most of the discussion about application-specific losses focus on efficiency and the shape of the conformal prediction sets, but not how one could control class-wise errors (the task that Mondrian predictors can handle quite well)\n\n* While I think that the proposal to better control the shape of the predicted set is actually quite interesting, I would be interested in having a more detailed argument about why this would preserve conformal guarantees (in the same way that lossless formulation would)? I am also missing a more critical discussion about the risks of privileging higher accuracy on some instances over a lower accuracy on some potentially critical instances? Classical marginal conformal predictors are known to have such undesirable effects, but it is unclear to me whether the proposed formulation can control in any sense this kind of behaviour? Would not an increased efficiency for a class/case lead to a lower accuracy for this class, possibly counter-balanced by a higher accuracy for the class for which we allow the learning method to be more uncertain about? I believe this would at least deserve a refined calibration/validity study along with the analysis of result efficiency. \n\n* Small comment: In the abstract and beginning of introduction, I would not especially refer to posterior probability estimates, as conformal predictions merely need score-valued predictors (whether those are brought back to the interval [0,1] by a softmax or another transformation does not matter much). I would also avoid talking about Bayes decision rule being the most probable class, as this is only true if one consider a zero/one loss? ", "summary_of_the_paper": "Conformal prediction is a method that intends to provide set-valued, calibrated prediction, in the sense that they cover the true class with a guaranteed marginal statistical accuracy. The paper mainly proposes to learn the conformal predictor at the same time as the predictive model is used, through an end-to-end procedure.\n\nTo this effect, conformity scores and threshold values (using quantiles) are approximated by differentiable surrogates that are directly injected into the learning framework. It is also argued that the framework can offer some solutions to better control class-wise predictions, or class-wise constraints on the conformal sets. ", "summary_of_the_review": "The paper proposes a differentiable scheme to learn conformal predictors. This is clearly an interesting approach that could lead to improve conformal predictors, which are gaining increased attention in ML (but existing as a consolidated approach since about 15 years). The technical part of the paper is densely presented, making it difficult to really follow. It is also unclear to which extent the validity guarantees coming with plug-in conformal approaches are actually preserved. However, although no theoretical guarantee of that is fully discussed, the differentiable approximation seems close enough to preserve at least a reasonable empirical validity. The additional loss-based formulation and its various adaptations look quite interesting, but it is here even less obvious what are their relation to class-wise conformal methods (i.e., Mondrian ones), and what are the impacts of choosing different losses over validities (particularly class-wise ones). ", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "2H6832n95aZ", "reviewer": "Reviewer_iXzv", "summary": "", "questions": "", "limitations": "", "rating": 8, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "## Strengths\n\nThe paper builds a convincing case for the proposed method by calling attention to the mismatch of goals in traditional training procedures and conformal prediction. Once one accepts this motivation, the proposed method appears quite reasonable. The experiments appear to be quite thorough. The extension to other structure-inducing losses is interesting, although its actual deployment may warrant caution.\n\n## Weaknesses\n\nI found no significant weaknesses in my initial assessment.\n\nA few questions for consideration are as follows:\n\n1. How large should the size of each mini-batch be? This probably depends on $\\alpha$, but are there other things that should be taken into account? Also, I feel like Section G ought to appear in the paper.\n\n2. In **Conformal Predictors for Training**, it is reported that \"Bel or ConfTr do not necessarily recover the accuracy of the baseline. When training from scratch, accuracy can be 2--6% lower while still *reducing* inefficiency.\" Here, I understand \"accuracy\" to mean the accuracy of marginal coverage. In that case, why is there any loss of accuracy at all when all methods are calibrated on a separate held-out set?\n\n## Typos\n- (p. 3) on test example -> on a test example\n- (p. 6) Put parentheses around \"see Tab. 1 for the main results\"\n- (p. 9. The last line) loose -> lose\n- (p. 10. The 2nd paragraph) loosing -> losing\n- (p. 14. Section B) Remove the parentheses around \"Vovk, 2021; Barber et al., 2019b\"\n- (p. 17. Table B) Batch Size and Learning Rate switched in the row corresponding to \"Camelyon, ConfTr+$\\mathcal{L}_{\\text{class}}$\"", "summary_of_the_paper": "In split conformal prediction, conformalization is applied using a model that has been trained on a separate training set. However, the training procedure usually optimizes an objective that has little to do with the ultimate goal of producing informative prediction sets. For the problem of classification, the paper proposes an alternative training procedure that simulates conformalization on mini-batches so that the learned model is directly optimized to produce smaller prediction sets. In addition, the proposed alternative training procedure can accommodate other loss functions, which can induce certain structures in the prediction sets. The performance gains are demonstrated through experiments.", "summary_of_the_review": "This is a well-argued paper backed up by extensive experimental results. To my knowledge, the method represents a novel contribution. I would recommend it for acceptance.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "4: All of the claims and statements are well-supported and correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "Not applicable"}, "extra_text": {}}]

Author rebuttal:

Meta-review: In this paper, a new learning scheme for minimizing the confidence set by conformal prediction is proposed. Most of the reviewers agree that the idea is interesting and novel. This is an important contribution to trustworthy ML, with theoretically sound considerations and thorough experimental validation.
Decision: Accept (Spotlight)