L-Shapley and C-Shapley: Efficient Model Interpretation for Structured Data

Jianbo Chen, Le Song, Martin J. Wainwright, Michael I. Jordan

Introduction

Modern machine learning models, including random forests, deep neural networks, and kernel methods, can produce high-accuracy prediction in many applications. Often however, the accuracy in prediction from such black box models, comes at the cost of interpretability. Ease of interpretation is a crucial criterion when these tools are applied in areas such as medicine, financial markets, and criminal justice; for more background, see the discussion paper by Lipton as well as references therein.

In this paper, we study instancewise feature importance scoring as a specific approach to the problem of interpreting the predictions of black-box models. Given a predictive model, such a method yields, for each instance to which the model is applied, a vector of importance scores associated with the underlying features. The instancewise property means that this vector, and hence the relative importance of each feature, is allowed to vary across instances. Thus, the importance scores can act as an explanation for the specific instance, indicating which features are the key for the model to make its prediction on that instance.

There is now a large body of research focused on the problem of scoring input features based on the prediction of a given instance (for instance, see the papers as well as references therein). Of most relevance to this paper is a line of recent work that has developed methods for model interpretation based on Shapley value from cooperative game theory. The Shapley value was originally proposed as an axiomatic characterization of a fair distribution of a total surplus from all the players, and can be applied in to predictive models, in which case each feature is modeled as a player in the underlying game. While the Shapley value approach is conceptually appealing, it is also computationally challenging: in general, each evaluation of a Shapley value requires an exponential number of model evaluations. Different approaches to circumventing this complexity barrier have been proposed, including those based on Monte Carlo approximation and methods based on sampled least-squares with weights .

In this paper, we take a complementary point of view, arguing that the problem of explanation is best approached within a model-based paradigm. In this view, explanations are cast in terms of a model, which may or may not be the same model as used to fit the data. Criteria such as Shapley value, which are intractable to compute when no assumptions are made, can be more effectively computed or approximated within the framework of a model. We focus specifically on settings in which a graph structure is appropriate for the data; specifically, we consider simple chains and grids, appropriate for time series and images, respectively. We propose two measures for instancewise feature importance scoring in this framework, which we term L-Shapley and C-Shapley; here the abbreviations “L" and “C" refer to “local” and “connected,” respectively. By exploiting the underlying graph structure, the number of model evaluations is reduced to linear—as opposed to exponential—in the number of features. We demonstrate the relationship of these measures with a constrained form of Shapley value, and we additionally relate C-Shapley with another solution concept from cooperative game theory, known as the Myerson value . The Myerson value is commonly used in graph-restricted games, under a local additivity assumption of the model on disconnected subsets of features. Finally, we apply our feature scoring methods to several state-of-the-art models for both language and image data, and find that our scoring algorithms compare favorably to several existing sampling-based algorithms for instancewise feature importance scoring.

The remainder of this paper is organized as follows. We begin in Section 2 with background and set-up for the problem to be studied. In Section 3, we describe the two methods proposed and analyzed in this paper, based on the L-Shapley and C-Shapley scores. Section 4 is devoted to a study of the relationship between these scores and the Myerson value. In Section 5, we evaluate the performance of L-Shapley and C-Shapley on various real-world data sets, and we conclude with a discussion in Section 6.

Background and preliminaries

We begin by introducing some background and notation.

There is also an information-theoretic interpretation to this definition of importance scores, as discussed in our previous work . In particular, suppose that for a given integer k<dk<d, there is a function x↦S∗(x)x\mapsto S^{*}(x) such that, for all almost all xx, the kk-sized subset S∗(x)S^{*}(x) maximizes vx(S)v_{x}(S) over all subsets of size kk. In this case, we are guaranteed that the mutual information I(XS∗(X),Y)I(X_{S^{*}(X)},Y) between XS∗(X)X_{S^{*}(X)} and YY is maximized, over any conditional distribution that generates a subset of size kk given XX. The converse is also true.

