Original: Fast TreeSHAP: Accelerating SHAP Value Computation for Trees
Revised: Fast TreeSHAP: Accelerating SHAP Value Computation for Trees

Original: Anonymous Author(s)

Original: AfﬁliationAddress email

Original: Abstract
Revised: Abstract

Original: SHAP (SHapley Additive exPlanation) values are one of the leading tools for interpreting machine learning models, with strong theoretical guarantees (consistency,local accuracy) and a wide availability of implementations and use cases.
Revised: SHAP (SHapley Additive exPlanation) values are one of the leading tools for interpreting machine learning models, with strong theoretical guarantees (consistency, local accuracy) and a wide availability of implementations and use cases.

Original: Eventhough computing SHAP values takes exponential time in general, TreeSHAP takespolynomial time on tree-based models.
Revised: Even though computing SHAP values takes exponential time in general, TreeSHAP takes polynomial time on tree-based models.

Original: While the speedup is signiﬁcant, TreeSHAPcan still dominate the computation time of industry-level machine learning solutions on datasets with millions or more entries, causing delays in post-hoc modeldiagnosis and interpretation service.
Revised: While the speedup is signiﬁcant, TreeSHAP can still dominate the computation time of industry-level machine learning solutions on datasets with millions or more entries, causing delays in post-hoc model diagnosis and interpretation service.

Original: In this paper we present two new algorithms,
Revised: In this paper we present two new algorithms,

Original: Fast TreeSHAP v1 and v2, designed to improve the computational efﬁciency of
Revised: Fast TreeSHAP v1 and v2, designed to improve the computational efﬁciency of

Original: TreeSHAP for large datasets.
Revised: TreeSHAP for large datasets.

Original: We empirically ﬁnd that Fast TreeSHAP v1 is 1.5xfaster than TreeSHAP while keeping the memory cost unchanged.
Revised: We empirically ﬁnd that Fast TreeSHAP v1 is 1.5x faster than TreeSHAP while keeping the memory cost unchanged.

Original: Similarly, Fast
Revised: Similarly, Fast

Original: TreeSHAP v2 is 2.5x faster than TreeSHAP, at the cost of a slightly higher memoryusage, thanks to the pre-computation of expensive TreeSHAP steps.
Revised: TreeSHAP v2 is 2.5x faster than TreeSHAP, at the cost of a slightly higher memory usage, thanks to the pre-computation of expensive TreeSHAP steps.

Original: We also showthat Fast TreeSHAP v2 is well-suited for multi-time model interpretations, resultingin as high as 3x faster explanation of newly incoming samples.
Revised: We also show that Fast TreeSHAP v2 is well-suited for multi-time model interpretations, resulting in as high as 3x faster explanation of newly incoming samples.

Revised: The link to the code repository to replicate the results in this paper is https://drive.google.com/ drive/u/4/folders/1P0V0Vj42K04QcT39wmbMM4Y6joyc67ZQ .

Original:  Introduction
Revised:  Introduction

Original: Predictive machine learning models are almost everywhere in industry and complex models such asrandom forest, gradient boosted trees and deep neural networks are being widely used due to theirhigh prediction accuracy.
Revised: Predictive machine learning models are almost everywhere in industry, and complex models such as random forest, gradient boosted trees, and deep neural networks are being widely used due to their high prediction accuracy.

Original: However, interpreting predictions from these complex models remainsan important challenge and many times the interpretations at individual sample level are of themost interest [27].
Revised: However, interpreting predictions from these complex models remains an important challenge and many times the interpretations at individual sample level are of the most interest [28].

Original: There exist several state-of-the-art sample-level model interpretation approaches,e.g., SHAP [19], LIME [27] and Integrated Gradient [30].
Revised: There exist several state-of-the-art sample-level model interpretation approaches, e.g., SHAP [20], LIME [28] and Integrated Gradient [31].

Original: Among them, SHAP (SHapley AdditiveexPlanation) calculates SHAP values quantifying the contribution of each feature to the modelprediction, by incorporating concepts from game theory and local explanations.
Revised: Among them, SHAP (SHapley Additive exPlanation) calculates SHAP values quantifying the contribution of each feature to the model prediction, by incorporating concepts from game theory and local explanations.

Original: In contrast to otherapproaches, SHAP has been justiﬁed as the only consistent feature attribution approach with severalunique properties which agree with human intuition.
Revised: In contrast to other approaches, SHAP has been justiﬁed as the only consistent feature attribution approach with several unique properties which agree with human intuition.

Original: Due to its solid theoretical guarantees, SHAPbecomes one of the top recommendations of model interpretation approaches in industry [20, 33, 2, 3].
Revised: Due to its solid theoretical guarantees, SHAP becomes one of the top recommendations of model interpretation approaches in industry [21, 34, 2, 3].

Original: There exist several variants of SHAP.
Revised: There exist several variants of SHAP.

Original: The general version is KernelSHAP [19], which is modelagnostic, and generally takes exponential time to compute the exact SHAP values.
Revised: The general version is KernelSHAP [20], which is modelagnostic, and generally takes exponential time to compute the exact SHAP values.

Original: Its variants include
Revised: Its variants include

Original: TreeSHAP [18, 17] and DeepSHAP [19], which are designed speciﬁcally for tree-based models (e.g.,decision tree, random forest, gradient boosted trees) and neural-network models.
Revised: TreeSHAP [19, 18] and DeepSHAP [20], which are designed speciﬁcally for tree-based models (e.g., decision tree, random forest, gradient boosted trees) and neural-network models.

Original: In these variants,the special model structures may lead to potential improvements in computational efﬁciency.
Revised: In these variants, the special model structures may lead to potential improvements in computational efﬁciency.

Original: Forexample, the tree structure enables a polynomial time complexity for TreeSHAP.
Revised: For example, the tree structure enables a polynomial time complexity for TreeSHAP.

Original: In this paper, wechoose TreeSHAP for further exploration, as tree-based models are widespread in industry.
Revised: In this paper, we choose TreeSHAP for further exploration, as tree-based models are widespread in industry.

Original: After looking into many TreeSHAP use cases, we ﬁnd out that despite its algorithmic complexityimprovement, computing SHAP values for large sample size (e.g., tens of millions of samples) or large model size (e.g., maximum tree depth ≥ 10 ) still remains a computational concern in practice.
Revised: After looking into many TreeSHAP use cases, we ﬁnd out that despite its algorithmic complexity improvement, computing SHAP values for large sample size (e.g., tens of millions of samples) or large model size (e.g., maximum tree depth ≥ 10 ) still remains a computational concern in practice.

Original: For example, explaining 20 million samples for a random forest model with 400 trees and maximumtree depth 12 can take as long as 15 hours even on a 100-core server (more details in Appendix A.9).
Revised: For example, explaining 20 million samples for a random forest model with 400 trees and maximum tree depth 12 can take as long as 15 hours even on a 100-core server (more details in Appendix A.11).

Original: In fact, explaining (at least) tens of millions of samples widely exist in industry-level predictivemodels, e.g., feed ranking model, ads targeting model, and subscription propensity model.
Revised: In fact, explaining (at least) tens of millions of samples widely exist in member-level predictive models in industry, e.g., feed ranking model, ads targeting model, and subscription propensity model.

Original: Spendingtens of hours in model interpretation becomes a signiﬁcant bottleneck in these modeling pipelines,causing huge delays in post-hoc model diagnosis via important feature analysis, as well as longwaiting time in preparing feature reasoning for model end users.
Revised: Spending tens of hours in model interpretation becomes a signiﬁcant bottleneck in these modeling pipelines: On one hand, it is likely to cause huge delays in post-hoc model diagnosis via important feature analysis, increasing the risks of incorrect model implementations and untimely model iterations.

Revised: On the other hand, it can also lead to long waiting time in preparing actionable items for model end users (e.g., marketing team in subscription propensity model) based on feature reasoning [33], and as a result, the end users may not take appropriate actions in a timely manner, which can negatively impact the company’s revenue.

Original: In this paper, we conduct a thorough inspection into the TreeSHAP algorithm, with the focus onimproving its computational efﬁciency for large size of samples to be explained.
Revised: In this paper, we conduct a thorough inspection into the TreeSHAP algorithm, with the focus on improving its computational efﬁciency for large size of samples to be explained.

Original: In this, we takethe number of samples into consideration in our time complexity analysis of TreeSHAP algorithm.
Revised: In this, we take the number of samples into consideration in our time complexity analysis of TreeSHAP algorithm.

Original: We propose two new algorithms - Fast TreeSHAP v1 and Fast TreeSHAP v2.
Revised: We propose two new algorithms - Fast TreeSHAP v1 and Fast TreeSHAP v2.

Original: Fast TreeSHAP v1 isbuilt based on TreeSHAP by redesigning the ways of calculating certain computationally-expensivecomponents.
Revised: Fast TreeSHAP v1 is built based on TreeSHAP by redesigning the ways of calculating certain computationally-expensive components.

Original: In practice, Fast TreeSHAP v1 is able to consistently boost the computational speedby ∼ 1.5x with the same memory cost as in TreeSHAP.
Revised: In practice, Fast TreeSHAP v1 is able to consistently boost the computational speed by ∼ 1.5x with the same memory cost as in TreeSHAP.

Original: Fast TreeSHAP v2 is built based on Fast
Revised: Fast TreeSHAP v2 is built based on Fast

Original: TreeSHAP v1 by further pre-computing certain computationally-expensive components which areindependent with the samples to be explained.
Revised: TreeSHAP v1 by further pre-computing certain computationally-expensive components which are independent with the samples to be explained.

Original: It is able to largely reduce the time complexity whencalculating SHAP values, leading to 2-3x faster computational speed than TreeSHAP in practicewith just a small sacriﬁce on memory.
Revised: It is able to largely reduce the time complexity when calculating SHAP values, leading to 2-3x faster computational speed than TreeSHAP in practice with just a small sacriﬁce on memory.

Original: The pre-computation step in Fast TreeSHAP v2 enables itssuitability in multi-time model interpretations, where the model is pre-trained and remains unchanged,and new scoring data are coming on a regular basis.
Revised: The pre-computation step in Fast TreeSHAP v2 enables its suitability in multi-time model interpretations, where the model is pre-trained and remains unchanged, and new scoring data are coming on a regular basis.

Original:  Related Works
Revised:  Related Work

Original: Since the introductions of SHAP [19] and TreeSHAP [18, 17], many related works have been donein this area.
Revised: Since the introductions of SHAP [20] and TreeSHAP [19, 18], many related works have been done in this area.

Original: Most of them focus on the application side in a variety of areas, including medicalscience [20, 33, 2], social science [4], ﬁnance [3] and sports [28].
Revised: Most of them focus on the application side in a variety of areas, including medical science [21, 34, 2], social science [4], ﬁnance [3] and sports [29].

Original: There also exist a lot of excitingpapers focusing on the designs of SHAP/TreeSHAP implementations [31, 26, 11, 32], as well as thetheoretical justiﬁcation of SHAP values [10, 16, 29, 1, 6, 22, 5].
Revised: There also exist a lot of exciting papers focusing on the designs of SHAP/TreeSHAP implementations [32, 27, 12, 33], as well as the theoretical justiﬁcation of SHAP values [11, 17, 30, 1, 7, 23, 5].

Original: Besides these works, only a few of them focus on the computational efﬁciency of SHAP/TreeSHAP:
Revised: Besides these works, only a few of them focus on the computational efﬁciency of SHAP/TreeSHAP:

Original: The authors of [7] developed a Python package fastshap to approximate SHAP values for arbitrarymodels by calling scoring function as few times as possible.
Revised: The authors of [8] developed a Python package fastshap to approximate SHAP values for arbitrary models by calling scoring function as few times as possible.

Original: In [8], a model-agnostic version of SHAPvalue approximation was implemented on Spark.
Revised: In [9], a model-agnostic version of SHAP value approximation was implemented on Spark.

Original: Both works were not speciﬁcally designed for treebased models, and thus the advanced polynomial time complexity may not be leveraged.
Revised: Both works were not speciﬁcally designed for treebased models, and thus the advanced polynomial time complexity may not be leveraged.

Original: The authorsof [21, 15] built R packages shapper and treeshap as R wrappers of SHAP Python library, whichachieved comparable speed.
Revised: The authors of [22, 16] built R packages shapper and treeshap as R wrappers of SHAP Python library, which achieved comparable speed.

Original: However, no algorithmic improvements have been made.
Revised: However, no algorithmic improvements have been made.

Original: In [23, 24],
Revised: In [24, 25],

Original: MASHAP was proposed to compute SHAP values for arbitrary models in an efﬁcient way, where anarbitrary model is ﬁrst approximated by a surrogate XGBoost model, and TreeSHAP is then appliedon this surrogate model to calculate SHAP values.
Revised: MASHAP was proposed to compute SHAP values for arbitrary models in an efﬁcient way, where an arbitrary model is ﬁrst approximated by a surrogate XGBoost model, and TreeSHAP is then applied on this surrogate model to calculate SHAP values.

Original: The most related work of improving computationalefﬁciency in TreeSHAP as far as we know is [25], where the authors presented GPUTreeShap asa GPU implementation of TreeSHAP algorithm.
Revised: The most related work of improving computational efﬁciency in TreeSHAP as far as we know is [26], where the authors presented GPUTreeShap as a GPU implementation of TreeSHAP algorithm.

Original: Our work is different from GPUTreeShap as ourwork focuses on improving the computational complexity of the algorithm itself, while the parallelmechanism of GPU rather than the improvement of algorithm complexity has led to the speedup of
Revised: Our work is different from GPUTreeShap as our work focuses on improving the computational complexity of the algorithm itself, while the parallel mechanism of GPU rather than the improvement of algorithm complexity has led to the speedup of

Original: GPUTreeShap.
Revised: GPUTreeShap.

Original: In our future work, it is possible to further combine Fast TreeSHAP v1 and v2 with
Revised: In our future work, it is possible to further combine Fast TreeSHAP v1 and v2 with

Original: GPUTreeShap.
Revised: GPUTreeShap.

Original:  Background
Revised:  Background

Original: In this section, we review the deﬁnition of SHAP values [19], and then walk through the derivation of
Revised: In this section, we review the deﬁnition of SHAP values [20], and then walk through the derivation of

Original: TreeSHAP algorithm [18, 17] which directly leads to the development of Fast TreeSHAP v1 and v2.
Revised: TreeSHAP algorithm [19, 18] which directly leads to the development of Fast TreeSHAP v1 and v2.

Original: 3.1 SHAP Values
Revised: 3.1 SHAP Values

Original: Let f be the predictive model to be explained, and N be the set of all input features.
Revised: Let f be the predictive model to be explained, and N be the set of all input features.

Original: f maps an inputfeature vector x ∈ R | N | to an output f ( x ) where f ( x ) ∈ R in regression and f ( x ) ∈ [0 , 1] in (binary)classiﬁcation.
Revised: f maps an input feature vector x ∈ R | N | to an output f ( x ) where f ( x ) ∈ R in regression and f ( x ) ∈ [0 , 1] in (binary) classiﬁcation.

Original: SHAP values are deﬁned as the coefﬁcients of the additive surrogate explanationmodel: g ( z (cid:48) )
Revised: SHAP values are deﬁned as the coefﬁcients of the additive surrogate explanation model: g ( z (cid:48) )

Original: =
Revised: =

Original: φ 

Revised: φ

Original: + (cid:80) i ∈ N φ i z (cid:48)
Revised: + (cid:80) i ∈ N φ i z (cid:48)

Original: i .
Revised: i .

Original: Here z (cid:48) ∈ { 0 , 1 } | N | represent a feature being observed ( z (cid:48) i = 1 ) or unknown ( z (cid:48)
Revised: Here z (cid:48) ∈ { 0 , 1 } | N | represent a feature being observed ( z (cid:48) i = 1 ) or unknown ( z (cid:48)

Original: i = 0 ), and φ i ∈ R are the feature attribution values.
Revised: i = 0 ), and φ i ∈ R are the feature attribution values.

Original: Note that the surrogate explanationmodel g ( z (cid:48) ) is a local approximation to the model prediction f ( x ) given an input feature vector x .
Revised: Note that the surrogate explanation model g ( z (cid:48) ) is a local approximation to the model prediction f ( x ) given an input feature vector x .

