Year: 2021

Abstract:
Recent work has shown that models trained to the same objective, and which achieve similar measures of accuracy on consistent test data, may nonetheless behave very differently on individual predictions. This inconsistency is undesirable in high-stakes contexts, such as medical diagnosis and finance. We show that this inconsistentbehavior extends beyond predictions to feature attributions, which may likewise have negative implications for the intelligibility of a model, and one’s ability to find recourse for subjects. We then introduce selective ensembles to mitigate such inconsistencies by applying hypothesis testing to the predictions of a set of models trained using randomly-selected starting conditions; importantly, selective ensembles can abstain in cases where a consistent outcome cannot be achieved up to a specified confidence level. We prove that that prediction disagreement between selective ensembles is bounded, and empirically demonstrate that selective ensembles achieve consistent predictions and feature attributions while maintaining low abstention rates. On several benchmark datasets, selective ensembles reach zero inconsistently predicted points, with abstention rates as low 1.5%.

heading: 1 INTRODUCTION
text: Recent work has drawn attention to the fact that models that appear similar from aggregate quality measures, such as accuracy, often have markedly different behavior at the level of individual predictions (Black and Fredrikson, 2021; Marx et al., 2019). Further, in deep models, this inconsistency can arise even between closely-related models, such as those arising from different initializations, or from leave-one-out differences in the training data (Black and Fredrikson, 2021; D’Amour et al., 2020; Mehrer et al., 2020). This behavior is undesirable in many high-stakes contexts, such as medical applications and credit-approving scenarios, as it may cast doubt on the justifiability of the model’s outcome and pose difficulties for reproducibility and comparison.
We begin by demonstrating that not only are the predictions of related deep models often dissimilar, but their feature attributions (Simonyan et al., 2014; Sundararajan et al., 2017; Leino et al., 2018) are as well (Section 3). In particular, we show that there is little connection between a model’s gradients, which are the basis for many deep attribution methods, and the labels that it predicts—models with identical predictions can have arbitrarily different gradients almost everywhere (Theorem 3.1). In practice, we show that this result occurs often on common datasets across closely-related models, leading to significant variation in attributions. This may be undesirable, as feature attributions are commonly used to provide explanations (Simonyan et al., 2014; Sundararajan et al., 2017; Leino et al., 2018), debug model behavior (Adebayo et al., 2020), and diagnose problems related to privacy and fairness (Leino and Fredrikson, 2020; Datta et al., 2016). Beyond these pragmatic concerns, this suggests that the salient factors behind these models’ predictions on many points may have little in common, even when models appear to do comparably well on test data.
To address inconsistency in both prediction and attribution, we then turn to ensembling, a well-known approach for reducing predictive variance (Meir et al., 1995; Naftaly et al., 1997; Lincoln and Skrzypek, 1990; Fumera et al., 2005; Hansen and Salamon, 1990; Krogh and Vedelsby, 1995). We introduce selective ensembles, which leverage a recent result on multinomial rank verification (Hung et al., 2019)—which has also been used recently for making certifiably-robust predictions (Cohen et al., 2019)—to efficiently mitigate the problem of inconsistency with a probabilistic guarantee. Given a point to classify, a selective ensemble returns the mode of the class labels predicted on that point, where the mode is sampled over models that vary according to a specified source of randomness in the training process. Importantly, if the mode cannot be inferred with sufficient confidence, then the selective ensemble abstains from prediction. This allows us to bound the probability that these ensembles do not return the true mode prediction (Theorem 4.1), and by extension, the rate of disagreement between selective ensembles (Corollary A.4). In addition, we show that
this also bounds the variance component in the ensembles’ bias-variance error decomposition (Domingos, 2000) (Corollary A.3), providing guidance on how to effectively use of them in practice.
Our experiments show that on seven benchmark datasets, selective ensembles of just ten models either agree on the entire test data across random differences in how their constituent models are trained, or abstain at reasonably low rates (1-5% in most cases; Section 5.1). Additionally, we show that simple ensembling doubles the agreement of attributions on key metrics on average, and when the variance of the constituent models is high that selective ensembling further enhances this effect (Section 5.2).
In summary, our contributions are: (1) we show that beyond predictions, feature attributions are not consistent across seemingly inconsequential random choices during learning (Section 3); (2) we introduce selective ensembling, a learning method that guarantees bounded inconsistency in predictions, (Section 4); and (3) we demonstrate the effectiveness of this approach on seven datasets, showing that selective ensembles consistently predict all points across models trained with different random seeds or leave-one-out differences in their training data, while also achieving low abstention rates and higher feature attribution consistency.

heading: 2 NOTATION AND PRELIMINARIES
text: We assume a supervised classification setting, with data points (x,y)∈X×Y, drawn from data distribution, D, where x represents a vector of features and y a response. In order to capture the effects of arbitrary random events on a learned model—ranging from randomness during training to randomness in the data selection process—we generalize the standard concept of a learning rule to that of a learning pipeline. Specifically, a learning pipeline, P, is a procedure that outputs a model, h :X→Y, taking as input a random state, S∼S, containing all the information necessary for P to produce a model (including the architecture, training set, random coin flips used by the learning rule, etc.). Intuitively, S represents a distribution over random events that might impact the learned model. For example, S might capture randomness in sampling of the training set, or nondeterminism in the optimization process, e.g., the initialization of parameters, the order in which batches are processed, or the effects of dropout.
In our experiments, we model S to capture two specific types of random choices, namely (1) the initial parameters of the model, and (2) leave-one-out changes to the training data. As the initial parameters of the model tend to be determined by a random seed, we will interchangeably refer to this as the selection of random seed. More generally, both of these types of choices instantiate a broader class of choices that could be considered arbitrary, despite the fact that they may impact the predictions (Black and Fredrikson, 2021; Marx et al., 2019; Mehrer et al., 2020) (Section 5.1) and explanations (Section 5.2) of the resulting model.