In many cases, class-specific importance is favored, where one is interested in seeing how important a feature subset SS is to the predicted class, instead of the prediction as a conditional distribution. In order to handle such cases, it is convenient to introduce the degenerate conditional distribution

which is the expected log probability of the predicted class given the features in SS.

2 Shapley value for measuring interaction between features

Consider the problem of quantifying the importance of a given feature index ii for feature vector xx. A naive way of doing so would be by computing the importance score vx({i})v_{x}(\{i\}) of feature ii on its own. However, doing so ignores interactions between features, which are likely to be very important in applications. As a simple example, suppose that we were interested in performing sentiment analysis on the following sentence:

This sentence is contained in a movie review from the IMDB movie data set , and it is classified as negative sentiment by a machine learning model to be discussed in the sequel. Now suppose we wish to quantify the importance of feature “not” in prediction. The word “not” plays an important role in the overall sentence as being classified as negative, and thus should be attributed a significant weight. However, viewed in isolation, the word “not” has neither negative nor positive sentiment, so that one would expect that vx({\mbox‘‘not′′})≈0v_{x}(\{\mbox{``\emph{not}''}\})\approx 0.

Thus, it is essential to consider the interaction of a given feature ii with other features. For a given subset SS containing ii, a natural way in which to assess how ii interacts with the other features in SS is by computing the difference between the importance of all features in SS, with and without ii. This difference is called the marginal contribution of ii to SS, and given by

In order to obtain a simple scalar measure for feature ii, we need to aggregate these marginal contributions over all subsets that contain ii. The Shapley value is one principled way of doing so. For each integer k=1,…,dk=1,\ldots,d, we let Sk(i)\mathcal{S}_{k}(i) denote the set of kk-sized subsets that contain ii. The Shapley value is obtained by averaging the marginal contributions, first over the set Sk(i)\mathcal{S}_{k}(i) for a fixed kk, and then over all possible choices of set size kk:

The concept of Shapley value was first introduced in cooperative game theory , and it has been used in a line of recent work on instancewise feature importance ranking . It can be justified on an axiomatic basis as being the unique function from a collection of 2d2^{d} numbers (one for each subset SS) to a collection of dd numbers (one for each feature ii) with the following properties:

The sum of the Shapley values ∑i=1dϕx(i)\sum_{i=1}^{d}\phi_{x}(i) is equal to the difference vx({1,…,d})−vx(∅)v_{x}(\{1,\ldots,d\})-v_{x}(\emptyset).

If vx(S∪{i})=vx(S∪{j})v_{x}(S\cup\{i\})=v_{x}(S\cup\{j\}) for all subsets SS, then ϕx(i)=ϕx(j)\phi_{x}(i)=\phi_{x}(j).

Note that all three of these axioms are reasonable in our feature selection context.

3 The challenge with computing Shapley values

The exact computation of the Shapley value ϕx(i)\phi_{x}(i) takes into account the interaction of feature ii with all 2d−12^{d-1} subsets that contain ii, thereby leading to computational difficulties. Various approximation methods have been developed with the goal of reducing complexity. For example, Štrumbelj and Kononenko proposed to estimate the Shapley values via a Monte Carlo approximation built on an alternative permutation-based definition of the Shapley value. Lundberg and Lee proposed to evaluate the model over randomly sampled subsets and use a weighted linear regression to approximate the Shapley values based on the collected model evaluations.

In practice, such sampling-based approximations may suffer from high variance when the number of samples to be collected per instance is limited. For large-scale predictive models, the number of features is often relatively large, meaning that the number of samples required to obtain stable estimates can be prohibitively large. The main contribution of this paper is to address this challenge in a model-based paradigm, where the contribution of features to the response variable respects the structure of an underlying graph. In this setting, we propose efficient algorithms and provide bounds on the quality of the resulting approximation. As we discuss in more detail later, our approach should be viewed as complementary to sampling-based or regresssion-based approximations of the Shapley value. In particular, these methods can be combined with the approach of this paper so as to speed up the computation of the L-Shapley and C-Shapley values that we propose.