Original: As described in [19], SHAP values are the single unique solution of φ i ’s in the class of additive surrogate explanation models
Revised: As described in [20], SHAP values are the single unique solution of φ i ’s in the class of additive surrogate explanation models

Original: g
Revised: g

Original: ( z (cid:48) )
Revised: ( z (cid:48) )

Original: that satisﬁes three desirable properties: local accuracy, missingness,and consistency.
Revised: that satisﬁes three desirable properties: local accuracy, missingness, and consistency.

Original: To compute SHAP values we denote f S ( x ) as the model output restricted to thefeature subset S ⊂ N , and the SHAP values are then computed based on the classic Shapley values:φ i = (cid:88)
Revised: To compute SHAP values we denote f S ( x ) as the model output restricted to the feature subset S ⊂ N , and the SHAP values are then computed based on the classic Shapley values:

Original: [Equation]
Revised: [Equation]

Original: It is still remaining to deﬁne f S ( x ) .
Revised: It is still remaining to deﬁne f S ( x ) .

Original: In recent literature, there exist two main options for deﬁningf S ( x ) : the conditional expectation f S ( x ) = E [ f ( x ) | x S ] =
Revised: In recent literature, there exist two main options for deﬁning f S ( x ) : the conditional expectation f S ( x ) = E [ f ( x ) | x S ] =

Original: E x ¯ S | x S [ f ( x )] , and the marginal expectation f S ( x ) =
Revised: E x ¯ S | x S [ f ( x )] , and the marginal expectation f S ( x ) =

Original: E x ¯ S [ f ( x )] , where x S is the sub-vector of x restricted to the feature subset S , and¯ S = N \ S .
Revised: E x ¯ S [ f ( x )] , where x S is the sub-vector of x restricted to the feature subset S , and ¯ S = N \ S .

Original: While it is still debating which option is more appropriate [10, 16, 29, 1, 6, 22, 5], bothoptions need exponential time in computation as Equation 1 considers all possible subsets in N .
Revised: While it is still debating which option is more appropriate [11, 17, 30, 1, 7, 23, 5], both options need exponential time in computation as Equation 1 considers all possible subsets in N .

Original: 3.2 SHAP Values for Trees
Revised: 3.2 SHAP Values for Trees

Original: For a tree-based model f , we note that it is sufﬁcient to investigate the ways to calculate SHAP valueson a single tree, since the SHAP values of tree ensembles equal the sums of SHAP values of itsindividual trees according to the additivity property of SHAP values [18, 17].
Revised: For a tree-based model f , we note that it is sufﬁcient to investigate the ways to calculate SHAP values on a single tree, since the SHAP values of tree ensembles equal the sums of SHAP values of its individual trees according to the additivity property of SHAP values [19, 18].

Original: The authors of [18, 17]deﬁne a conditional expectation f S ( x ) =
Revised: The authors of [19, 18] deﬁne a conditional expectation f S ( x ) =

Original: E [ f ( x ) | x S ] for tree-based models.
Revised: E [ f ( x ) | x S ] for tree-based models.

Original: The basic idea is tocalculate f S ( x ) by recursively following the decision path for x if the split feature in the decisionpath is in S , and taking the weighted average of both branches if the split feature is not in S .
Revised: The basic idea is to calculate f S ( x ) by recursively following the decision path for x if the split feature in the decision path is in S , and taking the weighted average of both branches if the split feature is not in S .

Original: We usethe proportions of training data that ﬂow down the left and right branches as the weights.
Revised: We use the proportions of training data that ﬂow down the left and right branches as the weights.

Original: Algorithm 1 proposed in [18, 17] (Appendix A.2) provides the details to calculate f S ( x ) for treebased models.
Revised: Algorithm 1 proposed in [19, 18] (Appendix A.2) provides the details to calculate f S ( x ) for treebased models.

Original: A tree is speciﬁed as a tuple of six vectors { v, a, b, t, r, d } : v contains the values ofeach leaf node.
Revised: A tree is speciﬁed as a tuple of six vectors { v, a, b, t, r, d } : v contains the values of each leaf node.

Original: a and b represent the left and right node indexes for each internal node.
Revised: a and b represent the left and right node indexes for each internal node.

Original: t containsthe thresholds for each internal node, d contains the feature indexes used for splitting in internalnodes, and r represents the cover of each node (i.e., how many training samples fall in that node).
Revised: t contains the thresholds for each internal node, d contains the feature indexes used for splitting in internal nodes, and r represents the cover of each node (i.e., how many training samples fall in that node).

Original: The time complexity of calculating f S ( x ) in Algorithm 1 is O
Revised: The time complexity of calculating f S ( x ) in Algorithm 1 is O

Original: ( L ) , where L is the number of leavesin a tree, since we need to loop over each node in the tree.
Revised: ( L ) , where L is the number of leaves in a tree, since we need to loop over each node in the tree.

Original: This leads to an exponential complexityof O ( MTL 2 | N | ) for computing SHAP values for M samples with a total of T trees.
Revised: This leads to an exponential complexity of O ( MTL 2 | N | ) for computing SHAP values for M samples with a total of T trees.

Original: We next showhow TreeSHAP can help reduce this time complexity from exponential to polynomial.
Revised: We next show how TreeSHAP can help reduce this time complexity from exponential to polynomial.

Original: 3.3 TreeSHAP
Revised: 3.3 TreeSHAP

Original: TreeSHAP proposed in [18, 17] runs in O ( MTLD 2 ) time and O
Revised: TreeSHAP proposed in [19, 18] runs in O ( MTLD 2 ) time and O

Original: ( D 2 + | N | ) memory, where Mis the total number of samples to be explained, | N | is the number of features, T is the number oftrees, D is the maximum depth of any tree, and L is the maximum number of leaves in any tree.
Revised: ( D 2 + | N | ) memory, where M is the total number of samples to be explained, | N | is the number of features, T is the number of trees, D is the maximum depth of any tree, and L is the maximum number of leaves in any tree.

Original: Theintuition of the polynomial time algorithm is to recursively keep track of the proportion of all possiblefeature subsets that ﬂow down into each leaf node of the tree, which is similar to running Algorithm 1simultaneously for all 2 | N | feature subsets.
Revised: The intuition of the polynomial time algorithm is to recursively keep track of the proportion of all possible feature subsets that ﬂow down into each leaf node of the tree, which is similar to running Algorithmsimultaneously for all 2 | N | feature subsets.

Original: We recommend readers to check [18, 17] for the algorithmdetails.
Revised: We recommend readers to check [19, 18] for the algorithm details.

Original: In this paper, we present our understanding of the derivation of the TreeSHAP algorithm,which also leads to our proposed Fast TreeSHAP algorithms with computational advantage.
Revised: In this paper, we present our understanding of the derivation of the TreeSHAP algorithm, which also leads to our proposed Fast TreeSHAP algorithms with computational advantage.

Original: We introduce some additional notations.
Revised: We introduce some additional notations.

Original: Assume in a given tree { v, a, b, t, r, d } , there are K leaveswith values v 1 to v K , corresponding to K paths P 1 to P K , where path P k is the set of internal nodesstarting from the root node and ending at the leaf node v k (leaf node v k is not included in the path).
Revised: Assume in a given tree { v, a, b, t, r, d } , there are K leaves with values v 1 to v K , corresponding to K paths P 1 to P K , where path P k is the set of internal nodes starting from the root node and ending at the leaf node v k (leaf node v k is not included in the path).

Original: Weuse j ∈ P k to denote the j th internal node in path P k hereafter.
Revised: We use j ∈ P k to denote the j th internal node in path P k hereafter.

Original: We also use D k = { d j : j ∈ P k } todenote the feature set used for splitting in internal nodes in path P k .
Revised: We also use D k = { d j : j ∈ P k } to denote the feature set used for splitting in internal nodes in path P k .

Original: Moreover, we denote the featuresubspaces restricted by the thresholds along the path P k as { T kj : j ∈ P k } , where T kj =
Revised: Moreover, we denote the feature subspaces restricted by the thresholds along the path P k as { T kj : j ∈ P k } , where T kj =

Original: ( −∞ , t kj ]if node j connects to its left child in path P k or T kj =
Revised: ( −∞ , t kj ] if node j connects to its left child in path P k or T kj =

Original: ( t kj , ∞ ) if node j connects to its right childin path P k
Revised: ( t kj , ∞ ) if node j connects to its right child in path P k

Original: ( { t kj : j ∈ P k } are the thresholds for internal nodes in path P k ), and we also denote thecovering ratios along the path P k as { R kj : j ∈ P k } , where R kj = r k,j +1 /r kj ( { r kj : j ∈ P k } arethe covers of internal nodes in path P k ).
Revised: ( { t kj : j ∈ P k } are the thresholds for internal nodes in path P k ), and we also denote the covering ratios along the path P k as { R kj : j ∈ P k } , where R kj = r k,j +1 /r kj ( { r kj : j ∈ P k } are the covers of internal nodes in path P k ).

Original: The formula of f S ( x ) in Algorithm 1 can be simpliﬁed as:
Revised: The formula of f S ( x ) in Algorithm 1 can be simpliﬁed as:

Original: [Equation]
Revised: [Equation]

Original: where 1 {·} is an indicator function.
Revised: where 1 {·} is an indicator function.

Original: Let W k,S :
Revised: Let W k,S :

