Practical Adversarial Multivalid Conformal Prediction
Abstract
We give a simple, generic conformal prediction method for sequential prediction that achieves target empirical coverage guarantees on adversarial data.
It is computationally lightweight — comparable to split conformal prediction — but does not require having a held-out validation set, and so all data can be used for training models from which to derive a conformal score.
Furthermore, it gives stronger than marginal coverage guarantees in two ways.
First, it gives threshold calibrated prediction sets that have correct empirical coverage even conditional on the threshold used to form the prediction set from the conformal score.
Second, the user can specify an arbitrary collection of subsets of the feature space — possibly intersecting — and the coverage guarantees will also hold conditional on membership in each of these subsets.
We call our algorithm MVP , short for MultiValid Prediction.
We give both theory and an extensive set of empirical evaluations.
Introduction
Consider the problem of predicting labels y ∈ Y given examples x ∈ X .
One popular strategy for expressing uncertainty is to allow the algorithm to produce a prediction
set T ⊆ Y rather than an individual label.
We give a simple, practical algorithm for constructing prediction sets in sequential prediction problems over an arbitrary domain X ×Y , given any data-dependent sequence of conformal score functions s t : X × Y → R ≥ 0 .
In each round t , an example represented by a feature vector x t ∈ X arrives.
We can define an arbitrary conformal score s t : X × Y → R ≥ 0 that can depend on previously observed examples (as well as on f ) in arbitrary ways.
We produce a round-dependent threshold q t which gives us a prediction set T t = { y ∈ Y :
s t ( x t , y ) ≤ q t } .
We then observe the true label y t ; we say our prediction set covers y t if y t ∈ S t .
Given a coverage target 1 − δ , our goal is to produce sets that have correct empirical coverage — i.e. that cover a 1 − δ fraction of the labels (we do not want either over-coverage or under-coverage).
We wish to make as few assumptions as possible, so that our method is robust to arbitrary and unanticipated distribution shift, and applies to e.g. time series data which are very far from exchangeable.
We also want our coverage guarantees to be meaningful not just marginally, but at finer granularities: conditional on both the threshold value we choose, and on membership of x t ∈ G for a set of groups G ∈ G ⊆ 2 X that can be arbitrarily defined and intersecting.
Finally, we want our algorithm to have low computational overhead, so that it can be applied as a wrapper on top of arbitrary prediction methods, for both regression and classification.
The algorithm we propose achieves these goals and has several desirable properties:
Worst-Case Empirical Coverage:
Our method has worst case adversarial guarantees.
The sequence of examples { ( x t , y t ) } T t =1 needs not be drawn from an exchangeable distribution as it does for standard conformal prediction methods [Shafer and Vovk, 2008] — instead, it can be chosen by an adaptive adversary.
The conformal scores s t can be arbitrary and can depend on data from previous rounds (e.g. they can be derived from models trained on all past data, and so there is no need to separate data into training and calibration sets as in split conformal prediction [Lei et al., 2018]).
Thus, our method can tolerate time series data, and arbitrary and unanticipated distribution shifts.
Calibrated, Multivalid Coverage:
Our prediction sets obtain their target empirical coverage level not just marginally, but in a threshold-calibrated fashion: for every threshold q , they approach 1 − δ coverage on the subsequence of rounds t on which the threshold q t = q 2 .
We also promise group-conditional coverage.
We can specify an arbitrary collection of groups G , each group G ∈ G representing an arbitrary feature-space subset: G ⊆ X .
These groups can intersect in arbitrary ways.
For example, G can be a collection of demographic groups based on race, age, income, or medical history, and each data point x ∈ X could represent a member of an arbitrary subset of these groups.
Our method promises that simultaneously for every group G ∈ G , on the subsequence of rounds t for which x t ∈ G , our intervals obtain the target empirical coverage rate (again, in a calibrated fashion).
Computationally Lightweight: Our method is computationally lightweight.
At each round t , it relies on simple arithmetic calculations involving the historical empirical coverage rates of finitely many candidate thresholds q t on groups G such that x t ∈ G .
Hence it is comparable in cost to fast split conformal prediction methods
[Lei et al., 2018] despite its ability to use all data for model training.
We give an implementation of our algorithm and an extensive empirical evaluation.
By contrast, prior work by Gupta et al.
[2022] that gets comparable theoretical guarantees (in the special case of regression prediction intervals) does not give a practical algorithm: their approach uses the
Ellipsoid method with a separation oracle to solve exponentially-sized linear programs at all rounds.
Nearly Statistically Optimal Rates:
For each threshold q and group G , we promise 1 − δ empirical coverage over the rounds t where x t ∈ G and the predicted threshold q t
= q .
Let n G,q denote the total number of such rounds.
Even if the labels y t were drawn from a known distribution and our coverage probability was exactly 1 − δ , we would expect our empirical coverage on these n G,q rounds to deviate from 1 − δ by a ± 1 / √ n G,q term.
The prior theoretical coverage guarantees for each q and G of Gupta et al.
[2022] differ from their target by ˜ O ( √ T/n G,q ) , which is nearly optimal if n G,q ≥ Ω( T ) but sub-optimal otherwise.
Our algorithm promises empirical coverage rates for each pair ( G, q ) that differ from the target by an optimal ˜ O
(1 / √ n G,q ) term.
We give an extensive experimental evaluation of our algorithm in a number of settings, and compare to vanilla split conformal prediction [Lei et al., 2018], as well as prior work that handles limited forms of known distribution shift [Tibshirani et al., 2019], produces conservative groupwise coverage [Foygel Barber et al., 2020], and gives adversarial (but uncalibrated) coverage guarantees [Gibbs and
Candes, 2021].
In each setting, we show that our algorithm is competitive with previous work “on their turf” (i.e. in settings for which their assumptions are satisfied and we use their evaluation metrics).
We then go on to show that our method gives substantial improvements when either the setting or the evaluation metric becomes more difficult — e.g. when the distribution shift is unanticipated, when we measure group-wise rather than just marginal coverage, or when the data comes in adversarial ordering.
In some cases we improve on standard techniques even in standard “benign” settings: for example, we improve on split conformal prediction in an online linear regression setting with iid. data when the evaluation metric is just marginal coverage, but the regression function has to be learned from the same stream of data used to calibrate the prediction intervals.
This is because split conformal prediction requires using separate splits of the data for training the regression and calibrating the prediction intervals to maintain exchangeability of the conformal scores — but we are able to use all of the data for both tasks.
do, rather than for threshold-calibrated prediction sets, one could obtain the right coverage rate by “cheating” in the following uninformative way: predict the full label set S t
=
Y on a 1 − δ fraction of rounds (guaranteeing coverage), and the empty set S t = ∅ on the remaining δ fraction of rounds (guaranteeing miscoverage of the label).
This obtains empirical coverage rate 1 − δ ±
O (1 /T ) marginally, but not conditional on the prediction sets chosen.
1.1 Additional Related Work
See Angelopoulos and Bates [2021] for an excellent recent survey of conformal prediction methods.
The weaknesses of these methods that we seek to address — namely, that in the worst case they provide only marginal coverage, and that they rely on strong distributional assumptions (typically exchangeability ) — have been noted before.
For example, Romano et al.
[2020a] note that marginal coverage guarantees are undesirable and give group conditional guarantees for disjoint groups by calibrating separately on each group.
This fails when the groups can intersect.
Foygel Barber et al.
[2020] provide guarantees that are valid conditional on membership in intersecting subgroups
G .
They take a conservative approach, by computing prediction sets separately for each group and then taking the union of all these sets over the groups of a new individual.
As a result, their prediction sets are conservative and do not approach the target coverage level.
These results both require exchangeable data.
Chernozhukov et al.
[2018] obtain approximate marginal coverage guarantees for non-exchangeable time series data coming from a rapidly mixing process.
Gendler et al.
[2021] study conformal prediction for adversarially perturbed data: they assume that the dataset is drawn exchangeably, but the test examples additionally have their features perturbed by small-norm adversarial noise.
Their techniques are different from ours, and leverage the fact that the underlying distribution (except for the perturbations) is exchangeable, which we do not require.
Tibshirani et al.
[2019] study conformal prediction under covariate shift .
They adapt conformal techniques to handle the case when both the point of distribution shift and the likelihood ratio between the training and test distribution are known.
Gibbs and Candes [2021] give a method that can guarantee target marginal coverage without any assumptions on the data generating process.
In contrast, our prediction sets promise not just marginal coverage, but are “threshold-calibrated” and hold also conditional on membership in arbitrary sub-groups.
Further notions of conditional coverage different from ours have been studied before in the batch setting, for instance training-, object-, and label- conditional guarantees; see e.g. Vovk [2012], Bian and Barber [2022] for details.
Following a recent resurgence in interest in conformal techniques, a number of papers have proposed conformal scores that have desirable properties [Hoff, 2021, Romano et al., 2019, Angelopoulos et al., 2020, Romano et al., 2020b, Park et al., 2019].
Our work is complementary to this line of work: just like traditional methods of conformal prediction, we too take as input arbitrary conformal scores.
Thus we can adopt any of these conformal score functions and inherit their properties, while providing the stronger worst-case guarantees of multivalid coverage.
For the special case of prediction intervals, the type of multi-valid prediction that we study was first defined in Jung et al.
[2021], who gave a way of obtaining it in the batch setting for i.i.d.
data, via producing multicalibrated estimates of label variances and higher moments.
Gupta et al.
[2022] proved that there exists an online prediction algorithm that gives the sort of multi-valid prediction intervals that we consider in this work.
The algorithm we give in this paper is both much more efficient (theirs was not implementable) and has substantially better (optimal) convergence bounds.
Finally, multivalidity is related to subgroup fairness constraints [Kearns et al., 2018, 2019, Kim et al., 2018], which ask for statistical “fairness” constraints to hold across all subgroups defined by some rich class G .
In particular, it is closely related to multicalibration [Hébert-Johnson et al., 2018].
Setting and Notation
We let X denote a feature domain and Y a label domain.
G ⊆ 2 X denotes a collection of subsets of
X , which we call “groups”.
For x ∈ X , G ( x ) = { G ∈ G : x ∈ G } is the set of groups that contain x .
For any integer T > 0 , [ T ] = { 1 , . .
, T } .
The probability simplex over a finite set
A is denoted ∆ A .
Our online uncertainty quantification is based on a bounded conformal score function s t : X ×Y → R which can change in arbitrary ways between rounds t ∈ [ T ] .
Without loss of generality, we assume that the scoring function takes values in the unit interval: s t ( x, y ) ∈ [0 , 1] for any x ∈ X ,
y ∈ Y , and t ∈
[ T ] .
Fix some target coverage rate 1 − δ .
Ideally, the learner wants to produce prediction sets T t ( x t ) =
{ y ∈ Y :
s t ( x t , y ) ≤ q t } that cover the true label y with probability 1 − δ over the randomness of the unknown label distribution:
Pr y | x t [ y ∈ T t ( x t )]
≈ 1 − δ .
This is equivalent to choosing a conformity threshold q t such that Pr y | x t [ s t ( x t , y ) ≤ q t ] ≈ 1 − δ .
We want to model an adversary that can choose an arbitrary sequence of examples x t and labels y t .
However, because the adversary may choose the label distribution with knowledge of the conformal score function, we will elide the particulars of the conformal score function and the distribution on labels y t in our derivation, and instead equivalently imagine the adversary as directly choosing x t and a distribution over conformal scores s t conditional on x t (representing the distribution over conformal scores s t ( x t , y t ) ).
We may thus without loss view the interaction in the following simplified form:
The adversary chooses a joint distribution over feature vector x t ∈ X and conformal score s t ∈ [0 , 1] .
The learner receives x t (a realized feature vector), but no information about s t .
The learner produces a conformity threshold q t . 3.
The learner observes the realized conformal score s t .
As we formally discuss in Definition 3.1 of Section 3 below, the adversary’s choice of the joint distribution over x t and s t in each round of the above protocol will need to additionally satisfy a mild smoothness property, namely that the score distribution should not be overly concentrated on any subinterval of the [0 , 1] range.
As we explain there, we can in fact enforce this property algorithmically if necessary, by slightly perturbing the observed scores.
For any round t ∈ [ T ] , we write π t =
( x t , s t , q t ) to denote the realized outcomes in round t , and π t 1 : t 2 for the transcript of the interaction in rounds t 1 ≤ τ ≤ t 2 : π t 1 : t 2 = (( x τ , s τ , q τ ))
t 2 τ = t 1 .
To denote a concatenation of two transcripts, we use ⊕ : for example, π 1: t = π 1: t − 1 ⊕ π t .
We write Π ∗ =
( X × [0 , 1] × [0 , 1]) ∗ as the domain of all transcripts.
Fixing a learner and an adversary induces a probability distribution over transcripts.
Our goal is to derive algorithms with coverage guarantees that hold over the transcript randomness, in the worst-case over all possible adversaries.
Given conformity threshold q , we say it covers conformal score s
if Cover( q, s ) = 1 , where we define: Cover( q, s )
= 1 [ s ≤ q ] .
To define threshold calibration, we bucket our thresholds using a discretization parameter m .
For any m , we write B m ( i ) = (cid:2)
i − 1 m , im (cid:1) for each bucket index i ∈ [ m − 1] , and B m ( m ) = (cid:2) m − 1 m , 1 (cid:3) , so that these buckets evenly partition the unit interval [0 , 1] 3 .
For any group G ∈ G and bucket i ∈ [ m ] , we write G T ( i ) = { t ∈
[ T ] : x t ∈ G, q t ∈ B m ( i ) } for the set of rounds in the transcript π 1: T in which the feature vectors belonged to the group G and the chosen threshold q t was in bucket i .
We can now define our main objective in this paper: threshold calibrated multivalid coverage.
Definition 2.1 (Threshold Calibrated Multivalid Coverage) .
Fix a coverage target 1 − δ and a collection of groups G ⊂ 2 X .
Given a transcript π 1: T , a sequence of conformity thresholds ( q t )
Tt =1 is said to be ( α, m ) -multivalid
with respect to δ and G for some function α : N
→ R if:
[Equation]
for every i ∈ [ m
[Equation]
and G ∈ G
[Equation]
Note that multivalid coverage is defined by a function α ( · ) of the length of the sequence on which empirical coverage is computed, letting us give fine-grained bounds that scale with the sequence length.
In this paper we use the following family of functions, parameterized by a constant ϵ > 0 :
[Equation]
where
[Equation]
Here, f is defined so that up to lower-order terms, α ( n ) ∼ 1 √ n ; the logarithmic factor that depends on ϵ > 0 serves to ensure the technical condition that the series
[Equation]
where K ϵ is a constant depending only on our choice of ϵ , that will later appear in our bounds.
Our Algorithm and Analysis
Before we provide the algorithm and its guarantees, we first discuss a needed assumption.
Observe that even in the easier setting where the conformal score s is drawn from a fixed, known distribution: s ∼ D — there may not be any threshold q ∈ [0 , 1] that satisfies the desired target coverage value, i.e. that guarantees that | E s ∼D [Cover( q, s ) − (1 − δ )] | is small.
Consider for example a distribution that places all its mass on a single value s .
Then any threshold q covers the s with probability 1 or 0 , which for δ ̸∈ { 0 , 1 } is bounded away from our target coverage probability.
One could randomize the threshold to get the target marginal coverage rate, but this corresponds to the “cheating” strategy we outline in Footnote 2, and in particular would not satisfy our notion of threshold calibrated coverage.
Of course, if achieving the target coverage is impossible in the easier distributional setting, then it is also impossible in the more challenging online adversarial setting.
With this in mind, just as with many other approaches to conformal prediction that aim to converge to the correct coverage rate (rather than conservatively over-cover), we will need to assume that our target distributions are not too concentrated on any single point.
Following Gupta et al.
[2022], we define a class of smooth distributions for which achieving (approximately) the target coverage is always possible for some threshold q defined over an appropriately finely discretized range.
Our smoothness condition makes sense even for discrete distributions, so we do not need to assume continuity.
To denote the uniform grid on [0 , 1] , we write P rm = (cid:8) 0 , 1 rm , 2 rm , . .
, 1 (cid:9) .
We show that we can achieve (approximately) our target coverage goals in the online adversarial setting when the adversary is constrained to playing smooth distributions, which are distributions that do not put too much probability mass on any sufficiently small sub-interval.
Definition 3.1.
A distribution Q ∈ ∆([0 , 1]) is ( ρ, rm ) - smooth if
Pr s ∼ Q [ s ∈ [ a, b ]] ≤ ρ for any subinterval [ a, b ] ⊆
[0 , 1] of length ≤ 1 rm ,
A joint distribution D ∈ ∆( X × [0 , 1]) is ( ρ, rm ) - smooth if for every x ∈ X , the marginal conformal score conditional on x , D| x , is ( ρ, rm ) -smooth.
An adversary is ( ρ, rm ) -smooth if the joint distribution over ( x t , s t ) is ( ρ, rm ) -smooth at every round t ∈ [ T ] .
Remark 3.1.
For any ρ , the assumption of ( ρ, rm ) -smoothness becomes more mild as r → ∞ .
For us, r will be a nuisance parameter that we can take as large as we want — we will not have to pay for it either in our running time or our coverage bounds.
We can also algorithmically enforce smoothness by perturbing the conformal scores with small amounts of noise from any continuous distribution, and so we should think of smoothness as a mild assumption.
Our experiments bear this out.
We now present the algorithm ( MVP — MultiValid Predictor).
It resembles the algorithm for online mean multicalibration given in Gupta et al.
[2022], which in turn is a multi-group generalization of the “almost deterministic” calibration algorithm of Foster and Hart [2021].
Algorithm 1: MVP ( δ, η, m, r ) for t = 1 , . .
, T do
Take as input an arbitrary conformal score s t : X × Y → [0 , 1] .
Observe x t , and for each i ∈ [ m ] and G ∈ G ( x t ) , compute:
[Equation]
Definition 3.
[Equation]
Cover(
[Equation]
−
[Equation]
Definition 3.
[Equation]
From Lemma 3.
if C it − 1 ( x t ) > 0 for all i ∈ [ m ] then
Choose threshold q t = 0 .
else if C it − 1 ( x t ) < 0 for all i ∈ [ m ] then
Choose threshold q t = 1 .
else
Find i ∗ ∈
[ m − 1] such that C i ∗ t − 1 ( x t ) ·
C i ∗ +1 t − 1 ( x t ) ≤ 0 .
Define 0 ≤ p t ≤ 1 as follows:
a p t = (cid:12) (cid:12)(cid:12) C i ∗ +1 t − 1 ( x t ) (cid:12) (cid:12)(cid:12) / (cid:16)(cid:12) (cid:12)(cid:12)
C i ∗ +1 t − 1 ( x t ) (cid:12) (cid:12)(cid:12) + (cid:12) (cid:12)(cid:12)
C
i ∗ t − 1 ( x t ) (cid:12) (cid:12)(cid:12) (cid:17) .
Choose threshold q t
= i ∗ m − 1 rm with probability p t and q t = i ∗ m with probability 1 − p t .
Output prediction set T t ( x t ) =
{ y ∈ Y :
s t ( x t , y ) ≤ q t } .
First, we give a brief intuitive description of the inner workings of the algorithm.
Note that for all groups G and buckets i , MVP maintains historical
over-
(equivalently, under-) coverage amounts over those rounds when the context was in group G (that is, x t ∈ G ), and the threshold played was in bucket i (that is, q t ∈ B m ( i ) ).
In each round, MVP is confronted with a new context x t , and needs to decide which bucket i to choose the threshold from.
For every candidate bucket i ∈ [ m ] ,
MVP performs a certain type of normalized softmax aggregation of that bucket’s historical over- or undercoverage over all groups G that x t belongs to.
The result is a single signed quantity C it − 1 for each bucket i , which summarizes its past coverage performance over all relevant groups G ∋ x t : intuitively, if thresholds from bucket i have been mostly overcovering on the relevant groups in the past, we can expect C it − 1 > 0 , and in the opposite case of significant undercoverage, we can expect
C it − 1 < 0 .
The algorithm then simply finds, if such exist, any two adjacent buckets one of which has historically over-covered and the other — under-covered, and randomizes between the two to output a balanced threshold that, it is hoped, neither over- nor under-covers.
Now, we are ready to present our main result — the multivalid coverage guarantees for MVP.
The proof of this statement is laid out in the following Section 3.1.
Theorem 3.1.
Against any ( ρ, rm ) -smooth adversary and for any adaptively chosen sequence of conformal scores s t , MVP ( η, m, r ) with learning rate η = (cid:113) ln( |G| m ) 2 K ϵ |G| m (Algorithm 1) produces a sequence of thresholds ( q t )
Tt =1 that is (cid:16)(cid:16) (cid:112) 4 K ϵ |G| m ln( |G| m ) + ρT (cid:17) α ( · ) , m (cid:17) -multivalid in expectation over the randomness of π 1: T with respect to δ and G .
Consequently, we have for any small ϵ > 0 of our choice (with K ϵ a constant that depends only on ϵ ):
[Equation]
Remark 3.2.
Since we can take r to be arbitrarily large, for any continuous distribution we can drive the ρT term to zero.
Thus this bound establishes nearly statistically optimal convergence rates for constant |G| and m .
Using a simpler analysis analogous to that of Gupta et al.
[2022] for mean multicalibration, it is also possible to establish ( α, m ) -multivalidity with α ( n ) =
O ( (cid:112) T log( |G| m ) /n
+ ρ ) , which is optimal in |G| and m but has a bad dependence on T .
We believe that our sub-optimal dependence on |G| and m is an artifact of our analysis, and not a property of our algorithm.
3.1 Analysis
Omitted proofs from this section are presented in full detail in Appendix A.
Our analysis here can be seen as an extension of the surrogate loss argument developed in Gupta et al.
[2022] for the problem of mean multicalibration.
There are two main novel insights that lead to our algorithm and analysis for multivalid coverage.
First, Gupta et al.
[2022] were unable to extend their simple multicalibration algorithm to prediction interval multivalidity (and instead analyzed an impractical Ellipsoid-based algorithm).
Informally this is because they parameterized prediction intervals with two parameters (the lower and upper endpoint), which eliminated the simple one-dimensional structure they were able to exploit for mean multicalibration.
In contrast, our prediction intervals are parameterized by a single parameter q , which allows us to exploit a simple one-dimensional structure.
Second, the bounds in Gupta et al.
[2022] uniformly bound the coverage error for each group G ∈ G and bucket i ∈ [ m ] by ˜ O ( √ T ) , which is optimal only for subsequences that have n G,iT
= Ω( T ) .
In contrast, we obtain non-uniform bounds that depend on n G,iT but not on T , and (at least for constant m and |G| ) have the optimal (cid:113) n G,iT dependence.
We achieve this by analyzing a modified surrogate loss, leading to a significant amount of added complexity which accounts for the bulk of our argument.
Proof sketch for Theorem 3.1.
For each group G ∈ G , bucket i ∈ [ m ] , round t ∈ [ T ] , we would like to bound the coverage error on the subsequence of rounds τ in which x τ ∈ G and q τ ∈ B m ( i ) in terms of the length of that sequence.
We give the following notation for these sequence lengths:
Definition 3.2 (Group-bucket size) .
Given a transcript π 1: t = (( x τ , s τ , q τ )) tτ =1 , we define the size for a group G ∈ G and a bucket i ∈ [ m ] at time t to be: n G,it ( π 1: t ) =
t (cid:88) τ
= 1 [ q τ ∈ B m ( i ) , x τ ∈ G ] .
Similarly, for each G ∈ G , i ∈ [ m ] and time t ∈ [ T ] , we can define the (unnormalized) coverage error on the sequence corresponding to rounds τ ≤ t such that x τ ∈ G and q τ ∈ [ m ] :
Definition 3.3.
Given transcript π 1: t , the coverage error for group G ∈ G and bucket i ∈ [ m ] at time t is given as: V G,it =
[Equation]
=
[Equation]
) , where v δ ( q, s ) =
Cover( q, s ) − (1 − δ ) .
Note that V G,it just records the deviation of the empirical coverage from its target (1 − δ ) on the subsequence of rounds τ in which x τ ∈ G and q t ∈ B m ( i ) : it takes a positive value if we have over-covered on this subsequence and a negative value if we have under-covered.
Observation 3.1.
Fix a transcript π 1: T .
If for all G ∈ G and i ∈ [ m ] , we have for some constant c : (cid:12) (cid:12)(cid:12) V G,iT (cid:12) (cid:12)(cid:12) ≤ cf ( n G,iT ) , then the resulting sequence of thresholds ( q t ) T t =1 is ( cα ( · ) , m ) -multivalid with respect to δ and G .
To bound the maximum of our normalized absolute coverage errors across all groups and buckets, i.e. max G ∈G ,i ∈ [ m ] | V G,iT | f ( n G,iT ) , we use the following surrogate loss:
Definition 3.4 (Surrogate loss) .
Fix a transcript π 1: t ∈ Π ∗ and a parameter η ∈ (0 , 1 / 2) .
Define a surrogate coverage loss function at day t for bucket i ∈ [ n ] and group G ∈ G as
[Equation]
where V G,it are implicitly functions of π 1: t .
The overall surrogate coverage loss function is defined as L t ( π 1: t ) =
(cid:80) G ∈G ,i ∈
[ m ] L G,it ( π 1: t ) .
We first show that the increase in the surrogate loss can be bounded in the following way:
Lemma 3.1.
Fix η ∈ (0 , 12 ) and a transcript π 1: t − 1 for some t .
For any π t = ( q t , x t , s t ) , we have
L t ( π 1: t − 1 ⊕ π t ) − L t − 1 ( π 1: t − 1 ) ≤ (cid:88)
[Equation]
where A t ( π t ) = { ( G,i ) :
G ∈G ( x t ) , q t ∈ B m ( i ) } contains ( G,i ) pairs “active” at
time t ∈
[ T ] , and
C G,it
[Equation]
Now, we show that Algorithm 1 guarantees (cid:80) ( G,i ) ∈
A t ( π t ) v δ ( q t , s t ) C G,it − 1 is small in expectation over the randomness of the algorithm.
Lemma 3.2.
Fix any t ∈
[ T ] , η ∈ (0 , 12 ) , transcript π 1: t − 1 recording a realization for the first t − 1 rounds and x t .
At round t , Algorithm 1 chooses a distribution over q t such that against any ( ρ, rm ) -smooth
distribution over conformal scores s t , we have:
[Equation]
Carefully telescoping the bounded increase in surrogate loss over each round via Lemma 3.1 and 3.
and noticing that 1 /f ( n ) 2 forms a convergent series yields the result of Theorem 3.1.
[Figure]
Experiments
In this section, we summarize our experiments 4 — full details can be found in Appendix B. We evaluate MVP and compare it to more traditional conformal prediction methods on a variety of tasks.
In each case, for a fair comparison, both MVP and the compared-to method receive as input the same predictive model and conformal scores.
Exchangeable data First, in Section B.1 we study a synthetic linear regression problem in a simple exchangeable (iid.) setting, and compare to split conformal prediction [Lei et al., 2018].
Given a regression model f t ( x ) , we use conformal score s t ( x, y ) =
| f t ( x ) − y | .
The regression function is unknown at the outset, and must be learned during the interaction.
As we show (Figure 1), MVP improves over split conformal prediction even in terms of marginal empirical coverage.
This is because to keep the conformal scores exchangeable, split conformal prediction must split the data into two sets: one for training the regression model and one for calibrating prediction sets.
In contrast, our method does not require exchangeability, so we can both train the regression model and calibrate our prediction sets on the entire dataset.
We are thus able to make better use of the data, and our regression function (and hence our conformal score function) becomes more informative faster.
Then, we modify our regression problem so that there are 20 overlapping sub-populations, one of which (consisting of half of the data) has higher label noise.
We measure groupwise coverage for MVP , for naive split conformal prediction with no knowledge of to-be-covered groups, and the method of Foygel Barber et al.
[2020] which guarantees (conservative) groupwise coverage for intersecting groups.
We find (Figure 2) that MVP significantly improves on both methods, obtaining correct coverage on all groups and (correctly) obtaining much smaller interval width on the low noise group.
Covariate shift Next, in Section B.2 we study a regression problem in the presence of covariate shift.
First we replicate an experiment of Tibshirani et al.
[2019], in which a synthetic covariate shift (with known propensity scores and known changepoint) is simulated on a UCI dataset.
The method of Tibshirani et al.
[2019] reweighs the calibration set using the propensity scores.
MVP can also take advantage of propensity scores warm-start MVP on the same portion of the dataset that split conformal prediction uses for calibration, sampled with replacement after being re-weighted by the propensity scores.
Both algorithms are then evaluated on the shifted distribution.
We find both algorithms perform comparably.
We then experiment with unanticipated covariate shift simulated on datasets derived from 2018 U.S. Census data provided from the Folktables package [Ding et al., 2021].
We use the quantile-regression based conformal score proposed by Romano et al.
[2019] for both methods.
We compare to split conformal prediction calibrated on California data and evaluated on the Pennsylvania data.
Similarly, we warm-start MVP on California data and measure its performance on the Pennsylvania data, finding that MVP gets the correct coverage rate and smaller interval widths compared to the split conformal method despite having no knowledge of the distribution shift.
[Figure]
Time series In Section B.3 we evaluate MVP on time series data — 20 years of stock returns, in a volatility prediction task.
We compare MVP to the Adaptive Conformal Inference (ACI) method of Gibbs and Candes [2021], which guarantees marginal (but not threshold- or group- calibrated) coverage for adaptively chosen data.
When evaluated in terms of marginal coverage, we find that
MVP and ACI perform comparably, with ACI’s coverage slightly closer to the target, but with MVP ’s sequence of predicted thresholds exhibiting more stability (Figure B.6).
We then complicate the experiment to exhibit the two advantages of MVP (groupwise and threshold-calibrated coverage).
First, we define 20 intersecting groups of trading days: a period-1 sequence (all the days), a periodsequence (the even days), ..., a period-20 sequence (every 20th day).
We add perturbations to the stock returns, such that each day receives an amount of noise commensurate with how many groups it belongs to.
The point of adding these perturbations to the stock returns on different subsets of the days is to produce a dataset on which the uncertainty of the model is quantifiably different within different groups — thus making it nontrivial to obtain valid coverage on each of those groups by only enforcing valid marginal coverage.
Indeed, we find that MVP obtains the correct group-wise coverage, whereas ACI fails to: as shown in Figure 4a, ACI undercovers on most groups.
As our next experiment, we produce a fully adversarial sequence by presenting examples to ACI and
MVP not in time order but in sorted order by their conformal scores (see Figure 4b).
By construction, this sequence would cause split conformal prediction methods to have 0 coverage, while both ACI and MVP guarantee correct marginal coverage on it.
However, we find (see Figure B.8d) that ACI achieves its correct marginal coverage by violating threshold calibration: namely, by predicting
[Figure]
predominantly the trivial coverage interval (all of [0 , 1] ) and occasionally — short, under-covering intervals.
This strategy both yields thresholds that are uninformative about the input sequence of scores, and produces close-to-maximum average interval widths regardless of the actual magnitude of the input scores.
In contrast, MVP , by virtue of its threshold calibration, outputs coverage thresholds that correctly track the input sequence of conformal scores (Figure 4c), and hence produces prediction intervals with the correct widths.
Classification: ImageNet Finally, in Section B.4 we compare MVP to the work of Angelopoulos et al.
[2020] on a large-scale ImageNet classification task.
We find that MVP obtains comparable coverage rates and prediction set sizes, despite the fact that the setting is favorable to Angelopoulos et al.
[2020] — i.e. the data is i.i.d.
and we measure only marginal coverage.
Potential societal impact of our work: When the underlying dataset consists of e.g. labeled individuals, our conformal prediction approach achieves target coverage guarantees not only marginally, but on arbitrary collections of user-specified population groups.
Thus, we believe that when used responsibly, our method can serve as a key tool for advancing the interests of protected subpopulations, resulting in significant added positive societal impact.
Checklist
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] (c) Did you discuss any potential negative societal impacts of your work?
[Yes] Please see the dedicated paragraph on societal impact at the end of the main part of the paper — we believe that responsible use of our method will lead to significant added positive societal impact.
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] (b) Did you include complete proofs of all theoretical results?
[Yes] 3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] (b) Did you specify all the training details (e g., data splits, hyperparameters, how they were chosen)?
[Yes] (c) Did you report error bars (e
g., with respect to the random seed after running experiments multiple times)?
[Yes] Described in detail where appropriate in Appendix B. (d) Did you include the total amount of compute and the type of resources used (e
g., type of GPUs, internal cluster, or cloud provider)?
[Yes] 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] (b) Did you mention the license of the assets?
[N/A] (c) Did you include any new assets either in the supplemental material or as a URL?
[Yes] The supplement will contain our code for the experiments.
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[N/A] We used and cited open access data.
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A]
None of our data contains such content or information.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]