Methods

In many applications, the features can be associated with the nodes of a graph, and we can define distances between pairs of features based on the graph structure. More concretely, for sequence data (such as language, music etc.), each feature vector xx can be associated with a line graph, whereas for image data, each xx is naturally associated with a grid graph. In this section, we propose modified forms of the Shapley values, referred to as L-Shapley and C-Shapley values, that can be computed more efficiently than the Shapley value. We also show that under certain probabilistic assumptions on the marginal distribution over the features, these quantities yield good approximations to the original Shapley values.

More precisely, given feature vectors x∈dx\in^{d}, we let G=(V,E)G=(V,E) denote a connected graph with nodes VV and edges E⊂V×VE\subset V\times V, where each feature ii is associated with a a node i∈Vi\in V, and edges represent interactions between features. The graph induces a distance function on V×VV\times V, given by

In the line graph, this graph distance corresponds to the number of edges in the unique path joining them, whereas it corresponds to the Manhattan distance in the grid graph. For a given node i∈Vi\in V, its kk-neighborhood is the set

of all nodes at graph distance at most kk. See Figure 1 for an illustration for the two-dimensional grid graph.

We propose two algorithms for the setting in which features that are either far apart on the graph or features that are not directly connected, have an accordingly weaker interaction.

In order to motivate our first graph-structured Shapley score, let us take a deeper look at Example (⋆\star ‣ 2.2). In order to compute the importance score of “not,” the most important words to be included are “heartwarming” and “entertaining.” Intuitively, the words distant from them have a weaker influence on the importance of a given word in a document, and therefore have relatively less effect on the Shapley score. Accordingly, as one approximation, we propose the L-Shapley score, which only perturbs the neighboring features of a given feature when evaluating its importance:

The coefficients in front of the marginal contributions of feature ii are chosen to match the coefficients in the definition of the Shapley value restricted to the neighborhood Nk(i)\mathcal{N}_{k}(i). We show in Section 4 that this choice controls the error under certain probabilistic assumptions. In practice, the choice of the integer kk is dictated by computational considerations. By the definition of kk-neighborhoods, evaluating all dd L-Shapley scores on a line graph requires 22kd2^{2k}d model evaluations. (In particular, computing each feature takes 22k+12^{2k+1} model evaluations, half of which overlap with those of its preceding feature.) A similar calculation shows that computing all dd L-Shapley scores on a grid graph requires 24k2d2^{4k^{2}}d function evaluations.

2 Connected Shapley

We also propose a second algorithm, C-Shapley, that further reduces the complexity of approximating the Shapley value. Coming back to Example (⋆\star ‣ 2.2) where we evaluate the importance of “not,” both the L-Shapley estimate of order larger than two and the exact Shapley value estimate would evaluate the model on the word subset “It not heartwarming,” which rarely appears in real data and may not make sense to a human or a model trained on real-world data. The marginal contribution of “not” relative to “It not heartwarming” may be well approximated by the marginal contribution of “not” to “not heartwarming.” This motivates us to proprose C-Shapley:

where Ck(i)\mathcal{C}_{k}(i) denotes the set of all subsets of Nk(i)\mathcal{N}_{k}(i) that contain node ii, and are connected in the graph GG.

The coefficients in front of the marginal contributions are a result of using Myerson value to characterize a new coalitional game over the graph GG, in which the influence of disconnected subsets of features are additive. The error between C-Shapley and the Shapley value can also be controlled under certain statistical assumptions. See Section 4 for details.

For text data, C-Shapley is equivalent to only evaluating n-grams in a neighborhood of the word to be explained. By the definition of kk-neighborhoods, evaluating the C-Shapley scores for all dd features takes O(k2d)\mathcal{O}(k^{2}d) model evaluations on a line graph, as each feature takes O(k2)\mathcal{O}(k^{2}) model evaluations.