Original: = (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } · (cid:81) j ∈ P k ,d j / ∈ S R kj ,i.e., W k,S is the "proportion" of subset S that ﬂows down into the leaf node v k , thenf S ( [Equation] = (cid:80)
Revised: = (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } · (cid:81) j ∈ P k ,d j / ∈ S R kj , i.e., W k,S is the "proportion" of subset S that ﬂows down into the leaf node v k , then f

Original: [Equation]
Revised: [Equation]

Original: k,
Revised: S

Original: [Equation]
Revised: [Equation]

Original: k . Plugging it into Equation 1 leads to the SHAP value φ i =(cid:80) S ⊂ N
Revised: Plugging it into Equation 1 leads to the SHAP value φ i =

Original: [Equation]
Revised: [Equation]

Original: { i 
Revised: Theorem 1. φ i can be computed by only considering the paths which contain feature i and all the subsets within these paths (i.e., instead of considering all 2 | N | subsets). Speciﬁcally, φ i = (cid:88)

Original: [Equation]
Revised: [Equation]

Original: | S | !
Revised: | D k | !

Original: ( | N |−| S |− [Equation] [Equation] N | !
Revised: (cid:88)

Original: [Equation] v k . Theorem 1. φ i can be computed by only considering the paths which contain feature i and all thesubsets within these paths (i.e., instead of considering all 2 | N | subsets).
Revised: S ⊂ D k \{ i } , | S | = m   (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )

Original: Speciﬁcally,
Revised: R kj   

Original:  [Equation]
Revised:  ·   (cid:89) [Equation] (cid:89) [Equation]

Original: The proof of Theorem 1 can be found in Appendix A.3.
Revised: The proof of Theorem 1 can be found in Appendix A.3.

Original: For convenience, we call m !
Revised: For convenience, we call m !

Original: ( | D k |− m )!
Revised: ( | D k |− m )!

Original: ( | D k | +1)!
Revised: ( | D k | +1)!

Original: the"Shapley weight" for subset size m and path P k .
Revised: the "Shapley weight" for subset size m and path P k .

Original: We point out that the TreeSHAP algorithm isexactly built based on Theorem 1.
Revised: We point out that the TreeSHAP algorithm is exactly built based on Theorem 1.

Original: Speciﬁcally, the EXTEND method in TreeSHAP alogithm keepstrack of the sum of the "proportion"s of all subsets that ﬂow down into a certain leaf node weightedby its Shapley weight for each possible subset size.
Revised: Speciﬁcally, the EXTEND method in TreeSHAP alogithm keeps track of the sum of the "proportion"s of all subsets that ﬂow down into a certain leaf node weighted by its Shapley weight for each possible subset size.

Original: When descending a path, EXTEND is calledrepeatedly to take a new feature in the path and add its contribution to the sum of the "proportion"sof all feature subsets of size 1 , 2 , · · · up to the current depth.
Revised: When descending a path, EXTEND is called repeatedly to take a new feature in the path and add its contribution to the sum of the "proportion"s of all feature subsets of size 1 , 2 , · · · up to the current depth.

Original: At the leaf node, EXTEND reachesthe sequence of valuesm !
Revised: At the leaf node, EXTEND reaches the sequence of values

Original: ( | D k |− m )! ( | D k | +1)! (cid:80) S ⊂ D k , | S | = m ( (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:81) j ∈ P k ,d
Revised: [Equation]

Original: j ∈ D k \ S R kj )for each possible subset size m = 1 , · · · , | D k | .
Revised: ) for each possible subset size m = 1 , · · · , | D k | .

Original: The UNWIND method in TreeSHAP algorithm isused to undo a previous call to EXTEND, i.e., to remove the contribution of a feature previously addedvia EXTEND, and is indeed commutative with EXTEND.
Revised: The UNWIND method in TreeSHAP algorithm is used to undo a previous call to EXTEND, i.e., to remove the contribution of a feature previously added via EXTEND, and is indeed commutative with EXTEND.

Original: UNWIND can be used when duplicatedfeatures are encountered in the path, or at the leaf node when calculating the contribution of eachfeature in the path to SHAP values according to Equation 2.
Revised: UNWIND can be used when duplicated features are encountered in the path, or at the leaf node when calculating the contribution of each feature in the path to SHAP values according to Equation 2.

Original:  Fast TreeSHAP
Revised:  Fast TreeSHAP

Original: We now further simplify Equation 2 for an even faster computational speed.
Revised: We now further simplify Equation 2 for an even faster computational speed.

Original: Consider a subset S k ⊂
Revised: Consider a subset S k ⊂

Original: D k which consists of all the features in D k not satisfying the thresholds along the path P k , i.e., S k ={ d j : j ∈ P k , x d j / ∈ T kj } .
Revised: D k which consists of all the features in D k not satisfying the thresholds along the path P k , i.e., S k = { d j : j ∈ P k , x d j / ∈ T kj } .

Original: Also deﬁne U m,D k ,C :
Revised: Also deﬁne U m,D k ,C :

Original: = m !
Revised: = m !

Original: ( | D k |− m )!
Revised: ( | D k |− m )!

Original: ( | D k | +1)!
Revised: ( | D k | +1)!

Original: (cid:80) S ⊂ C, | S | = m (cid:81) j ∈ P k ,d j ∈ C \ S R kjfor m = 0 , · · · , | C | , where C ⊂ D k is a subset of D k .
Revised: (cid:80) S ⊂ C, | S | = m (cid:81) j ∈ P k ,d j ∈ C \ S R kj for m = 0 , · · · , | C | , where C ⊂ D k is a subset of D k .

Original: We see that when C = D k \ S k , U m,D k ,D k \ S kcan be interpreted as the sum of the "proportion"s of all subsets that ﬂow down into a leaf node v k(each feature in the subsets must satisfy the thresholds along the path P k ) weighted by its Shapleyweight for subset size m .
Revised: We see that when C = D k \ S k , U m,D k ,D k \ S k can be interpreted as the sum of the "proportion"s of all subsets that ﬂow down into a leaf node v k (each feature in the subsets must satisfy the thresholds along the path P k ) weighted by its Shapley weight for subset size m .

Original: Finally, we deﬁne U D k ,C :
Revised: Finally, we deﬁne U D k ,C :

Original: = (cid:80) | C | m =

Revised: = (cid:80) | C | m =

Original: | D k | +1 | D k |− m U m,D k ,C .
Revised: | D k | +1 | D k |− m U m,D k ,C .

Original: Theorem 2 furthersimpliﬁes Equation 2 (proof in Appendix A.4):
Revised: Theorem 2 further simpliﬁes Equation 2 (proof in Appendix A.4):

Original: Theorem 2.
Revised: Theorem 2.

Original: φ i can be computed by only considering the subsets within the paths where each featurein the subsets satisﬁes the thresholds along the path.
Revised: φ i can be computed by only considering the subsets within the paths where each feature in the subsets satisﬁes the thresholds along the path.

Original: Speciﬁcally,
Revised: Speciﬁcally,

Original: [Equation]
Revised: [Equation]

Original: if i [Equation] S 
Revised: if i ∈ S k ,

Original: [Equation]
Revised: [Equation]

Original: 4.1 Fast TreeSHAP v1 Algorithm
Revised: 4.1 Fast TreeSHAP v1 Algorithm

Original: We propose Fast TreeSHAP v1 algorithm based on Theorem 2 which runs in O ( MTLD 2 ) time and
Revised: We propose Fast TreeSHAP v1 algorithm based on Theorem 2 which runs in O ( MTLD 2 ) time and

Original: O ( D 2 + | N | ) memory.
Revised: O ( D 2 + | N | ) memory.

Original: This computational complexity looks the same as in the original TreeSHAP.
Revised: This computational complexity looks the same as in the original TreeSHAP.

Original: However, we will show in section 4.1.1 and 5 that the average running time can be largely reduced.
Revised: However, we will show in section 4.1.1 and 5 that the average running time can be largely reduced.

Original: In Fast TreeSHAP v1 algorithm (Algorithm 2 in Appendix A.5), we follow the similar algorithmsetting as in the original TreeSHAP algorithm, where both EXTEND and UNWIND methods arebeing used.
Revised: In Fast TreeSHAP v1 algorithm (Algorithm 2 in Appendix A.5), we follow the similar algorithm setting as in the original TreeSHAP algorithm, where both EXTEND and UNWIND methods are being used.

Original: The EXTEND method is used to keep track of U m,D k ,D k \ S k for m = 0 , · · · , | D k |−| S k | .
Revised: The EXTEND method is used to keep track of U m,D k ,D k \ S k for m = 0 , · · · , | D k |−| S k | .

Original: Remind that U m,D k ,D k \ S k is the sum of the "proportion"s of all subsets that ﬂow down into a leaf172 node v k (each feature in the subsets must satisfy the thresholds along the path P k ) weighted by its Shapley weight for subset size m .
Revised: Remind that U m,D k ,D k \ S k is the sum of the "proportion"s of all subsets that ﬂow down into a leaf node v k (each feature in the subsets must satisfy the thresholds along the path P k ) weighted by its Shapley weight for subset size m .

Original: Compared with the EXTEND method in the original TreeSHAPalgorithm, the main difference is the constraint applied on these subsets (highlighted in bold), whichlargely reduces the number of subset sizes to be considered.
Revised: Compared with the EXTEND method in the original TreeSHAP algorithm, the main difference is the constraint applied on these subsets (highlighted in bold), which largely reduces the number of subset sizes to be considered.

Original: Speciﬁcally, in Fast TreeSHAP v1, whendescending a path, EXTEND is called only when a new feature in the path satisﬁes the threshold,and then its contribution to the sum of "proportion"s of all feature subsets of size 1 , 2 , · · · up to thenumber of features satisfying the thresholds until the current depth is added.
Revised: Speciﬁcally, in Fast TreeSHAP v1, when descending a path, EXTEND is called only when a new feature in the path satisﬁes the threshold, and then its contribution to the sum of "proportion"s of all feature subsets of size 1 , 2 , · · · up to the number of features satisfying the thresholds until the current depth is added.

Original: When reaching the leafnode, the number of possible subset sizes considered by EXTEND is | D k | − | S k | in Fast TreeSHAPv1 rather than | D k | in the original TreeSHAP.
Revised: When reaching the leaf node, the number of possible subset sizes considered by EXTEND is | D k | − | S k | in Fast TreeSHAP v1 rather than | D k | in the original TreeSHAP.

Original: The UNWIND method is still used to undo a previouscall to EXTEND.
Revised: The UNWIND method is still used to undo a previous call to EXTEND.

Original: Speciﬁcally, it is used when duplicated features are encountered in the path orwhen calculating U m,D k ,D k \ ( { i }∪ S k ) for i
Revised: Speciﬁcally, it is used when duplicated features are encountered in the path or when calculating U m,D k ,D k \ ( { i }∪ S k ) for i

Original: ∈ D
Revised: ∈ D

Original: k \ S k , m = 0 , · · · , | D k | − | S k | − 1 at the leaf node.
Revised: k \ S k , m = 0 , · · · , | D k | − | S k | − 1 at the leaf node.

Original: 183 Besides EXTEND and UNWIND, we also keep track of the product of covering ratios of all featuresnot satisfying the thresholds along the path, i.e., (cid:81) j ∈ P k ,d j ∈ S k R kj in Equation 3, which is trivial.
Revised: Besides EXTEND and UNWIND, we also keep track of the product of covering ratios of all features not satisfying the thresholds along the path, i.e., (cid:81) j ∈ P k ,d j ∈ S k R kj in Equation 3, which is trivial.

Original: 4.1.1 Complexity Analysis
Revised: 4.1.1 Complexity Analysis

Original: In the original TreeSHAP, the complexity of EXTEND and UNWIND is bounded by O ( D ) , sinceboth of them need to loop over the number of possible subset sizes, which equals | D k | in path P k .
Revised: In the original TreeSHAP, the complexity of EXTEND and UNWIND is bounded by O ( D ) , since both of them need to loop over the number of possible subset sizes, which equals | D k | in path P k .

Original: Ateach internal node, EXTEND is called once, while at each leaf node, UNWIND is called D times toupdate SHAP values for each of the D features in the path.
Revised: At each internal node, EXTEND is called once, while at each leaf node, UNWIND is called D times to update SHAP values for each of the D features in the path.

Original: This leads to a complexity of O ( LD 2 )for the entire tree because the work done at the leaves dominates the work at the internal nodes.
Revised: This leads to a complexity of O ( LD 2 ) for the entire tree because the work done at the leaves dominates the work at the internal nodes.

Original: In Fast TreeSHAP v1, both EXTEND and UNWIND need to loop over the number of possible subsetsizes under the constraint on subset (highlighted in bold), which is | D k | − | S k | in path P k .
Revised: In Fast TreeSHAP v1, both EXTEND and UNWIND need to loop over the number of possible subset sizes under the constraint on subset (highlighted in bold), which is | D k | − | S k | in path P k .

Original: Thus,although the complexity of EXTEND and UNWIND is still bounded by O ( D ) , the average runningtime can be reduced to 50% , which equals the average ratio between the number of possible subsetsizes under constraint and the number of all possible subset sizes, i.e., E [( | D k | − | S k | ) /
Revised: Thus, although the complexity of EXTEND and UNWIND is still bounded by O ( D ) , the average running time can be reduced to 50% , which equals the average ratio between the number of possible subset sizes under constraint and the number of all possible subset sizes, i.e., E [( | D k | − | S k | ) /

Original: | D k | ] ≈196 (cid:80)
Revised: | D k | ] ≈ (cid:80)

Original: Di =

Revised: Di =

Original: C iD ( D − i ) / (2 D D )
Revised: C iD ( D − i ) / (2 D D )

Original: ≈ 50% .
Revised: ≈ 50% .

Original: Moreover, according to Equation 3, at the leaf node of Path P k ,
Revised: Moreover, according to Equation 3, at the leaf node of Path P k ,

Original: UNWIND is called | D k | − | S k | times for each of the | D k | − | S k | features satisfying the thresholdsin the path, and only once for all other features in the path.
Revised: UNWIND is called | D k | − | S k | times for each of the | D k | − | S k | features satisfying the thresholds in the path, and only once for all other features in the path.

Original: Therefore, although the number of times
Revised: Therefore, although the number of times

Original: UNWIND being called is still bounded by O ( D ) , the actual number can also be lowered by 50% onaverage.
Revised: UNWIND being called is still bounded by O ( D ) , the actual number can also be lowered by 50% on average.

Original: As a result, although we still have the complexity of O ( LD 2 ) for the entire tree, the averagerunning time can be reduced to 50% × 50% = 25% compared with the original TreeSHAP.
Revised: As a result, although we still have the complexity of O ( LD 2 ) for the entire tree, the average running time can be reduced to 50% × 50% = 25% compared with the original TreeSHAP.

Original: Finally,the complexity is O ( MTLD 2 ) for the entire ensemble of T trees and M samples to be explained,with the running time reduced to 25% on average compared with the original TreeSHAP.
Revised: Finally, the complexity is O ( MTLD 2 ) for the entire ensemble of T trees and M samples to be explained, with the running time reduced to 25% on average compared with the original TreeSHAP.

Original: 4.2 Fast TreeSHAP v2 Algorithm
Revised: 4.2 Fast TreeSHAP v2 Algorithm

Original: We propose Fast TreeSHAP v2 algorithm that runs in O ( TL 2 D D + MTLD ) time and O
Revised: We propose Fast TreeSHAP v2 algorithm that runs in O ( TL 2 D D + MTLD ) time and O

Original: ( L 2 D )memory.
Revised: ( L 2 D ) memory.

Original: For balanced trees it becomes O ( TL 2 D + MTLD ) time and O ( L 2 ) memory.
Revised: For balanced trees it becomes O ( TL 2 D + MTLD ) time and O ( L 2 ) memory.

Original: Comparedwith O ( MTLD 2 ) time and O ( D 2 + | N | ) memory in original TreeSHAP and Fast TreeSHAP v1,
Revised: Compared with O ( MTLD 2 ) time and O ( D 2 + | N | ) memory in original TreeSHAP and Fast TreeSHAP v1,

Original: Fast TreeSHAP v2 outperforms in computational speed when the number of samples M exceeds2 D +1 /D , where D is the maximum depth of any tree (more details in the next paragraph).
Revised: Fast TreeSHAP v2 outperforms in computational speed when the number of samples M exceeds 2 D +1 /D , where D is the maximum depth of any tree (more details in the next paragraph).

Original: Fast
Revised: Fast

Original: TreeSHAP v2 has a stricter restriction on tree size due to memory concerns.
Revised: TreeSHAP v2 has a stricter restriction on tree size due to memory concerns.

Original: In practice, it workswell for trees with maximum depth as large as 16 in an ordinary laptop, which covers most of the usecases of tree-based models.
Revised: In practice, it works well for trees with maximum depth as large as 16 in an ordinary laptop, which covers most of the use cases of tree-based models.

Original: We discuss the memory concerns in detail in Sections 4.3 and 5.
Revised: We discuss the memory concerns in detail in Sections 4.3 and 5.

Original: The design of Fast TreeSHAP v2 algorithm is inspired by Fast TreeSHAP v1 algorithm.
Revised: The design of Fast TreeSHAP v2 algorithm is inspired by Fast TreeSHAP v1 algorithm.

Original: Recall thatthe loops of UNWIND at the leaves dominate the complexity of Fast TreeSHAP v1 algorithm, wherethe length of each loop is O ( D ) , and each call to UNWIND also takes O ( D ) time, resulting in O ( D 2 )time complexity at each leaf node.
Revised: Recall that the loops of UNWIND at the leaves dominate the complexity of Fast TreeSHAP v1 algorithm, where the length of each loop is O ( D ) , and each call to UNWIND also takes O ( D ) time, resulting in O ( D 2 ) time complexity at each leaf node.

Original: While looping over each of the D features in the path is inevitablein updating SHAP values at the leaf node (i.e., the loop of length O ( D ) is necessary), our questionis: Is it possible to get rid of calling UNWIND?
Revised: While looping over each of the D features in the path is inevitable in updating SHAP values at the leaf node (i.e., the loop of length O ( D ) is necessary), our question is: Is it possible to get rid of calling UNWIND?

Original: From Equation 3 we see that, the ultimate goal ofcalling UNWIND is to calculate U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i ∈
Revised: From Equation 3 we see that, the ultimate goal of calling UNWIND is to calculate U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i ∈

Original: D k \ S k .
Revised: D k \ S k .

Original: We also note that220 for different samples to be explained, although S k may vary from sample to sample, all the possiblevalues of U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i∈
Revised: We also note that for different samples to be explained, although S k may vary from sample to sample, all the possible values of U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i

Original: D
Revised: ∈

Original:  k \ S k fall in the set { U D k ,C : C ⊂ D k } withsize 2 D k .
Revised: D k \ S k fall in the set { U D k ,C : C ⊂ D k } with size 2 D k .

Original: Therefore, a natural idea to reduce the computational complexity is, instead of calling
Revised: Therefore, a natural idea to reduce the computational complexity is, instead of calling

Original: UNWIND to calculate U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i ∈
Revised: UNWIND to calculate U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i ∈

Original: D k \ S k every time we explain asample, we can pre-compute all the values in the set { U D k ,C : C ⊂ D k } which only depend onthe tree itself, and then extract the corresponding value when looping over features at leaf nodes tocalculate φ i for each speciﬁc sample to be explained.
Revised: D k \ S k every time we explain a sample, we can pre-compute all the values in the set { U D k ,C : C ⊂ D k } which only depend on the tree itself, and then extract the corresponding value when looping over features at leaf nodes to calculate φ i for each speciﬁc sample to be explained.

Original: In fact, what we just proposed is to trade space complexity for time complexity.
Revised: In fact, what we just proposed is to trade space complexity for time complexity.

Original: This should signiﬁcantly save computational efforts when there existredundant computations of U D k ,C across samples, which generally happens when M > 2 D +1 /D(For
Revised: This should signiﬁcantly save computational efforts when there exist redundant computations of U D k ,C across samples, which generally happens when M > 2 D +1 /D

Original:  each sample, around D/ 2 U D k ,C ’s should be calculated for each path, thus on average MD/ 2calculations should be taken for M samples).
Revised: (For each sample, around D/ 2 U D k ,C ’s should be calculated for each path, thus on average MD/calculations should be taken for M samples).

Original: This commonly occurs in a moderate-sized dataset,e.g., M > 22 when D = 6 , M > 205 when D = 10 , and M > 2341 when D = 14 .
Revised: This commonly occurs in a moderate-sized dataset, e.g., M > 22 when D = 6 , M > 205 when D = 10 , and M > 2341 when D = 14 .

Original: We show theappropriateness of trading space complexity for time complexity in practice in Section 5.
Revised: We show the appropriateness of trading space complexity for time complexity in practice in Section 5.

Original: We split Fast TreeSHAP v2 algorithm into two parts: Fast TreeSHAP Prep and Fast TreeSHAP
Revised: We split Fast TreeSHAP v2 algorithm into two parts: Fast TreeSHAP Prep and Fast TreeSHAP

Original: Score .
Revised: Score .

Original: Fast TreeSHAP Prep (Algorithm 3 in Appendix A.6) calculates the sets { U D k ,C : C ⊂ D k }for all D k ’s in the tree, and Fast TreeSHAP Score (Algorithm 4 in Appendix A.6) calculates φ i ’s forall samples to be explained based on the pre-computed { U D k ,C : C
Revised: Fast TreeSHAP Prep (Algorithm 3 in Appendix A.6) calculates the sets { U D k ,C : C ⊂ D k } for all D k ’s in the tree, and Fast TreeSHAP Score (Algorithm 4 in Appendix A.6) calculates φ i ’s for all samples to be explained based on the pre-computed { U D k ,C : C

Original: ⊂ D k } .
Revised: ⊂ D k } .

Original: The main output of Fast
Revised: The main output of Fast

Original: TreeSHAP Prep is S , an L × 2 D matrix where each row records the values in { U D k ,C : C ⊂ D k } forone path P k .
Revised: TreeSHAP Prep is S , an L × 2 D matrix where each row records the values in { U D k ,C : C ⊂ D k } for one path P k .

Original: To calculate S , similar to the original TreeSHAP and Fast TreeSHAP v1, both EXTENDand UNWIND methods are used.
Revised: To calculate S , similar to the original TreeSHAP and Fast TreeSHAP v1, both EXTEND and UNWIND methods are used.

Original: The EXTEND method keeps track of { U m,D k ,C : m = 0 , · · · , | C |}for all possible subsets C ⊂ D k simultaneously, and the UNWIND method undoes a previous call to
Revised: The EXTEND method keeps track of { U m,D k ,C : m = 0 , · · · , | C |} for all possible subsets C ⊂ D k simultaneously, and the UNWIND method undoes a previous call to

Original: EXTEND when duplicated features are encountered in the path.
Revised: EXTEND when duplicated features are encountered in the path.

Original: At the leaf node, U D k ,C is obtainedby summing up { U m,D k ,C } across m for all possible subsets C ⊂ D k simultaneously.
Revised: At the leaf node, U D k ,C is obtained by summing up { U m,D k ,C } across m for all possible subsets C ⊂ D k simultaneously.

Original: In Fast
Revised: In Fast

Original: TreeSHAP Score, given a feature vector x , we need to ﬁnd out its corresponding S k , i.e., the featuresubset within path P k where each feature satisﬁes the thresholds along the path, and then extract thecorresponding value of U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for 
Revised: TreeSHAP Score, given a feature vector x , we need to ﬁnd out its corresponding S k , i.e., the feature subset within path P k where each feature satisﬁes the thresholds along the path, and then extract the corresponding value of U D k ,D k \ S k and U D k ,D k \ ( { i }∪ S k ) for i

Original: i ∈ D
Revised: ∈ D

Original: k \ S k from pre-computed S .
Revised: k \ S k from pre-computed S .

Original: 4.2.1 Complexity Analysis
Revised: 4.2.1 Complexity Analysis

Original: In Fast TreeSHAP Prep, the time complexities of both EXTEND at the internal node and S calculationat the leaf node are bounded by O (2 D D ) , where O (2 D ) comes from the number of possible subsetswithin each path, and O ( D ) comes from the number of possible subset sizes.
Revised: In Fast TreeSHAP Prep, the time complexities of both EXTEND at the internal node and S calculation at the leaf node are bounded by O (2 D D ) , where O (2 D ) comes from the number of possible subsets within each path, and O ( D ) comes from the number of possible subset sizes.

Original: Thus the time complexityis O ( TL 2 D D ) for the entire ensemble of T trees.
Revised: Thus the time complexity is O ( TL 2 D D ) for the entire ensemble of T trees.

Original: Note that this time complexity is independent withthe number of samples to be explained, thus this entire part can be pre-computed, and matrix S canbe stored together with other tree properties to facilitate future SHAP value calculation.
Revised: Note that this time complexity is independent with the number of samples to be explained, thus this entire part can be pre-computed, and matrix S can be stored together with other tree properties to facilitate future SHAP value calculation.

Original: The spacecomplexity is dominated by S , which is O ( L 2 D ) .
Revised: The space complexity is dominated by S , which is O ( L 2 D ) .

Original: Note that this complexity is for one tree.
Revised: Note that this complexity is for one tree.

Original: In practice,there are two ways to achieve this complexity for ensemble of T trees: i).
Revised: In practice, there are two ways to achieve this complexity for ensemble of T trees: i).