heading: 3 INSTABILITY OF FEATURE ATTRIBUTIONS IN DEEP MODELS
text: Before we consider mitigating predictive inconsistency with ensembling, we first demonstrate that models’ inconsistency across random choices in training is exhibited not only through its predictions, but through its feature attributions as well. Feature attributions refer to numeric scores generated for some set of a model’s features—most commonly the model’s input features—which are meant to connote how important each feature is in generating the model’s prediction. Feature attributions are commonly used as a tool for explaining model behavior (Simonyan et al., 2014; Leino et al., 2018; Sundararajan et al., 2017; Adebayo et al., 2020) localized to given set of inputs. Thus, inconsistent feature attributions between models suggest the models differ in the process by which they arrive at their predictions, even if the predictions are the same.
In deep models, many of the most popular attribution methods are based on the model’s gradients at or around a given point (Simonyan et al., 2014; Sundararajan et al., 2017). Accordingly, we will focus on the stability of gradients, and show via analysis and experiment that they are not stable in conventional deep models. First, we motivate our results by showing that even two deep models that predict the same labels on all points may have arbitrarily different gradients almost everywhere. Later, in our empirical evaluation (Section 5.2), we demonstrate the extent of the differences between Saliency Maps (Simonyan et al., 2014) (i.e., input gradients) of deep networks even when the randomness of the learning pipeline is controlled to allow only one-point differences in the training set or differences in the random seed.
Predictions with Arbitrary Gradients. We show that even deep models that predict the exact same labels on all points cannot necessarily be expected to have the same, or even similar, gradients; in fact, given a binary classification model h, we can construct a model ĥ which predicts the same labels as h,
but has arbitrarily different gradients everywhere except an arbitrarily small region around the boundary of h (Theorem 3.1). Theorem 3.1. Let H :X→{−1,1}= sign(h) be a binary classifier and g :Rn→R be an unrelated function that is bounded from above and below, continuous, and piecewise differentiable. Then there exists another binary classifier Ĥ=sign(ĥ) such that for any >0,
∀x∈X . 1. Ĥ(x)=H(x) 2. inf x′:H(x′)6=H(x)
{ ||x−x′|| } > /2 =⇒ ∇ĥ(x)=∇g(x)
The proof of Theorem 3.1 is given in Appendix A.1 in the supplementary material. The proof is by construction of ĥ; a sketch giving the intuition behind the construction is provided in Figure 1. In short, we first partition the domain into contiguous regions that are given the same label byH. We then construct ĥ from g by adjusting g to lie above or below the origin to match the prediction behavior of h in each region. As these transformations merely shift g by a constant in each region, they do not change∇g except near decision boundaries, where it is necessary to move across the origin.
Observations. The intuition stemming from Theorem 3.1 is that a model’s gradients at each point are largely disconnected from the labels it predicts on a distribution. As models that make identical predictions are likely to have similar loss on a given dataset, this theorem points to the possibility that models of similar objective quality may still have arbitrarily different gradients. In Section 5.2, we demonstrate that this outcome is not only possible, but that it occurs in real models—for example, on the German Credit dataset predicting credit risk, on average, individual models with similar accuracy agree on less than two out of the five most important features influencing their decision.