Properties

In this section, we study some basic properties of the L-Shapley and C-Shapley values. In particular, under certain probabilistic assumptions on the features, we show that they provide good approximations to the original Shapley values. We also show their relationship to another concept from cooperative game theory, namely that of Myerson values, when the model satisfies certain local additivity assumptions.

In order to characterize the relationship between L-Shapley and the Shapley value, we introduce absolute mutual information as a measure of dependence. Given two random variables XX and YY, the absolute mutual information Ia(X;Y)I_{a}(X;Y) between XX and YY is defined as

Theorem 1 and Theorem 2 show that L-Shapley and C-Shapley values, respectively, are related to the Shapley value whenever the model obeys a Markovian structure that is encoded by the graph. We leave their proofs to Appendix B.

Suppose there exists a feature subset S⊂Nk(i)S\subset\mathcal{N}_{k}(i) with i∈Si\in S, such that

In particular, we have ϕ^Xk(i)=ϕX(i)\hat{\phi}_{X}^{k}(i)=\phi_{X}(i) almost surely if we have X_{i}\mathchoice{\mathrel{\hbox to0.0pt{\displaystyle\perp\hss}\mkern 2.0mu{\displaystyle\perp}}}{\mathrel{\hbox to0.0pt{\textstyle\perp\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptstyle\perp\hss}\mkern 2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptscriptstyle\perp\hss}\mkern 2.0mu{\scriptscriptstyle\perp}}}X_{[d]\setminus S}|X_{T} and X_{i}\mathchoice{\mathrel{\hbox to0.0pt{\displaystyle\perp\hss}\mkern 2.0mu{\displaystyle\perp}}}{\mathrel{\hbox to0.0pt{\textstyle\perp\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptstyle\perp\hss}\mkern 2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptscriptstyle\perp\hss}\mkern 2.0mu{\scriptscriptstyle\perp}}}X_{[d]\setminus S}|X_{T},Y for any T⊂S∖{i}T\subset S\setminus\{i\}.

Suppose there exists a neighborhood S⊂Nk(i)S\subset\mathcal{N}_{k}(i) of ii, with i∈Si\in S, such that Condition 8 is satisfied. Moreover, for any connected subset U⊂SU\subset S with i∈Ui\in U, we have

In particular, we have ϕ^Xd(i)=ϕX(i)\hat{\phi}_{X}^{d}(i)=\phi_{X}(i) almost surely if we have X_{i}\mathchoice{\mathrel{\hbox to0.0pt{\displaystyle\perp\hss}\mkern 2.0mu{\displaystyle\perp}}}{\mathrel{\hbox to0.0pt{\textstyle\perp\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptstyle\perp\hss}\mkern 2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptscriptstyle\perp\hss}\mkern 2.0mu{\scriptscriptstyle\perp}}}X_{R(U)}|X_{U\setminus\{i\}} and X_{i}\mathchoice{\mathrel{\hbox to0.0pt{\displaystyle\perp\hss}\mkern 2.0mu{\displaystyle\perp}}}{\mathrel{\hbox to0.0pt{\textstyle\perp\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptstyle\perp\hss}\mkern 2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox to0.0pt{\scriptscriptstyle\perp\hss}\mkern 2.0mu{\scriptscriptstyle\perp}}}X_{R(U)}|X_{U\setminus\{i\}},Y for any U⊂[d]U\subset[d].

2 Relating the C-Shapley value to the Myerson value

Let us now discuss how the C-Shapley value can be related to the Myerson value, which was introduced by Myerson as an approach for characterizing a coalitional game over a graph GG. Given a subset of nodes SS in the graph GG, let CG(S)\mathcal{C}_{G}(S) denote the set of connected components of SS—i.e., subsets of SS that are connected via edges of the graph. Thus, if SS is a connected subset of GG, then CG(S)\mathcal{C}_{G}(S) consists only of SS; otherwise, it contains a collection of subsets whose disjoint union is equal to SS.