Original: Sequentially calculate
Revised: Sequentially calculate

Original: S for each tree, and update SHAP values for all samples immediately after one S is calculated. ii).
Revised: S for each tree, and update SHAP values for all samples immediately after one S is calculated. ii).

Original: Pre-calculate S for all trees and store them in the local disk, and sequentially read each S into memoryand update SHAP values for all samples accordingly.
Revised: Pre-calculate S for all trees and store them in the local disk, and sequentially read each S into memory and update SHAP values for all samples accordingly.

Original: In Fast TreeSHAP Score, it takes O (1) time at each internal node to ﬁgure out S k , and O ( D ) time ateach leaf node to loop over each of the D features in the path to extract its corresponding value from
Revised: In Fast TreeSHAP Score, it takes O (1) time at each internal node to ﬁgure out S k , and O ( D ) time at each leaf node to loop over each of the D features in the path to extract its corresponding value from

Original: S (It takes O (1) time to look up in S ).
Revised: S (It takes O (1) time to look up in S ).

Original: Therefore, the loops at the leaves dominate the complexity of
Revised: Therefore, the loops at the leaves dominate the complexity of

Original: Fast TreeSHAP Score, which is O ( D ) .
Revised: Fast TreeSHAP Score, which is O ( D ) .

Original: Finally, the complexity is O ( MTLD ) for the entire ensembleof T trees and M samples to be explained.
Revised: Finally, the complexity is O ( MTLD ) for the entire ensemble of T trees and M samples to be explained.

Original: Compared with O ( MTLD 2 ) complexity in the original
Revised: Compared with O ( MTLD 2 ) complexity in the original

Original: TreeSHAP and Fast TreeSHAP v1, this is a D -time improvement in computational complexity.
Revised: TreeSHAP and Fast TreeSHAP v1, this is a D -time improvement in computational complexity.

Original: 4.3 Fast TreeSHAP Summary
Revised: 4.3 Fast TreeSHAP Summary

Original: Table 1 summarizes the time and space complexities of each variant of TreeSHAP algorithm ( M isthe number of samples to be explained, | N | is the number of features, T is the number of trees, L isthe maximum number of leaves in any tree, and D is the maximum depth of any tree).
Revised: Table 1 summarizes the time and space complexities of each variant of TreeSHAP algorithm ( M is the number of samples to be explained, | N | is the number of features, T is the number of trees, L is the maximum number of leaves in any tree, and D is the maximum depth of any tree).

Original: [Table]
Revised: [Table]

Original: [Equation]
Revised: |

Original: [Table]
Revised: [Table]

Original: [Equation]
Revised: ( TL

Original: [Table]
Revised: [Table]

Original: [Equation]
Revised: D + MTLD ) O ( L 2 D )

Original: [Table]
Revised: [Table]

Original: [Equation]
Revised: ( TL 2 D + MTLD )

Original: [Table]
Revised: [Table]

Original: [Equation]
Revised: ( L 2 )

Original: [Table]
Revised: [Table]

Original: Fast TreeSHAP v1 strictly outperforms original TreeSHAP in average running time and performscomparably with original TreeSHAP in space allocation.
Revised: Fast TreeSHAP v1 strictly outperforms original TreeSHAP in average running time and performs comparably with original TreeSHAP in space allocation.

Original: Thus we recommend to at least replaceoriginal TreeSHAP with Fast TreeSHAP v1 in any tree-based model interpretation use cases.
Revised: Thus we recommend to at least replace original TreeSHAP with Fast TreeSHAP v1 in any tree-based model interpretation use cases.

Original: We consider two scenarios in model interpretation use cases to compare Fast TreeSHAP v1 and v2:
Revised: We consider two scenarios in model interpretation use cases to compare Fast TreeSHAP v1 and v2:

Original: • One-time usage: We explain all the samples for once, which usually occurs in ad-hocmodel diagnosis.
Revised: • One-time usage: We explain all the samples for once, which usually occurs in ad-hoc model diagnosis.

Original: In this case, as mentioned in Section 4.2, Fast TreeSHAP v2 is preferredwhen M > 2 D +1 /D
Revised: In this case, as mentioned in Section .2, Fast TreeSHAP v2 is preferred when M > 2 D +1 /D

Original: (commonly occurs in a moderate-sized dataset, as most tree-basedmodels produce trees with depth ≤ 16 ).
Revised: (commonly occurs in a moderate-sized dataset, as most tree-based models produce trees with depth ≤ 16 ).

Original: Also, Fast TreeSHAP v2 is under a stricter memoryconstraint: O ( L 2 D ) < memory tolerance .
Revised: Also, Fast TreeSHAP v2 is under a stricter memory constraint: O ( L 2 D ) < memory tolerance .

Original: For reference, for double type L × 2 D matrixS (assume in complete balanced trees, i.e., L = 2 D ), its space allocation is 32KB for D = 6 ,8MB for D = 10 , and 2GB for D = 14 .
Revised: For reference, for double type L × 2 D matrix S (assume in complete balanced trees, i e., L = 2 D ), its space allocation is 32KB for D = 6 , 8MB for D = 10 , and 2GB for D = 14 .

Original: In practice, when D becomes larger, it becomesharder to build a complete balanced tree, i.e., L will be much smaller than 2 D , leading to amuch smaller memory allocation than the theoretical upbound.
Revised: In practice, when D becomes larger, it becomes harder to build a complete balanced tree, i e., L will be much smaller than 2 D , leading to a much smaller memory allocation than the theoretical upbound.

Original: We will see this in Section 5.• Multi-time usage: We have a stable model in the backend, and we receive new data to bescored on a regular basis.
Revised: We will see this in Section 5. • Multi-time usage: We have a stable model in the backend, and we receive new data to be scored on a regular basis.

Original: This happens in most of the use cases of predictive modelingin industry, where the model is trained in a monthly/yearly frequency but the scoring dataare generated in a daily/weekly frequency.
Revised: This happens in most of the use cases of predictive modeling in industry, where the model is trained in a monthly/ yearly frequency but the scoring data are generated in a daily/weekly frequency.

Original: One advantage of Fast TreeSHAP v2 is that itis well-suited for this multi-time usage scenario.
Revised: One advantage of Fast TreeSHAP v2 is that it is well-suited for this multi-time usage scenario.

Original: In Fast TreeSHAP v2, we only need tocalculate S once and store it in the local disk, and read it when new samples are coming,which leads to D -time computational speedup over Fast TreeSHAP v1.
Revised: In Fast TreeSHAP v2, we only need to calculate S once and store it in the local disk, and read it when new samples are coming, which leads to D -time computational speedup over Fast TreeSHAP v1.

Original:  Evaluation
Revised:  Evaluation

Original: We train different sizes of random forest models for evaluation on a list of datasets in Table 4 in Appendix A.7, with the goal of evaluating a wide range of tree ensembles representative of differentreal-world settings.
Revised: We train different sizes of random forest models for evaluation on a list of datasets in Table 2, with the goal of evaluating a wide range of tree ensembles representative of different real-world settings.

Original: While the ﬁrst three datasets Adult [14], Superconductor [9], and Crop [12, 13]in Table 4 are publicly available, we also include one LinkedIn internal dataset “Upsell” to betterillustrate the TreeSHAP implementation in industry.
Revised: While the ﬁrst three datasets Adult [15], Superconductor [10], and Crop [13, 14] in Table 2 are publicly available, we also include one LinkedIn internal dataset “Upsell” to better illustrate the TreeSHAP implementation in industry.

Original: The Upsell dataset is used to predict how likelyeach LinkedIn customer is to purchase more Recruiters products by using features including productusage, recruiter activity, and company attributes.
Revised: The Upsell dataset is used to predict how likely each LinkedIn customer is to purchase more Recruiters products by using features including product usage, recruiter activity, and company attributes.

Original: For each dataset, we ﬁx the number of trees to be100, and we train a small, medium, large, and extra-large model variant by setting the maximumdepth of trees to be 4, 8, 12, and 16 respectively.
Revised: For each dataset, we ﬁx the number of trees to be 100, and we train a small, medium, large, and extra-large model variant by setting the maximum depth of trees to be 4, 8, 12, and 16 respectively.

Original: Other hyperparameters in the random forest are leftas default.
Revised: Other hyperparameters in the random forest are left as default.

Original: Summary statistics for each model variant is listed in Table 5 in Appendix A.7.
Revised: Summary statistics for each model variant is listed in Table 5 in Appendix A.7.

