Explaining Preferences with Shapley Values
Abstract
While preference modelling is becoming one of the pillars of machine learning, the problem of preference explanation remains challenging and underexplored.
In this paper, we propose P REF -SHAP, a Shapley value-based model explanation framework for pairwise comparison data.
We derive the appropriate value functions for preference models and further extend the framework to model and explain context specific information, such as the surface type in a tennis game.
To demonstrate the utility of P REF -SHAP, we apply our method to a variety of synthetic and real-world datasets and show that richer and more insightful explanations can be obtained over the baseline
Introduction
Preference learning [1] is a classical problem in machine learning, where one is interested in learning the order relations on a collection of data items.
Preference learning algorithms [2–5] often assume that there is a latent utility function f : X
(cid:55)→ R dictating the outcome of preferences, where
X denotes the domain of item covariates.
An explicit feedback such as item ratings or rankings from recommender systems can be treated as noisy evaluations of f , whereas pairwise comparison data (also known as duelling data) arising from, e.g., sports match outcomes [6, 7] can be used to implicitly infer f , i.e. item x ( ℓ ) is preferred over (beats) item x ( r )
when f ( x ( ℓ ) ) >
f ( x ( r ) ) .
As shown by Kahneman and Tversky [8], humans often struggle with evaluating absolute quantities when it comes to eliciting preferences, but are broadly capable of evaluating relative differences, a core observation often exploited in preference learning.
Motivated by such, this work will focus on explaining preferences inferred using duelling data.
Explaining preference models is crucial when they are applied in areas such as recommendation systems [9], finance [10], and sports science [11] for the practitioner to trust, debug and understand the value of their findings [12].
However, despite its importance, no prior work has studied this problem to the best of our knowledge.
While one may suggest applying existing explainability tools such as LIME [13], or SHAP [14] to a learned utility function f , we reason that this approach only explains the utility but not the mechanism of eliciting preferences itself.
We highlight the important differences between these two viewpoints in our numerical experiments.
Moreover, the utility-based model places a strong rankability assumption on the underlying preferences, meaning that if we define x ( ℓ ) ⪯ x ( r ) ⇐⇒ f
( x ( ℓ ) ) ≤ f ( x ( r ) ) , then ⪯ is a total order on all the items.
However, as
Pahikkala et al.
[15] and Chau et al.
[16] have discussed, there are many departures from rankability in practice, e.g. we might easily see a preference of A over B , B over C , but C over A – conforming to the rock-paper-scissors relation.
Such inconsistent preferences are under frequent study in social choice theory [17, 18], and are of wider interest in both healthcare [19] and retail [20] where data are both large and noisy.
To move beyond the rankability assumption, we will utilise the Generalised Preferential Kernel from [16] to model the underlying preferences, and develop P REF -SHAP, a novel Shapley value [21]-based explainability toolbox, to explain the inferred preferences.
Our contributions can be summarised as follows:
We propose P REF -SHAP, a novel Shapley value-based explainability algorithm, to explain preferences based on duelling data.
We empirically demonstrate that P REF -SHAP gives more informative explanations compared to the naive approach of applying SHAP to the inferred utility function f . 3.
We release a high-performant implementation of P REF -SHAP at [22].
Background materials
We will first give a brief overview of preference learning and Shapley Additive Explanations (SHAP) [14], which are the two core concepts of our contribution, P REF -SHAP, described in
Section 3.
Notation
Scalars are denoted by lower case letters, while vectors and matrices are denoted by bold lower case and upper case letters, respectively.
Random variables are denoted by upper case letters.
X ⊆ R d denotes the item space with d features and Y = {− 1 , 1 } is the binary preference outcome space 3 .
We let k : X × X
→ R be a kernel function and H k
the corresponding reproducing kernel
Hilbert space (RKHS).
2.1 Preference Learning
In this section, we will introduce the two approaches to model preferences from duelling data, namely the utility based approach and the more general approach from Chau et al.
Formally, a preference feedback is denoted as duelling , when a pair of items ( x ( ℓ ) , x ( r ) )
∈
X × X is given to a user, and a binary outcome y ∈ Y telling us whether x ( ℓ ) or x ( r ) won the duel, is observed.
In general, we observe m binary preferences among n items, giving the data D = (cid:0) y , X ( ℓ ) , X ( r ) (cid:1) =
(cid:110) ( y j , x ( ℓ ) j , x ( r ) j ) (cid:111) m j =1 .
We also use X ∈ R n × d to denote the full item covariate matrix.
Utility-based Preference model (UPM)
The following likelihood model is often used [2–5, 7] to model duelling feedback using a latent utility function f :
[Equation]
where σ is the logistic CDF, i.e. σ ( z )
= (1 + exp( − z )) − 1 .
Maximum likelihood approaches are then deployed to learn the latent utility function f .
Consequently, preferences between items can be inferred accordingly from f = { f ( x i ) } ni =1 , i.e. x i is on average preferred over x j if f i ≥
f j .
Albeit elegant, there are several drawbacks to this approach in modelling preferences.
As mentioned, using a one-dimensional vector f to derive preferences assumes that the items { x i } ni =1 are perfectly rankable, i.e. there is a total ordering on X which the true preferences are consistent with.
This is a strong assumption that often does not hold in practice.
For example, it is well studied that cognitive biases often lead to inconsistent human preferences in behavioural economics [8].
Moreover, the ranking community has also challenged this assumption by devising rankability metrics [23, 24] to test this restrictive assumption in practice.
Generalised Preference Model (GPM)
Chau et al.
[16] proposed to model preference directly using a more general g :
X × X → R that captures the preference within any pair of items, using the likelihood
[Equation]
We note that g has to be a skew-symmetric function to ensure the natural property p ( y | x ( ℓ ) , x ( r ) )
= 1 − p ( y | x ( r ) , x ( ℓ ) ) .
The utility based approach can be obtained as a special case of this model, i.e. by setting g ( x ( ℓ ) , x ( r ) )
=
f ( x ( ℓ ) ) − f ( x ( r ) ) .
We propose that when one is interested in modelling (and thus explaining) pairwise preferences, we should consider the preference function g directly instead of explaining preferences based on a restrictive utility model f .
We follow Chau et al.
[16]’s approach to model g non-parametrically using kernel methods [25].
We assume g as a function lives in the following RKHS of skew-symmetric functions: given kernel k : X × X
→ R defined on the item space X , the generalised preferential kernel k E on X × X is constructed as follows:
[Equation]
This kernel allows us to model the similarity across pairs of items.
Moreover, if k is a universal kernel [26], then k E also satisfies the corresponding notion of universality, meaning that the corresponding RKHS H k E is rich enough to approximate any bounded continuous skew-symmetric function arbitrarily well [16, Theorem. 1].
To infer g ∈ H k E using likelihood (2), one simply runs kernel logistic regression with data y as labels and (cid:0) X ( ℓ ) , X ( r ) (cid:1) as inputs.
We will refer to this approach as the Generalised Preference Model (GPM).
We emphasize that explaining GPM allows us to specifically explain inconsistent preferences , which in contrast to explaining rank allows us to infer preferences even when transitivity is violated.
Such insights can be of great importance in broader contexts such as decision theory [27] and utility theory [28] where transitivity does not hold.
Incorporating context variables.
Besides item-level covariates x ∈ X , when there exist additional context covariates u ∈ U ⊆
R d ′ that describe the context in which a specific pairwise comparison is made, they can be incorporated into the kernel design as discussed in Chau et al.
[16, Appendix.
B].
Examples of such context covariates could be court type when a tennis match is conducted, or where a different user compares two clothing items in e-commerce.
Considering the enriched dataset
D =
(cid:110)(cid:16) y j , u j , x ( ℓ ) j , x ( r ) j (cid:17)(cid:111) m j =1 , we can now model the preference incorporating the context as: p ( y | u , x ( ℓ ) , x ( r ) )
=
σ (cid:0) g U (cid:0) u , x ( ℓ ) , x ( r ) (cid:1)(cid:1) .
Now, given a kernel k U defined on the context space U , the context-specific preference function g U : U × X × X
→ R can be learnt non-parametrically with the following kernel,
[Equation]
We refer to this approach as the Context-specific Generalised Preference Model (C-GPM).
2.2 Shapley Additive Explanations (SHAP)
To explain preferences, we will utilise the popular SHAP (SHapley Additive exPlanations) paradigm, which is based on the concept of Shapley values (SV).
SV [21] were originally proposed as a credit allocation scheme for a group of d players in the context of cooperative games, which are characterised by a value function ν : [0 , 1] d → R that measures utility of subsets of players.
Formally, the Shapley value for player j in game ν is defined as:
[Equation]
where Ω = { 1 , ..., d } is the set of players of the game.
Given a value function ν , the Shapley values are proven to be the only credit allocation scheme that satisfies a particular set of favourable and fair game theoretical axioms, commonly known as efficiency , null player property , symmetry and additivity [21].
Štrumbelj and Kononenko [29] later connect Shapley values to the field of explainable machine learning by drawing an analogy between model fitting and cooperative game.
Given a specific data point, by considering its features as players participating in a game that measures features’ utilities, the Shapley values obtained can be treated as local feature importance scores .
Such games are typically defined through the value functions defined below.
Definition 2.1 (Value functions) .
Let X be a random variable on X ⊆ R d and f : X → R a model from hypothesis space H .
The value function ν : X × [0 , 1] d × H is given by
[Equation]
where r is an appropriate reference distribution, X S is the subvector of X corresponding to the feature set S , S c is the complement of the feature set S and { X S , X S c } =
X denotes the concatenation of
X S and X S c .
In other words, given a data point x , the utility of the feature subset S is defined as the impact on the model prediction, after “removing” the contribution from S c via integration with respect to the reference distribution r .
These “removal-based” strategies are common in the explainability literature [30].
Nonetheless, the correct choice of the reference distribution has been a long-standing debate [31].
Janzing et al.
[32] argued from a causality perspective that the feature marginal distribution should be used as the reference distribution, i.e. r ( X S c | X S
= x S )
=
p ( X S c ) where p is the data distribution.
On the other hand, Frye et al.
[33] disagreed by pointing out these “marginal” value functions ignore feature correlations and lead to unintelligible explanations in higher-dimensional data, and they instead advocate the use of conditional distribution as reference, i.e. r ( X S c | X S
= x S )
=
p ( X S c | X S = x S ) .
Thus, there is no consensus and in fact, Chen et al.
[31] took a neutral stand and argued the choice depends on the application at hand.
This also leads to design of value functions for specific problems, e.g. improving local estimation [34], incorporating causal knowledge [35, 36] and modelling structured data [37].
In this paper, we will design an appropriate value function for preference learning and show that naive application of the existing value function to preference learning will lead to unintuitive results.
Shapley value estimation.
Given a data point x and a model f , estimating Shapley values consist of two main steps: Firstly, for each feature subset S ⊆ Ω , estimate the value function ν x ,f ( S ) either by Monte Carlo sampling from the reference distributions r , or by utilising a model specific structure to speed up the estimation such as in L INEAR SHAP [29], D EEP SHAP [14], T REE SHAP [38], and RKHS-SHAP [12].
The former sampling procedure is straightforward when r is the marginal distribution, but computationally heavy and difficult when r is the conditional distribution, as it involves estimating an exponential number of conditional densities [39].
Finally, after estimating the value functions, one can compute the Shapley values based on Eq. 3 or by utilising the efficient weighted least square approach proposed by Lundberg and Lee [14].
Estimating value functions when f ∈ H k .
We give a review to the recently introduced RKHSSHAP algorithm proposed by Chau et al.
[12] as it is another core component for P REF -SHAP.
RKHS-SHAP is a SV estimation method for functions in a given RKHS.
It circumvents the need for any density estimation and utilises the arsenal of kernel mean embeddings [40] to estimate the value functions non-parametrically.
Assume k takes a product kernel structure across dimensions, then for any f ∈ H k , by applying the reproducing property [25], the value function can be decomposed as: [Equation]
[Equation]
where k X S is the product of kernels belonging to the feature set S , and µ r ( X Sc | X S = x S ) :
= (cid:82) k
X Sc r ( X S c | X S
= x S ) dX S c is the kernel mean embedding [40] of the reference distribution r .
Depending on the choice of the reference distribution, one recovers either the standard kernel mean embedding or the conditional mean embedding.
This allows us to arrive at a closed form expression of the value function and circumvents the need for fitting an exponential number of conditional densities.
Proposed method: P REF -SHAP
In this section, we will present P REF -SHAP, a new Shapley explainability toolbox designed to explain preferences by attributing contribution scores over item-level and context-level covariates for our preference models.
Recall the likelihood model for C-GPM from Sec. 2.1:
[Equation]
where g U is the context-included preference function that denotes the strength of preference of item x ( ℓ ) over item x ( r ) under context u .
As there are two distinct sets of covariates present, we will propose two different value functions to capture the influences from items and context variables respectively, and show how they could be estimated non-parametrically using tools from the kernel methods literature, as in RKHS-SHAP.
3.1 Preferential value function for items
To explain a general preference model g : X × X
→ R , we propose the following preferential value function for items .
Definition 3.1 (Preferential value function for items) .
Given a preference function g ∈ H , a pair of items (cid:0) x ( ℓ ) , x ( r ) (cid:1) ∈
X × X to compare, we define the preferential value function for items as ν ( p I ) :
X × X × [0 , 1] d × H → R such that:
[Equation]
where expectation is taken over the reference q
[Equation]
We note that ν ( p I ) is also applicable to the context-specific preference models.
For example, applying ν ( p I ) to g u :=
g U ( u , · , · ) allows one to quantify the item covariate’s influences under a specific context u , while applying ν ( p I ) to ¯ g :=
E p ( U ) [ g U ( U, · , · )] quantifies the average influence from each of the item covariates instead.
Similar to standard value functions, the influence of a feature set S shared by the items x ( ℓ ) , x ( r ) is measured as the impact on the preference model after “removing” contributions from features in
S c , via integration with respect to some reference distribution r .
Similar to g , this value function is skew-symmetric in its first two arguments, i.e. ν ( p I ) ( x ( ℓ ) , x ( r ) , S, g ) = − ν ( p I ) ( x ( r ) , x ( ℓ ) , S, g ) .
This is justified, since features that “encourage” preference of x ( ℓ ) over x ( r ) should naturally be the ones that “discourage” preference of x ( r ) over x ( ℓ ) to ensure consistency.
In this paper, we assume the items are i.i.d sampled from some distribution p , and we utilise the observational data distribution as reference as in [33], i.e. we take r (cid:16) X ( ℓ ) S c , X ( r ) S c
| X ( ℓ ) S
= x ( ℓ ) S , X ( r ) S
= x ( r ) S (cid:17) to be p (cid:16) X ( ℓ ) S c | X ( ℓ ) S = x ( ℓ ) S (cid:17) p (cid:16) X ( r ) S c | X ( r ) S
= x ( r ) S (cid:17) .
Although we decide here to use the observational distribution as the reference, the corresponding estimation procedure follows analogously if one instead uses the marginal distribution approach in Janzing et al.
Problems with direct application of SHAP to preference model g
A naive way of explaining with SHAP a general preference model g which assumes no rankability would require concatenation of the items’ covariates.
Namely, we would set z = ( x ( ℓ ) , x ( r ) )
∈
R 2 d and then apply SHAP to the function g ( z ) directly, now giving 2 d Shapley values for each observed preference, i.e. two Shapley values for each feature.
Not only does this approach require us to consider a larger number of feature coalitions during computation (squaring the original amount), but it also ignores that x ( ℓ ) and x ( r ) in fact consist of the same features, leading to inconsistent explanations, i.e. that the same feature in x ( ℓ ) and x ( r ) has a different influence, hence giving different explanations simply due to the ordering of items.
We illustrate these pitfalls of such a naive approach in Appendix B.
Empirical estimation of the preferential value function ν ( p I ) x ( ℓ ) , x ( r ) ,S ( g )
While the preferential value function is general in the sense that it could be applied to any preference function g , we divert our attention to functions in H k E , where k E is the generalised preferential kernel introduced in
Sec 2.1.
This allows us to adapt the recently introduced RKHS-SHAP to our settings, and we can thus circumvent learning an exponential number of conditional densities as in [33].
In the following segment, we prove the existence of the Riesz representation of the preferential value functional , a necessary step to adapt the RKHS-SHAP framework to our setting.
Proposition 3.1 (Preferential value functional for items) .
Let k be a product kernel on X , i.e. k ( x ( ℓ ) , x ( r ) )
= (cid:81) dj
=1 k ( j ) ( x ( j ) , x ′ ( j ) ) .
Assume k
( j ) are bounded for all j , then the Riesz representation of the functional ν ( p ) x ( ℓ ) , x ( r ) ,S exists and takes the form:
[Equation]
where K ( x , S ) =
k S ( · , x S ) ⊗ µ X Sc | X S
= x S and k S ( · , x S ) = (cid:78)
j ∈ S k
( j ) ( · , x ( j ) ) is the sub-product kernel defined analogously as X S .
All proofs are included in the appendix.
By representing the functionals as elements in the corresponding RKHS, we can now estimate the value function non-parametrically using kernel mean embeddings.
Proposition 3.2 (Non-parametric Estimation) .
Given ˆ g = (cid:80) mj {+=
+}
α j k E (( x ( ℓ ) j , x ( r ) j ) , · ) , datasets
X ( ℓ ) , X ( r ) , test items x ( ℓ ) , x ( r ) , the preferential value function at test items x ( ℓ ) , x ( r ) for coalition S
[Table]
and preference function ˆ g can be estimated as
[Equation] [Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
⊙ Γ [Equation] X [Table]
S
[Equation]
x
[Table]
S [Equation] where Γ( X ( ℓ ) S , x ( ℓ ) S ) = K X (
[Equation] ) S , x ( [Equation] ) S ⊙ K X (
[Equation]
Sc , X Sc K − 1 X S
[Equation] λ K X S , x ( [Table] ) S , K X S ,λ = K X S , X S + nλI , α = { α j } mj =1 and λ > 0 is a regularisation parameter.
3.2 Preferential value function for contexts
The influence an individual context feature in U has on a C-GPM function g U can be measured by the following value function.
Proposition 3.3 (Preferential value function for contexts) .
Given a preference function g U ∈ H k UE , denote Ω ′
= { 1 , ..., d ′ } , then the utility of context features S ′ ⊆
Ω ′ on { u , x ( ℓ ) , x ( r ) } is measured by ν ( p U ) u , x ( ℓ ) , x ( r ) ,S ′ ( g U ) =
E [ g U (cid:0) { u S , U S c } , x ( ℓ ) , x ( r ) (cid:1) | U S = u S ] where the expectation is taken over the observational distribution of U .
Now, given a test triplet ( u , x ( ℓ ) , x ( r ) ) , if ˆ g U = (cid:80) mj
=
α j k UE (cid:16) ( u j , x ( ℓ ) j , x ( r ) j ) , · (cid:17) , the non-parametric estimator is: ˆ [Equation] ⊙
[Equation]
where Ξ x ( ℓ ) , x ( r ) = (cid:0) K X ( ℓ ) , x ( ℓ ) ⊙ K X ( r ) , x ( r ) − K X [Equation] r ) [Equation]
x
[Equation] ⊙ K X [Equation] x
[Equation]
r ) (cid:1) .
Analogously, the average influence of a specific context feature can be computed by taking an average over all pairs of matches, i.e. by using a modified value function 1 m (cid:80) mj
=1 ν ( p U ) u , x ( ℓ ) j , x ( r ) j ,S ′
(ˆ g U ) .
We summarise different ways to modify the proposed preferential value functions to interrogate the preference models in Table 1.
Computational complexity of P REF -SHAP
When computing GPM, it is fundamentally a kernel ridge regression (KRR), which naïvely has complexity O ( n 3 ) .
There exists a multitude of approximation techniques for KRR, the most common type being the Nyström approximation [41].
For all our experiments, we use FALKON [42], a large-scale library for solving kernel logistic regression using preconditioned conjugate gradient descent and Nyström approximations.
FALKON has a computational complexity of O ( n √ n ) , which effectively becomes the complexity for GPM when using FALKON.
As the value function for GPM requires estimating conditional mean embeddings, which in turn also are KRR’s, one can appeal to FALKON again to reduce complexity to O ( n √ n ) .
We summarize the procedure of P REF -SHAP in Algorithm 1.
We further detail computational details pertaining to computing coalitions S and batched conjugate gradient descent ( BatchedCGD ) in Appendix A.
Experiments
The main focus of our experiments is to illustrate the difference between explaining GPM (P REFSHAP) and applying SHAP to UPM, thus highlighting the difference in explaining the mechanism of eliciting preferences and explaining the utility.
When we explain UPM, we first explain how items x ( ℓ ) , x ( r ) affect their utilities f ( x ( ℓ ) ) , f ( x ( r ) ) .
Explaining the utility corresponds to calculating the value functions of the utilities ν x ( ℓ ) ,S ( f ) and ν x ( r ) ,S ( f ) .
By linearity of SHAP values [14] and the simple structure relating preference and utilities in UPM, we can explain UPM by subtracting the
Shapley values of x ( ℓ ) with x ( r ) .
However, this type of explanation is only correct when data is rankable, which seldom happens in practice, thus motivating P REF -SHAP.
BatchedCGD 6:
9: Calculate Shapley β
We apply P REF -SHAP to unrankable synthetic and real-world datasets to connect theory with practice.
We split data, i.e. matches with their outcomes, into train (80%), validation (10%), and test (10%) and explain the model on a random subset of the data.
The hyperparameters for the kernels are selected using gradient descent, based on the proposed method in [43].
We first generate synthetic duelling data where performance can be compared against ground truth, to demonstrate that
P REF -SHAP is capable of identifying the relevant features.
Synthetic data
We first consider a synthetic experiment with unrankable duelling data.
We generate the items by first sampling 1000 item covariates [ x [0] i , x ABi , x ACi , x BCi ]
=: p i ∈
R 4 ∼ N (0 , I 4 ) .
We associate each item with a cluster membership c i ∈ { A, B, C } , where the assignment is randomly chosen for each item with equal probability.
We then form the full item covariate by concatenating p i with one-hot encoded c i as x i
= [ p i , one_hot ( c i )] .
40000 matches between randomly chosen pairs of items are conducted by the following mechanism: match outcomes are decided based on the underlying cluster membership of the items.
For example, if an item from cluster A competes against an item from cluster B , the winner is decided by their inter-cluster covariate x AB , i.e. i ⪯ j if x ABj ≥ x ABi .
When the match is between members of the same cluster, it is dictated by the maximum among the within-cluster variable, i.e. max( x [0] i , x [0] j ) .
See Fig.
1 for an illustration.
As no clusters have any advantage over the others, the data is not rankable, and we expect the inter-cluster covariates x AB , x AC , x BC to have similar explanations on average, but significantly different from each other when we examine local explanations.
A
B
C A B C
We consider both global and grouped-local explanations of the synthetic dataset in Figure 2 and Figure 3 respectively.
In the global explanations, we explain all matches regardless of the cluster membership, while in the groupedlocal explanations we only explain matches between items from A against items from B .
For more grouped-local explanations on different cluster pairs, we refer to appendix B.
Interpreting the simulation explanations.
The beehive plots showcase the recovered P REF -SHAP values, where the bar plots demonstrated the average
P REF -SHAP values for each feature.
The colour in the beehive plots indicates the magnitude of the difference between the corresponding features of the winner and of the loser in that match.
For example, a red point in a beehive plot for feature
d indicates that the difference x ( d ) winner − x ( d ) loser is large.
Fig.
2 illustrates the explanation results for the global synthetic experiments.
We see that P REF -SHAP identified the within-cluster variable x [0] as the most important, which is a consequence of the fact that the largest number of matches are played between the items of the same cluster (cf.
Fig.where there are three blue lines and two lines of each of the other colours).
The three inter-cluster [Table] variables contributed similarly according to P REF -SHAP, which, by symmetry, should be the case.
Furthermore, the correct battle mechanism is captured by P REF -SHAP
but not UPM, as we see that the large P REF -SHAP values for each feature are red in the beehive plot.
This indicates that items with larger value are more likely to win against items with lower value in the corresponding features.
In contrast, SHAP for UPM does not recover this insight.
The explanations for the matches between items from A against items from B , are shown in Fig 3.
Here, x AB is correctly picked as the relevant feature in these matches with P REF -SHAP, but not with SHAP for UPM.
We see again that there is a clear tendency that large P REF -SHAP values are red for feature x AB , showing that P REF -SHAP once again captures the designed gaming mechanism – which is not the case in SHAP for UPM.
Intuitively, even though SHAP for UPM allows local explanations, it does so based on a global utility , which fails completely in a non-rankable case.
[Figure] [Figure]
Real-world explanations
For our real-world datasets, we consider publicly available datasets
Chameleon , Pokémon and Tennis .
We provide descriptive statistics of these datasets in Tableand give their brief descriptions below.
Appendix B contains further large scale experiments on an additional dataset consisting of user-item interactions on a fashion retail website.
The Chameleon dataset [44] considers 106 contests between 35 male dwarf chameleons.
Physical traits of the chameleons are measured such as the height of their casque , length of their jaw , body mass etc.
According to [44], they fitted a linear Bradley Terry model and examined the coefficients to deduce that casque height (ch.res) and relative area of the flank patch (prop.patch) positively affected the fighting ability the most.
The Pokémon dataset considers 60000 Pokémon battles among 800 Pokémon.
Pokémon have different characteristics such as attack power , speed , health etc.
The
Pokémon further has at least one different type such as Electric, Water, Fire , etc.
Certain types have advantages and disadvantages against each other, for instance, fire Pokémon are weak to water-based attacks (receiving twice the damage) and as a result have a disadvantage against water Pokémon.
The Tennis dataset considers professional tennis matches between 1991 and 2017 in all major tournaments each year.
The data is provided publicly by ATP World Tour [45].
Features such as birthyear , weight , height etc are included about each tennis player together with context details of the match such as the court being indoor or outdoor and what surface the match is being played on.
The above datasets are not rankable, and we validate this claim by comparing GPM performance against UPM in Table 4, together with the estimated rankability measure SpecR proposed in [23] for each dataset.
SpecR measures the similarity of the data to a complete dominance graph (i.e. rankable data).
It takes values between 0 and 1 with values close to 1 being evidence in support of rankability.
[Table]
For the Tennis data where there are additional relationships with the context (tournaments), we estimate the average SpecR of each tournament.
Both the superior performance of GPM over UPM and the low SpecR measures suggest that the datasets are generally not rankable, which points to limitations of explaining preferences via utility-based modeling.
Explaining Pokémon battles.
We first consider standard dueling data for explaining preferences.
We explain the learned preferences and learned differences in utilities on the Pokémon dataset in
Figure 4.
In this dataset, we have summed the Shapley values for Type features.
[Figure]
We see that explaining general preferences provides further insight than just explaining the difference in utility functions.
In particular,
SHAP for UPM does not capture the additional importance of Speed in winning battles.
As higher (more red) values of differences in speed x speedwinner − x speedloser have positive impact on the outcome, we conclude that having higher speed than your opponent is advantageous besides a type advantage.
This insight is aligned with the “Sweeper” strategy [46], where one would employ a leading Pokémon with very high speed and attack to attempt downing the opponent before they can strike back.
In Fig.
5, we see P REF -SHAP
can also capture the correct type advantage/disadvantages among the Pokémon, but not
SHAP for UPM.
Explaining Chameleon contests.
We find that UPM’s explanations are more aligned with [44]’s findings ( prop.path and ch.res are the most important features), which is unsurprising since the Bradley
Terry model used in [44] is also a utility based model.
However, since GPM gives a much better predictive performance than UPM (Test AUC 0 . 92 v.s. 0 . 80 ), we believe P REF -SHAP’s explanations are also insightful.
In fact, P REF -SHAP discovers that having larger jaw sizes (jl.res) than your opponent have a significant negative effect on match outcome, a previously undiscovered mechanism from [44].
We verify this finding in
Appendix B by applying P REF -SHAP to GPM trained on multiple folds of the Chameleon dataset and consistently find that high values of the jaw size (jl.res) variable have a negative impact on the outcome.
[Figure]
Explaining Tennis matches.
We now consider preference learning with context covariates and explain both item characteristics and context covariates in Figure 7.
In terms of item-based inference,
P REF -SHAP finds that being older than your opponent ( x yobwinner − x yobloser <
→ Blue), physically heavier, and taller than your opponent positively impacts the chances of winning.
We also find that debuting earlier as a professional tennis player than your opponent positively impacts your chances of winning.
This is not surprising as debuting earlier may be indicative of a promising young talent.
Across all competitions, there appear to be no significant patterns in environment effects.
[Figure]
Explaining Djokovic’s losses
In plot Figure 8, we locally explain all Novak Djokovic’s losses in his professional career.
Novak Djokovic is regarded as one of the greatest tennis players of all time, so understanding his weakness could serve as a practical demonstration of the utility of P REF -SHAP.
[Figure]
While the results take a similar shape to the global explanations, Djokovic remarkably seems to be weaker to players shorter than him, contrary to the general advantage of being taller.
Besides this,
Djokovic seems to be weaker on clay courts and when playing indoors.
Conclusion
In this work, we proposed P REF -SHAP to explain preference learning for pairwise comparison data.
We proposed the appropriate value function for preference explanations and demonstrated the pathologies of the naive concatenation approach in Appendix B. Experiments demonstrated that
P REF -SHAP recovers richer explanations than utility-based approaches, showcasing the ability of
P REF -SHAP in interpreting the mechanism of preference elicitation.
Acknowledgments
The authors sincerely thank Oscar Clivio for the helpful comments and feedback.
SLC is supported by the EPSRC and MRC through the OxWaSP CDT programme EP/L016710/1.
DS is supported in part by Tencent AI Lab and in part by the Alan Turing Institute (EP/N510129/1).
A Computation and Implementation Details
We propose several optimizations in the P REF -SHAP procedure.
We consider fast sampling of coalitions S in Algorithm 2 batched conjugate gradient descent in Algorithm 3 described below.
Fast coalitions
We first propose an optimized sampling scheme for finding coalitions S in Algorithm 2.
In contrast to the implementation in [14] which samples the weights from p ( Z ) , our method
Algorithm
Sampling unique n , d -dimensional coalitions in O ( d ) time
Input: Number of coalitions n , number features d .
1: I =
SampleWithoutReplacement
( n, 0 , 2 d )
▷ Sample n unique integers between 0 and 2 d 2: def base2(i): ▷ Convert integer to base-2 representation 3:
S = [0 , . . . , 0] ∈ R d , r = i
▷ Initialize d -dimensional 0 vector and the rest term r 4: while r > 0 do 5: i =
⌊ log 2 ( r ) ⌋ ▷ Find which index of S to set to6:
S [ i ] =
▷ Update S 7: r = r − 2 i ▷ Update rest term 8: end while 9: return S return { S 1 , . . .
S n } = parallel_apply ( I, base2 )
▷ Each integer can be independently converted is embarrassingly parallel, which allows for an additional O ( n ) reduction.
A naive algorithm that compares each sample S i has complexity O ( n
2 d 2 ) and cannot be parallelized.
Stabilizing the Shapley value estimation We remove the features which have 0 variance in the data we are explaining, similar to the implementation in SHAP.
To ensure we get numerically stable
Shapley Values, we calculate the inverse using Cholesky decomposition, as we found the regular inverse function provided inconsistent results.
To calculate CMEs effectively, we use preconditioned batched conjugate gradient descent over coalitions detailed in Algorithm 3.
Algorithm 3 Batched conjugate
Input
[Equation]
x Sn ,x Sn ] , max_its , tolerance ε
Set R = B , Z = BatchMM
( P, B ) ,
p =
Z , a =
Set R Z =
[( R i ◦ Z i )
++ . . .
( R n ◦ Z n )
++ ] ▷ Element wise product and sum for max_its do
L = BatchMM
( X , B ) α
= L ◦
[( L i ◦ p i )
++ ...
( L n ◦ p n )
++ ] a = a + α ◦ p r = r − α ◦ L if Mean( [( r i ◦ r i ) ++ . . .
( r n ◦ r n ) ++ ] ) <
ε then return a end if z = BatchMM ( P, r )
R new Z =
[( R i ◦ Z i )
++ . . .
( R n ◦ Z n )
++ ] p
=
z
+ [( R new i ◦ 1 R i ) ++ . . .
( R new n ◦ 1 R n ) ++ ] ◦ p
R Z = R new Z end for return a
We have run all our jobs on one Nvidia V100 GPU.
B Additional Experimental Results Naive Concatenation
We demonstrate the pathologies of the naive concatenation approach mentioned in Sec.
3 with our synthetic experiment.
Recall that naive-concatenation approach here corresponds to first concatenating x ( ℓ ) , x ( r ) ’s features together and applying SHAP to the learned function g directly, in order to to obtain 2 d Shapley values, instead of the original d , since each feature has been duplicated.
This approach ignores that the items x ( ℓ ) and x ( r ) in fact consist of the same features.
Therefore, when we use the usual value function from SHAP (corresponding to the impact an individual feature has on the model when it is turned “off” by integration), we would be turning “off” the feature from the left item, while keeping “on” the feature from the right item, obtaining a difficult to interpret attribution score.
This is highly problematic, as we might be inferring vastly different contributions of the same feature purely because of the item ordering when concatenating them.
We note that the item ordering in all our experiments is arbitrary and carries no additional information about the match.
We can see from Fig.
9 that when we explain the preference model applied to the synthetic experiment, we see that, for example, x AC ( l ) from x ( ℓ ) and x AC ( r ) from x ( r ) have in fact very different average
Shapley values.
Even attempting to average each pair of corresponding features does not give a meaningful feature contribution ordering ( x AB and x AC are scored higher on average than x BC and x [0] ).
Additional synthetic data We consider an additional synthetic experiment where we generate data directly from a GPM model and one where we construct synthetic dueling data.
When simulating data, we first generate player covariates as x i ∈ R
d ∼ N (0 , 0 .
1 I d ) for each player
i .
When generating from the GPM model, we would set 2 covariates as important, by only keeping the 2 first entries of x i and fixing the rest to be constant (equal to 0).
We build a GPM model for g out of these covariates and generate match outcomes.
We consider d = 10 , where only the two first features are set to be important in predicting the outcome.
[Figure]
not.
Chameleon data We further provide explanations of the Chameleon dataset on several different folds in Figure 11 and Figure 12.
Additional local explanations We additionally provide local explanations on the synthetic dataset in Figure 13 and Figure 14.
[Figure]
[Figure]
Website dataset The Website dataset considers anonymized visitors on a fashion retail website, where we are given what garment each visitor viewed and what each visitor clicked in a session.
A user may have more than one session.
In this setup, we interpret a browsing session for a visitor as multiple matches between items, such that the winning item (clicked) competes against all losing items (only viewed).
If several items are winners, they do not play against each other.
Each item has several descriptive statistics such as colour , garment type , assortment characteristic etc.
There
[Table]
D binary
D Contextcontinuous
D Contextbinary
[Table] [Table]
users)
are some limited descriptive statistics of the visitors, such as year of birth and gender code (i
[Table]
e.
Male/Female/Unspecified/Unknown).
Explaining Website
For the website dataset, we explain product and user preferences in Figure 15.
We generally found that, for the period considered, cosmetic products and the “Jersey Basic category” drove clicks.
[Table] [Table]
C Proofs
Proposition 3.1 (Preferential value functional for items) .
Let k be a product kernel on X ,
i
[Table]
e. k ( x ( ℓ ) , x ( r ) )
= (cid:81) dj
=1 k ( j ) ( x ( j ) , x ′ ( j ) ) .
Assume k
( j ) are bounded for all j , then the Riesz representation of the functional ν ( p ) x ( ℓ ) , x ( r ) ,S exists and takes the form:
[Equation]
where K ( x , S ) =
k S ( · , x S ) ⊗ µ X Sc | X S
= x S and k S ( · , x S ) = (cid:78)
j ∈ S k
( j ) ( · , x ( j ) ) is the sub-product kernel defined analogously as X S .
Proof.
From [16]
[Equation]
we know the generalised preferential kernel has the following feature map:
[Equation]
where ⊗ are the usual tensor product
[Equation]
Recall we defined the preferential value function for items as,
[Equation]
as ν ( p I ) x ( ℓ ) , x ( r ) ,S is a bounded linear functional on g where g ∈ H k E is bounded, Riesz representation theorem [25] tells us there exists a Riesz representation of the functional in H k E
[Equation]
which for notation simplicity
[Equation]
we will denote it as ν ( p I ) x ( ℓ ) , x ( r ) ,S as well.
This corresponds to,
[Equation]
r ) ,S ⟩ H kE (13) now we expand the expectation of the feature map as,
[Equation]
However, we note that
[Equation]
because X ( ℓ ) and X ( r ) are identical copies of X and we take the reference distribution as
[Equation]
Focusing on the duplicating component
[Equation]
we have,
[Equation]
therefore by symmetry
[Equation]
we can arrange the terms in Eq 14 and conclude the proposition,
[Equation]
To estimate the preferential value functional, we simply replace the conditional mean embeddings with the empirical versions, i.e. ˆ K ( x , S ) =
k S ( · , x S ) ⊗ ˆ µ X Sc | X S = x S , where ˆ µ X Sc | X S
= x S =
K x S , X S ( K X S , X S + nλI ) − 1 Φ ⊤ X Sc is the standard conditional mean embedding estimator ( Φ X Sc is the feature map matrix of rv X
S c ).
Now we proceed to estimate the preferential value function given a function g from the RKHS,
Proposition 3.2 (Non-parametric Estimation) .
Given ˆ g = (cid:80) mj =
α j k E (( x ( ℓ ) j , x ( r ) j ) , · ) , datasets
X ( ℓ ) , X ( r ) , test items x ( ℓ ) , x ( r ) , the preferential value function at test items x ( ℓ ) , x ( r ) for coalition S and preference function ˆ g can be estimated as
[Equation]
where Γ( X ( ℓ ) S , x ( ℓ ) S ) = K X ( ℓ ) S , x ( ℓ ) S ⊙ K X ( ℓ ) Sc , X Sc K − 1 X S ,λ K X S , x ( ℓ ) S , K X S ,λ = K X S , X S + nλI , α = { α j } mj =1 and λ > 0 is a regularisation parameter.
Proof.
Given ˆ g , the preferential value function evaluated at ˆ g can be written as, ˆ
[Equation]
Now we focus on the first component
[Equation]
and rewrite:
[Equation]
and we continue to expand the terms,
[Equation]
We then note that
[Equation]
To go from the second equation to the third equation in this paragraph
[Equation]
realise k ( · , x ( ℓ ) )
=
k S ( · , x ( ℓ ) S ) ⊗ k S c ( · , x ( ℓ ) S c ) by product kernel assumption.
In this case
[Equation]
we can rewrite A (1) j as,
[Equation]
Analogously
[Equation]
define (cid:80) A (2)
j as the second component after the subtraction sign
[Equation]
by symmetry, we know
[Equation]
35) by subtracting A (1) j and A (1) j , we get the following:
[Equation]
writing it in compact form, we arrive to our result,
[Equation]
Proposition 3.3 (Preferential value function for contexts) .
Given a preference function g U ∈ H k UE , denote Ω ′
= { 1 , ..., d ′ } , then the utility of context features S ′ ⊆
Ω ′ on { u , x ( ℓ ) , x ( r ) } is measured by ν ( p U ) u , x ( ℓ ) , x ( r ) ,S ′ ( g U ) =
E [ g U (cid:0) { u S ′ , U S ′ c } , x ( ℓ ) , x ( r ) (cid:1) | U S ′ =
u S ′ ] where the expectation is taken over the observational distribution of U .
Now, given a test triplet ( u , x ( ℓ ) , x ( r ) ) , if ˆ g U = (cid:80) mj
=
α j k UE (cid:16) ( u j , x ( ℓ ) j , x ( r ) j ) , · (cid:17) , the non-parametric estimator is:
[Equation]
x ( ℓ ) , x ( r ) (cid:17) where Ξ x ( ℓ ) , x ( r ) = (cid:0) K X ( ℓ ) , x ( ℓ ) ⊙ K X ( r ) , x ( r ) − K X ( r ) , x ( ℓ ) ⊙ K X ( ℓ ) , x ( r ) (cid:1) .
Proof.
Recall the feature map of the kernel k UE takes the following form,
[Equation]
Therefore we can express the preferential value function for context as,
[Equation]
The remaining steps are analogous to [12, Prop.2].
To obtain the empirical estimation, we first replace the conditional mean embedding µ U S ′ c | U S ′ =
u S ′ with its empirical estimate and replace g U with ˆ g U =
[Equation]
=
[Equation]
α
[Equation]
UE
[Equation]
( u j , x
[Equation]
ℓ ) j , x
[Equation]
r ) j ) , ·
[Equation]
Now the empirical estimator has the following form,
[Equation]
Now write everything in terms of matrices,
[Equation]
46) where Ξ x
[Equation]