Consider a score function T↦v(T)T\mapsto v(T) that satisfies the following decomposability condition: for any subset of nodes SS, the score v(S)v(S) is equal to the sum of the scores over all the connected components of SS—viz.

For any such score function, we can define the associated Shapley value, and it is known as the Myerson value on GG with respect to vv. Myerson showed that the Myerson value is the unique quantity that satisfies both the decomposability property, as well as the properties additivity, equal contributions and monotonicity given in Section 2.2.

In our setting, if we use a plug-in estimate for conditional probability, the decomposability condition (12) is equivalent to assuming that the influence of disconnected subsets of features are additive at sample xx, and C-Shapley of order k=dk=d is exactly the Myerson value over GG. In fact, if we partition each subset SS into connected components, as in the definition of Myerson value, and sum up the coefficients (using Lemma 1 in Appendix B), then the Myerson value is equivalent to equation (6).

3 Connections with related work

Let us now discuss connections with related work in more depth, and in particular how methods useful for approximating the Shapley value can be used to speed up the evaluation of approximate L-Shapley and C-Shapley values.

There is an alternative definition of the Shapley value based on taking averages over permutations of the features. In particular, the contribution of a feature ii corresponds to the average of the marginal contribution of ii to its preceding features over the set of all permutations of dd features. Based on this definition, Štrumbelj and Kononenko propose a Monte Carlo approximation, based on randomly sampling permutations.

While L-Shapley is deterministic in nature, it is possible to combine it with this and other sampling-based methods. For example, if one hopes to consider the interaction of features in a large neighborhood Nk(i)\mathcal{N}_{k}(i) with a feature ii, where exponential complexity in kk becomes a barrier, sampling based on random permutation of local features may be used to alleviate the computational burden.

3.2 Regression-based methods

Lundberg and Lee proposed to sample feature subsets based on a weighted kernel, and carry out a weighted linear regression to estimate the Shapley value. Suppose the model is evaluated on NN feature subsets at xx. In weighted least squares, each row of the data matrix X∈{0,1}N×dX\in\{0,1\}^{N\times d} is a dd-dimensional vector, with the jthj^{th} entry being one if the feature jj is selected, and zero otherwise. The response F∈NF\in^{N} is the evaluation of the model over feature subsets. The weight matrix WW is diagonal with Wii=(d−1)/((dni)ni(d−ni))W_{ii}=(d-1)/(\binom{d}{n_{i}}n_{i}(d-n_{i})) with ni=∑j=1dXijn_{i}=\sum_{j=1}^{d}X_{ij}.

Experiments

We evaluate the performance of L-Shapley and C-Shapley on real-world data sets involving text and image classification. Codes for reproducing the key results are available online.https://github.com/Jianbo-Lab/LCShapley We compare L-Shapley and C-Shapley with several competitive algorithms for instancewise feature importance scoring on black-box models, including the regression-based approximation known as KernelSHAP , SampleShapley , and the LIME method . As discussed previously, KernelSHAP forms a weighted regression-approximation of the Shapley values, whereas SampleShapley estimates Shapley value by random permutation of features. The LIME method uses a linear model to locally approximate the original model through weighted least squares. For all methods, the number of model evaluations is the same, and linear in the number of features. We also choose the objective to be the log probability of the predicted class, and use the plug-in estimate of conditional probability across all methods (see Section 2.1).

For image data, we also compare with Saliency map as another baseline. The Saliency method is used for interpreting neural networks in computer vision, by assuming knowledge of the gradient of a model with respect to the input, and using the gradient magnitude as the importance score for each pixel.

Text classification is a classical problem in natural language processing, in which text documents are assigned to predefined categories. We study the performance of L-Shapley and C-Shapley on three popular neural models for text classification: word-based CNNs , character-based CNNs , and long-short term memory (LSTM) recurrent neural networks , with the following three data sets on different scales. See Table 1 for a summary, and Appendix A for all of the details.