Original:  We compare the execution times of Fast TreeSHAP v1 and v2 against the existing TreeSHAPimplementation in the open source SHAP package ( https://github.com/slundberg/shap ).
Revised: [Table] We compare the execution times of Fast TreeSHAP v1 and v2 against the existing TreeSHAP implementation in the open source SHAP package ( https://github.com/slundberg/shap ).

Original: Forfair comparison, we directly modify the C ﬁle treeshap.h in SHAP package to incorporate both
Revised: For fair comparison, we directly modify the C ﬁle treeshap.h in SHAP package to incorporate both

Revised: [Table]

Original: Fast TreeSHAP v1 and v2.
Revised: Fast TreeSHAP v1 and v2.

Original: All the evaluations were run on a single core in Azure Virtual Machinewith size Standard_D8_v3 (8 cores and 32GB memory).
Revised: All the evaluations were run on a single core in Azure Virtual Machine with size Standard_D8_v3 (8 cores and 32GB memory).

Original: We ran each evaluation on 10,000 samples.
Revised: We ran each evaluation on 10,000 samples.

Original: In Table 2, results are averaged over 5 runs and standard deviations are also presented.
Revised: In Table 3, results are averaged over 5 runs and standard deviations are also presented.

Original: To justify thecorrectness of Fast TreeSHAP v1 and v2, in each run we also compare the calculated SHAP valuesfrom Fast TreeSHAP v1 and v2 with SHAP values from the original TreeSHAP, and the maximalelement-wise difference we observed during the entire evaluation process is ∼ 10 − 13 , which is mostlikely the numerical error.
Revised: To justify the correctness of Fast TreeSHAP v1 and v2, in each run we also compare the calculated SHAP values from Fast TreeSHAP v1 and v2 with SHAP values from the original TreeSHAP, and the maximal element-wise difference we observed during the entire evaluation process is ∼ 10 − 13 , which is most likely the numerical error.

Original: We conduct pairwise comparisons between these three algorithms:
Revised: We conduct pairwise comparisons between these three algorithms:

Original: • Original TreeSHAP vs Fast TreeSHAP v1: For medium, large, and extra-large models, we observe speedups consistently around 1.5x.
Revised: • Original TreeSHAP vs Fast TreeSHAP v1: For medium, large, and extra-large models, we observe speedups consistently around 1.5x.

Original: We observe lower speedup (around 1.2x) for small models probably due to the insufﬁcient computation in computationally-expensive parts.
Revised: We observe lower speedup (around 1.2x) for small models probably due to the insufﬁcient computation in computationally-expensive parts.

Original: These speedups also seem much lower than the theoretical upper bound ( ∼ 4 ) discussed in Section 4.1, which is probably due to the existence of other tasks with slightly 
Revised: These speedups also seem much lower than the theoretical upper bound ( ∼ 4 ) discussed in Section 4.1, which is probably due to the existence of other tasks with slightly lower computational complexity in the algorithm.

Original: lower computational complexity in the algorithm.• Original TreeSHAP vs Fast TreeSHAP v2: For medium and large models, we observespeedups around 2.5-3x, while the speedups drop to around 2x for extra-large models.
Revised: • Original TreeSHAP vs Fast TreeSHAP v2: For medium and large models, we observe speedups around 2.5-3x, while the speedups drop to around 2x for extra-large models.

Original: Thisis because the ﬁrst step Fast TreeSHAP Prep in Fast TreeSHAP v2 takes much longertime for larger models, and the execution time of Fast TreeSHAP v2 listed in Table 2 is acombination of its two steps.
Revised: This is because the ﬁrst step Fast TreeSHAP Prep in Fast TreeSHAP v2 takes much longer time for larger models, and the execution time of Fast TreeSHAP v2 listed in Table 3 is a combination of its two steps.

Original: Later in this section, we will examine the execution times ofFast TreeSHAP Prep and Fast TreeSHAP Score separately.•
Revised: Later in this section, we will examine the execution times of Fast TreeSHAP Prep and Fast TreeSHAP Score separately.

Original:  Fast TreeSHAP v1 vs Fast TreeSHAP v2: The speedups of Fast TreeSHAP v2 are consistently higher than the speedups of Fast TreeSHAP v1 except for small models, showingthe effectiveness of Fast TreeSHAP v2 in improving the computational complexity.
Revised: • Fast TreeSHAP v1 vs Fast TreeSHAP v2: The speedups of Fast TreeSHAP v2 are consistently higher than the speedups of Fast TreeSHAP v1 except for small models, showing the effectiveness of Fast TreeSHAP v2 in improving the computational complexity.

Original: Theircomparable performance for small models is also due to the insufﬁcient computation.
Revised: Their comparable performance for small models is also due to the insufﬁcient computation.

Original: [Table]

Original: [Table]

Original: Super-Med

Original: [Table]

Original: [Table]

Original: [Table]

Original: Super-Large

Original: [Table]

Original: [Table]

Original: -xLarge

Original: [Table]

Original: Crop-Small

Original: [Table]

Original: [Table]

Original: [Table]

Original: [Table]

Original: -Med

Original: [Table]

Original: Crop-Large

Original: [Table]

Original: Crop-xLarge

Original: [Table]

Original: [Table]

Original: Upsell-Small

Original: [Table]

Original: Upsell-Med

Original: [Table]

Original: Upsell-Large

Original: [Table]

Original: [Table]

Original: [Table]

Original: Upsell-xLarge 2265.82 (

Original: [Table]

Original: [Table]

Original: [Table]

Original: [Table] [Table] 996MB Table 3 shows the execution times of Fast TreeSHAP Prep and Fast TreeSHAP Score in Fast
Revised: Table 4 shows the execution times of Fast TreeSHAP Prep and Fast TreeSHAP Score in Fast

Original: TreeSHAP v2.
Revised: TreeSHAP v2.

Original: We see that the execution time of Fast TreeSHAP Prep is almost negligible for smallmodels, but increases dramatically when the model size increases.
Revised: We see that the execution time of Fast TreeSHAP Prep is almost negligible for small models, but increases dramatically when the model size increases.

Original: This coincides with our discussionsin Section 4.3 that for Fast TreeSHAP v2, a larger model needs a larger set of samples to offset thecomputational cost in Fast TreeSHAP Prep.
Revised: This coincides with our discussions in Section 4.3 that for Fast TreeSHAP v2, a larger model needs a larger set of samples to offset the computational cost in Fast TreeSHAP Prep.

Original: The column “Speedup” shows the ratios between theexecution times of Fast TreeSHAP Score and original TreeSHAP.
Revised: The column “Speedup” shows the ratios between the execution times of Fast TreeSHAP Score and original TreeSHAP.

Original: For one-time usage scenarios, thiscolumn approximates the speedup when sample size M is sufﬁciently large (i.e., Fast TreeSHAP
Revised: For one-time usage scenarios, this column approximates the speedup when sample size M is sufﬁciently large (i.e., Fast TreeSHAP

Original: Score dominates the execution time of Fast TreeSHAP v2).
Revised: Score dominates the execution time of Fast TreeSHAP v2).

Original: For multi-time usage scenarios, thiscolumn reﬂects the exact speedup when matrix S is pre-computed, and newly incoming samples arebeing explained.
Revised: For multi-time usage scenarios, this column reﬂects the exact speedup when matrix S is pre-computed, and newly incoming samples are being explained.

Original: We observe that the speedup increases as the model size increases, which exactlyreﬂects the D -time improvement in computational complexity between Fast TreeSHAP Score and
Revised: Finally, the last column shows the space allocation of matrix S which dominates

Original: [Figure]
Revised: [Table]

Revised: 15.1MB

Revised: Crop-xLarge 552.23 (10.37) 75.28 (2.34) 215.21 (2.02) 2.

Revised: 323MB

Original: original TreeSHAP.
Revised: Upsell-Small 2.80 (0.04) <0.01 (<0.01) 2.20 (0.06) 1. 2KB Upsell-Med 90.64 (4.59) 0.33 (0.01) 33.69 (0.92) 2. 452KB

Original: Finally, the last column shows the space allocation of matrix S which dominatesthe memory usage of Fast TreeSHAP v2.
Revised: Upsell-Large 790.83 (5.79) 24.59 (0.36) 258.39 (4.53) 3. 33.7MB Upsell-xLarge 2265.82 (17.44) 442.74 (14.26) 724.24 (7.89) 3. 996MB

Original:  2 We can see that, although Fast TreeSHAP v2 costs morememory than the other two algorithms in theory, in practice, the memory constraint is quite looseas all the space allocations in Table 3 are not causing memory issues even in an ordinary laptop.
Revised: [Figure] the memory usage of Fast TreeSHAP v2. 2 We can see that, although Fast TreeSHAP v2 costs more memory than the other two algorithms in theory, in practice, the memory constraint is quite loose as all the space allocations in Table 4 are not causing memory issues even in an ordinary laptop.

Original: Actually, the maximum depth of trees in most tree-based models in industry do not exceed 16.
Revised: Actually, the maximum depth of trees in most tree-based models in industry do not exceed 16.

Original: Figure 1 plots the execution time versus number of samples for models Adult-Med and Adult-Large.95% conﬁdence interval of the execution time is also indicated by the shaded area.
Revised: Figure 1 plots the execution time versus number of samples for models Adult-Med and Adult-Large. 95% conﬁdence interval of the execution time is also indicated by the shaded area.

Original: Here we considerthe one-time usage scenarios for a better performance showcase of the two steps in Fast TreeSHAPv2.
Revised: Here we consider the one-time usage scenarios for a better performance showcase of the two steps in Fast TreeSHAP v2.

Original: For Adult-Med, Fast TreeSHAP v2 almost starts at the same place as the other two algorithms,since the ﬁrst step Fast TreeSHAP Prep takes only 0.2s.
Revised: For Adult-Med, Fast TreeSHAP v2 almost starts at the same place as the other two algorithms, since the ﬁrst step Fast TreeSHAP Prep takes only 0.2s.

Original: For Adult-Large, Fast TreeSHAP Prep takesmuch longer time due to the larger model size, resulting in higher starting point of the green curve.
Revised: For Adult-Large, Fast TreeSHAP Prep takes much longer time due to the larger model size, resulting in higher starting point of the green curve.

Original: However, the green curve immediately crosses the other two curves when the number of samplesexceeds 500, which coincides with our previous discussions on the sample size requirement of Fast
Revised: However, the green curve immediately crosses the other two curves when the number of samples exceeds 500, which coincides with our previous discussions on the sample size requirement of Fast

Original: TreeSHAP v2.
Revised: TreeSHAP v2.

Original: In both plots, Fast TreeSHAP v2 consistently performs the best while the original
Revised: In both plots, Fast TreeSHAP v2 consistently performs the best while the original

Original: TreeSHAP consistently performs the worst when the number of samples exceeds a certain threshold.
Revised: TreeSHAP consistently performs the worst when the number of samples exceeds a certain threshold.

Revised: We also compare the performance of original TreeSHAP, Fast TreeSHAP v1 and Fast TreeSHAP v on varying number of trees in Section A.8.

Revised: We ﬁnd that the execution time is approximately linear in terms of the number of trees for all the three approaches, which justiﬁes the linear term of number of trees in the theoretical complexity formulas in Table 1.

Revised: We also ﬁnd that the relative performance of the three approaches is consistent with the number of trees.

Revised: In addition to this comparison, we also compare the performance of the three approaches on other types of tree-based models, e.g., XGBoost [6] model in Section A.9.

Revised: Overall we see that Fast TreeSHAP v1 and v2 can still achieve ∼ 1.5x and ∼ 2.5-3x speedups over the original TreeSHAP on XGBoost model.

Original: The above evaluations are all based on 100 trees, 10,000 samples, and 1 core for fast and faircomparisons.
Revised: The above evaluations are all based on 100 trees, 10,000 samples, and 1 core for fast and fair comparisons.

Original: In real life scenarios, the number of trees can be as large as several thousands, hundredsof millions of samples can be encountered in model scoring, and multi-core machines can be usedto conduct parallel computing.
Revised: In real life scenarios, the number of trees can be as large as several thousands, hundreds of millions of samples can be encountered in model scoring, and multi-core machines can be used to conduct parallel computing.

Original: As parallel computing is one of our future works, we just brieﬂydiscuss the potential ways to parallelize Fast TreeSHAP v1 and v2 in Appendix A.8.
Revised: As parallel computing is one of our future works, we just brieﬂy discuss the potential ways to parallelize Fast TreeSHAP v1 and v2 in Appendix A.10.

Original: Based on theproposed ways of parallel computing, we can reasonably expect that both Fast TreeSHAP v1 and v2are able to signiﬁcantly improve the computational efﬁciency in real life scenarios (e.g., reducing theexecution time of explaining 20 million samples in a 100-core server from 15h to 5h, and reducingthe execution time of explaining 320 thousand samples in a 4-core laptop from 3.5h to 1.4h).
Revised: Based on the proposed ways of parallel computing, we can reasonably expect that both Fast TreeSHAP v1 and v are able to signiﬁcantly improve the computational efﬁciency in real life scenarios (e.g., reducing the execution time of explaining 20 million samples in a 100-core server from 15h to 5h, and reducing the execution time of explaining 320 thousand samples in a 4-core laptop from 3.5h to 1.4h).

Original: Moredetails of the analysis of real life scenarios can be found in Appendix A.9.
Revised: More details of the analysis of real life scenarios can be found in Appendix A.11.

Original:  Conclusion
Revised:  Conclusion

Original: TreeSHAP has been widely used for explaining tree-based models due to its desirable theoreticalproperties and polynomial computational complexity.
Revised: TreeSHAP has been widely used for explaining tree-based models due to its desirable theoretical properties and polynomial computational complexity.

Original: In this paper, we presented Fast TreeSHAPv1 and Fast TreeSHAP v2, two new algorithms to further improve the computational efﬁciency of
Revised: In this paper, we presented Fast TreeSHAP v1 and Fast TreeSHAP v2, two new algorithms to further improve the computational efﬁciency of

Original: TreeSHAP, with the emphasis on explaining samples with a large size.
Revised: TreeSHAP, with the emphasis on explaining samples with a large size.

Original: Speciﬁcally, Fast TreeSHAPv1 shrinks the computational scope for the features along each path of the tree, which is ableto consistently improve the computational speed while maintaining the low memory cost.
Revised: Speciﬁcally, Fast TreeSHAP v1 shrinks the computational scope for the features along each path of the tree, which is able to consistently improve the computational speed while maintaining the low memory cost.

Original: Fast
Revised: Fast

Original: TreeSHAP v2 further splits part of computationally-expensive components into pre-computation step,which signiﬁcantly reduces the time complexity from O ( MTLD 2 ) to O ( TL 2 D D + MTLD ) witha small sacriﬁce on memory cost, and is well-suited for multi-time model explanation scenarios.
Revised: TreeSHAP v2 further splits part of computationally-expensive components into pre-computation step, which signiﬁcantly reduces the time complexity from O ( MTLD 2 ) to O ( TL 2 D D + MTLD ) with a small sacriﬁce on memory cost, and is well-suited for multi-time model explanation scenarios.

Revised: We note that in practice, the computational advantage of Fast TreeSHAP v2 is achieved for sufﬁciently large value of M (number of samples), and in the meantime D (maximum depth of tree) should be upper-bounded according to the memory constraint.

Original: As one of our future works, we are currently working on implementing the parallel computation in
Revised: As one of our future works, we are currently working on implementing the parallel computation in

Original: Fast TreeSHAP v1 and v2.
Revised: Fast TreeSHAP v1 and v2.

Original: Another future direction of Fast TreeSHAP is to implement it in Sparkwhich naturally ﬁts the environment of Hadoop clusters and the datasets stored in HDFS.Checklist
Revised: Another future direction of Fast TreeSHAP is to implement it in Spark which naturally ﬁts the environment of Hadoop clusters and the datasets stored in HDFS.

Original: For all authors...

Original: (a) Do the main claims made in the abstract and introduction accurately reﬂect the paper’s

Original: contributions and scope? [Yes] (b) Did you describe the limitations of your work? [N/A]
Revised: Acknowledgments and Disclosure of Funding

Original: (c) Did you discuss any potential negative societal impacts of your work?

Original: [N/A](d)

Original: Have you read the ethics review guidelines and ensured that your paper conforms tothem?

Original: [Yes]

Original: If you are including theoretical results...

Original: (a) Did you state the full set of assumptions of all theoretical results?

Original: [Yes]

Original: (b) Did you include complete proofs of all theoretical results?

Original: [Yes]

Original: If you ran experiments...

Original: (a) Did you include the code, data, and instructions needed to reproduce the main experi-

Original: mental results (either in the supplemental material or as a URL)?

Original: [Yes] (b) Did you specify all the training details (e.g., data splits, hyperparameters, how theywere chosen)? [Yes] (c) Did you report error bars (e
Revised: We would like to express our sincere thanks to Humberto Gonzalez, Diana Negoescu, and Wenrong

Original: g., with respect to the random seed after running experiments multiple times)?

Original: [Yes](d) Did you include the total amount of compute and the type of resources used (e

Original: g., typeof GPUs, internal cluster, or cloud provider)?

Original: [Yes]

Original: If you are using existing assets (e

Original: g., code, data, models) or curating/releasing new assets...

Original: (a) If your work uses existing assets, did you cite the creators?

Original: [Yes]

Original: (b) Did you mention the license of the assets?

Original: [N/A]

Original: (c) Did you include any new assets either in the supplemental material or as a URL?

Original: [No]

Original: (d) Did you discuss whether and how consent was obtained from people whose data you’re

Original: using/curating?

Original: [N/A]

Original: (e) Did you discuss whether the data you are using/curating contains personally identiﬁable

Original: information or offensive content?

Original: [N/A]

Original: If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
Revised: Zeng for their helpful comments and feedback, and Parvez Ahammad for his support throughout this project.

Original: (b) Did you describe any potential participant risks, with links to Institutional Review

Original: Board (IRB) approvals, if applicable?

Original: [N/A]

Original: (c) Did you include the estimated hourly wage paid to participants and the total amount

Original: spent on participant compensation?

Original: [N/A]

Original: Question from eXplainable AI approaches for debugging and diagnosis Workshop @

Original: NeurIPS2021...

Original: (a) Would you like an extended version of the submission to be considered for publi-

Original: cation in a journal special issue?

Original: [Yes]

Original: A Appendix 
Revised: A Appendix A.1 Link to Code Repository

Original: A.1 Link to Code Repository

Original: Here is the link toan anonymized repository containing the code  to replicate the results in Section5: https://drive.google.com/drive/folders/1Xfu7hGnhXGPwpMoFSpBNIoQhaPLeIYyh?usp=sharing .
Revised: Here is the link to the code repository to replicate the results in Section 5: https://drive.google. com/drive/u/4/folders/1P0V0Vj42K04QcT39wmbMM4Y6joyc67ZQ .

Original: A.2 Algorithm Details of Estimating f S ( x )
Revised: A.2 Algorithm Details of Estimating f S ( x )

Original: Algorithm 1 proposed in [18, 17] provides the details to calculate f S ( x ) for tree-based models.
Revised: Algorithm 1 proposed in [19, 18] provides the details to calculate f S ( x ) for tree-based models.

Original: Here atree is speciﬁed as { v, a, b, t, r, d } , where v is a vector of node values, which takes the value internalfor internal nodes.
Revised: Here a tree is speciﬁed as { v, a, b, t, r, d } , where v is a vector of node values, which takes the value internal for internal nodes.

Original: The vectors a and b represent the left and right node indexes for each internalnode.
Revised: The vectors a and b represent the left and right node indexes for each internal node.

Original: The vector t contains the thresholds for each internal node, and d is a vector of indexes of thefeatures used for splitting in internal nodes.
Revised: The vector t contains the thresholds for each internal node, and d is a vector of indexes of the features used for splitting in internal nodes.

Original: The vector r represents the cover of each node (i.e., howmany data samples fall in that node from its parent).
Revised: The vector r represents the cover of each node (i.e., how many data samples fall in that node from its parent).

Original:  procedure EXPVALUE( x , S , tree = { v, a, b, t, r, d } ) return G (1) (cid:46)
Revised: Algorithm procedure EXPVALUE( x , S , tree = { v, a, b, t, r, d } ) return G (1) (cid:46)

Original: Start recursion at the root node end procedure procedure G ( j ) if v j (cid:54) =
Revised: Start recursion at the root node end procedure procedure G ( j ) if v j (cid:54) =

Original: internal then (cid:46) Check if node j is a leaf return v j (cid:46) Return the leaf’s value elseif d j ∈ S then (cid:46) Check if the split feature is in S return G ( a j ) if x d j ≤ t j else G ( b j ) (cid:46)
Revised: internal then (cid:46) Check if node j is a leaf return v j (cid:46) Return the leaf’s value elseif d j ∈ S then (cid:46) Check if the split feature is in S return G ( a j ) if x d j ≤ t j else G ( b j ) (cid:46)

Original: Use value of child on the decision path elsereturn G ( a j ) r a j /r j + G ( b j )
Revised: Use value of child on the decision path elsereturn G ( a j ) r a j /r j + G ( b j )

Original: r b j /r j (cid:46)
Revised: r b j /r j (cid:46)

Original: Weight values of both children by coverage end if end if end procedure
Revised: Weight values of both children by coverage end if end if end procedure

Original: A.3 Proof of Theorem
Revised: A.3 Proof of Theorem

Original: Proof.
Revised: Proof.

Original: Plugging in f S ( x ) = (cid:80)
Revised: Plugging in f S ( x ) = (cid:80)

Original: Kk =1 W k,S v k into Equation 1 leads to the SHAP value 
Revised: Kk =1 W k,S v k into Equation 1 leads to the SHAP value φ i =

Revised: (cid:88)

Revised: S ⊂ N \{

Original: [Equation]
Revised: [Equation]

Original: It is easy to see that W k,S ∪{ i } =
Revised: It is easy to see that W k,S ∪{ i } =

Original: W k,S
Revised: W k,S

Original: if i / ∈ D k (i.e., ∀ j ∈ P k , d j (cid:54) = i ).
Revised: if i / ∈ D k (i.e., ∀ j ∈ P k , d j (cid:54) = i ).

Original: Therefore, the aboveequation can be simpliﬁed as
Revised: Therefore, the above equation can be simpliﬁed as

Original: [Equation]
Revised: [Equation]

Original: Similarly, ∀ l / ∈ D k where l (cid:54) =
Revised: Similarly, ∀ l / ∈ D k where l (cid:54) =

Original: i , ∀ S ⊂ N \
Revised: i , ∀ S ⊂ N \

Original: i, l } , we have W k,S ∪{ i,l } =
Revised: i, l } , we have W k,S ∪{ i,l } =

Original: W k,S ∪{ i } and W k,S ∪{ l } =
Revised: W k,S ∪{ i } and W k,S ∪{ l } =

Original: W k,S , thus W k,S ∪{ i,l } − W k,S ∪{ l } =
Revised: W k,S , thus W k,S ∪{ i,l } − W k,S ∪{ l } =

Original: W k,S ∪{ i } − W k,S .
Revised: W k,S ∪{ i } − W k,S .

Original: Therefore, ∀ l / ∈ D k ,φ i = (cid:88)[Equation] k
Revised: Therefore, ∀ l / ∈ D k , φ i = (cid:88)

Original: [Equation]
Revised: [Equation]

Original: We repeat the above process | N | − | D k | times for each k , each time on a feature l / ∈ D k , and weﬁnally have
Revised: We repeat the above process | N | − | D k | times for each k , each time on a feature l / ∈ D k , and we ﬁnally have

Original: [Equation]
Revised: [Equation]

Original: (cid:88)

Original: S ⊂ D k \{ i } | S | !
Revised: ⊂ D k \{ i } | S | !

Original: ( | D k | − | S | − 1)!
Revised: ( | D k | − | S | − 1)!

Original: | D k | !
Revised: | D k | !

Original: ( W k,S ∪{ i } − W k,S ) 
Revised: ( W k,S ∪{ i } − W k,S ) 

Original:  v k .
Revised:  v k .

Original: Plugging in W k,S =
Revised: Plugging in W k,S =

Original: (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } · (cid:81) j ∈ P k ,d j / ∈ S R kj into the above equation, we haveφ i = (cid:88)
Revised: (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } · (cid:81) j ∈ P k ,d j / ∈ S R kj into the above equation, we have φ i = (cid:88)

Original: k : i ∈
Revised: k : i ∈

Original: D k [ (cid:88)
Revised: D k [ (cid:88)

Original: S ⊂ D k \{ i } | S | !
Revised: S ⊂ D k \{ i } | S | !

Original: ( | D k | − | S | − 1)!
Revised: ( | D k | − | S | − 1)!

Original: | D k | !
Revised: | D k | !

Original: ( (cid:89) j ∈ P k ,d j ∈ S ∪{ i } 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )
Revised: ( (cid:89) j ∈ P k ,d j ∈ S ∪{ i } 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )

Original: R kj − (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ S
Revised: R kj − (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ S

Original: R kj )] v k = (cid:88)
Revised: R kj )] v k = (cid:88)

Original: k : i ∈
Revised: k : i ∈

Original: D k [ (cid:88)
Revised: D k [ (cid:88)

Original: S ⊂ D k \{ i } | S | !
Revised: S ⊂ D k \{ i } | S | !

Original: ( | D k | − | S | − 1)!
Revised: ( | D k | − | S | − 1)!

Original: | D k | !
Revised: | D k | !

Original: ( (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )
Revised: ( (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )

Original: R kj ) ( (cid:89) j ∈ P k ,d j = i 1 { x d j ∈ T kj } − (cid:89) j ∈ P k ,d j = i
Revised: R kj ) ( (cid:89) j ∈ P k ,d j = i 1 { x d j ∈ T kj } − (cid:89) j ∈ P k ,d j = i

Original: R kj )] v k = (cid:88)
Revised: R kj )] v k = (cid:88)

Original: k : i ∈
Revised: k : i ∈

Original: D k  
Revised: D k  

Original: | D k |− 1 (cid:88) m = m !
Revised: | D k |− 1 (cid:88) m = m !

Original: ( | D k | − m − 1)!
Revised: ( | D k | − m − 1)!

Original: | D k | ! (cid:88)
Revised: | D k | ! (cid:88)

Original: S ⊂ D k \{ i } , | S | = m   (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )
Revised: S ⊂ D k \{ i } , | S | = m   (cid:89) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i } )

