SlowGuess/NeurIPS_2023_OCR huggingface dataset:
A way to further speed up LINEX would be to implement it through embarrassing parallelism which can easily be done across explanations. This will prevent scaling of the running time in the number of examples when many explanations are needed. The setting with many explanations is anyway where we would need efficiency because if only few explanations were desired the slightly higher running time of LINEX would not be an issue.
Expanding on the proof sketch provided in the main paper we now provide a case wise analysis to prove Theorem 1.
-  $\boldsymbol{w}_1^* = \boldsymbol{w}_2^*$ : If the optimal solutions to both environments in the convex set  $[-\gamma, \gamma]^d$  are the same, then in the first iteration itself where we fit to the first environment we would have reached the optimal solution to our problem where  $\tilde{\boldsymbol{w}}_1 = \boldsymbol{w}_1^*$ . This is because in the second iteration where we fit the second environment to the residual from the previous fit  $\tilde{\boldsymbol{w}}_2 = \mathbf{0}$  and the algorithm would terminate. This would imply the output of algorithm 1 would be  $\boldsymbol{w} = \boldsymbol{w}_1^*$ .
-  $\pmb{w}_1^* \neq \pmb{w}_2^*$ : When the optimal solutions for the two environments are not equal we consider the following two cases:
- Opposite sign attributions: If the  $i^{th}$  component of  $\boldsymbol{w}_1^*$  and  $\boldsymbol{w}_2^*$  have opposite signs, then the  $i^{th}$  components of the ensemble predictor,  $\tilde{w}_{1i}$  and  $\tilde{w}_{2i}$  are both at the boundary  $\gamma$  and  $-\gamma$  respectively if  $\tilde{w}_{1i} > 0$ . This is because both try to push the ensemble (i.e. their sum) towards the sign they have where eventually they reach the boundary  $\pm \gamma$  and have no incentive to deviate. Any deviation from these values will lead to a higher least squares error in their environment, thus making this a NE.
- Same sign attributions: If the  $i^{th}$  component of  $w_{1}^{*}$  and  $w_{2}^{*}$  have same signs, then the  $i^{th}$  component of ensemble predictor constructed from the NE is set to the least squares attribution with a smaller absolute value, i.e.,  $w_{i} = w_{1i}^{*}$ , where  $|w_{1i}^{*}| \leq |w_{2i}^{*}|$ . Without loss of generality assume  $0 < w_{1i}^{*} < w_{2i}^{*}$ , the attribution of the environments' predictors in NE, then  $\tilde{w}_{1i}$  and  $\tilde{w}_{2i}$  have opposite signs, i.e.,  $\tilde{w}_{2i} = \gamma$  and  $\tilde{w}_{1i} = w_{1i}^{*} - \gamma$  where the
ensemble predictor for the  $i^{\mathrm{th}}$  component would be  $w_{i} = \tilde{w}_{1i} + \tilde{w}_{2i} = w_{1i}^{*} - \gamma +\gamma = w_{1i}^{*}$  since any deviation from this would lead to a worse least squares loss for the corresponding environment. This shows that ensemble predictor is conservative and selects the smaller least squares attribution.
C Behavior for More than Two Environments
Given Assumptions 1 and 2 we now discuss the behavior of our method for more than two environments. If the number of environments is odd, then using similar logic to that discussed in the proof sketch one can see that the feature attribution would be equal to the median of the feature attributions across all the environments. Essentially, all environments with optimal least squares attributions above the median would be at  $+\gamma$ , while those below it would be at  $-\gamma$ . The one at the median would remain so with no incentive for any environment to alter its attribution making it a NE. This is a stable choice that is also likely to be faithful as we have no more information to decide otherwise. On the other hand if we have an even number of environments the final attribution in this case depends on the middle two environments in the same manner as the two environment case proved in Theorem 1. Thus, if the optimal least squares attributions of the middle two environments have opposite sign, then the final attribution is zero, else its the lower of the two attributions in terms of the numerical value. This happens because the NE for the other environments is  $\pm \gamma$  depending on if their optimal least squares attributions are above/below those of the middle two environments. This again is a stable and likely to be faithful choice, where also unidirectionality is preferred.
D.1 Dataset Details and Hyperparameter Specifications
We describe the datasets and the hyperparameters used for each. We set perturbation neighborhood sizes 10 (IRIS), 500 (MEPS), 100 (FMNIST-random), 500 (FMNIST-realistic), 100 (CIFAR10-random), 500 (CIFAR10-realistic), 100 (Rotten tomatoes) for generating local explanations. We also use 3, 10, 10, 10, 5 as exemplar neighborhood sizes to compute GI, CI and  $\Upsilon$  metrics for the five datasets respectively. We also use 5-sparse explanations for all cases except FMNIST and CIFAR10 with realistic perturbations where we follow MeLIME and generate a dense explanation using ridge penalty with penalty multiplier value of 0.001. The  $\ell_{\infty}$  bound  $\gamma$  in Algorithm 1 is set as the maximum absolute value of linear coefficient computed by running LIME/MeLIME in the two individual environments. Please look at IRIS dataset first since it contains some of the common details used across others.
IRIS (Tabular): This dataset has 150 instances with four numerical features representing the sepal and petal width and length in centimeters. The task is to classify instances of Iris flowers into three species: setosa, versicolor, and virginica. A random forest classifier was trained with a train/test split of  $0.8 / 0.2$  and yielded a test accuracy of  $93\%$ . We provide local explanations for the prediction probabilities for class setosa. For both random and realistic perturbations, we use a perturbation neighborhood size of  $n$ . For random perturbations, we used the same approach followed by LIME and sample from a Gaussian around each data point. Realistic perturbations (with the same number  $n$ ) were generated using KDEGen [8], a kernel density estimator (KDE) with the Gaussian kernel fitted on the training dataset to sample data around a sample point. For both random and realistic perturbations, we weight the neighborhood using a Gaussian kernel of width  $\tau \sqrt{d}$ , where  $d$  is the dimension of the feature vector and  $\tau = \{0.05, 0.1, 0.25, 0.5, 0.75\}$ , and this corresponded to kernel widths  $\{0.1, 0.2, 0.5, 1.0, 1.5\}$ . We also perform a weighted version of realistic selection where we use MAPLE [39] to assign weights to all the test examples and pick the top  $n$  weighted examples to use as the perturbation neighborhood. For random/realistic perturbations and realistic selection, the corresponding environments (of size  $n$  each) for LINEX are created by drawing  $k$  bootstrap samples where  $k = \{2, 3, 4, 5\}$  in our experiments. We test for  $n = \{10, 20, 30, 40, 50\}$  with this dataset.
Medical Expenditure Panel Survey (Tabular): The Medical Expenditure Panel Survey (MEPS) dataset is produced by the US Department of Health and Human Services. It is a collection of surveys of families of individuals, medical providers, and employers across the country. We choose Panel 19 of the survey which consists of a cohort that started in 2014 and consisted of data collected over 5
rounds of interviews over 2014 - 2015. The outcome variable was a composite utilization feature that quantified the total number of healthcare visits of a patient. The features used included demographic features, perceived health status, various diagnosis, limitations, and socioeconomic factors. We filter out records that had a utilization (outcome) of 0, and log-transformed the outcome for modeling. These pre-processing steps resulted in a dataset with 11136 examples and 32 categorical features. We train a random forest regressor that has a test  $R^2$  of 0.325 in this dataset. We provide local explanations of the predictions. With MEPS, we do not use realistic perturbations since KDE and VAE generators do not work well with categorical data. Otherwise the setting is similar as IRIS data, except that we use  $n = \{50, 100, 200, 300, 400, 500\}$ . The kernel widths in this case were \{0.28, 0.57, 1.41, 2.83, 4.24\}. We use  $k = \{2, 3, 4, 5\}$  for this dataset.
Fashion MNIST (Images): This dataset has  $28 \times 28$  grayscale images of fashion articles with 60,000 train and 10,000 test samples. The task is to classify these into 10 classes corresponding to coat, shoe, and so on. A neural network trained with test accuracy of  $87\%$ . Explanations are generated for the prediction probabilities corresponding to the predicted class for each example. We choose 1000 test examples to generate explanations. Realistic perturbations were generated using VAEGen [8], a Variational Auto Encoder (VAE) fitted on the training dataset. For random perturbations, we chose  $n$  from  $\{50,100,200,300,400,500\}$  and kernel sizes were  $\{0.43,0.85,2.14,4.27,6.41\}$ . For realistic perturbations we chose  $n$  from  $\{250,500,750,1000\}$  and the kernel widths were  $\{1.4,2.8,7.0,14.0,21.0\}$ . We use  $k = \{2,3,4,5\}$  for this dataset.
CIFAR10 (Images): This dataset has  $32 \times 32$  colored images belonging to 10 different classes. The dataset has 50,000 train and 10,000 test samples. The task is to classify these into 10 classes corresponding to dog, bird, and so on. A residual network with 18 units (ResNet18) was trained with test accuracy of  $\sim 95\%$ . Explanations are generated for the prediction probabilities corresponding to the predicted class for each example. We choose 1000 test examples to generate explanations. Realistic perturbations were generated using VAEGen [8], a Variational Auto Encoder (VAE) fitted on the training dataset. For random perturbations, we chose  $n$  from  $\{50, 100, 200, 300, 400, 500\}$  and kernel sizes were  $\{0.43, 0.85, 2.14, 4.27, 6.41\}$ . For realistic perturbations we chose  $n$  from  $\{250, 500, 750, 1000\}$  and the kernel widths were  $\{1.4, 2.8, 7.0, 14.0, 21.0\}$ . We use  $k = \{2, 3, 4, 5\}$  for this dataset.
Rotten Tomatoes (Text): This dataset contains 10662 movie reviews from rotten tomatoes website along with their sentiment polarity, i.e., positive or negative reviews and the task is to classify the sentiment of the reviews into positive or negative. The review sentences were vectorized using CountVectorizer and TfidfTransformer and a sklearn Naive Bayes classifier was fitted on training dataset which yielded a test accuracy of  $75\%$ . Explanations are generated for the prediction probabilities corresponding to the predicted class for each example. Realistic perturbations were generated using Word2VecGen [8], wherein word2vec embeddings are first trained using the training corpus and new sentences are generated by randomly replacing a sentence word whose distance in the embedding space lies within the radius of the neighbourhood. For both random and realistic perturbations,  $n$  was chosen from  $\{25, 50, 75, 100\}$ . The kernel sizes were  $\{0.42, 1.06, 2.12, 3.18\}$  for random perturbations (kernel size 0.21 resulted in numerical issues), and  $\{0.21, 0.42, 1.06, 2.12, 3.18\}$  for realistic perturbations. We use  $k = \{2, 3, 4, 5\}$  for this dataset.
E Results with All Datasets and Hyperparameter Combinations for Random and Realistic Perturbations
We present results with all hyperparameter combinations for random and realistic perturbations. Results for LIME with random perturbations (LIME), smoothed LIME (S-LIME), LINEX with random perturbations (LINEX/rand), MeLIME (MeLIME), LINEX with MeLIME-like realistic neighborhoods (LINEX/real), MAPLE (MAPLE), LINEX with MAPLE-like realistic neighborhoods (LINEX/mpl) are presented in figures 5-19. The legend for these figures are given in Figure 4.
For the five datasets, we perform ablations by varying one of perturbation neighborhood size (Figures 5-9), number of environments (Figures 10-14), and kernel width (Figures 15-19). Each point in these figures are averaged over all possible values for the two parameters that are not ablated. For example, each point in Figure 5 is averaged over all possible values for kernel widths and number of
environments for a given perturbation neighborhood size. Standard errors of the mean are also plotted in the same color with lesser opacity. Lower values of Infidelity (INFD), Generalized Infidelity (GI), Coefficient Inconsistency (CI) are better whereas for Unidirectionality  $(\Upsilon)$  and Class Attribution Consistency (CAC) higher values are better.
Figures 5-9 show ablations with respect to perturbation neighborhood sizes. Considering all datasets, the stability/recourse metrics (CI,  $\Upsilon$ , CAC) are clearly better for LINEX compared to its counterparts. For LINEX methods (LINEX/random, LINEX/real, LINEXmpl), the metrics get better or stays approximately the same generally as perturbation neighborhood size increases keeping with the intuition that larger perturbation neighborhood sizes should produce explanations that are more stable in the exemplar neighborhood.  $\Upsilon$  for FMNIST and CIFAR10 are already good for small perturbation neighborhood sizes possibly because of the quality of MeLIME perturbations.
Turning to the fidelity metrics (INFD and GI) in tabular datasets, we see that the results still favor LINEX, but less heavily compared to the stability/recourse metrics. This is in line with what we observe in Table 2. In IRIS and MEPS, LINEX is close to or outperforms the corresponding baselines in the GI measure (except for LINEX/mpl with MEPS). This gap closes a bit with INFD, but we note that GI is a better measure since it estimates how faithful explanations are in an exemplar neighborhood. With the text dataset, LINEX variants are slightly more favored, whereas with the image dataset, the baselines have an edge.
Considering Figures 10-14, we see that variations are less stark with respect to number of environments overall for LINEX variants. Note that except for S-LIME, other baselines do not use multiple environments, and hence stay constant. The slight variations in MAPLE are due to the effect of random seeds. In the stability/recourse metrics, again LINEX variants emerge as the clear winner across datasets. With the faithfulness metrics (GI and INFD), in the text dataset, LINEX variants generally perform better, whereas the baselines have a better performance in the image dataset.
Finally, we study the variation of the performance measures with respect to kernel width in Figures 15-19. We see that the stability/recourse metrics flatten out in all cases with large kernel widths. This behaviour holds true for faithfulness metrics (GI and INFD) as well except in some cases. GI and INFD measures also increase before they flatten out since the fit becomes poorer at larger kernel widths. The stability/recourse metrics become better or remain approximately the same since explanations generally improve or preserve their stability properties as kernel widths increase. Note that very small kernel widths can lead to unexpected behavior that does not fit the trend as seen with the tabular datasets since explanations can become hyper-local. MAPLE and LINEX/mpl stay the same at different kernel widths since they use a different weighting scheme. As with other ablations, we see that LINEX variants are similar or better in stability/recourse metrics overall, while with the faithfulness metrics the results are more mixed.
Note that we do not compute MeLIME perturbations with MEPS since KDE and VAE generators do not work well with categorical data, and do not use compute CAC since the task is regression. Further, the features used in explanations for different test examples are not comparable for random perturbations with FMNIST, CIFAR10 and Rotten Tomatoes, hence we cannot compute CAC for those cases as well. This explains the missing curves/plots.
Figure 4: Legend for figures 5-19
(b) MEPS
(d) Rotten Tomatoes
(c) FMNIST
(e) CIFAR10
Figure 5: Coefficient inconsistency (CI) vs. Perturbation neighborhood size.
(a) Iris
(b) FMNIST
(c) Rotten Tomatoes
Figure 6: Class attribution consistency (CAC) vs. Perturbation neighborhood size.
(a) Iris
(b) MEPS
(c) FMNIST
(e) CIFAR10
Figure 7: Unidirectionality  $(\Upsilon)$  vs. Perturbation neighborhood size.
(a) Iris
(b) MEPS
(c) FMNIST
(e) CIFAR10
Figure 8: Generalized infidelity (GI) vs. Perturbation neighborhood size.
(e) Rotten Tomatoes (random)
(f) Rotten Tomatoes (realistic)
(c) FMNIST (random)
(d) FMNIST (realistic)
(g) CIFAR10
Figure 9: Infidelity (INFD) vs. Perturbation neighborhood size.
(a) Iris
Figure 10: Coefficient inconsistency (CI) vs. Number of environments.
(a) Iris
Figure 11: Class attribution consistency (CAC) vs. Number of environments.
F Example Feature Attributions in Text Data: MeLIME vs LINEX
Below we see sample attributions by the two methods along with the magnitude of the attributions. Attribution magnitudes are printed with a precision of  $10^{-3}$  and shown along with the corresponding words in descending order.
F.1 Positive Sentiment
MeLIME: documentary funny and enticing often
LINEX : documentary funny often enticing and
MeLIME: 0.517 0.446 0.333 0.317 0.311
Figure 12: Unidirectionality  $(\Upsilon)$  vs. Number of environments.
(a) Iris
Figure 13: Generalized infidelity (GI) vs. Number of environments.
(a) Iris
(b) MEPS
(e) Rotten Tomatoes (random)
Figure 14: Infidelity (INFD) vs. Number of environments.
(c) FMNIST (random)
(f) Rotten Tomatoes (realistic)
(d) FMNIST (realistic)
(g) CIFAR10
LINEX:0.416 0.377 0.342 0.331 0.330
one-of-a-kind near-masterpiece.
MeLIME: kind near masterpiece
LINEX : masterpiece kind one
MeLIME: 0.832 0.695 0.182
LINEX:0.712 0.384 0.381
(c) FMNIST
(b) MEPS
(e) CIFAR10
Figure 15: Unidirectionality  $(\Upsilon)$  vs. Kernel width.
Figure 16: Coefficient inconsistency (CI) vs. Kernel width.
(a) Iris
Figure 17: Class attribution consistency (CAC) vs. Kernel width.
(a) Iris
(b) MEPS
(c) FMNIST
(e) CIFAR10
Figure 18: Generalized infidelity (GI) vs. Kernel width.
(a) Iris
(e) Rotten Tomatoes (random)
Figure 19: Infidelity (INFD) vs. Kernel width.
MeLIME: enjoyable highly funny fast movie
LINEX : enjoyable highly fast funny movie
MeLIME: 0.550 0.432 0.412 0.389 0.198
LINEX:0.409 0.389 0.372 0.350 0.326
ferrara’s strongest and most touching movie of recent years .
MeLIME: touching years most strongest and
LINEX : touching most recent strongest and
MeLIME: 0.735 0.490 0.450 0.443 0.427
LINEX:0.490 0.488 0.450 0.444 0.407
saved from being merely way-cool by a basic , credible compassion .
MeLIME: cool basic credible merely from
LINEX: cool credible merely compassion from
MeLIME: 1.514 0.050 0.040 0.029 0.026
LINEX:0.358 0.308 0.304 0.299 0.293
MeLIME: funny quite really
LINEX : funny quite really
MeLIME: 0.559 0.417 0.233
LINEX:0.462 0.368 0.275
spare yet audacious . . .
MeLIME: spare yet audacious
LINEX : audacious spare yet
MeLIME: 0.626 0.447 0.395
LINEX:0.501 0.431 0.422
MeLIME: engrossing documentary and enthusiastic an
LINEX : engrossing documentary an enthusiastic and
MeLIME: 0.593 0.455 0.358 0.354 0.333
LINEX:0.461 0.407 0.374 0.357 0.350
MeLIME: funny caper wildly prison
LINEX : funny caper prison wildly
MeLIME: 0.541 0.364 0.214 0.193
LINEX:0.403 0.335 0.245 0.239
this charming but slight tale has warmth, wit and interesting characters compassionately portrayed. MeLIME: charming compassionately and interesting portrayed LINEX : charming compassionately has tale portrayed MeLIME: 0.690 0.507 0.456 0.444 0.424 LINEX : 0.464 0.435 0.431 0.430 0.429
thoughtful, provocative and entertaining.  
MeLIME: thoughtful entertaining and provocative  
LINEX: thoughtful entertaining and provocative  
MeLIME: 0.612 0.517 0.402 0.395  
LINEX: 0.505 0.461 0.415 0.404
the film is quiet, threatening and unforgettable.  
MeLIME: quiet unforgettable and film the  
LINEX: unforgettable quiet film and is  
MeLIME: 0.597 0.483 0.412 0.325 0.303  
LINEX: 0.421 0.416 0.388 0.378 0.338
a moving tale of love and destruction in unexpected places, unexamined lives.  
MeLIME: unexpected moving love tale lives  
LINEX: moving unexpected places lives in  
MeLIME: 0.692 0.662 0.577 0.538 0.499  
LINEX: 0.538 0.530 0.521 0.513 0.501
though frodo's quest remains unfulfilled, a hardy group of determined new zealanders has proved its creative mettle.  
MeLIME: creative group proved has new  
LINEX: creative quest its proved determined  
MeLIME: 0.602 0.441 0.424 0.402 0.393  
LINEX: 0.410 0.392 0.390 0.385 0.381
F.2 Negative Sentiment
originality is sorely lacking.  
MeLIME: lacking sorely is originality  
LINEX: lacking sorely originality is  
MeLIME: 0.543 0.381 0.296 0.278  
LINEX: 0.430 0.356 0.314 0.271
an ugly , pointless , stupid movie . MeLIME: stupid pointless ugly movie an LINEX : stupid pointless ugly movie an MeLIME: 0.543 0.499 0.385 0.365 0.276 LINEX : 0.446 0.411 0.373 0.360 0.350
so devoid of pleasure or sensuality that it cannot even be dubbed hedonistic. MeLIME: devoid even be dubbed of LINEX : devoid so dubbed be cannot MeLIME: 0.666 0.416 0.413 0.372 0.344 LINEX : 0.400 0.392 0.387 0.380 0.368
neither revelatory nor truly edgy--merely crassly flamboyant and comedically labored.  
MeLIME: edgy neither nor labored revelatory  
LINEX: edgy neither nor labored truly  
MeLIME: 1.256 0.338 0.277 0.204 0.021
LINEX:0.439 0.398 0.398 0.369 0.349
occasionally funny , sometimes inspiring , often boring .
MeLIME: boring occasionally inspiring sometimes often
LINEX : boring occasionally sometimes often inspiring
MeLIME: 0.669 0.242 0.218 0.210 0.182
LINEX:0.377 0.266 0.266 0.250 0.236
a cumbersome and cliche-ridden movie greased
with every emotional device known to man .
MeLIME: cliche every device movie with
LINEX : cliche every man cumbersome emotional
MeLIME: 0.695 0.449 0.327 0.280 0.268
LINEX:0.385 0.361 0.354 0.349 0.309
MeLIME: plodding soap ponderous opera disguised
LINEX : plodding soap film ponderous feature
MeLIME: 0.579 0.522 0.421 0.408 0.382
LINEX:0.442 0.440 0.418 0.406 0.377
MeLIME: soap flashy opera overlong kitschy
LINEX : soap flashy opera overlong kitschy
MeLIME: 0.499 0.397 0.391 0.358 0.230
LINEX:0.389 0.362 0.360 0.346 0.300
[a] poorly executed comedy.
MeLIME: poorly comedy executed
LINEX : poorly comedy executed
MeLIME: 0.653 0.348 0.257
LINEX:0.502 0.335 0.309
MeLIME: bad happened movie to that
LINEX : bad happened to movie actors
MeLIME: 0.692 0.396 0.371 0.367 0.242
LINEX:0.442 0.384 0.367 0.361 0.344
MeLIME: waste complete time of
LINEX : waste complete time of
MeLIME: 0.614 0.425 0.313 0.247
LINEX:0.480 0.381 0.348 0.278
don’t waste your money .
MeLIME: waste money don your
LINEX : waste money don your
MeLIME: 0.592 0.497 0.408 0.309
LINEX:0.483 0.450 0.411 0.337
MeLIME: pointless witless and utterly
LINEX : pointless witless utterly and
MeLIME: 0.652 0.491 0.263 0.245
LINEX:0.506 0.444 0.311 0.269
Figure 20: Results using individual samples for realistic perturbations for FMNIST dataset for all classes:1-10 (T-shirt/top, Trouser, Pullover, Dress, Coat, Sandal, Shirt, Sneaker, Bag and Ankle boot). (a) MeLIME feature attributions for an image. (b) LINEX feature attributions for an image. (c) Original image in the class. The  $r$  values show Pearson's correlation between feature attributions and the original image from the respective class. We observe that LINEX attributions/explanations exhibit significantly higher correlation with the original image belonging to a particular class (i.e. high CAC).
G Example Feature Attributions in Image Data: MeLIME vs LINEX
We show feature attributions for individual example images with MeLIME and LINEX with MeLIME perturbations in Figure 20. In Figure 21 we show class-wise mean feature attributions along with mean images. In Figure 22, we see examples from CIFAR10. LINEX explanations seem to provide more meaningful feature attributions.
H Results for All Methods Including SHAP