heading: 4 SELECTIVE ENSEMBLING
text: The results of Section 3 suggests that models that are retrained and redeployed, may exhibit substantially different behavior from their previous iterations. We build on the approach of ensembling for variance reduction by showing how these differences in behavior can be bounded via selective ensembling. However, whereas prior work which finds that more diversity among the constituent networks is beneficial for reducing overall error (Krogh and Vedelsby, 1995; Hansen and Salamon, 1990; Maclin et al., 1995; Opitz and Shavlik, 1996), our goal is to minimize, or at least place strict bounds on, the variance component. We show that ideas from robust classification, and in particular randomized smoothing (Cohen et al., 2019), which stem from recent results on multinomial hypothesis testing (Hung et al., 2019), can be used to enforce such a bound.
Mode Predictor. We may view the image of the learning pipeline,P, as a distribution over possible models induced by applyingP to the random state, S∼S. The mode prediction on an input x, with respect to S, is the expected label that would be predicted onx by models drawn from this distribution. More formally, we define the mode predictor, gP,S for a pipeline,P, and random state distribution, S, as given by Equation 1.
gP,S(x)=argmax y∈Y { E S∼S [ 1[P(S ; x)=y] ]} (1)
Algorithm 1: Selective Ensemble Creation
def train_ensemble(P, S∼Sn, n): return {P(Si) for i∈ [n]}
def sample_ensemble(P, S, n): S ← sample_iid(Sn) return train_ensemble(P, S, n)
Algorithm 2: Selective Ensemble Prediction def ensemble_predict(ĝn(P,S), α, x):
Y ← ∑
h∈ĝn(P,S)one_hot(h(x)) nA, nB ← top_2(Y ) if binom_p_value(nA, nA+nB, 0.5)≤α
then return argmax(Y )
else return ABSTAIN
Note that while gP,S is deterministic, and is therefore not sensitive to a specific state drawn from S, it does not necessarily produce the ground truth label on all inputs—some learning pipelines may converge to a stable loss minimum that misclassifies certain points.
Approximation via Ensembling. An explicit representation of the true mode predictor is, of course, unattainable—the non-convex loss surface of deep models and the complex interactions between the learning pipeline and the distribution of random states makes the expectation in Equation 1 infeasible to compute analytically. However, we can approximate gP,S(x) by computing the empirical mode prediction on x over a random sample of models produced by i.i.d. draws from P(S). But although ensembles with sufficiently many constituent models will more reliably output the mode prediction, for any fixed-size ensemble there will remain points on which the margin of the plurality vote is small enough to “flip” to runner-up in some set of nearby ensembles that differ on a subset of their constituents; in other words, these ensembles will not predict the mode prediction.
To rigorously bound the rate at which the ensemble will differ from the mode prediction, we allow the ensemble to abstain on points where the constituent predictions indicate a statistical toss-up between the two most likely classes. We call ensembles that may abstain in this way selective ensembles, borrowing the terminology from selective classification (El-Yaniv et al., 2010). We can think of of abstention as a means of flagging unstable points on which the selective ensemble cannot accurately determine the mode prediction; whether this should be interpreted as a failed attempt at classification is an application-specific consideration.
Selective ensembles of n models predict according to the following procedure. First, the predictions of each of the n models in the ensemble are collected. The constituent models are derived from n i.i.d. samples of P(S) from S, as described in Algorithm 1. From these predictions, we perform a two-sided statistical test to determine if the mode prediction was selected by a statistically significant majority of the constituent models. If the statistical test succeeds, we return the empirical mode prediction; otherwise we abstain from predicting. Pseudocode for this prediction procedure is given in Algorithm 2. We will denote by ĝn(P,S) (for S∼Sn) the output of train_ensemble in Algorithm 1, and by ĝn(P,S ; α,x) prediction produced by ensemble_predict in Algorithm 2 on ĝn(P,S). Because of their ability to abstain from prediction, we can prove that with probability at least 1−α, a selective ensemble will either return the true mode prediction or abstain, where α is a chosen threshold for the statistical test to prevent prediction in the case of a toss-up. In other words, on any point on which it does not abstain, a selective ensemble will disagree with the mode predictor, gP,S , with probability at most α, as stated formally in Theorem 4.1.
The statement of Theorem 4.1 make use of the relation, ABS6=, where y1 ABS6= y2 if and only if y1 6=ABSTAIN and y2 6=ABSTAIN and y1 6=y2. That is, ABS6= captures disagreement between non-rejected predictions. Theorem 4.1. Let P be a learning pipeline, and let S be a distribution over random states. Further, let gP,S be the mode predictor, let ĝn(P,S) for S∼Sn be a selective ensemble, and let α≥0. Then,
∀x∈X . Pr S∼Sn
[ ĝn(P,S ; α,x) ABS6=gP,S(x) ] ≤α
The proof (Appendix A) relies on a result from Hung and Fithian (Hung et al., 2019) which bounds the probability that a set of votes does not return the true plurality outcome, and we apply it in a similar fashion to how it is used for making robust predictions in Randomized Smoothing (Cohen et al., 2019).
Theorem 4.1 states that the probability that a selective ensemble makes a prediction that does not match the mode prediction is small. However, one possible means of ensuring this is by not providing a prediction
in the first place, i.e., if the selective ensemble abstains. Thus, the abstention rate is necessary to quantify the fraction of points on which the mode prediction will actually be produced.
In the 0-1 loss bias-variance decomposition of Domingos (2000), the variance component of a classifier’s loss is defined as the expected loss relative to the mode prediction (in our case, taken over the randomness in S). Thus, Theorem 4.1 leads to a direct bound on this component, assuming a bound, β, on the abstention rate. This is formalized in Corollary A.3. Corollary 4.2. Let P be a learning pipeline, and let S be a distribution over random states. Further, let gP,S be the mode predictor, let ĝn(P,S) for S∼Sn be a selective ensemble. Finally, let α≥0, and let β≥0 be an upper bound on the expected abstention rate of ĝn(P,S). Then, the expected loss variance, V (x), over inputs, x, is bounded by α+β. That is,
E x∼D
[ V (x) ] = E x∼D [ Pr S∼Sn [ ĝn(P,S ; x) 6=gP,S(x) ] ] ≤α+β
Consistency of Selective Ensembles. Using the result from Theorem 4.1, we can also address the original problem raised: that deep models often disagree on their predictions due to arbitrary random events over the training pipeline. We show that, given a bound, β, on the abstention rate, the probability that two selective ensembles disagree in their predictions is bounded by 2(α+β) (Corollary A.4). Intuitively, this suggests that the predictions of selective ensembles are more stable over different instantiations of the random decisions captured by S compared to individual models. Corollary 4.3. Let P be a learning pipeline, and let S be a distribution over random states. Further, let ĝn(P,S) for S∼Sn be a selective ensemble. Finally, let α≥0, and let β≥0 be an upper bound on the expected abstention rate of ĝn(P,S). Then,
E x∼D
[ Pr
S1,S2∼Sn
[ ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x) ] ] ≤2(α+β)
Corollary A.4 tells us that the agreement between any two selective ensembles is at least 1−2(α+β). For a fixed n, decreasing α will lead to a higher abstention rate. Thus in order for α and β to both be small, as would be necessary for a high fraction of consistently-predicted points, we may require a large number of constituent models, n. Figure 2 illustrates the trade-off between α, β, and n, depending on the base level of agreement of the constituent models. In Section 5, we show empirically that even with small values of n, abstention rates of selective ensembles are reasonably low in practice.
In summary, selective ensembles accomplish three primary things: (1) they identify points on which the mode prediction cannot be determined, (2) they bound the fraction of points that can be inconsistently predicted, and (3) they provide a means of reliably inferring the mode prediction when the abstention rate can be kept sufficiently low.

heading: 5 EVALUATION
text: In this section, we demonstrate empirically that selective ensembles reduce instability in deep model predictions far below their theoretical bounds—to zero inconsistent predictions in the test set over 276
pairwise comparisons of model predictions for each of tabular datasets, and 40 for image datasets. Additionally, following Theorem 3.1, we show that feature attributions of individual deep models are frequently inconsistent, and that ensembling effectively mitigates this problem.
Setup. To evaluate selective ensembling, we focus on two sources of randomness in the learning rule: (1) random initialization, and (2) leave-one-out changes to the training set. Our experiments consider seven datasets: UCI German Credit, Adult, Taiwanese Credit Default, Seizure, all from Dua and Karra Taniskidou (2017); the IWPC Warfarin Dosing Recommendation (International Warfarin Pharmacogenetic Consortium, 2009), Fashion MNIST (Xiao et al., 2017), and Colorectal Histology (Kather et al., 2016a). All of these datasets are either related to finance, credit approval, or medical diagnosis, except for FMNIST, which we include as it is a common benchmark for image classification. Further details are in Appendix B.
All experiments are implemented in TensorFlow 2.3. For each tabular, we train 500 models from independent samples of the relevant source of randomness (e.g. leave-one-out data variations or random seeds), and for each image dataset, we train 200 models from independent samples of each source of randomness. Details about the model architecture and hyperparameters used are given in Appendix C. Table 1 reports the mean accuracy for each dataset, along with the standard deviation.
For each non-image dataset we generate 24 random ensembles of size n∈ {5,10,15,20} by selecting uniformly without replacement among the 500 pre-trained models, as well 24 “singleton” models drawn uniformly from the 500 to use as a point of comparison when measuring the stability of each ensemble. For image datasets, we generate 10 random ensembles of each size among 200 pre-trained models. We report ensemble predictions in the main paper using α=0.05.