Original: R kj   
Revised: R kj   

Original:  ·   (cid:89) j ∈ P k ,d j = i 1 { x d j ∈ T kj } − (cid:89) j ∈ P k ,d j = i
Revised:  ·   (cid:89) j ∈ P k ,d j = i 1 { x d j ∈ T kj } − (cid:89) j ∈ P k ,d j = i

Original: R kj 
Revised: R kj 

Original:  v k .
Revised:  v k .

Original: A.4 Proof of Theorem
Revised: A.4 Proof of Theorem

Original: Proof.
Revised: Proof.

Original: Let S ki :=
Revised: Let S ki :=

Original: { d j : j ∈ P k , x d j / ∈ T kj , d j (cid:54) = i } , i.e., S ki is the subset of D k \{ i } where thefeatures in S ki do not satisfy the thresholds along the path P k .
Revised: { d j : j ∈ P k , x d j / ∈ T kj , d j (cid:54) = i } , i.e., S ki is the subset of D k \{ i } where the features in S ki do not satisfy the thresholds along the path P k .

Original: Note that (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈
Revised: Note that (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈

Original: T kj } = 0 if S ∩ S ki (cid:54) = ∅ and (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } = 1 otherwise, Equation 2 can then besimpliﬁed asφ i = (cid:88)
Revised: T kj } = 0 if S ∩ S ki (cid:54) = ∅ and (cid:81) j ∈ P k ,d j ∈ S 1 { x d j ∈ T kj } = 1 otherwise, Equation 2 can then be simpliﬁed as [Equation]

Original: k : i ∈
Revised: m [Equation]

Original: D k  
Revised: m !

Original: | D k |− 1 −| S ki | (cid:88) m
Revised: [Equation]

Original: = m !
Revised: m [Equation]

Original: ( | D k | − m − 1)! | D k | ! 
Revised: | D k | !   [Equation]

Revised: S

Original:   (cid:88)
Revised: [Equation] m (cid:89)

Revised: j

Original: S ⊂ D k \ ({ i }∪ S ki ) , | S | = m (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i }∪ S ki )
Revised: [Equation] [Equation] \ ( S [Equation]

Original: R kj  
Revised: R kj  

Original:   · (cid:89) j ∈ P k ,d j ∈ S ki
Revised: [Equation]  · (cid:89) j ∈ P [Equation]

Original:  R kj ·   (cid:89) j ∈ P k ,d j = i 1 { x d j ∈ T kj } − (cid:89) j ∈ P k ,d j = i
Revised: ,d j ∈ S ki R kj ·   (cid:89) j ∈ P k ,d j = i 1 { x d j ∈ T kj } − (cid:89) j ∈ P k ,d j = i

Original: R kj 
Revised: R kj 

Original:  v k .
Revised:  v k .

Original: I.e., only subsets S ⊂ D k \ ( { i } ∪ S ki ) are necessary to be included in the equation.
Revised: I.e., only subsets S ⊂ D k \ ( { i } ∪ S ki ) are necessary to be included in the equation.

Original: Remind that S k
Revised: Remind that S k

Original: = { d j : j ∈ P k , x d j / ∈ T kj } , i.e., S k is the subset of D k wherethe features in S k do not satisfy the thresholds along the path P k .
Revised: = { d j : j ∈ P k , x d j / ∈ T kj } , i.e., S k is the subset of D k where the features in S k do not satisfy the thresholds along the path P k .

Original: Also remind that
Revised: Also remind that

Original: U m,D k ,C :
Revised: U [Equation]

Original: = m ! ( | D k |− m )! ( | D k | +1)!
Revised: | [Equation]

Original: (cid:80) S ⊂ C, | S | = m (cid:81) j ∈ P k ,d j ∈ C \ S R kj , m = 0 , · · · , | C | , and U[-D k ,C :=(cid:80) | C | m =
 | D k | +1 | D k |− m U m,D k ,C , where C ⊂ D k is a subset of D k . Then it is easy to see that when (cid:81) j ∈ P k ,d j = i 1 { x d j ∈ T kj } = 
 (i.e., i ∈ S k ), we have S ki ∪{ i } =-]
Revised: and U[-D k ,C :=(cid:80) | C | m =
 | D k | +1 | D k |− m U m,D k ,C , where C ⊂ D k is a subset of D k . Then it is easy to see that when (cid:81) j ∈ P k ,d j = i 1 { x d j ∈ T kj } = 
 (i.e., i ∈ S k ), we have S ki ∪{ i } =-]

Original: S k ,and [Equation] 
Revised: [Equation] C :

Original: m

Original: [Equation]
Revised: [Equation]

Original: m [Equation] [Equation] m (cid:89)
Revised: U m,D k ,C , where C ⊂ D k is a subset of D k .

Original: [Equation]

Original: · (cid:89) j [Equation] ki{+∈ P k ,d j = i 1 { x d j ∈ T kj } = 
+}
Revised: Then it is easy to see that when (cid:81) j {+∈ P k ,d j = i 1 { x d j ∈ T kj } = 
+}

Original: [Equation]

Original:  i R [Equation] v k  =
Revised: (i.e., i ∈ S k ), we have S ki ∪{ i } =

Original: [Equation] k : [Equation] k 
Revised: S k , and

Original: [Equation]
Revised: [Equation]

Original: (cid:88) m [Equation] | D k | +| D k | − m U m,D k ,D k \ S k   (cid:89) j ∈ P k ,d j ∈ S k
Revised: k ,D k \ S k   (cid:89) j ∈ P k ,d j ∈ S k

Original: R kj v k = − (cid:88) k : i ∈
Revised: R kj v k = − (cid:88) k : i ∈

Original: D k  
Revised: D k  

Original: U D k ,D k \ S k (cid:89) j ∈ P k ,d j ∈ S k
Revised: U D k ,D k \ S k (cid:89) j ∈ P k ,d j ∈ S k

Original: R kj   v k .
Revised: R kj   v k .

Original: When (cid:81) j ∈ P k ,d j = i 1 { x d j ∈ T kj } = 1 (i.e., i / ∈ S k ), we have S
Revised: When (cid:81) j ∈ P k ,d j = i 1 { x d j ∈ T kj } = 1 (i.e., i / ∈ S k ), we have S

Original: ki = S k , andφ i = (cid:88)
Revised: ki = S k , and φ i = (cid:88)

Original: k : i ∈
Revised: k : i ∈

Original: D k  
Revised: D k  

Original: | D k |− 1 −| S k | (cid:88) m
Revised: | D k |− 1 −| S k | (cid:88) m

Original: = m !
Revised: = m !

Original: ( | D k | − m − 1)!
Revised: ( | D k | − m − 1)!

Original: | D k | !
Revised: | D k | !

Original:   (cid:88)
Revised:   (cid:88)

Original: S ⊂ D k \ ( { i }∪ S k ) , | S | = m (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i }∪ S k )
Revised: S ⊂ D k \ ( { i }∪ S k ) , | S | = m (cid:89) j ∈ P k ,d j ∈ D k \ ( S ∪{ i }∪ S k )

Original: R kj   
Revised: R kj   

Original:  · (cid:89) j ∈ P k ,d j ∈ S k
Revised:  · (cid:89) j ∈ P k ,d j ∈ S k

Original: R kj   1 − (cid:89) j ∈ P k ,d j = i
Revised: R kj   1 − (cid:89) j ∈ P k ,d j = i

Original: R kj 
Revised: R kj 

Original:  v k = (cid:88)
Revised:  v k = (cid:88)

Original: k : i ∈
Revised: k : i ∈

Original: D k  
Revised: D k  

Original: | D k |− 1 −| S k | (cid:88) m =
Revised: | D k |− 1 −| S k | (cid:88) m =

Original: | D k | +| D k | − mU m,D k ,D k \ ( { i }∪ S k ) 
Revised: | D k | +| D k | − mU m,D k ,D k \ ( { i }∪ S k ) 

Original:  (cid:89) j ∈ P k ,d j ∈ S k
Revised:  (cid:89) j ∈ P k ,d j ∈ S k

Original: R kj   1 − (cid:89) j ∈ P k ,d j = i
Revised: R kj   1 − (cid:89) j ∈ P k ,d j = i

Original: R kj 
Revised: R kj 

Original:  v k = (cid:88)
Revised:  v k = (cid:88)

Original: k : i ∈
Revised: k : i ∈

Original: D k  
Revised: D k  

Original: U D k ,D k \ ( { i }∪ S k ) (cid:89)
Revised: U D k ,D k \ ( { i }∪ S k ) (cid:89)

Original: j ∈ P k ,d j ∈ S k
Revised: j ∈ P k ,d j ∈ S k

Original: R kj (1 − (cid:89) j ∈ P k ,d j = i
Revised: R kj (1 − (cid:89) j ∈ P k ,d j = i

Original: R kj ) 
Revised: R kj ) 

Original:  v k .
Revised:  v k .

Original: A.5 Fast TreeSHAP v1 Algorithm Details
Revised: A.5 Fast TreeSHAP v1 Algorithm Details

Original: In Algorithm 2, m is the path of unique features we have split on so far, and contains three attributes(We use the dot notation to access member values) 4 : i) m j +1 .d , the feature index for the j th internalnode (i.e., d j ), ii) m j +1 .z , the covering ratio for the j th internal node (i.e., R kj ), iii) m
Revised: In Algorithm 2, m is the path of unique features we have split on so far, and contains three attributes (We use the dot notation to access member values) 4 : i) m j +1 .d , the feature index for the j th internal node (i.e., d j ), ii) m j +1 .z , the covering ratio for the j th internal node (i.e., R kj ), iii) m

Original: j +1 .o , thethreshold condition for the j th internal node (i.e., 1 { x d j ∈ T kj } ) ( m 0 .d , m 0 .z , m 0{+
+} .o
Revised: j +1 .o , the threshold condition for the j th internal node (i.e., 1 { x d j ∈ T kj } ) ( m 0 .d , m 0 .z , m {+
+} .o

Original: record theinformation of a dummy node).
Revised: record the information of a dummy node).

Original: Moreover, at the j th internal node, w is used to record U m,D kj ,D kj \ S kj( m = 0 , · · · , j − | S kj | ) where D kj and S kj are subsets of D k and S k up to the j th internal node,and q is used to record (cid:81) l ∈ P kj ,d l ∈ S kj R kl where P kj is the subpath of P k up to the j th internal node.
Revised: Moreover, at the j th internal node, w is used to record U m,D kj ,D kj \ S kj ( m = 0 , · · · , j − | S kj | ) where D kj and S kj are subsets of D k and S k up to the j th internal node, and q is used to record (cid:81) l ∈ P kj ,d l ∈ S kj R kl where P kj is the subpath of P k up to the j th internal node.

Original: When reaching the leaf node, m will reach length | D k | +1 , w will reach length
Revised: When reaching the leaf node, m will reach length | D k | +1 , w will reach length

Original: | D k |−| S k | +1 and qis always a scalar.
Revised: | D k |−| S k | +1 and q is always a scalar.

Original: The values p z , p o , and p i represent the covering ratio, the threshold condition, andthe feature index of the last split.
Revised: The values p z , p o , and p i represent the covering ratio, the threshold condition, and the feature index of the last split.

Original: One thing to note is that the functionality of EXTEND in Algorithm2 is slightly different from what we described in Section 4.1, where in addition to its functionalitydescribed in Section 4.1 when we encounter a feature not in S k , EXTEND is also called when weencounter a feature in S k to simply update the Shapley weights.
Revised: One thing to note is that the functionality of EXTEND in Algorithm 2 is slightly different from what we described in Section 4.1, where in addition to its functionality described in Section 4.1 when we encounter a feature not in S k , EXTEND is also called when we encounter a feature in S k to simply update the Shapley weights.

Original:  procedure T REE SHAP( x , tree = { v, a, b, t, r, d } )φ = array of len ( x ) zeros
Revised: Algorithm procedure T REE SHAP( x , tree = { v, a, b, t, r, d } ) φ = array of len ( x ) zeros

Original: RECURSE (0 , [] , [] , 1 , 1 , 1 , − 1) (cid:46) Start recursion at the root nodereturn φend procedureprocedure RECURSE( j, m, w, q, p z , p o , p i )m, w, q = EXTEND ( m, w, q, p z , p o , p i )
Revised: RECURSE (0 , [] , [] , 1 , 1 , 1 , − 1) (cid:46) Start recursion at the root node return φ end procedure procedure RECURSE( j, m, w, q, p z , p o , p i ) m, w, q = EXTEND ( m, w, q, p z , p o , p i )