IMDB Review with Word-CNN: The Internet Movie Review Dataset (IMDB) is a dataset of movie reviews for sentiment classification , which contains 50,00050,000 binary labeled movie reviews, with a split of 25,00025,000 for training and 25,00025,000 for testing. A simple word-based CNN model composed of an embedding layer, a convolutional layer, a max-pooling layer, and a dense layer is used, achieving an accuracy of 90.1%90.1\% on the test data set.

AG news with Char-CNN: The AG news corpus is composed of titles and descriptions of 196,000196,000 news articles from 2,0002,000 news sources . It is segmented into four classes, each containing 30,00030,000 training samples and 1,9001,900 testing samples. Our character-based CNN has the same structure as that proposed in Zhang et al. . The model achieves an accuracy of 90.09%90.09\% on the test data set.

Yahoo! Answers with LSTM: The corpus of Yahoo! Answers Topic Classification Dataset is divided into ten categories, each class containing 140,000140,000 training samples and 5,0005,000 testing samples. Each input text includes the question title, content and best answer. We train a bidirectional LSTM which achieves an accuracy of 70.84%70.84\% on the test data set, close to the state-of-the-art accuracy of 71.2%71.2\% obtained by character-based CNNs .

We choose zero paddings as the reference point for all methods, and make 4×d4\times d model evaluations, where dd is the number of words for each input. Given the average length of each input (see Table 1), this choice controls the number of model evaluations under 1,0001,000, taking less than one second in TensorFlow on a Tesla K80 GPU for all the three models. For L-Shapley, we are able to consider the interaction of each word ii with the two neighboring words in N1(i)\mathcal{N}_{1}(i) given the budget. For C-Shapley, the budget allows the regression-based version to evaluate all nn-grams with n≤4n\leq 4.

The change in log-odds scores before and after masking the top features ranked by importance scores is used as a metric for evaluating performance, where masked words are replaced by zero paddings. This metric has been used in previous literature in model interpretation . We study how the average log-odds score of the predicted class decreases as the percentage of masked features over the total number of features increases on 1,0001,000 samples from the test set. Results are plotted in Figure 2.

On IMDB with Word-CNN, the simplest model among the three, L-Shapley, achieves the best performance while LIME, KernelSHAP and C-Shapley achieve slightly worse performance. On AG’s news with Char-CNN, L-Shapley and C-Shapley both outperform other algorithms. On Yahoo! Answers with LSTM, C-Shapley outperforms the rest of the algorithms by a large margin, followed by LIME. L-Shapley with order 11, SampleShapley, and KernelSHAP do not perform well for LSTM model, probably because some of the signals captured by LSTM are relatively long nn-grams.

We also visualize the importance scores produced by different Shapley-based methods on Example (⋆\star ‣ 2.2), which is part of a negative movie review taken from IMDB. The result is shown in Table 2. More visualizations by our methods are available online.\@footnotemark

2 Image Classification

We carry out experiments in image classification on the MNIST and CIFAR10 data sets:

MNIST: The MNIST data set contains 28×2828\times 28 images of handwritten digits with ten categories 0−90-9 . A subset of MNIST data set composed of digits 33 and 88 is used for better visualization, with 12,00012,000 images for training and 1,0001,000 images for testing. A simple CNN model achieves 99.7%99.7\% accuracy on the test data set.

CIFAR10: The CIFAR10 data set contains 32×3232\times 32 images in ten classes. A subset of CIFAR10 data set composed of deers and horses is used for better visualization, with 10,00010,000 images for training and 2,0002,000 images for testing. A convolutional neural network modified from AlexNet achieves 96.1%96.1\% accuracy on the test data set.

We take each pixel as a single feature for both MNIST and CIFAR10. We choose the average pixel strength as the reference point for all methods, and make 4×d4\times d model evaluations, where dd is the number of pixels for each input image, which keeps the number of model evaluations under 4,0004,000.

