S HAPLEY EXPLAINABILITY ON THE DATA MANIFOLD
Anonymous authors
Paper under double-blind review
A BSTRACT
Explainability in AI is crucial for model development, compliance with regulation, and providing operational nuance to predictions.
The Shapley framework for explainability attributes a model’s predictions to its input features in a mathematically principled and model-agnostic way.
However, general implementations of
Shapley explainability make an untenable assumption: that the model’s features are uncorrelated.
In this work, we demonstrate unambiguous drawbacks of this assumption and develop two solutions to Shapley explainability that respect the data manifold.
One solution, based on generative modelling, provides ﬂexible access to data imputations; the other directly learns the Shapley value-function, providing performance and stability at the cost of ﬂexibility.
While “off-manifold”
Shapley values can (i) give rise to incorrect explanations, (ii) hide implicit model dependence on sensitive attributes, and (iii) lead to unintelligible explanations in higher-dimensional data, on-manifold explainability overcomes these problems.
I NTRODUCTION
Explainability in AI is central to the practical impact of AI on society, thus making it critical to get right.
While many dichotomies exist within the ﬁeld — between local and global explanations (Ribeiro et al., 2016), between post hoc and intrinsic interpretability (Rudin, 2019), and between model-agnostic and model-speciﬁc methods (Shrikumar et al., 2017) — in this work we focus on local, post-hoc, model-agnostic explainability as it provides insight into individual model predictions, does not limit model expressiveness, and is comparable across model types.
In this context, explainability can be treated as a problem of attribution, which has been developed extensively in cooperative game theory.
Shapley values (Shapley, 1953) provide the unique attribution method satisfying a set of intuitive axioms, e.g. they capture all interactions between features and sum to the model prediction.
The Shapley approach to explainability has matured over the last two decades (Lipovetsky & Conklin, 2001;
Kononenko et al., 2010; ˇ Strumbelj & Kononenko, 2014;
Datta et al., 2016; Lundberg & Lee, 2017).
Implementations of Shapley explainability suffer from a problem common across model-agnostic methods: they involve marginalisation over features, achieved by splicing data points together and evaluating the model on highly unrealistic inputs (e.g. Fig. 1).
Such splicing would only be justiﬁed if all features were independent; otherwise, spliced data lies off the data manifold .
Outside the Shapley paradigm, emerging explainability methods have begun to address this problem.
See e.g. Anders et al.
for a general treatment of the off-manifold problem in gradient-based explainability.
See also Chang et al.
(2019) and Agarwal et al.
for image-speciﬁc explanations that respect the data distribution.
Within Shapley explainability, initial work towards remedying the off-manifold problem has emerged; e.g. Aas et al.
and Sundararajan & Najmi (2019) explore empirical and kernelbased estimation techniques, but these methods do not scale to complex data.
A satisfactorily general and performant solution to computing Shapley values on the data manifold has yet to appear and is a focus of this work.
Our main contributions are twofold:
• Sec. 3 compares on- and off-manifold explainability, focusing on novel and unambiguous shortcomings of off-manifold Shapley values.
In particular, we show that off-manifold explanations are often incorrect, and that they can hide implicit model dependence on sensitive features.
[Table]
/SD9Fr0BY67haJbcqegi8TLSJFkqHYLX+1exJMQFHLJjGl5boydlGkUXMI4304MxIwPWR9alioWgumk06vH9NgqPRpE2pZCOlV/T6QsNGYU+rYzZDgw895E/M9rJRhcdFKh4gRB8dmiIJEUIzqJgPaEBo5yZAnjWthbKR8wzTjaoPI2BG/+5UVSL5e809LZbblYucziyJFDckROiEfOSYXckCqpEU40eSav5M15dF6cd+dj1rrkZDMH5A+czx8JBpLY</latexit>
• Sec. 4 develops two methods to compute on-manifold Shapley values on general data sets: (i) a ﬂexible generative-modelling technique to learn the data’s conditional distributions, and (ii) a simple supervised-learning technique that targets the Shapley value-function directly.
We demonstrate the effectiveness of these methods on higher-dimensional data with experiments.
B ACKGROUND ON S HAPLEY EXPLAINABILITY
The Shapley value (Shapley, 1953) is a method from cooperative game theory that distributes credit for the total value v ( N ) earned by a team N = { 1 , 2 , . . . , n } among its players:
[Equation]
where the value function v ( S ) indicates the value that a coalition of players S would earn without their other teammates.
The Shapley value φ v ( i ) represents player
i ’s marginal value-added upon joining the team, averaged over all orderings in which the team can be constructed.
In supervised learning, let f y ( x ) be a model’s predicted probability that data point x belongs to class y .
1 To apply Shapley attribution to model explainability, one interprets the features { x 1 , . . .
, x n } as players in a game and the output f y ( x ) as their earned value.
To compute Shapley values, one must deﬁne a value function representing the model’s output on a coalition x S ⊆ { x 1 , . . .
, x n } .
As the model is undeﬁned on partial input x S , the standard implementation (Lundberg & Lee, 2017) samples out-of-coalition features, x (cid:48)
¯ S where ¯ S = N \ S , unconditionally from the data distribution:
[Equation]
We refer to this value function, and the corresponding Shapley values, as lying off the data manifold since splices x S (cid:116) x (cid:48) ¯ S generically lie far from the data distribution.
Alternatively, conditioning outof-coalition features x (cid:48) ¯ S on in-coalition features x S would result in an on-manifold value function:
[Equation]
The conditional distribution p ( x (cid:48) | x S ) is not empirically accessible in practical scenarios with highdimensional data or many-valued (e.g. continuous) features.
A performant method to compute onmanifold Shapley values on general data is until-now lacking and a focus of this work.
Shapley values φ f y ( x ) ( i ) provide local explainability for the model’s prediction on data point x .
To understand the model’s global behaviour, one aggregates the φ f y ( x ) ( i ) ’s into global Shapley values :
[Equation]
where p ( x, y ) is the labelled-data distribution.
Global Shapley values can be seen as a special case of the global explanation framework introduced by Covert et al.
As a consequence of the axioms (Shapley, 1953) satisﬁed by the φ f y ( x ) ( i ) ’s, global Shapley values satisfy a sum rule:
[Equation]
One interprets the global Shapley value Φ f ( i ) as the portion of model accuracy attributable to the i th feature.
Indeed, the ﬁrst term in Eq.
(5) is the accuracy one achieves by sampling labels from f ’s predicted probability distribution over classes.
The offset term, which relates to class balance, is not attributable to any individual feature.
E VIDENCE IN FAVOUR OF ON - MANIFOLD EXPLAINABILITY
The key differences between on- and off-manifold Shapley values is a subject of ongoing discussion; see Sundararajan & Najmi (2019) or Chen et al.
(2020) for recent overviews.
Here we focus on theoretical arguments and experimental evidence yet to appear in the literature, in favour of the onmanifold approach.
We begin with mathematically precise differences between on- and off-manifold methods in Sec.
3.1 and present unambiguous drawbacks of off-manifold Shapley values in Sec. 3.2.
3. O N - VERSUS OFF - MANIFOLD DIFFERENCES MADE PRECISE
Suppose the model’s input features x 1 , . . .
, x n are the result of a data-generating process seeded by unobserved latent variables z 1 , . . .
, z d .
Then there exist functional relationships
[Equation]
where (cid:15) i represents noise in x i .
In the limit of small (cid:15) i ’s, there are d directions in which a data point ( x 1 , . . .
, x n ) can be perturbed while remaining consistent with the data distribution: these correspond to perturbations in z 1 , . . .
, z d in Eq.
The data thus lives on a d -dimensional manifold in ambient n -dimensional features space, and therefore satisﬁes n − d constraints on the x i ’s:
[Equation]
On-manifold Shapley values evaluate the model on inputs that satisfy these constraints, while the off-manifold approach uses spliced data that generically break them.
For a more detailed and mathematically precise discussion of the data manifold in this context, see Anders et al.
A LGEBRAIC MODEL DEPENDENCE CAN BE MISLEADING
Any model f y ( x ) can be written in many algebraic forms that all evaluate identically on the data manifold.
To show this, one can add any of the n − d constraints from Eq.
(7) to any of the model’s n input slots.
This changes the model’s algebraic form but does not affect the model’s output on the data, since each constraint equals zero on-manifold.
The model f y ( x ) thus belongs to an n ( n − d ) dimensional equivalence class of functions that behave indistinguishably on the data.
On-manifold Shapley values provide the same explanation for any two models that evaluate identically on the data distribution, because on-manifold explanations do not involve evaluation anywhere else.
Off-manifold Shapley values provide different explanations for two models in the same equivalence class, as spliced data in the off-manifold value function break the constraints of Eq.
H IDDEN MODEL DEPENDENCE ON SENSITIVE ATTRIBUTES
This is not an academic concern: it follows that off-manifold explanations are vulnerable to adversarial model perturbations that hide dependence on select input features (Dombrowski et al., 2019;
Slack et al., 2020).
Dimanov et al.
(2020) demonstrated that the off-manifold Shapley value for a sensitive feature like gender could be reduced near zero via this vulnerability.
To see how this can happen, suppose that input feature x 1 represents gender and formally solve one of the constraints in Eq.
(7) for x 1 .
The result, say x 1 = ˜Ψ( x 2 , . . .
, x n ) , can then be used to transform any model f y ( x ) into another
[Equation]
(8) that has no algebraic dependence on gender x 1 but behaves identically to f y ( x ) on the data manifold.
The off-manifold Shapley value for gender in ˜ f would vanish, since the off-manifold value function of Eq.
(2) depends on x 1 only through ˜ f
(i.e. not at all).
This result is problematic, since the two models behave equivalently on the data and thus possess the same gender bias.
In contrast, the on-manifold Shapley values for f and ˜ f would be identical, as x 1 dependence enters the on-manifold value function of Eq.
(3) through the conditional expectation value.
In a sense, on-manifold Shapley values represent the model’s dependence on the information content of each feature, rather than the model’s algebraic dependence.
[Table]
+Z1HpjSP5QNOEuZHZCh5yClBI3kesicMwqwanE/75YpTc+awV4mbkwrkaPbLX94gpmnEJFJBtO65ToJ+RhRyKti05KWaJYSOyZD1DJUkYtrP5jdP7TOjDOwwVqYk2nP190RGIq0nUWA6I4IjvezNxP+8XorhtZ9xmaTIJF0sClNhY2zPArAHXDGKYmIIoYqbW206IopQNDGVTAju8surpF2vuRe1y/t6pXGTx1GEEziFKrhwBQ24gya0gEICz/AKb1ZqvVjv1seitWDlM8fwB9bnD9IVkYY=</latexit>
<latexit sha1_base64="7x6+5wuWO0CJ4bEDQG6YlHpb+R8=">AAACBHicbVA9SwNBEN2LXzF+RS3TLAbBKtwFRQuLQBrLCOYDkhD2NnPJkr29Y3dODEcKG/+KjYUitv4IO/+Nm49CEx8MPN6bYWaeH0th0HW/ncza+sbmVnY7t7O7t3+QPzxqmCjRHOo8kpFu+cyAFArqKFBCK9bAQl9C0x9Vp37zHrQRkbrDcQzdkA2UCARnaKVevtBBeEA/SKugTGKoUDwKgfYZskkvX3RL7gx0lXgLUiQL1Hr5r04/4kkICrlkxrQ9N8ZuyjQKLmGS6yQGYsZHbABtSxULwXTT2RMTemqVPg0ibUshnam/J1IWGjMOfdsZMhyaZW8q/ue1EwyuuqlQcYKg+HxRkEiKEZ0mQvtCA0c5toRxLeytlA+ZZhxtbjkbgrf88ipplEveeenitlysXC/iyJICOSFnxCOXpEJuSI3UCSeP5Jm8kjfnyXlx3p2PeWvGWcwckz9wPn8AHjiYYA==</latexit>
<latexit sha1_base64="PV+iux96QsCkOo9Rge1FP/YHnRs=">AAACB3icbVBNS8NAEN3Ur1q/oh4FWSyCp5IURQ8eCnrwWMF+QBvKZrtpl242YXciltCbF/+KFw+KePUvePPfuGlz0NYHA4/3ZpiZ58eCa3Ccb6uwtLyyulZcL21sbm3v2Lt7TR0lirIGjUSk2j7RTHDJGsBBsHasGAl9wVr+6CrzW/dMaR7JOxjHzAvJQPKAUwJG6tmHXWAP4AfptUoGmEZSJ2GcWbhPgEx6dtmpOFPgReLmpIxy1Hv2V7cf0SRkEqggWndcJwYvJQo4FWxS6iaaxYSOyIB1DJUkZNpLp39M8LFR+jiIlCkJeKr+nkhJqPU49E1nSGCo571M/M/rJBBceCmXcQJM0tmiIBEYIpyFgvtcMQpibAihiptbMR0SRSiY6EomBHf+5UXSrFbc08rZbbVcu8zjKKIDdIROkIvOUQ3doDpqIIoe0TN6RW/Wk/VivVsfs9aClc/soz+wPn8AzfqZ4w==</latexit>
We can demonstrate this on UCI Census Income data (Dua & Graff, 2017).
We trained a neural network to predict whether an individual’s income exceeds $50k based on demographic features in the data.
Coral bars in Fig.
2(a) display global Shapley values for this “Original model”.
(Onmanifold values were computed with the unsupervised method developed in Sec. 4.1.)
We then trained an alternative model by ﬁne-tuning the neural network above on a loss function that penalises model dependence on sex; see App.
B for full details of this experiment.
This resulted in a “Suppressed model” that makes identical predictions as the original model on 98.5% of the data.
Teal bars in Fig.
2(a) display global Shapley values for this model.
Note that the off-manifold
Shapley value for sex is zero despite the similar behaviour exhibited by the original and suppressed models on the data.
In contrast, on-manifold Shapley values explain both models similarly.
O N - MANIFOLD S HAPLEY VALUES IN THE OPTIMAL - MODEL LIMIT
Here we present a result that strengthens the connection between on-manifold Shapley values and the data distribution: in the limit of an optimal model of the data, on-manifold Shapley values converge to an explanation of how the information in the data associates with the labelled outcomes.
To show why this holds, suppose the predicted probability f y ( x ) converges to the true underlying distribution p ( y | x ) .
In this optimal-model limit (which is approached in the limit of abundant data and high model capacity) the on-manifold value function of Eq.
(3) becomes
[Equation]
(9) which shows that value is attributed to x i based on x i ’s predictivity of the label y .
We can demonstrate this on UCI Drug Consumption data (Dua & Graff, 2017).
Using the 10 binary features listed in Fig.
2(b) – Mushrooms, Ecstasy, etc.
– we trained a random forest f to predict whether individuals had consumed an 11th drug: LSD.
As the data contains just 10 binary features, we were able to empirically sample the conditional distributions in the on-manifold value function,
Eq.
See Fig. 2(b) for the resulting off- and on-manifold global Shapley values.
Next we ﬁt a separate random forest g S to each coalition S of features, 2 10 models in total, in the spirit e.g. of ˇStrumbelj et al.
We used the accuracy A ( g S ) of each model, in the sense of
Eq.
(5), as the value function for an additional Shapley computation:
[Equation]
where Φ g ( i ) is directly the average gain in accuracy that results from adding feature i to the set of inputs.
These values are labelled “Model retraining” in Fig. 2(b).
Note their agreement with the on-manifold explanation of the ﬁxed random forest f .
On-manifold Shapley values thus indicate which features in the data are most predictive of the label.
This consistency check allows us to show in passing that Tree SHAP (Lundberg et al., 2018; 2020) does not provide a method for on-manifold explainability.
Observe in Fig. 2(b)
that Tree SHAP
[Table]
(a)
[Table]
V3xMZjbSeRIHpjCiO9LI3E//zeimG137GZZIiSLZYFKbCxtieBWAPuAKGYmIIZYqbW202oooyNDGVTAju8surpF2vuRe1y/t6pXGTx1EkJ+SUVIlLrkiD3JEmaRFGEvJMXsmblVov1rv1sWgtWPnMMfkD6/MH146RjA==</latexit> roughly tracks the off-manifold explanation, albeit larger on the most predictive feature and somewhat smaller on the others.
This occurs because trees tend to split on high-predictivity features ﬁrst, and Tree SHAP privileges early-splitting features in an otherwise off-manifold calculation.
3. U NAMBIGUOUS SHORTCOMINGS OF OFF - MANIFOLD EXPLAINABILITY
Whereas above we clariﬁed precise differences between on- and off-manifold Shapley values, in this section we focus on unambiguous drawbacks of the off-manifold approach.
U NCONTROLLED MODEL BEHAVIOUR OFF - MANIFOLD
Sec. 3.1 might lead one to believe that off-manifold Shapley values provide insight into the algebraic dependence of a model.
However, the off-manifold approach of evaluating the model on spliced indistribution data does not constitute a controlled study of such dependence.
Off-manifold Shapley values serve as a perilously uncontrolled technique, especially in complex nonlinear models such as neural networks.
Indeed, it is widely known that deep-learning models are not robust to distributional shift (Nguyen et al., 2015; Goodfellow et al., 2015).
Still, off-manifold Shapley values evaluate the model outside its domain of validity, where it is untrained and potentially wildly misbehaved.
This garbage-in-garbage-out problem is the clearest reason to avoid the off-manifold approach.
Since this point has been documented in the literature (Hooker & Mentch, 2019), here we simply provide an example: Fig.
1 shows a binary MNIST digit (LeCun & Cortes, 2010), a coalition of pixels, and 5 random splices that would be used to compute an off-manifold explanation.
O UTLIER DETECTION EXPLAINED INCORRECTLY OFF - MANIFOLD
To demonstrate that off-manifold Shapley values frequently lead to incorrect explanations, here we offer an example on synthetic data where the ground-truth explanation is known.
We generated 10synthetic data points, each consisting of 20 real-valued features, for the purpose of outlier detection.
We split the dataset between 99% inliers and 1% outliers, with the classes generated according to:
[Equation]
That is, there is a single binary latent variable z .
For inliers, each feature is an independent noisy reading of the latent z .
For outliers, the ﬁrst 5 features are centred instead around its opposite ¯ z .
An example outlier (with σ = 0 . 05 ) is shown in Fig. 3(a).
We generated one such data set for each σ ∈ { 0 . 01 , 0 .
. , 0 . 15 } in order to study the effect of noise on explanation errors.
[Table] [Table]
ooXD4p49Ru8+Td2loPbg4LHe1VU1fMTJQ257qczMzs3v7CYW8ovr6yurRc2NqsmTrXAiohVrOs+GFQywgpJUlhPNELoK6z5/fORX7tFbWQc3dAgwVYI3UgGUgBZqV3YaRLekR9kFyr2QfHrHiQKB/wWVIrDdqHoltwx+F/iTUmRTVFuFz6anVikIUYkFBjT8NyEWhlokkLhMN9MDSYg+tDFhqURhGha2fiNId+zSocHsbYVER+r3ycyCI0ZhL7tDIF65rc3Ev/zGikFJ61MRklKGInJoiBVnGI+yoR3pEZBamAJCC3trVz0QIMgm1zehuD9fvkvqR6UvMPS0dVB8ex0GkeObbNdts88dszO2CUrswoT7J49smf24jw4T86r8zZpnXGmM1vsB5z3L5wJmTI=</latexit>
<latexit
[Table]
/rZZrV7M6CuSIHJNT4pILUiM3pE4ahJGcPJNX8mY9WS/Wu/UxHV2yZjsH5A+szx9mUJbn</latexit>
<latexit sha1_base64="tjMCpM3UHXXqPxMimrLfGFfRtaQ=">AAACC3icbVC7SgNBFJ2NrxhfUUubIUGwCrtB0cIiYGMZ0TwgCWF2cjcZMju7zNwVw5Lexl+xsVDE1h+w82+cPApNPDBwOOfcO9zjx1IYdN1vJ7Oyura+kd3MbW3v7O7l9w/qJko0hxqPZKSbPjMghYIaCpTQjDWw0JfQ8IdXE79xD9qISN3hKIZOyPpKBIIztFI3X2gjPKAfpLcjhQNAwWmPIaN9UKCnmXE3X3RL7hR0mXhzUiRzVLv5r3Yv4kkICrlkxrQ8N8ZOyrTdLmGcaycGYsaHrA8tSxULwXTS6S1jemyVHg0ibZ9COlV/T6QsNGYU+jYZMhyYRW8i/ue1EgwuOqlQcYKg+OyjIJEUIzophvaEBo5yZAnjWkya4AOmGUdbX86W4C2evEzq5ZJ3Wjq7KRcrl/M6suSIFMgJ8cg5qZBrUiU1wskjeSav5M15cl6cd+djFs0485lD8gfO5w/8zJuh</latexit>
We ﬁt an isolation forest (Liu et al., 2008) to perform outlier detection on each synthetic dataset, achieving 100% accuracy in every case.
We computed the off- and on-manifold value functions of
Eqs.
(2) and (3) for each isolation forest by sampling the probability distributions directly, as these can be inferred from Eqs.
(11) and (12).
Figs. 3(b) and 3(c) show the resulting local Shapley values for the example outlier from Fig. 3(a).
The ground-truth explanation of why Fig. 3(a) represents an outlier is that its ﬁrst 5 features break correlations that exist across 99% of the data.
The on-manifold explanation of Fig. 3(c) correctly attributes the 5 largest Shapley values to features x 1 , . . .
, x 5 .
The off-manifold explanation of Fig. 3(b) is unambiguously incorrect: feature x 7 receives a larger value than x 2 , x 4 , and x 5 .
We consider an explanation to be erroneous if x 1 , . . .
, x 5 do not receive the 5 largest Shapley values.
To show the frequency of incorrect explanations, Fig. 3(d) displays the off- and on-manifold error rates as a function of noise σ in the synthetic data set.
Incorrect explanations are commonplace off-manifold: one-quarter are in error in the presence of minimal noise, and two-thirds are incorrect at σ = 0 .
The on-manifold error rate is dramatically lower across this range.
Figs. 3(e) and 3(f) show the root cause of off-manifold errors.
These histograms display the distribution of model outputs when evaluated on Shapley coalitions in the off- and on-manifold calculations for σ = 0 .
In particular, Fig.
3(e) shows the model evaluated on “inlier coalitions” which do not include x 1 , . . .
, x 5 .
Note that model outputs for on-manifold coalitions agree with the model evaluated on the actual data, while off-manifold coalitions follow a very different distribution.
In particular, since a positive model output indicates a predicted outlier, Fig.
3(e) shows that the offmanifold calculation itself fabricates outliers through its splicing procedure.
Similarly, Fig. 3(f) shows the model evaluated on “outlier coalitions” which do include x 1 , . . .
, x 5 .
Note that model outputs are similar for on-manifold coalitions and actual outliers, whereas offmanifold coalitions again differ dramatically.
This is a manifestation of uncontrolled model behaviour off the data manifold, and it ultimately leads to erroneous off-manifold explanations.
B REAKDOWN IN GLOBAL S HAPLEY VALUES OFF - MANIFOLD
To demonstrate that global Shapley values can be misleading off-manifold as well, we generated an additional synthetic data set according to the process in Fig. 4(a).
The data has two binary features and a binary label.
We ﬁt a decision tree to this data, resulting in a precise match to Fig. 4(a).
Note that the features x 0 and x 1 are positively correlated, both with each other and with label y .
However, with x 0 ﬁxed, the likelihood of y = 1 decreases slightly from x 1 = 0 to x 1 = 1 .
One might think of x 0 as disease severity, x 1 as treatment intensity, and y as mortality rate.
Fig. 4(b) displays global Shapley values for this model.
The global Shapley values are positive onmanifold, consistent with their interpretation as the portion of model accuracy attributable to each feature.
Off-manifold, however, a negative value results from placing too much weight on splices, e.g. with ( x 0 , x 1 , y )
= (0 , 1 , 1) , that occur less frequently in the actual data.
The negative value would erroneously indicate that x 1 is detrimental to the model’s overall performance.
We can demonstrate this on real data using UCI Abalone data (Dua & Graff, 2017).
We trained a neural network to classify abalone as younger than or older than the median age based on physical characteristics.
Fig.
4(c) displays global Shapley values for this model.
(On-manifold values were computed using techniques developed in Sec. 4.1; see App.
B for details.)
Observe the drastic difference between the on- and off-manifold explanations in Fig. 4(c).
This is due to the tight correlations between features in the data (4 weights and 3 lengths) making the data manifold low-dimensional and important.
Notice further the large negative off-manifold global
Shapley value, negating its interpretation as the portion of model accuracy attributable to that feature.
S CALABLE APPROACHES TO ON - MANIFOLD S HAPLEY VALUES
In Sec.
3 we computed on-manifold Shapley values for simple data by estimating p ( x (cid:48) | x S ) from the empirical data distribution or, for synthetic data, by knowing this distribution analytically.
Here we introduce two performant methods to compute on-manifold Shapley values on general data.
Sec. 4.
develops the theory underlying our methods, and Sec.
4.2 presents additional experimental results.
4. T HEORETICAL DEVELOPMENT OF ON - MANIFOLD METHODS
Here we develop two methods to learn the on-manifold value function: (i) unsupervised learning the conditional distribution p ( x (cid:48) | x S ) , and (ii) a supervised technique to learn the value function directly.
U NSUPERVISED APPROACH
One can use unsupervised learning to learn the conditional distributions p ( x (cid:48) | x S ) that appear in the on-manifold value function.
Here we take an approach similar to Ivanov et al.
(2019) to learn these distributions with variational inference.
See Douglas et al.
(2017) and Belghazi et al.
for alternative techniques to learning conditional distributions that could be used here instead.
Our speciﬁc approach includes two model components.
The ﬁrst is a variational autoencoder (Kingma & Welling, 2014; Rezende et al., 2014), with encoder q φ ( z | x ) and decoder p θ ( x | z ) .
The second is a masked encoder, r ψ ( z | x S ) , for which the goal is to map the coalition x S to a distribution in latent space that agrees with the encoder q φ ( z | x ) as well as possible.
A model of p ( x (cid:48) | x S ) is then provided by the composition:
[Equation]
13) and a good ﬁt to the data should maximise ˆ p ( x (cid:48) | x S ) .
A lower bound to its log-likelihood is given by
[Equation]
While L 0 could be used on its own as the objective function to learn ˆ p ( x (cid:48) | x S ) , this would leave the variational distribution q φ ( z | x ) unconstrained, at odds with our goal of learning a smooth-manifold structure in latent space.
This concern can be mitigated by L reg =
−D KL (cid:0) q φ ( z | x ) || p ( z ) (cid:1) which regularises q φ ( z | x ) by penalising differences from a smooth (e.g. unit normal) prior distribution p ( z ) .
We thus include L reg as a regularisation term in our unsupervised objective: L = L 0 + β L reg .
M ETRIC FOR THE LEARNT VALUE FUNCTION
The unsupervised method presented above leads to a learnt estimate of the conditional distribution, and thus to an estimate of the on-manifold value function: ˆ v f y ( x ) ( S ) =
E
ˆ p ( x (cid:48) | x S )
[ f y ( x (cid:48) )] .
With the goal of judging the performance of this estimate, consider the following formal quantity:
[Equation]
This quantity is minimal with respect to ˆ v f y ( x ) ( S ) when ˆ v f y ( x ) ( S ) =
E p ( x (cid:48) | x S )
[ f y ( x (cid:48) )] , in agreement with the deﬁnition, Eq.
(3), of the on-manifold value function.
We can then quantitatively judge the performance of the unsupervised model
ˆ p ( x (cid:48) | x S ) by computing
[Equation]
[Equation]
[Table]
+tDFhqURhGha2fiNId+zSocHsbYVER+r3ycyCI0ZhL7tDIF65rc3Ev/zGikFJ61MRklKGInJoiBVnGI+yoR3pEZBamAJCC3trVz0QIMgm1zehuD9fvkvqR6UvMPS0dVB8ex0GkeObbNdts88dszO2CUrswoT7J49smf24jw4T86r8zZpnXGmM1vsB5z3L5wJmTI=</latexit>
[Table]
Note that this is precisely Eq.
(15) averaged over coalitions S drawn from the Shapley sum, 2 features x S ∼ p ( x S ) drawn from the data, and labels y drawn uniformly over classes.
Moreover, the meansquare-error in Eq.
(16) is easy to estimate using the empirical distribution p ( x ) and the learnt model ˆ p ( x (cid:48)
| x S ) , thus providing an unambiguous metric to judge the outcome of the unsupervised approach
S UPERVISED APPROACH
The MSE metric of Eq.
(16) supports a supervised approach to learning the on-manifold value function directly: one can deﬁne a surrogate model g y ( x S ) that operates on coalitions of features x S (e.g. by masking out-of-coalition features) and that is trained to minimise the loss: [Equation]
[Equation]
As discussed above Eq.
(16), this loss is minimised as the surrogate model g y ( x S ) approaches the on-manifold value function E p ( x (cid:48) | x S )
[ f y ( x (cid:48) )] of the model-to-be-explained.
4. A DDITIONAL EXPERIMENTS
Sec. 3 above presented two experiments using the scalable on-manifold methods developed here.
In particular, Fig. 2(a) applied the unsupervised method to Census Income data, showing that onmanifold Shapley values detect hidden model dependence on sensitive features, and Fig. 4(c) applied both methods to Abalone data, showing that global Shapley values remain positive and interpretable on-manifold.
In this section, we perform additional experiments to study the performance and stability of Sec.
4.1’s methods, as well as their effectiveness on higher-dimensional data.
P ERFORMANCE AND STABILITY
Our implementations of the unsupervised and supervised approaches to on-manifold Shapley values are summarised in Apps.
A and B. Both approaches lead to broadly similar results.
Fig.
5 compares the two techniques on the Drug Consumption data, where explanations are compared against the ground-truth empirical computation from Fig. 2(b).
The unsupervised approach is ﬂexible but untargeted: p ( x (cid:48)
| x S ) is data-speciﬁc but model-agnostic, accommodating explanations for many models trained on the same data.
The supervised approach
[Table]
+jNerJerHfrY9a6ZOUzB+gPrM8f9OCVig==</latexit> coalition size <latexit sha1_base64="EEw2GDbE4wykreYiH982S6ddCsg=">AAACAHicbVC7SgNBFJ2NrxhfqxYWNoNBsAq7EjB2ARvLCCYRkhBmJ3eTIbMPZu6KcUnjr9hYKGLrZ9j5N84mW2jigQuHc+7lco4XS6HRcb6twsrq2vpGcbO0tb2zu2fvH7R0lCgOTR7JSN15TIMUITRRoIS7WAELPAltb3yV+e17UFpE4S1OYugFbBgKX3CGRurbR12EB/T8lEdMikyjWjzCtG+XnYozA10mbk7KJEejb391BxFPAgiRS6Z1x3Vi7KVMoeASpqVuoiFmfMyG0DE0ZAHoXjoLMKWnRhlQP1JmQqQz9fdFygKtJ4FnNgOGI73oZeJ/XidBv9ZLRRgnCCGfP/ITSTGiWRt0IBRwlBNDGFcmP6d8xBTjaDormRLcxcjLpHVecauVy5tquV7L6yiSY3JCzohLLkidXJMGaRJOpuSZvJI368l6sd6tj/lqwcpvDskfWJ8/pBeXEQ==</latexit> must expected higher We in this paper see Table 1 for a numerical comparison
In Table 1, central values indicate the test-set MSE achieved by each method. The table compares the unsupervised and supervised methods against off-manifold splicing, showing signiﬁcant improvement over this baseline. Note that an MSE of zero is not achievable, because f y ( x ) in Eq.
(16) or (17) is not fully determined by partial input x S .
For the Drug Consumption data where we can compute p ( x (cid:48) | x S ) empirically, the optimal MSE happens to be 0 . 0436 .
Uncertainties in Table 1 represent the standard deviation in test-set MSE upon repeating each method with ﬁxed hyperparameters 10 times.
(Uncertainties are absent for the off-manifold and empirical columns, as these do not involve training a separate model.)
The table thus indicates that the supervised method offers increased stability as compared to the unsupervised approach.
The supervised method is more efﬁcient as well: while the unsupervised technique estimates the value function by sampling from ˆ p ( x (cid:48) | x S ) , the supervised approach learns the value function directly.
The supervised method thus requires far fewer model evaluations to match the standard-error of the unsupervised method: roughly 10 times fewer in our experiments.
E XAMPLE ON MNIST
To demonstrate on-manifold explainability on higher-dimensional data, we trained a fully connected network on binary MNIST (LeCun & Cortes, 2010) and explained random digits in Fig. 6(a).
Despite having the same sum over pixels – as controlled by the local version of Eq.
(5) – and explaining the same model prediction, each on-manifold explanation is more concentrated, with more interpretable structure, than its off-manifold counterpart.
The handwritten strokes are clearly visible on-manifold, with key off-stroke regions highlighted as well.
Off-manifold explanations generally display lower intensities spread less informatively across the digit-region.
These off-manifold explanations are a result of splices as in Fig.
With such unrealistic input, the model’s output is uncontrolled and less informative.
In fact, it is only on very large coalitions of pixels, subject to minimal splicing, that the model can make intelligent predictions off-manifold.
This is conﬁrmed in Fig.
6(b), which shows the average Shapley summand as a function of coalition size on
MNIST.
Note that primarily large coalitions underpin off-manifold explanations, whereas far fewer pixels are required on-manifold, consistent with the low-dimensional manifold underlying the data.
C ONCLUSION
In this work, we took a careful study of the off-manifold problem in AI explainability.
We presented important distinctions between on- and off-manifold explainability and provided experimental evidence for several novel shortcomings of the off-manifold approach.
We then introduced two techniques to compute on-manifold Shapley values on general data: one technique learns to impute features on the data manifold, while the other learns the Shapley value-function directly.
In-so-doing, we provided compelling evidence against the use of off-manifold explainability, and demonstrated that on-manifold Shapley values offer a viable approach to AI explainability in real-world contexts.
A I MPLEMENTATION DETAILS
For the unsupervised approach, we modelled the encoder q φ ( z | x ) as a diagonal normal distribution with mean and variance determined by a neural network:
[Equation]
We modelled the decoder p θ ( x | z ) as a product distribution:
[Equation]
) where the distribution type (e.g. normal, categorical) of each x i is chosen per-data-set and each distribution’s parameters are determined by a shared neural network.
We modelled the masked encoder r ψ ( z | x S ) as a Gaussian mixture:
[Equation]
To allow r ψ ( z | x S ) to accept variable-size coalitions x S as input, we simply masked out-of-coalition features with a special value ( − 1 ) that never appears in the data.
The unsupervised method has several hyperparameters: β which multiplies the regularisation term, the number of components in Eq.
(20), as well the architecture and optimisation of the networks involved.
For each experiment in this paper, we tuned hyperparameters to minimise the MSE of
Eq.
(16) on a held-out validation set; see App.
B for numerical details.
For the supervised approach, we modelled g y ( x S ) using a neural network, again masking out-ofcoalition features (with − 1 ) to accommodate variable-size coalitions x S .
This method’s hyperparameters, relating to architecture and optimisation, were similarly tuned to minimise the validationset MSE; see App.
B for details.
B D ETAILS OF EXPERIMENTS
Here we provide numerical details for the experiments presented in the paper
. B. D RUG C ONSUMPTION EXPERIMENT
On the Drug Consumption data from the UCI repository (Dua & Graff, 2017), we used 10 binary features from the data set – Mushrooms, Ecstasy, etc., as displayed in Fig. 5 – to predict whether individuals had ever consumed an 11th drug: LSD.
The explanations of Fig. 2(b) and Fig.
5 describe a random forest ﬁt with default sklearn parameters and max features =
None, which achieves 82.2% test-set accuracy amidst a 57 : 43 class balance.
In Fig. 2(b), global off-manifold Shapley values were computed using 10 6 Monte Carlo samples of Eq.
For each labelled data point ( x, y ) sampled from the test set, a single permutation was drawn to estimate Eq.
(1) and a single data point x (cid:48) was drawn to estimate the off-manifold value function Eq.
In all the ﬁgures of this paper, bar height represents the mean that resulted from
Monte Carlo sampling, and error bars display the standard error of the mean.
Global on-manifold Shapley values in Fig. 2(b) were computed similarly, but in this case using the on-manifold value function of Eq.
For each sampled coalition x S , a random data point x (cid:48) was drawn from the test set, with the crucial requirement
that x (cid:48) S = x S .
In the text, we refer to this as empirically estimating the conditional distribution p ( x (cid:48) | x S ) .
Such empirical estimation is only possible because this data set has a small number of all-binary features.
Tree SHAP values in Fig. 2(b) were computed with the SHAP package (Lundberg & Lee, 2017) with model output = margin and feature perturbation = tree path dependent.
The values labelled “Model retraining” in Fig.
2(b) were computed by ﬁtting a separate random forest g S for each coalition S of features in the data set: 2 10 models in all.
We used these models to compute the sum of Eq.
(10), where A ( g S ) represents a variant of model g S ’s accuracy: it is the
[Table]
accuracy achieved if one predicts labels by drawing stochastically from g S ’s predicted probability distribution (as opposed to deterministically drawing the maximum-probability class).
The global on-manifold Shapley values in Fig. 2(b) appear in Fig.
5 as well, labelled “Empirical”.
Fig.
5 also displays on-manifold Shapley values computed using the supervised and unsupervised methods introduced in this paper.
As above, these are Monte Carlo estimates of Eq.
The supervised method involved training a fully connected network on the MSE loss of Eq.
All neural networks in this paper used 2 ﬂat hidden layers, Adam (Kingma & Ba, 2015) for optimisation, and a batch size of 256.
We scanned over a grid with hidden layer size = { 128 , 256 , 512 } (21)
[Table]
choosing the point with minimal MSE on a held-out validation set after 10k epochs of training; see
Table 2.
Each supervised value in Fig.
5 corresponds to 10 4 Monte Carlo samples.
The unsupervised method involved training a variational autoencoder as described in Sec.
4.1 and
App. A.
The encoder, decoder, and masked encoder were each modelled using fully connected networks, trained using early stopping with patience 100.
We scanned over a grid of hidden layer sizes and learning rates as in Eq.
(21) as well as latent dimension
[Equation]
[Equation] [Equation]
regularisation
[Equation]
choosing the point with minimal validation-set MSE; see Table 2.
Unsupervised values in Fig.correspond to 10 6 Monte Carlo samples.
B. C ENSUS I NCOME EXPERIMENT
To produce the explanations of Fig. 2(a) we used the Census Income data set from the UCI repository (Dua & Graff, 2017).
The data contains 49k individuals from the 1994 US Census, as well as 13 features which we used to predict whether annual income exceeded $50k.
We trained a fully connected network (hidden layer size 50, default sklearn parameters, and early stopping), achieving a test-set accuracy of 85% amidst a 76 : 24 class balance.
The Shapley values for this model are labelled “Original model” in Fig. 2(a).
These were computed exactly as described in App.
B.1, except that the supervised method used 5k epochs, and the unsupervised method used patience 50.
Optimised hyperparameters are given in Table 2.
The onmanifold values in Fig. 2(a) were computed using the unsupervised method.
While the supervised method does not appear in the ﬁgure, it was performed to complete Table 1.
We also ﬁne-tuned the “Original model” to suppress the importance of sex.
Motivated by Dimanov et al.
we added a term to the loss that penalises the ﬁnite difference in the model output with respect to sex (as this is a discrete feature).
The modiﬁed loss function thus becomes
[Equation]
where L is the cross-entropy loss, f (cid:0) x i | do ( sex = j ) (cid:1) denotes f evaluated on the data point
x i with the value for sex replaced with j , and α is a hyperparameter controlling the trade-off between optimising the accuracy and minimising the effect of sex.
We ﬁne-tuned the model for an additional 200 epochs with α = 3 .
The resulting model agrees with the baseline on over 98.5% of the data, and has the same test-set accuracy.
Shapley values for this model are labelled “Suppressed model” in Fig. 2(a).
B. A BALONE EXPERIMENT
The Abalone data set from the UCI repository (Dua & Graff, 2017) contains 8 features corresponding to physical measurements (see Fig. 4c) which we used to classify abalone as younger than or older than the median age.
We trained a neural network to perform this task – with hidden layer size 100, default sklearn parameters, and early stopping – obtaining a test-set accuracy of 78%.
Shapley values in Fig. 4(c) were computed exactly as described in App.
B.1, except that the supervised method involved training for 5k epochs.
Optimised hyperparameters are given in Table 2.
B. MNIST EXPERIMENT
For binary MNIST (LeCun & Cortes, 2010), we trained a fully connected network (hidden layer size 512, default sklearn parameters, and early stopping) achieving 98% test-set accuracy.
The digits in Fig. 6(a) were randomly drawn from the test set.
Shapley values in Fig.
6(a) were computed exactly as described in App.
B.1, except that the supervised method involved training for 2k epochs, and the on-manifold explanations are based on 16k Monte Carlo samples per pixel.
Optimised hyperparameters are given in Table 2.
The on-manifold explanations in Fig. 6(a) were computed using the supervised method.
While the unsupervised method does not appear in the ﬁgure, it was performed to complete Table 1.
The average uncertainty, which is not shown in Fig. 6(a), is roughly 0.002 – stated as a fraction of the maximum Shapley value in each image.