Original: (cid:46) Update m, w, q for the feature of the last splitif v j (cid:54) =
Revised: (cid:46) Update m, w, q for the feature of the last split if v j (cid:54) =

Original: internal then (cid:46) Check if we are at a leaf nodeif len ( m ) > len ( w ) thens 0{+then s 
+} = − sum ( UNWIND ( m, w, q, − 1)[1]) (cid:46)
Revised: internal then (cid:46) Check if we are at a leaf node if len ( m ) > len ( w ) {+then s 
+} = − sum ( UNWIND ( m, w, q, − 1)[1]) (cid:46)

Original: Pre-calculate U D k ,D k \ S k for d i ’s in S kend iffor i ← 1 to len ( m ) − 1 doif m i .o
Revised: Pre-calculate U D k ,D k \ S k for d i ’s in S k end if for i ← 1 to len ( m ) − 1 do if m i .o

Original: = 

Revised: =

Original: thenφ m i .d
Revised: then φ m i .d

Original: =
Revised: =

Original: φ m i .d
Revised: φ m i .d

Original: + s 0 · q · v j (cid:46) Update contribution for feature d i ∈ S kelses = sum ( UNWIND ( m, w, q, i )[1]) (cid:46)
Revised: + s 0 · q · v j (cid:46) Update contribution for feature d i ∈ S k else s = sum ( UNWIND ( m, w, q, i )[1]) (cid:46)

Original: Calculate U D k ,D k \ ( { d i }∪ S k ) for d i / ∈ S
Revised: Calculate U D k ,D k \ ( { d i }∪ S k ) for d i / ∈ S

Original: kφ m i .d
Revised: k φ m i .d

Original: =
Revised: =

Original: φ m i .d
Revised: φ m i .d

Original: + s · q · (1 − m i .z )
Revised: + s · q · (1 − m i .z )

Original: · v j (cid:46) Update contribution for feature d i / ∈ S kend ifend forelseh, c = ( a j , b j ) if x d j ≤ t j else ( b j , a j ) (cid:46) Determine hot and cold childreni z
Revised: · v j (cid:46) Update contribution for feature d i / ∈ S k end if end for else h, c = ( a j , b j ) if x d j ≤ t j else ( b j , a j ) (cid:46) Determine hot and cold children i z

Original: = i o = 1k =
Revised: = i o = k =

Original: FINDFIRST ( m.d, d j )if k (cid:54) =
Revised: FINDFIRST ( m.d, d j ) if k (cid:54) =

Original: nothing then (cid:46)
Revised: nothing then (cid:46)

Original: Undo previous update for feature d k if we see this feature againi z , i o = m k .z, m k .om, w, q = UNWIND ( m, w, q, k )end if
Revised: Undo previous update for feature d k if we see this feature again i z , i o = m k .z, m k .o m, w, q = UNWIND ( m, w, q, k ) end if

Original: RECURSE ( h, m, w, q, i z
Revised: RECURSE ( h, m, w, q, i z

Original: r h /r j , i o , d j )
Revised: r h /r j , i o , d j )

Original: RECURSE ( c, m, w, q, i z
Revised: RECURSE ( c, m, w, q, i z

Original: r c /r j , 0 , d j )end ifend procedureprocedure EXTEND( m, w, q, p z , p o , p i )
Revised: r c /r j , 0 , d j ) end if end procedure procedure EXTEND( m, w, q, p z , p o , p i )

Original: (cid:46) Update m, w, q for the feature of the last splitl, l w = len ( m ) , len ( w )m, w = copy ( m ) , copy ( w )m l .
Revised: (cid:46) Update m, w, q for the feature of the last split l, l w = len ( m ) , len ( w ) m, w = copy ( m ) , copy ( w ) m l .

Original: ( d, z, o ) =
Revised: ( d, z, o ) =

Original: ( p i , p z , p o )
Revised: ( p i , p z , p o )

Original: (cid:46) Extend m given the feature of the last splitif p o = 0 thenq = q · p zfor i ← l w − 1 to 0 dow i =
Revised: (cid:46) Extend m given the feature of the last split if p o = 0 then q = q · p z for i ← l w − 1 to 0 do w i =

Original: w i · ( l − i ) /
Revised: w i · ( l − i ) /

Original: ( l + 1)end forelsew l w = 1 if l w = 0 else(cid:46) Extend w if the feature of the last split is not in S kfor i ← l w − 1 to [-
-]{+0 do w i +
+}
Revised: ( l + 1) end for else w l w = 1 if l w = 0 else(cid:46) Extend w if the feature of the last split is not in S k for i ← l w − 1 to [-
-]{+0 do w i +
+}

Original: dow i +1 =
Revised: =

Original: w i +1 + w i · ( i + 1) /
Revised: w i +1 + w i · ( i + 1) /

Original: ( l + 1)w i =
Revised: ( l + 1) w i =

Original: p z · w i · ( l − i ) /
Revised: p z · w i · ( l − i ) /

Original: ( l + 1)end forend ifreturn m, w, qend procedureprocedure UNWIND( m, w, q, i ) (cid:46)
Revised: ( l + 1) end for end if return m, w, q end procedure procedure UNWIND( m, w, q, i ) (cid:46)

Original: Undo previous update for feature d il, l w = len ( m ) − 1 , len ( w ) − 1m = copy ( m 0 ··· l − 1 )if i < 0 thenw = copy ( w )for j ← l w to [-
 dow-] j = w j · ( l + 1) /( l − j ) end forelseif
Revised: Undo previous update for feature d i l, l w = len ( m ) − 1 , len ( w ) −m = copy ( m 0 ··· l − 1 ) if i < 0 then w = copy ( w ) for j ← l w to [-
 dow-]0 do w j = w j · ( l + 1) /

Original:  m i .o
Revised: ( l − j ) end for elseif m i .o

Original: = 

Revised: =

Original: thenw = copy ( w )for j ← l w to [-
 dow-] j = w j · ( l + 1) / ( l − j )end forq = 
Revised: then w = copy ( w ) for j ← l w to [-
 dow-]0 do w j = w j · ( l + 1) / ( l − j ) end for q = q/m i .z

Original: q/m i .zelsen
Revised: else

Original:  = w l ww = copy ( w 0 ··· l w − 1 ) (cid:46) Shrink w if feature d i / ∈ S kfor j ← l w − 1 to 0 dot = w jw j = n · ( l + 1) /
Revised: n = w l w w = copy ( w 0 ··· l w − 1 ) (cid:46) Shrink w if feature d i / ∈ S k for j ← l w − 1 to 0 do t = w j w j = n · ( l + 1) /

Original: ( j + 1)n = t − w j · m i .z · ( l − j ) / ( l + 1)end forend iffor j ← i to l − 1 dom j .
Revised: ( j + 1) n = t − w j · m i .z · ( l − j ) / ( l + 1) end for end if for j ← i to l − 1 do m j .

Original: ( d, z, o )
Revised: ( d, z, o )

Original: = m
Revised: = m

Original: j +1 .
Revised: j +1 .

Original: ( d, z, o ) (cid:46) Shrink m given feature d iend forend ifreturn m, w, qend procedure
Revised: ( d, z, o ) (cid:46) Shrink m given feature d i end for end if return m, w, q end procedure

Original: A.6 Fast TreeSHAP v2 Algorithm Details
Revised: A.6 Fast TreeSHAP v2 Algorithm Details

Original: In Algorithm 3 and 4, S is a matrix of size L × 2 D where each row records the values in the set{ U D k ,C : C ⊂ D k } for one path P k , and the subsets C in each row are ordered according to thereverse ordering of binary digits.
Revised: In Algorithm 3 and 4, S is a matrix of size L × 2 D where each row records the values in the set { U D k ,C : C ⊂ D k } for one path P k , and the subsets C in each row are ordered according to the reverse ordering of binary digits.

Original: 5 W is a matrix of size 2 D ×
Revised: 5 W is a matrix of size 2 D ×

Original: ( D + 1) , where each row correspondsto a subset C ⊂ D k ordered according to the reverse ordering of binary digits.
Revised: ( D + 1) , where each row corresponds to a subset C ⊂ D k ordered according to the reverse ordering of binary digits.

Original: At the j th internalnode along path P k , each row of W records { U m,D kj ,C : m = 0 , · · · , | C |} for a subset C ⊂ D kjwhere D kj is the subset of D k up to the j th internal node.
Revised: At the j th internal node along path P k , each row of W records { U m,D kj ,C : m = 0 , · · · , | C |} for a subset C ⊂ D kj where D kj is the subset of D k up to the j th internal node.

Original: It is easy to see that at the leaf node ofpath P k , summing up each row of W exactly matches one row in S corresponding to path P k .
Revised: It is easy to see that at the leaf node of path P k , summing up each row of W exactly matches one row in S corresponding to path P k .

Original: l w isa vector of size 2 D which records the number of nonzero elements in each row of W .
Revised: l w is a vector of size 2 D which records the number of nonzero elements in each row of W .

Original: e is a vectorof the same size as d , which records the node indices of duplicated features along the path.
Revised: e is a vector of the same size as d , which records the node indices of duplicated features along the path.

Original: c is aninteger which records the number of paths explored so far.
Revised: c is an integer which records the number of paths explored so far.

Original: Algorithm  procedure T REE SHAPP REP ( tree = { v, a, b, t, r, d } )
Revised: Algorithm 3 Fast TreeSHAP v2: Prep procedure T REE SHAPP REP ( tree = { v, a, b, t, r, d } )

Original: S = matrix of L × 2 D zerose = array of len ( d ) negative ones
Revised: S = matrix of L × 2 D zeros e = array of len ( d ) negative ones

Original: W = matrix of 2 D × ( D + 1) zerosl w = array of 2 D zerosc =[-
-]
Revised: W = matrix of 2 D × ( D + 1) zeros l w = array of 2 D zeros c =[-
-]

Original: RECURSE (0 , [] , W, l w , 1 , − 1) (cid:46) Start recursion at the root nodereturn S, eend procedureprocedure RECURSE( j, m, W, l w , p z , p i )m, W, l w = EXTEND ( m, W, l w , p z , p i )
Revised: RECURSE (0 , [] , W, l w , 1 , − 1) (cid:46) Start recursion at the root node return S, e end procedure procedure RECURSE( j, m, W, l w , p z , p i ) m, W, l w = EXTEND ( m, W, l w , p z , p i )

Original: (cid:46) Update m, W, l w for the feature of the last splitif v j (cid:54) =
Revised: (cid:46) Update m, W, l w for the feature of the last split if v j (cid:54) =

Original: internal then (cid:46) Check if we are at a leaf nodel = len ( m ) − 1for t ← 0 to 2 l − 1 do (cid:46)
Revised: internal then (cid:46) Check if we are at a leaf node l = len ( m ) −for t ← 0 to 2 l − 1 do (cid:46)

Original: Calculate { U D k ,C : C ⊂ D k } for the current pathfor i ← l w [ t ] to 0 do
Revised: Calculate { U D k ,C : C ⊂ D k } for the current path for i ← l w [ t ] to 0 do

Original: S [ c, t ] = S [ c, t ] + W [ t, i ] · ( l + 1) /
Revised: S [ c, t ] = S [ c, t ] + W [ t, i ] · ( l + 1) /

Original: ( l − i )end forend for c
Revised: ( l − i ) end for end for c

Original: = c + 1elsei z = 1k =
Revised: = c +else i z = k =

Original: FINDFIRST ( m.d, d j )if k (cid:54) =
Revised: FINDFIRST ( m.d, d j ) if k (cid:54) =

Original: nothing thene j = k (cid:46) Record node index of duplicated featurei z = m k .zm, W, l w = UNWIND ( m, W, l w , k ) (cid:46)
Revised: nothing then e j = k (cid:46) Record node index of duplicated feature i z = m k .z m, W, l w = UNWIND ( m, W, l w , k ) (cid:46)

Original: Undo previous update for d k if we see it againend ifl w = l w +[-
-]
Revised: Undo previous update for d k if we see it again end if l w = l w +[-
-]

Original: RECURSE ( a j , m, W, l w , i z
Revised: RECURSE ( a j , m, W, l w , i z

Original: r a j /r j , d j )
Revised: r a j /r j , d j )

Original: RECURSE ( b j , m, W, l w , i z
Revised: RECURSE ( b j , m, W, l w , i z

Original: r b j /r j , d j )end ifend procedureprocedure EXTEND( m, W, l w , p z , p i ) (cid:46) Update m, W, l w for the feature of the last splitl = len ( m )m
Revised: r b j /r j , d j ) end if end procedure procedure EXTEND( m, W, l w , p z , p i ) (cid:46) Update m, W, l w for the feature of the last split l = len ( m ) m

Original: = copy ( m )m l .
Revised: = copy ( m ) m l .

Original: ( d, z ) =
Revised: ( d, z ) =

Original: ( p i , p z ) (cid:46) Extend m given the feature of the last splitif l = 0 then
Revised: ( p i , p z ) (cid:46) Extend m given the feature of the last split if l = 0 then

Original: W [0 , 0]
Revised: W [0 , 0]

Original: = 1else (cid:46) Extend W, l w given the feature of the last split
Revised: =else (cid:46) Extend W, l w given the feature of the last split

Original: W, l w = copy ( W ) , copy ( l w )
Revised: W, l w = copy ( W ) , copy ( l w )

Original: W [2 l − 1 : 2 l , :] =
Revised: W [2 l − 1 : 2 l , :] =

Original: copy ( W [: 2 l − 1 , :])l w [2 l − 1 : 2 l ] =
Revised: copy ( W [: 2 l − 1 , :]) l w [2 l − 1 : 2 l ] =

Original: copy
Revised: copy

Original: ( l w [: 2 l − 1 ])for t ← 0 to 2 l − 1 − 1 dofor i ← l w [ t ] − 1 to 0 do
Revised: ( l w [: 2 l − 1 ]) for t ← 0 to 2 l − 1 − 1 do for i ← l w [ t ] − 1 to 0 do

Original: W [ t, i ] =
Revised: W [ t, i ] =

Original: W [ t, i ] · ( l − i ) /
Revised: W [ t, i ] · ( l − i ) /

Original: ( l + 1)end forend forfor t ← 2 l − 1 to 2 l − 1 dofor i ← l w [ t ] − 1 to 0 do
Revised: ( l + 1) end for end for for t ← 2 l − 1 to 2 l − 1 do for i ← l w [ t ] − 1 to 0 do

Original: W [ t, i + 1] =
Revised: W [ t, i + 1] =

Original: W [ t, i + 1] + W [ t, i ] · ( i + 1) /
Revised: W [ t, i + 1] + W [ t, i ] · ( i + 1) /

Original: ( l + 1)
Revised: ( l + 1)

Original: W [ t, i ] =
Revised: W [ t, i ] =

Original: p z · W [ t, i ] · ( l − i ) /
Revised: p z · W [ t, i ] · ( l − i ) /

Original: ( l + 1)end forend forl w [: 2 l − 1 ]
Revised: ( l + 1) end for end for l w [: 2 l − 1 ]

Original: = l w [: 2 l − 1 ] − 1end ifreturn m, W, l wend procedureprocedure UNWIND( m, W, l w , i ) (cid:46)
Revised: = l w [: 2 l − 1 ] −end if return m, W, l w end procedure procedure UNWIND( m, W, l w , i ) (cid:46)

Original: Undo previous update for feature d il = len ( m ) − 1m, W, l w = copy ( m 0 ··· l − 1 ) , copy ( W ) , copy ( l w )ind = empty arrayfor t 1 ← { 0 , 2 i , 2 · 2 i , 3 · 2 i , · · · , 2 l − 2 i } dofor t 2 ← t 1 to t 1 + [-
-] i − 1 − 1 doind.append ( t 2 )end forend for
Revised: Undo previous update for feature d i l = len ( m ) −m, W, l w = copy ( m 0 ··· l − 1 ) , copy ( W ) , copy ( l w ) ind = empty array for t 1 ← { 0 , 2 i , 2 · 2 i , 3 · 2 i , · · · , 2 l − 2 i } do for t 2 ← t 1 to t 1 + [-
-]2 i − 1 − 1 do ind.append ( t 2 ) end for end for