LIME and L-Shapley are not used for comparison because LIME takes “superpixels” instead of raw pixels segmented by segmentation algorithms as single features, and L-Shapley requires nearly sixteen thousand model evaluations when applied to raw pixels.L-Shapley becomes practical if we take small patches of images instead of pixels as single features. For C-Shapley, the budget allows the regression-based version to evaluate all n×nn\times n image patches with n≤4n\leq 4.

Figure 3 shows the decrease in log-odds scores before and after masking the top pixels ranked by importance scores as the percentage of masked pixels over the total number of pixels increases on 1,0001,000 test samples on MNIST and CIFAR10 data sets. C-Shapley consistently outperforms other methods on both data sets.

Figure 4 and Figure 5 provide additional visualization of the results. By masking the top pixels ranked by various methods, we find that the pixels picked by C-Shapley concentrate around and inside the digits in MNIST. The C-Shapley and Saliency methods yield the most interpretable results in CIFAR10. In particular, C-Shapley tends to mask the parts of head and body that distinguish deers and horses, and the human riding the horse. Figure 3 shows two misclassified digits by the CNN model. Interestingly, the top pixels chosen by C-Shapley visualize the “reasoning” of the model: more specifically, the important pixels to the model are exactly those which could form a digit from the opposite class.

Discussion

We have proposed L-Shapley and C-Shapley for instancewise feature importance scoring, making use of a graphical representation of the data. We have shown the superior performance of the proposed algorithms compared to other methods for instancewise feature importance scoring in text and image classification.

Acknowledgments

We would like to acknowledge support from the DARPA Program on Lifelong Learning Machines from the Army Research Office under grant number W911NF-17-1-0304, and from National Science Foundation grant NSF-DMS-1612948.

References

Appendix A Model structure

The word-based CNN model is composed of a 5050-dimensional word embedding, a 11-D convolutional layer of 250 filters and kernel size three, a max-pooling and a 250250-dimensional dense layer as hidden layers. Both the convolutional and the dense layers are followed by ReLU as nonlinearity, and Dropout as regularization. The model is trained with rmsprop . The model achieves an accuracy of 90.1%90.1\% on the test data set.

The character-based CNN has the same structure as the one proposed in Zhang et al. , composed of six convolutional layers, three max-pooling layers, and two dense layers. The model is trained with SGD with momentum 0.9 and decreasing step size initialized at 0.010.01. (Details can be found in Zhang et al. .) The model reaches accuracy of 90.09%90.09\% on the test data set.

The network consists of a 300300-dimensional randomly-initialized word embedding, a bidirectional LSTM, each LSTM unit of dimension 256256, and a dropout layer as hidden layers. The model is trained with rmsprop . The model reaches accuracy of 70.84%70.84\% on the test data set, close to the state-of-the-art accuracy of 71.2%71.2\% obtained by character-based CNN .

A simple CNN model is trained on the data set, which achieves 99.7%99.7\% accuracy on the test data set. It is composed of two convolutional layers of kernel size 5×55\times 5 and a dense linear layer at last. The two convolutional layers contain 8 and 16 filters respectively, and both are followed by a max-pooling layer of pool size two.

A convolutional neural network modified from AlexNet is trained on the subset. It is composed of six convolutional layers of kernel size 3×33\times 3 and two dense linear layers of dimension 512 and 256 at last. The six convolutional layers contain 48,48,96,96,192,192 filters respectively, and every two convolutional layers are followed by a max-pooling layer of pool size two and a dropout layer. The CNN model is trained with the Adam optimizer and achieves 96.1%96.1\% accuracy on the test data set.

Appendix B Proof of Theorems

In this appendix, we collect the proofs of Theorems 1 and 2.

We state an elementary combinatorial equality required for the proof of the main theorem:

For any positive integer nn, and any pair of non-negative integers with s≥ts\geq t, we have