heading: 5.1 SELECTIVE ENSEMBLES: PREDICTION STABILITY AND ACCURACY
text: To measure prediction instability over either selective ensembles or singleton models, we compare the predictions of each pair of models on each point in the test set, amounting to 276 comparisons for tabular datasets, and 40 comparisons for image datasets, in total for each point, and record the rate of disagreement, pflip, across these comparisons. We report mean and variance of this disagreement over 10 random re-samplings of constituent models to create ensemble models.
The results in Table 2 and Figure 3a show the percentage of points with disagreement rate greater than zero. We see that for singleton models, as many as 57% of test points have pflip>0, indicating that disagreement in prediction is in some cases the norm rather than the exception, although more commonly this occurs on 5-10% of the data. Notably, selective ensembles completely mitigate this effect: even when as few as ten models are included in the ensemble, no points experienced pflip > 0. Combined with the fact that abstention rates remain low (1-5%) in all cases except where pflip was originally very high (e.g., German Credit), this shows that selective ensembling can be a practical method for mitigating prediction instability.
Table 3 shows the accuracy of selective ensembles, with abstention counted towards error, as well as accuracy of non-selective ensembles for comparison. Notably, in all six models, with the exception of German Credit, the abstention rate drops to below 4% with 20 models in the ensemble. Accordingly, the accuracy of the selective ensembles in these cases is comparable—typically within a few points—to that of the traditional ensemble. However, with just five models in the ensemble, the abstention rate is 100%; to achieve reasonable predictions with very few models, the threshold α needs to be increased accordingly. Disagreement of non-selective ensembles are pictured in Figure 3a (with exact numbers in Appendix F): while they do lower prediction inconsistency, they are unable to eliminate it as selective ensembles do.

heading: 5.2 ATTRIBUTION STABILITY
text: Following up on the theoretical result given in Theorem 3.1, we demonstrate that feature attributions, which are usually computed for deep models using gradients (Simonyan et al., 2014; Sundararajan et al., 2017; Leino et al., 2018), are often inconsistent between similar models. We then show that, just as ensembling increases prediction stability, it also mitigates gradient instability, leading to more consistent attributions across models. For these experiments, we computed attributions using saliency maps (Simonyan et al., 2014), which are simply the gradient of the model’s prediction with respect to its input, as a simple and widely-used representative of gradient-based attribution methods.
Metrics. Following previous work (Dombrowski et al., 2019; Ghorbani et al., 2019), we measure the similarity between attributions using Spearman’s Ranking Correlation (ρ) and the top-k intersection, with k=5. For image datasets, we also display the Structural similarity metric (SSIM), discussed further in Appendix D.1. Spearman’s ρ is a natural choice of metric as attributions induce an order of importance among features. We note that the top-k intersection is especially interesting in tabular datasets, as often only the most important features are of explanatory interest. To stay consistent with prior work, we also include Pearson’s Correlation Coefficient (r). Note that r and ρ vary from -1 to 1, denoting negative, zero, and positive correlation. We compute these metrics over 276 pairwise comparisons of attributions for each size of ensemble (1, 5, 10, 15, and 20) for tabular datasets, and 40 pairwise comparisons for image datasets. For the top-k metric, we report the mean size of the intersection between each pair of attributions. More details are in Appendix D.
Baselines. To contextualize the difference of attributions across models trained from distinct randomness, we also include the attribution similarity between 24 randomly chosen points in the same model (Table 4). We also present a visual comparison of model attributions, for which we simply plot the attribution for the predicted class for a given point from nine randomly selected models out of the 24, and present the feature attributions in order of their magnitude according to another randomly selected model (Figure 4).
Singleton Models The left image in Figure 4 demonstrates the inconsistency of model attributions of individual German Credit models on a random point in the test set. Each bar on the x-axis represents the attributions for a feature, and each different-colored bar represents a different randomly selected model. Thus, the disagreement between the sizes of the bars of different colors shows the disagreement between models on which features should be deemed important. Notably, some of the bars on the graph depicting individual models even have different signs, which means that models disagree on whether that feature counts towards or against the same prediction. Similar graphs for all other datasets are included in Appendix H.1.
We demonstrate this inconsistency further in Table 4. We see that German Credit and Seizure models have particularly unstable attributions, as the top-k (and to a lesser extent, ρ and r) scores of attributions of varying points in both the same model, and varying models on the same point, are quite similar. Feature attributions of individual models are inconsistent even on highly weighted features: e.g., German Credit dataset has a top-k intersection of just over one attribute on average—suggesting that attributions generated through saliency maps on these sets of models may vary substantially over benign retrainings. Even on models where the metrics are higher, e.g. Taiwanese Credit, the baseline similarity between attributions is higher as well—thus, we see that attributions between models of the same point are usually only 2-3× more related than those of random points within the same model.
This instability suggests that salient variables used to inform predictions across models are sensitive to random choices made during training. As previous work has argued in similar contexts (D’Amour et al., 2020), this may be a result of a deep model’s under-constrained search space with many local optima equivalent with respect to loss, with several minima corresponding to distinct rationales for making predictions.
Ensemble Models. We demonstrate that the similarity between saliency maps of ensembled models is greater than that of individual models, and that this similarity increases linearly with the number of models in the ensemble. For these experiments, we average each model’s attributions toward the majority predicted class of the ensemble. On the right side of Figure 4, we see the feature attributions of various
ensemble models of size 15 over the German Credit dataset. Note how the attributions of ensemble models are much more consistent than on the individual model.
We show this phenomenon more broadly in Figure 3b, where we display graphs of average Spearman’s Rank Coefficient (ρ) (y-axis) between saliency maps on a point in the test set. We see ρ increase as we increase the number of models in the ensemble (x-axis), for models generated over different random initializations and one-point differences in the training set. Selective ensembles can further increase stability of explanations by abstaining from unstable points, and this has a marked effect when the abstention rate is high (e.g. German Credit). Similar graphs for the rest of metrics calculated are presented in Appendix H.