Original: W [: 2 l − 1 , :] =
Revised: W [: 2 l − 1 , :] =

Original: W [ ind, :] (cid:46)
Revised: W [ ind, :] (cid:46)

Original: Shrink W, l w given feature d il w [: 2 l − 1 ]
Revised: Shrink W, l w given feature d i l w [: 2 l − 1 ]

Original: = l w [ ind ]for t ← 0 to 2 l − 1 − 1 dofor i ← l w [ t ] to 0 do
Revised: = l w [ ind ] for t ← 0 to 2 l − 1 − 1 do for i ← l w [ t ] to 0 do

Original: W [ t, i ] =
Revised: W [ t, i ] =

Original: W [ t, i ] · ( l + 1) /
Revised: W [ t, i ] · ( l + 1) /

Original: ( l − i )end forend forfor j ← i to l − 1 dom j .
Revised: ( l − i ) end for end for for j ← i to l − 1 do m j .

Original: ( d, z ) = m j +1 .
Revised: ( d, z ) = m j +1 .

Original: ( d, z ) (cid:46) Shrink m given feature d iend for return m, W, l wend procedure
Revised: ( d, z ) (cid:46) Shrink m given feature d i end for end procedure

Original: Algorithm procedure T REE SHAPS CORE ( x, tree = { v, a, b, t, r, d, S, e } )φ = array of len ( x ) zerosb = array of [0 , 1 , 2 , 2 2 , · · · , 2 D ]c =[-
-]
Revised: Algorithm procedure T REE SHAPS CORE ( x, tree = { v, a, b, t, r, d, S, e } ) φ = array of len ( x ) zeros b = array of [0 , 1 , 2 , 2 2 , · · · , 2 D ] c =[-
-]

Original: RECURSE (0 , [] , 1 , 1 , 1 , − 1) (cid:46) Start recursion at the root nodereturn φend procedureprocedure RECURSE( j, m, q, p z , p o , p i )l = len ( m )m
Revised: RECURSE (0 , [] , 1 , 1 , 1 , − 1) (cid:46) Start recursion at the root node return φ end procedure procedure RECURSE( j, m, q, p z , p o , p i ) l = len ( m ) m

Original: = copy ( m )m l .
Revised: = copy ( m ) m l .

Original: ( d, z, o ) =
Revised: ( d, z, o ) =

Original: ( p i , p z , p o )
Revised: ( p i , p z , p o )

Original: (cid:46) Update m, q for the feature of the last splitif p o = 0 thenq = q · p zend ifif v j (cid:54) =
Revised: (cid:46) Update m, q for the feature of the last split if p o = 0 then q = q · p z end if if v j (cid:54) =

Original: internal then (cid:46) Check if we are at a leaf nodeb sum 
Revised: internal then (cid:46) Check if we are at a leaf node b sum =

Original: = 0for i ← 1 to l do (cid:46)
Revised: for i ← 1 to l do (cid:46)

Original: Use b sum to search in { U D k ,C : C ⊂ D k } for the current pathb sum
Revised: Use b sum to search in { U D k ,C : C ⊂ D k } for the current path b sum

Original: = b sum
Revised: = b sum

Original: + b i if m i .o
Revised: + b i if m i .o

Original: (cid:54)=
Revised: (cid:54)

Original: 0end forfor i ← 1 to l doif m i .o
Revised: =end for for i ← 1 to l do if m i .o

Original: = 

Revised: =

Original: then (cid:46) Update contribution for feature d i ∈ S
Revised: then (cid:46) Update contribution for feature d i ∈ S

Original: kφ m i .d
Revised: k φ m i .d

Original: =
Revised: =

Original: φ m i .d
Revised: φ m i .d

Original: − S [ c, b sum ] · q · v jelse (cid:46) Update contribution for feature d i / ∈ S kφ m i .d
Revised: − S [ c, b sum ] · q · v j else (cid:46) Update contribution for feature d i / ∈ S k φ m i .d

Original: =
Revised: =

Original: φ m i .d
Revised: φ m i .d

Original: + S [ c, b sum − b i ] · q · (1 − m i .z )
Revised: + S [ c, b sum − b i ] · q · (1 − m i .z )

Original: · v jend ifend forc =
Revised: · v j end if end for c

Original: c + 1elsei z =  i o = 1k =
Revised: = c +else i z =

Original: e jif k
Revised: i o

Original:  (cid:54) = − 1 then (cid:46)
Revised: = k = e j if k (cid:54) = − 1 then (cid:46)

Original: Undo previous update for feature d k if we see this feature againi z , i o = m k .z, m k .om
Revised: Undo previous update for feature d k if we see this feature again i z , i o = m k .z, m k .o m

Original: = copy ( m 0 ··· l − 1 )for j ← k to l − 1 dom j .
Revised: = copy ( m 0 ··· l − 1 ) for j ← k to l − 1 do m j .

Original: ( d, z, o )
Revised: ( d, z, o )

Original: = m
Revised: = m

Original: j +1 .
Revised: j +1 .

Original: ( d, z, o )end forif i o = 0 thenq{+
+}
Revised: ( d, z, o ) end for if i o = {+
+}

Original:  = q/i zend ifend if
Revised: then q = q/i z end if end if

Original: RECURSE ( a j , m, q, i z
Revised: RECURSE ( a j , m, q, i z

Original: r a j /r j , i o · 1 ( x d j ≤ t j ) , d j )
Revised: r a j /r j , i o · 1 ( x d j ≤ t j ) , d j )

Original: RECURSE ( b j , m, q, i z
Revised: RECURSE ( b j , m, q, i z

Original: r b j /r j , i o · 1 ( x d j > t j ) , d j )end ifend procedure
Revised: r b j /r j , i o · 1 ( x d j > t j ) , d j ) end if end procedure

Original: A.7 Additional Tables in Evaluation
Revised: A.7 Additional Tables in Evaluation

Original: Table 4 lists the basic information of each dataset used in the evaluation study.

Original: Table 5 lists the summary statistics for each model variant used in the evaluation study.
Revised: Table 5 lists the summary statistics for each model variant used in the evaluation study.

Original: We ﬁx thenumber of trees to be 100, since the computational time is approximately linear in terms of thenumber of trees, therefore without loss of generalizability, we simply set the number of trees to be aﬁxed number.
Revised: We ﬁx the number of trees to be 100, since the computational time is approximately linear in terms of the number of trees, therefore without loss of generalizability, we simply set the number of trees to be a ﬁxed number.

Original: [Table]
Revised: [Table]

Revised: [Figure]

Revised: A.8 Evaluation on Varying Number of Trees

Revised: We compare the performance of original TreeSHAP, Fast TreeSHAP v1 and Fast TreeSHAP v on varying number of trees.

Revised: Figure 2 plots the execution time versus number of trees for models

Revised: Adult-Med and Adult-Large.

Revised: 95% conﬁdence interval of the execution time is also indicated by the shaded area.

Revised: We ﬁnd that in both plots, the execution time is approximately linear in terms of the number of trees for all the three approaches, which justiﬁes the theoretical complexity formulas in

Revised: Table 1.

Revised: We also ﬁnd that the relative performance of the three approaches is consistent with the number of trees, where Fast TreeSHAP v2 consistently performs the best, while original TreeSHAP consistently performs the worst.

Revised: A.9 Evaluation on XGBoost Model

Revised: We compare the performance of original TreeSHAP, Fast TreeSHAP v1 and Fast TreeSHAP v2 on

Revised: XGBoost [6] models trained on datasets Adult [15] and Superconductor [10].

Revised: For fair comparison, all the evaluations were run on a single core in Azure Virtual Machine with size Standard_D8_v3 ( cores and 32GB memory).

Revised: We construct Table 6, 7, and 8 in the same format of Table 5, 3, and 4.

Revised: Overall we see that Fast TreeSHAP v1 and v2 can still achieve ∼ 1.5x and ∼ 2.5-3x speedups than original TreeSHAP.

Revised: [Table]

Original: [Table]
Revised: [Table]

Original: A.8 Fast TreeSHAP Parallelization
Revised: A.10 Fast TreeSHAP Parallelization

Original: Parallel computing is not the main topic of this paper and will be one of our future works.
Revised: Parallel computing is not the main topic of this paper and will be one of our future works.

Original: Herewe just brieﬂy discuss the potential ways to parallelize Fast TreeSHAP v1 and v2 to achieve aneven higher computational speed.
Revised: Here we just brieﬂy discuss the potential ways to parallelize Fast TreeSHAP v1 and v2 to achieve an even higher computational speed.

Original: Fast TreeSHAP v1 can be parallelized per sample, similar to theparallelization setting in the original TreeSHAP.
Revised: Fast TreeSHAP v1 can be parallelized per sample, similar to the parallelization setting in the original TreeSHAP.

Original: The parallelization setting for Fast TreeSHAP v2 isa bit complicated:
Revised: The parallelization setting for Fast TreeSHAP v2 is a bit complicated:

Original: For one-time usage, per-tree parallelization is recommended as long as the totalmemory cost across multiple threads (i.e., # thread · O ( L 2 D ) ) ﬁts the entire memory, which worksfor most moderate-sized trees.
Revised: For one-time usage, per-tree parallelization is recommended as long as the total memory cost across multiple threads (i.e., # thread · O ( L 2 D ) ) ﬁts the entire memory, which works for most moderate-sized trees.

Original: For multi-time usage or when per-tree parallelization is not applicable,we can pre-compute S ’s for all trees and store them in the local disk, and read them when explainingthe samples.
Revised: For multi-time usage or when per-tree parallelization is not applicable, we can pre-compute S ’s for all trees and store them in the local disk, and read them when explaining the samples.

Original: In this case, per-sample parallelization can be implemented.
Revised: In this case, per-sample parallelization can be implemented.

Original: Speciﬁcally, we can readthese S ’s in batches with size B which leads to O ( BL 2 D ) memory cost.
Revised: Speciﬁcally, we can read these S ’s in batches with size B which leads to O ( BL 2 D ) memory cost.

Original: When the correspondingtree size is small, we can increase the batch size to potentially reduce the overheads in data loading.
Revised: When the corresponding tree size is small, we can increase the batch size to potentially reduce the overheads in data loading.

Original: When the tree size is large, we can decrease the batch size until it ﬁts the memory well.
Revised: When the tree size is large, we can decrease the batch size until it ﬁts the memory well.

Original: Once a batchof S ’s have been loaded into memory, we can implement per-sample parallelization to update SHAPvalues for all samples for this batch of trees.
Revised: Once a batch of S ’s have been loaded into memory, we can implement per-sample parallelization to update SHAP values for all samples for this batch of trees.

Original: A.9 Analysis of Real Life Scenarios
Revised: A.11 Analysis of Real Life Scenarios

Original: The evaluation studies in Section 5 are all based on 100 trees, 10,000 samples, and 1 core for fast andfair comparisons.
Revised: The evaluation studies in Section 5 are all based on 100 trees, 10,000 samples, and 1 core for fast and fair comparisons.

Original: In real life scenarios in industry, the number of trees is usually between 200 and1000, hundreds of millions of samples can be encountered in model scoring, and multi-core machinescan be used to conduct parallel computing.
Revised: In real life scenarios in industry, the number of trees is usually between 200 and 1000, hundreds of millions of samples can be encountered in model scoring, and multi-core machines can be used to conduct parallel computing.

Original: Based on the discussions in Section A.8 and the linearpatterns in Figure 1, we can reasonably expect the linear scaling of the performance of the three
Revised: Based on the discussions in Section A.10 and the linear patterns in Figure 1, we can reasonably expect the linear scaling of the performance of the three

Original: TreeSHAP algorithms with respect to the number of trees, the number of samples, and the number ofthreads in parallel computing.
Revised: TreeSHAP algorithms with respect to the number of trees, the number of samples, and the number of threads in parallel computing.

Original: Here we list two real life scenarios and estimate the improvement of
Revised: Here we list two real life scenarios and estimate the improvement of

Original: Fast TreeSHAP v1 and v2 over the original TreeSHAP (The estimates may not be very accurate, and they are mostly used to provide an intuitive view of the magnitude of problems and the improvementof proposed approaches):•
Revised: Fast TreeSHAP v1 and v2 over the original TreeSHAP (The estimates may not be very accurate, and they are mostly used to provide an intuitive view of the magnitude of problems and the improvement of proposed approaches):

Original:  In the prediction of Premium subscriptions of LinkedIn members, 20 million LinkedInmembers need to be scored every week.
Revised: • In the prediction of Premium subscriptions of LinkedIn members, 20 million LinkedIn members need to be scored every week.

Original: The model we have built is a random forest modelwhich is refreshed every half a year.
Revised: The model we have built is a random forest model [Table] which is refreshed every half a year.

Original: This model contains 400 trees with the maximum depthof 12.
Revised: This model contains 400 trees with the maximum depth of 12.

Original: Assume we are using a server with 100 cores.
Revised: Assume we are using a server with 100 cores.

Original: We can reasonably approximate fromTable 2 that the execution time of explaining the entire 20 million samples by using theoriginal TreeSHAP is about 660 × 4 × 2000 / 100 s = 14.7h (we use the average executiontime of the large models across 4 datasets) even with parallel computing on 100 cores.
Revised: We can reasonably approximate from Table 3 that the execution time of explaining the entire 20 million samples by using the original TreeSHAP is about 660 × 4 × 2000 / 100 s = 14.7h (we use the average execution time of the large models across 4 datasets) even with parallel computing on 100 cores.

Original: Thiscomputational cost is much higher than the model scoring itself!
Revised: This computational cost is much higher than the model scoring itself!

Original: We propose using FastTreeSHAP v2 as this is the multi-time usage scenario, where matrix S can be pre-computedand stored in the server.
Revised: We propose using Fast TreeSHAP v2 as this is the multi-time usage scenario, where matrix S can be pre-computed and stored in the server.

Original: From Table 3, we can reasonably estimate that the matrix S occupiesabout 400 × 30 MB=12GB in storage (store all 400 trees together), and 30MB in memory(read each tree sequentially) when running Fast TreeSHAP v2, which should well ﬁt theindustry-level server.
Revised: From Table 4, we can reasonably estimate that the matrix S occupies about 400 × 30 MB=12GB in storage (store all 400 trees together), and 30MB in memory (read each tree sequentially) when running Fast TreeSHAP v2, which should well ﬁt the industry-level server.

Original: We can also estimate from Table 3 that Fast TreeSHAP v2 provides∼ 3 x speedup compared with the original TreeSHAP, which reduces the execution time ofmodel interpretation from 14.7h to just 4.9h.•
Revised: We can also estimate from Table 4 that Fast TreeSHAP v2 provides ∼ 3 x speedup compared with the original TreeSHAP, which reduces the execution time of model interpretation from 14.7h to just 4.9h.

Original:  In the crop mapping prediction [12, 13], 320 thousand remote sensing images need tobe scored on a 4-core laptop.
Revised: • In the crop mapping prediction [13, 14], 320 thousand remote sensing images need to be scored on a 4-core laptop.

Original: The model we have built is similar to the model used inSection 5: a random forest model with 500 trees and maximum depth of 12.
Revised: The model we have built is similar to the model used in Section 5: a random forest model with 500 trees and maximum depth of 12.

Original: From Table2, it is reasonable to estimate that the execution time of the original TreeSHAP is about315 × 32 × 5 / 4 s = 3.5h when parallelizing on the entire 4 cores.
Revised: From Table 3, it is reasonable to estimate that the execution time of the original TreeSHAP is about 315 × 32 × 5 / 4 s = 3.5h when parallelizing on the entire 4 cores.

Original: Fast TreeSHAP v1 canhelp reduce the execution time to 216 × 32 × 5 / 4 s = 2.4h.
Revised: Fast TreeSHAP v1 can help reduce the execution time to 216 × 32 × 5 / 4 s = 2.4h.

Original: Since this is the one-timeusage scenario, per-tree parallelization can be implemented for Fast TreeSHAP v2, whichcosts around 15 × 4 MB = 60MB in memory, and can further reduce the execution time to130 × 32 × 5 / 4 s = 1.4h.
Revised: Since this is the one-time usage scenario, per-tree parallelization can be implemented for Fast TreeSHAP v2, which costs around 15 × 4 MB = 60MB in memory, and can further reduce the execution time to 130 × 32 × 5 / 4 s = 1.4h.