By the binomial theorem for negative integer exponents, we have

The identity can be found by examination of the coefficient of xnx^{n} in the expansion of

In fact, equating the coefficients of xnx^{n} in the left and the right hand sides, we get

Moving (n+sn)\binom{n+s}{n} to the right hand side and expanding the binomial coefficients, we have

Taking this lemma, we now prove the theorem. We split our analysis into two cases, namely S=Nk(i)S=\mathcal{N}_{k}(i) versus S⊂Nk(i)S\subset\mathcal{N}_{k}(i). For notational convenience, we extend the definition of L-Shapley estimate for feature ii to an arbitrary feature subset SS containing ii. In particular, we define

First, suppose that S=Nk(i)S=\mathcal{N}_{k}(i). For any subset A⊂[d]A\subset[d], we introduce the shorthand notation US(A): =A∩SU_{S}(A):\,=A\cap S and VS(A): =A∩ScV_{S}(A):\,=A\cap S^{c}, and note that A=US(A)∪VS(A)A=U_{S}(A)\cup V_{S}(A). Recalling the definition of the Shapley value, let us partition all the subsets AA based on US(A)U_{S}(A), in particular writing

Based on this partitioning, the expected error between ϕ^XS(i)\hat{\phi}_{X}^{S}(i) and ϕX(i)\phi_{X}(i) can be written as

Partitioning the set {A:US(A)=U}\{A:U_{S}(A)=U\} by the size of VS(A)=A∩ScV_{S}(A)=A\cap S^{c}, we observe that

where we have applied Lemma 1 with n=d−∣S∣n=d-|S|, s=∣S∣−1s=|S|-1, and t=∣U∣−1t=|U|-1. Substituting this equivalence into equation (18), we find that the expected error can be upper bounded by

where we recall that A=US(A)∪VS(A)A=U_{S}(A)\cup V_{S}(A).

Now omitting the dependence of US(A),VS(A)U_{S}(A),V_{S}(A) on AA for notational simplicity, we now write the difference as

Substituting this equivalence into our earlier bound (19) and taking an expectation over XX on both sides, we find that the expected error is upper bounded as

Recalling the definition of the absolute mutual information, we see that

which completes the proof of the claimed bound.

We now consider the general case in which S⊂Nk(i)S\subset\mathcal{N}_{k}(i). Using the previous arguments, we can show

B.2 Proof of Theorem 2

As in the previous proof, we divide our analysis into two cases.

First, suppose that S=Nk(i)=[d]S=\mathcal{N}_{k}(i)=[d]. For any subset A⊂SA\subset S with i∈Ai\in A, we can partition AA into two components US(A)U_{S}(A) and VS(A)V_{S}(A), such that i∈US(A)i\in U_{S}(A) and US(A)U_{S}(A) is a connected subsequence. VS(A)V_{S}(A) is disconnected from US(A)U_{S}(A). We also define

We partition all the subsets A⊂SA\subset S based on US(A)U_{S}(A) in the definition of the Shapley value:

Partitioning {A:US(A)=U}\{A:U_{S}(A)=U\} by the size of VS(A)V_{S}(A), we observe that

where we apply Lemma 1 with n=d−∣U∣−2n=d-|U|-2, s=∣U∣+1s=|U|+1 and t=∣U∣−1t=|U|-1. From equation (21), the expected error can be upper bounded by

where A=US(A)∪VS(A)A=U_{S}(A)\cup V_{S}(A). We omit the dependence of US(A)U_{S}(A) and VS(A)V_{S}(A) on the pair (A,S)(A,S) for notational simplicity, and observe that the difference between mx(A,i)m_{x}(A,i) and mx(U,i)m_{x}(U,i) is

Taking an expectation over XX at both sides, we can upper bound the expected error by

We now turn to the general case S⊂Nk(i)⊂[d]S\subset\mathcal{N}_{k}(i)\subset[d]. Similar as above, we can show