heading: 6 RELATED WORK
text: Prior work has shown that deep models are inconsistent in their predictions across arbitrary random changes in their training pipeline, such as initialization parameters and makeup of the training set (Black and Fredrikson, 2021; Mehrer et al., 2020; D’Amour et al., 2020; Kolen and Pollack, 1991; Feldman, 2019). The problem of model sensitivity, particularly to variability in the training set, can lead to an increase generalization error (Elisseeff et al., 2003) as well as to leaking training set information (Dwork, 2006; Yeom et al., 2018). Thus, stability-enhancing learning rules have received significant attention in order to bolster desirable properties, such as privacy (Liu et al., 2020; Papernot et al., 2018; Wang et al., 2016).
One such approach is model ensembling, which has been used as a variance reduction method since the advent of statistical learning (Zhou et al., 2002; Valentini et al., 2004; Opitz and Maclin, 1999; Tumer and Ghosh, 1996; Dvornik et al., 2019; Hasan et al., 2020; Freund and Schapire, 1997; Sagi and Rokach, 2018; Polikar, 2012; Che et al., 2011; Perrone and Cooper, 1992; Hansen and Salamon, 1990). However, to our knowledge, there is little work on providing guarantees about model disagreement using ensemble models that may abstain from prediction. We relate our approach to the classic bias-variance decomposition of error (Domingos, 2000), showing that it certifiably bounds the variance component.
Selective ensembles can be seen as a way to flag points that prone to inconsistency. Under this view, calibration and uncertainty estimation of deep model predictions (Lakshminarayanan et al., 2016; Ovadia et al., 2019) is a related stream of work, and one could potentially use these techniques to determine when to abstain from prediction. However, preventing inconsistent predictions and abstaining from uncertain predictions are different goals: in our setting, the aim is to predict the mode across models drawn from a certain distribution, whereas calibration is measured against predicting the true label. Moreover, prior work has shown that confidence scores may not be correlated with prediction consistency across models with different random initializations (Black and Fredrikson, 2021). Finally, while abstaining on points with low confidence scores may lead to greater consistency, it may not yield a guarantee, which this work provides.
Conformal inference (Linusson et al., 2020; Gupta et al., 2019; Löfström et al., 2013), which rigorously assigns confidence to predictions in settings where the data may differ from training, is similarly related in that such a measure could be useful in identifying inconsistently predicted points. However, in this work, we aim to achieve consistent predictions across a known distribution of models, as prior work, as well as our results, suggest, even points conforming to past observations may still be predicted differently by different models.
In addition to inconsistent predictions, this work demonstrates how feature attributions can differ substantially between individual deep models with inconsequential differences. Prior works investigating instability of gradient-based explanation techniques focus on an adversarial context (Dombrowski et al., 2019; Ghorbani et al., 2019; Heo et al., 2019; Wang et al., 2020). For example, Anders et al. (2020) develop attacks to create similar models that have differing gradient-based explanations. Contrastingly, this work focuses on the instability of counterfactual explanations between similar models that may occur naturally. As we demonstrate in Section 5.2, model gradients can be quite dissimilar without any adversary.

heading: 7 CONCLUSION
text: We show that similar deep models can have not only inconsistent predictions, but substantially different gradients as well. We introduce selective ensembles to mitigate this problem by bounding a model’s inconsistency over random choices made during training. Empirically, we show that selective ensembles predict all points consistently over all datasets we studied. Selective ensembling may present a more reliable way of using deep models in settings where high model complexity and stability are required.

heading: A PROOFS
text: A.1 PROOF OF THEOREM 3.1
Theorem 3.1. Let H :X→{−1,1}= sign(h) be a binary classifier and g :X→R be an unrelated function that is bounded from above and below, continuous, and piecewise differentiable. Then there exists another binary classifier Ĥ=sign(ĥ) such that for any >0,
∀x∈X . 1. Ĥ(x)=H(x) 2. inf x′:H(x′)6=H(x)
{ ||x−x′|| } > /2 =⇒ ∇ĥ(x)=∇g(x)
Proof. We partition X into regions {I1....Ik} determined by the decision boundaries ofH. That is, each Ii represents a maximal contiguous region for which each x∈Ii receives the same label fromH. Recall we are given a function g :X→R which is bounded from above and below. We create a set of functions ĝIi :Ii→R such that
ĝIi(x)= { g(x)−infxg(x)+c ifH(Ii)=1 g(x)−supxg(x)−c ifH(Ii)=−1
where c is some small constant greater than zero. Additionally, let d(x) be the `2 distance from x to the nearest decision boundary of h, i.e. d(x)=infx′:H(x′)6=H(x) { ||x−x′|| } . Then, we define ĥ to be:
ĥ(x)= { ĝIi(x) for x ∈Ii if d(x)> 2 ĝIi(x)· 2d(x) for x ∈Ii if d(x)≤
2
And, as described above, we define Ĥ=sign(ĥ). First, we show that Ĥ(x)=H(x) ∀x∈X. Without loss of generality, consider some Ii whereH(x)=1, for any x∈Ii. We first consider the case where d(x)> 2 .
By construction, for x∈Ii, Ĥ(x)=sign(ĥ(x))=sign(ĝIi(x))=sign(g(x)−infxg(x)+c). By definition of the infimum, g(x)−infxg(x)≥0, and thus sign(g(x)−infxg(x)+c)=1, so Ĥ(x)=1=H(x). Note that in the case where d(x)≤ 2 , we can follow the same argument as multiplication by a positive constant does not affect the sign. A symmetric argument follows for the case where for x∈Ii,H(x)=−1; thus, Ĥ(x)=H(x) ∀x∈X.
Secondly, we show that ∇ĥ(x) =∇g(x) ∀x where d(x)> 2 . Consider the case where H(x) = 1. By construction, ĥ(x)= ĝIi(x)=g(x)−infxg(x)+c. Note that this means the infimum and c are constants, so their gradients are zero. Thus, ∇ĥ(x) =∇g(x). A symmetric argument holds for the case where H(x)=−1.
It remains to prove that ĥ is continuous and piecewise differentiable, in order to be a realizable as a ReLU-network. By assumption, g is piecewise differentiable, which means that ĝi are piecewise differentiable as well, as is ĝi(x)· d(x) . Thus, ĥ is piecewise-differentiable. To see that ĥ is continuous, consider the case where d(x)= /2 for some x. Then ĝi(x)· d(x) = ĝi(x)· = ĝi(x). Additionally, consider the case where d(x) = 0, i.e. x is on a decision boundary of h(x), between two regions Ii,Ij. Then ĥ(x)= ĝi(x)· d(x) = ĝi(x)·0=0= ĝj(x)·0= ĝj(x). This shows that the piecewise components of ĥ come to the same value at their intersection.Further, each piecewise component of ĥ is equal to some continuous function, as g(x) is continuous by assumption. Thus, ĥ is continuous, and we conclude our proof.
We include a visual intuition of the proof in Figure 5.
A.2 PROOF OF THEOREM 4.1
Theorem 4.1. Let P be a learning pipeline, and let S be a distribution over random states. Further, let gP,S be the mode predictor, let ĝn(P,S) for S∼Sn be a selective ensemble, and let α≥0. Then,
∀x∈X . Pr S∼Sn
[ ĝn(P,S ; α,x) ABS6=gP,S(x) ] ≤α
Proof. ĝn(P,S) is an ensemble of nmodels. By the definition of Algorithm 2, ĝn(P,S) gathers a vector of class counts of the prediction for x from each model in the ensemble. Let the class with the highest count be cA, with counts nA, and the class with the second highest count be called cB, with counts nB. ĝn(P,S) runs a two-sided hypothesis test to ensure that Pr[nA∼Binomial(nA+nB,0.5)]<α, i.e. that cA is the true mode prediction over S. See that
Pr [ gP,S(x) 6=cA ∧ ĝn(P,S ; α,x)=cA ] (2)
= Pr [ gP,S(x) 6=cA ] ·Pr [ ĝn(P,S ; α,x) 6=ABSTAIN | gP,S(x) 6=cA ] (3)
≤ Pr [ ĝn(P,S ; α,x) 6=ABSTAIN | gP,S(x) 6=cA ] (4)
≤ Pr [ ĝn(P,S ; α,x) 6=ABSTAIN | gP,S(x) 6=cA ] =α By Hung et al. (2019) (5)
Thus,
Pr [ gP,S(x) 6=cA ∧ ĝn(P,S ; α,x)=cA ] ≤α
A.3 PROOF OF COROLLARY 4.2
Corollary 4.2. Let P be a learning pipeline, and let S be a distribution over random states. Further, let gP,S be the mode predictor, let ĝn(P,S) for S∼Sn be a selective ensemble. Finally, let α≥0, and let β≥0 be an upper bound on the expected abstention rate of ĝn(P,S). Then, the expected loss variance, V (x), over inputs, x, is bounded by α+β. That is,
E x∼D
[ V (x) ] = E x∼D [ Pr S∼Sn [ ĝn(P,S ; x) 6=gP,S(x) ] ] ≤α+β
Proof. Since gP,S never abstains, we have by the law of total probability that
Pr S∼Sn
[ ĝn(P,S ; α,x) 6=gP,S(x) ] = Pr
S∼Sn
[ ĝn(P,S ; α,x) ABS6= gP,S(x) ∨ ĝn(P,S ; α,x)=ABSTAIN
= Pr S∼Sn
[ ĝn(P,S ; α,x) ABS6= gP,S(x) ] + Pr
S∼Sn
[ ĝn(P,S ; α,x)=ABSTAIN ]
By Theorem 4.1, we have that PrS∼Sn [ ĝn(P,S ; α,x) ABS6=gP,S(x) ] ≤α, thus
E x∼D
[ Pr
S∼Sn
[ ĝn(P,S ; α,x) 6=gP,S(x) ] ] ≤α+ E
x∼D
[ Pr
S∼Sn
[ ĝn(P,S ; α,x)=ABSTAIN ] ] Finally, since β is an upper bound on the expected abstention rate of ĝn(P,S), we conclude that
E x∼D
[ Pr
S∼Sn
[ ĝn(P,S ; α,x) 6=gP,S(x) ] ] ≤α+β
A.4 PROOF OF COROLLARY 4.3
Corollary 4.3. Let P be a learning pipeline, and let S be a distribution over random states. Further, let ĝn(P,S) for S∼Sn be a selective ensemble. Finally, let α≥0, and let β≥0 be an upper bound on the expected abstention rate of ĝn(P,S). Then,
E x∼D
[ Pr
S1,S2∼Sn
[ ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x) ] ] ≤2(α+β)
Proof. For i∈{1,2}, let Ai be the event that ĝn(P,Si ; α,x) = ABSTAIN, and let N i be the event that ĝn(P,Si ; α,x)
ABS6= gP,S . In the worst case, A1 and A2, and N1 and N2 are disjoint, that is, e.g., if ĝn(P,Si) abstains on x, then ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x). In other words, we have that
Pr S1,S2∼Sn
[ ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x) ] ≤Pr [ A1 ∨ A2 ∨ N1 ∨ N2 ] which, by union bound implies that
Pr S1,S2∼Sn
[ ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x) ] ≤Pr [ A1 ] +Pr [ A2 ] +Pr [ N1 ] +Pr [ N2 ] .
By Theorem 4.1 Pr [ N i ] ≤α. Thus we have
E x∼D
[ Pr
S1,S2∼Sn
[ ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x) ] ] ≤2α+ E
x∼D
[ Pr [ A1 ] ]
+ E x∼D
[ Pr [ A2 ] ] .
Finally, since β is an upper bound on the expected abstention rate of ĝn(P,S), we conclude that
E x∼D
[ Pr
S1,S2∼Sn
[ ĝn(P,S1 ; α,x) 6= ĝn(P,S2 ; α,x) ] ] ≤2(α+β)

heading: B DATASETS
text: The German Credit and Taiwanese data sets consist of individuals financial data, with a binary response indicating their creditworthiness. For the German Credit dataset, there are 1000 points, and 20 attributes. We one-hot encode the data to get 61 features, and standardize the data to zero mean and unit variance using SKLearn Standard scaler. We partitioned the data intro a training set of 700 and a test set of 200. The Taiwanese credit dataset has 30,000 instances with 24 attributes. We one-hot encode the data to get 32 features and normalize the data to be between zero and one. We partitioned the data intro a training set of 22500 and a test set of 7500.
The Adult dataset consists of a subset of publicly-available US Census data, binary response indicating annual income of > 50k. There are 14 attributes, which we one-hot encode to get 96 features. We normalize the numerical features to have values between 0 and 1. After removing instances with missing
values, there are 30,162 examples which we split into a training set of 14891, a leave one out set of 100, and a test set of 1501 examples.
The Seizure dataset comprises time-series EEG recordings for 500 individuals, with a binary response indicating the occurrence of a seizure. This is represented as 11500 rows with 178 features each. We split this into 7,950 train points and 3,550 test points. We standardize the numeric features to zero mean and unit variance.
The Warfain dataset is collected by the International Warfarin Pharmacogenetics Consortium (International Warfarin Pharmacogenetic Consortium, 2009) about patients who were prescribed warfarin. We removed rows with missing values, 4819 patients remained in the dataset. The inputs to the model are demographic (age, height, weight, race), medical (use of amiodarone, use of enzyme inducer), and genetic (VKORC1, CYP2C9) attributes. Age, height, and weight are real-valued and were scaled to zero mean and unit variance. The medical attributes take binary values, and the remaining attributes were one-hot encoded. The output is the weekly dose of warfarin in milligrams, which we encode as "low", "medium", or "high", following the recommendations set by International Warfarin Pharmacogenetic Consortium (2009).
Fashion MNIST contains images of clothing items, with a multilabel response of 10 classes. There are 60000 training examples and 10000 test examples. We pre-process the data by normalizing the numerical values in the image array to be between 0 and 1.
The colorectal histology dataset contains images of human colorectal cancer, with a multilabel response of 8 classes. There are 5,000 images, which we divide into a training set of 3750 and a validation set of 1250. We pre-process the data by normalizing the numerical values in the image array to be between 0 and 1.
The UCI datasets as well as FMNIST are under an MIT license, the colorectal histology and Warfarin datasets are under a Creative Commons License. (Dua and Karra Taniskidou, 2017; Kather et al., 2016b; International Warfarin Pharmacogenetic Consortium, 2009).

heading: C MODEL ARCHITECTURE AND HYPER-PARAMETERS
text: The German Credit and Seizure models have three hidden layers, of size 128, 64, and 16. Models on the Adult dataset have one hidden layer of 200 neurons. Models on the Taiwanese dataset have two hidden layers of 32 and 16. The Warfarin models have one hidden layer of 100. The FMNIST model is a modified LeNet architecture (LeCun et al., 1995). This model is trained with dropout. The Colon models are trained with a modified, ResNet50 (He et al., 2016), pre-trained on ImageNet (Deng et al., 2009), available from Keras. German Credit, Adult, Seizure, Taiwanese, and Warfarin models are trained for 100 epochs; FMNIST for 50, and Colon models are trained for 20 epochs. German Credit models are trained with a batch size of 32; FMNIST 64; Adult, Seizure, and Warfarin models with batch sizes of 128; and Colon and Taiwanese Credit models with batch sizes of 512. German Credit, Adult, Seizure, Taiwanese Credit, Warfarin, and Colon are trained with keras’ Adam optimizer with the default parameters. FMNIST models are trained with keras’ SGD optimizer with the default parameters.
Note that we discuss train-test splits and data preprocessing above in Section B. We prepare different models for the same dataset using Tensorflow 2.3.0 and all computations are done using a Titan RTX accelerator on a machine with 64 gigabytes of memory.

heading: D METRICS
text: We report similarity between feature attributions with Spearman’s Ranking Correlation (ρ), Pearson’s Correlation Coefficient (r), top-k intersection, `2 distance, and SSIM for image datasets. We use standard implementations for Spearman’s Ranking Correlation (ρ) and Pearson’s Correlation Coefficient (r) from scipy, and implement `2 distance as well as the top-k using numpy functions.
Note that r and ρ vary from -1 to 1, denoting negative, zero, and positive correlation. We display top-k for k=5, and compute this by taking the number of features in the intersection of the top 5 between two models, and then diving this by 5. Thus top-k is between 0 and 1, indicating low and high correlation respectively.
The `2 distance has a minimum of 0, but is unbounded from above, and SSIM varies from -1 to 1, indicating no correlation to exact correlation respectively.
Note that we compute these metrics between two different models on the same point, for every point in the test set, over 276 different pairs of models for tabular datasets and over 40 pairs of models for image datasets. We average this result over the points in the test set and over the comparisons to get the numbers displayed in the tables and graphs throughout the paper.
D.1 SSIM
Explanations for image models can be interpreted as an image (as there is an attribution for each pixel), and are often evaluated visually (Leino et al., 2018; Simonyan et al., 2014; Sundararajan et al., 2017). However, pixel-wise indicators for similarity between images (such as top-k similarity between pixel values, Spearman’s ranking coefficient, or mean squared error) often do not capture how similar images are visually, in aggregate. In order to give an indication if the entire explanation for an image model, i.e. the explanatory image produced, is similar, we use the structural similarity index (SSIM) (Wang et al., 2004). We use the implementation from scikit−image (str). SSIM varies from -1 to 1, indicating no correlation to exact correlation respectively.
E EXPERIMENTAL RESULTS FOR α=0.01
We include results on the prediction of selective ensemble models for α=0.01 as well. We include the percentage of points with disagreement between at least one pair of models (pflip>0) trained with different random seeds (RS) or leave-one-out differences in training data, for singleton models (n=1) and selective ensembles (n>1) in Table 5. Notice the number of points with pflip>0 is again zero. We also include the mean and standard deviation of accuracy and abstention rate for α=0.01 in Table 6.

heading: F SELECTIVE ENSEMBLING FULL RESULTS
text: We include the full results from the evaluation section, including error bars on the disagreement, accuracy, abstention rates of selective ensembles, in Table 7 and Table 8 respectively. We also include the results for all datasets on the accuracy of non-selective ensembling and their ability to mitigate disagreement, in Table 7 and Table 6 respectively.

heading: G SELECTIVE ENSEMBLES AND DISPARITY IN SELECTIVE PREDICTION
text: In light of the fact that prior work has brought to light the possibility of selective prediction exacerbating model accuracy disparity between demographic groups Jones et al. (2020), we present the selective ensemble accuracy and abstention rate group-by-group for several different demographic groups across four datasets: Adult, German Credit, Taiwanese Credit, and Warfarin Dosing. Results are in Table 9.

heading: H EXPLANATION CONSISTENCY FULL RESULTS
text: We give full results for selective and non-selective ensembling’s mitigation of inconsistency in feature attributions.
H.1 ATTRIBUTIONS
We pictorially show the inconsistency of individual model feature attributions versus the consistency of attributions ensembles of 15 for each tabular dataset in Figure 8 and Figure 9. The former shows inconsistency over differences in random initialization, the latter shows inconsistency over one-point changes to the training set.
H.2 SIMILARITY METRICS OF ATTRIBUTIONS
We display how Spearman’s ranking coefficient (ρ), Pearson’s Correlation Coefficient (r), top-5 intersection and `2 distance between feature attributions over the same point become more and more similar with increasing numbers of ensemble models. While the comparisons to generate the similarity score is between two models on the same point, the result is averaged over this comparison for the entire test set. We average this over 276 comparisons between different models. In cases were abstention is high, indicating inconsistency on the dataset for the training pipeline, selective ensembling can further improve stability of attributions by not considering unstable points (see e.g. German Credit). We present the expanded results from the main paper, for all datasets, on all four metrics (as SSIM is only computed for image datasets, and ρ is not computed for image datasets). We display error bars indicating standard deviation over the 276 comparisons between two models for tabular datasets, and 40 comparisons for image datasets.
I INTUITION BEHIND ENSEMBLE GRADIENT CONSISTENCY
In section 4, we demonstrated how prediction inconsistency can be provably bounded in selective ensembles. Section 5.2 showed that ensembling also improves the consistency of the gradients; we now provide some theoretical insight as to why this is the case.
At a high level, we argue that by taking the average gradient (of the mode prediction, w.r.t. the input), we reduce the variance in the ensemble gradient, stabilizing it towards the expected gradient over the distribution S. While it is difficult to exactly characterize the distribution over gradients, we provide a formalized intuition by making some simplifying assumptions about this distribution.
We model the variations in gradients from model to model as a Gaussian (i.e., the gradient of each model deviates from the expected gradient by some Gaussian noise). Formally, let f=P(S) be a model produced by the pipeline on some random state, S, and let ∇̂f(x)=ES∼S [∇f(x)] be the expected gradient over S. We will assume that∇f(x), the gradient of a particular model produced by the pipeline, is given by ∇̂f(x)+η, where η∼N (0,σ2). Under this assumption, the fact that the gradient is stabilized by ensembling follows from the fact that the variance of the sample mean is smaller than the population variance. Specifically, the variance of the sample mean of the gradient with n samples is σ2/n, which tends towards 0 as n increases (Equation 6).
Var
[ 1
n n∑ i=1 ∇f(x)
] = σ2
n (6)
The metrics we measure for gradient consistency are not based on variance of the gradient (which Equation 6 shows is reduced by ensembling), but rather ranking of features according to their gradients. To relate this to variance we can argue the following: first, let us take, for example, the top-ranked feature (the feature with the largest positive gradient). Assuming the expected gradient is not degenerate (in our case this means there is a unique top-ranked feature), we can consider the gap between the average gradient of the top-ranked feature, i, and the second-ranked feature, j. When the variance in the ensemble gradient is reduced sufficiently relative to this gap, it will be unlikely that this order will be switched.
Specifically, let δ̂=∇̂if(x)−∇̂jf(x) be the gap between the average gradient of the top-ranked feature and the second-ranked feature, and let δ(n)= 1n ∑n i=1∇if(x)−∇jf(x) be the gap between the gradient of the same features on an ensemble of nmodels produced by the pipeline. Note that the ordering between features i and j is preserved provided that δ(n)>0. Thus, we can quantify the probability that this ordering is preserved according to Equation 7.
Pr[δ(n)>0]=Pr[ηi−ηj>0] where ηi∼N ( ∇̂if(x), σ2
n
) and ηj∼N ( ∇̂jf(x), σ2
n ) =Pr [ δ̂>ηij ] where ηij∼N ( 0, 2σ2
n ) =Φ ( δ̂ √ n
2σ2
) (7)
The same argument holds for other pairs of features.

heading: J ACCURACY REJECTION CURVES
text: Figure 11 shows plots of accuracy-rejection curves Nadeem et al. (2009) for selective ensembles of sizes 5, 10, 15, and 20. Rejection rates were controlled by varying α from 1 to 0. In accordance with the convention of Nadeem et al., we count the accuracy as 1.0 when the model abstains on all points.
The plots indicate that accuracy remained relatively high even with low abstention rates and did not increase substantially when more points were rejected, signifying that there was not a strong trade-off between accuracy and rejection. This is desirable because we clearly prefer to have a low rejection rate; meanwhile,
the purpose of abstention is to guarantee consistency, so we do not expect abstention to have a strong effect on accuracy. Furthermore, low rejection rates correspond to more consistent predictions. Finally, we note that rejection rates are kept low even for small values of α by increasing the size of the ensemble.

Review summaries:
In the paper the authors proposed a selective ensemble whose constituents are classifiers with reject (abstention) option. They theoretically exposed the problem that differentiable models yielding identical predictions might remotely share identical gradients, biasing the feature attribution based on (integrated) gradient approaches. They theoretically demonstrated that the selective ensemble can contribute to model stability, and empirically showed that both the model stability and feature attribution could be improved as a result of the proposed method.

In this paper, the authors address the problem that models trained for the same purpose may achieve similar accuracy on consistent test data but differently on individual predictions. Such inconsistent behavior is highly problematic, especially in the medical and financial domains. To address this problem, the authors introduce a selective ensemble that mitigates such inconsistencies by applying hypothesis testing to the predictions of a set of models trained on randomly selected starting conditions. First, they proved that the inconsistency of predictions between the selective ensembles is bounded. Additionally,  they empirically showed that the selective ensembles achieve consistent predictions and feature attributions while maintaining a low abstention rate. On seven benchmark datasets, the selective ensembles have zero points with inconsistent predictions. And an abstention rate as low as 1.5%. Thus, the selective ensemble proposed by the authors may present a more reliable method for using deep models in environments where high model complexity and stability are required.

This paper presents a selective ensemble method. Given a set of models, it performs a statistical test to determine if the mode prediction was selected by a statistically significant majority of the constituent models. If the test succeeds, it returns the mode prediction, Otherwise, it abstains from prediction. the authors demonstrated the effectiveness of their method on improving classification accuracy by abstaining from those that are difficult to classify.