The success of state-of-the-art prediction models such as neural networks is driven by their capability to learn complex feature interactions. When such models are used to make predictions for users, we may want to know how they personalize to us. Such model behaviors can be explained via interaction detection and attribution, i.e. if features influence each other and how these interactions contribute to predictions, respectively. Interaction explanations are useful for applications such as sentiment analysis [35] , image classification [47] , and recommendation tasks [21, 47] .
Relevant methods for attributing predictions to feature interactions are black-box explanation methods based on axioms (or principles), but these methods lack interpretability. One of the core issues is that an interaction's importance is not the same as its attribution. Techniques like Shapley Taylor Interaction Index (STI) [14] and Integrated Hessians (IH) [25] combine these concepts in order to be axiomatic. Specifically, they base an interaction's attribution on non-additivity, i.e. the degree that features non-additively affect an outcome. While non-additivity can be used for interaction detection, it is not interpretable as an attribution measure as we see in Fig. 1 . In addition, neither STI nor IH is tractable for higher-order feature interactions [14, 45] . Hence, there is a need for interpretable, axiomatic, and scalable methods for interaction attribution and corresponding interaction detection. Shapley Taylor Interaction Index [14] Our Method function which is a good approximator to any function, as is leveraged in earlier works [48] [49] [50] . On the other hand, ArchDetect circumvents intractability issues of higher-order interaction detection by removing certain uninterpretable higher-order interactions and leveraging a property of feature interactions that allows pairwise interactions to merge for disjoint arbitrary-order interaction detection.
In practice, where any assumptions may not hold in real-world settings, Archipelago still performs well. In particular, Archipelago effectively detects relevant interactions and is more interpretable than state-of-the-art methods [14, 20, 25, 26, 46 , 50] when evaluated on annotation labels in sentiment analysis and image classification. We visualize Archipelago explanations on sentiment analysis, COVID-19 prediction on chest X-rays, and ad-recommendation.
Our main contributions are summarized below.
• Interaction Attribution: We propose ArchAttribute, a feature attribution measure that leverages feature interactions. It has advantages of being model-agnostic, interpretable, and runtime-efficient as compared to other state-of-the-art interaction attribution methods.
• Principled Attribution: ArchAttribute obeys standard attribution axioms [46] that are generalized to work for feature sets, and we also propose a new axiom for interaction attribution to respect the additive structure of a function.
• Interaction Detection: We propose a complementary feature interaction detector, ArchDetect, that is also model-agnostic and O(p 2 )-efficient for pairwise and disjoint arbitrary-order interaction detection (p is number of features).
Our empirical studies on ArchDetect and ArchAttribute demonstrate their superior properties as compared to state-of-the-art methods.
We first introduce preliminaries that serve as a basis for our discussions.
Notations: We use boldface lowercase symbols, such as x, to represent vectors. The i-th entry of a vector x is denoted by x i . For a set S, its cardinality is denoted by |S|, and the operation \S means all except S. For p features in a dataset, let I be a subset of feature indices: I ⊆ {1, 2, . . . , p}. For a vector x ∈ R p , let x I ∈ R p be defined element-wise in (1) . In our discussions, a context means x \I .
Problem Setup: Let f denote a black-box model with scalar output. For multi-class classification, f is assumed to be a class logit. We use a target vector x ∈ R p to denote the data instance where we wish to explain f , and x ∈ R p to denote a neutral baseline. Here, the baseline is a reference vector for x and conveys an "absence of signal" as per [46] . These vectors form the space of X ⊂ R p , where each element comes from either x i or x i , i.e. X = {(x 1 , . . . , x p ) | x i ∈ {x i , x i }, ∀i = 1, . . . , p}.
Feature Interaction: The definition of the feature interaction of interest is formalized as follows. For example, this means that the function ReLU(x 1 + x 2 ) creates a feature interaction because it cannot be represented as an addition of univariate functions, i.e., ReLU(x 1 + x 2 ) = f 1 (x 2 ) + f 2 (x 1 ) (Fig. 2b) . We refer to individual feature effects which do not interact with other features as main effect. Higher-order feature interactions are captured by |I| > 2, i.e. interactions larger than pairs. Additionally, if a higher-order interaction exists, all of its subsets also exist as interactions [45, 48] .
We begin by presenting our feature attribution measure. Our feature attribution analyzes and assigns scores to detected feature interactions. Our corresponding interaction detector is presented in §4.
Let I be the set of feature indices that correspond to a desired attribution score. Our proposed attribution measure, called ArchAttribute, is given by
ArchAttribute essentially isolates the attribution of x I from the surrounding baseline context while also satisfying axioms ( §3.2). We call this isolation an "island effect", where the target features {x i } i∈I do not specifically interact with the baseline features x j j∈\I . For example, consider sentiment analysis on a phrase x = "not very bad" with a baseline x = "_ _ _" . Suppose that we want to examine the attribution of an interaction I that corresponds to {very, bad} in isolation. In this case, the contextual word "not" also interacts with I, which becomes apparent when small perturbations to the word "not" causes large changes to prediction probabilities. However, as we move further away from the word "not" towards the empty-word "_" in the word-embedding space, small perturbations no longer result in large prediction changes, meaning that "_" does not specifically interact with {very, bad}. This intuition motivates our use of the baseline context x \I in (2).
We now show how ArchAttribute obeys standard feature attribution axioms [46] . Since ArchAttribute operates on feature sets, we generalize the notion of standard axioms to feature sets.
To this end, we also propose a new axiom, Set Attribution, which allows us to work with feature sets.
be all k feature interactions and main effects of f in the space X (defined in §2), where we take the union of overlapping sets in S. Later in §4, we explain how to obtain S.
We consider a generalization of the completeness axiom for which the sum of all attributions equals f (x ) − f (x ). The axiom tells us how much feature(s) impact a prediction.
Lemma 2 (Completeness on S). The sum of all attributions by ArchAttribute for the disjoint sets in S equals the difference of f between x and the baseline x :
The proof is in Appendix C. We can easily see ArchAttribute satisfying this axiom in the limiting case where k = 1, [14] do.
Set Attribution: We propose an axiom for interaction attribution called Set Attribution to work with feature sets as opposed to individual features and follow the additive structure of a function.
have roots, then an interaction attribution method admits an attribution for feature set I i as ϕ i (x Ii ) ∀i = 1, . . . , k.
For example, if we consider a function y = x 1 x 2 + x 3 ; it makes sense for the attribution of the x 1 x 2 interaction to be the value of x 1 x 2 and the attribution for the x 3 main effect to be the value of x 3 . Lemma 4 (Set Attribution on S). For x = x and a baseline x such that ϕ i (x Ii ) = 0 ∀i = 1, . . . , k, ArchAttribute satisfies the Set Attribution axiom and provides attribution ϕ i (x Ii ) for set I i ∀i.
The proof is in Appendix E, which follows from Lemma 2. Neither SCD, CD, SOC, SI, IH, nor STI satisfy Set Attribution (shown in Appendix E.1). We can enable Integrated Gradients (IG) [46] to satisfy our axiom by summing its attributions within each feature set of S. ArchAttribute differs from IG by its "island effect" ( §3.1) and model-agnostic properties.
Other Axioms: ArchAttribute also satisfies the remaining axioms: Sensitivity, Implementation Invariance, Linearity, and Symmetry-Preserving, which we show via Lemmas 7-11 in Appendix F.
Discussion: Several axioms required disjoint interaction and main effect sets in S. Though interactions are not necessarily disjoint by definition (Def. 1), it is reasonable to merge overlapping interactions to obtain compact visualizations, as shown in Fig. 1 
Our axiomatic analysis of ArchAttribute relied on S, which contains interaction sets of f on the space X (defined in §2). To develop an interaction detection method that works in tandem with ArchAttribute, we draw inspiration from the discrete interpretation of mixed partial derivatives.
Consider the plots in Fig. 2 , which consist of points a, b, c, and d that each contain two features. From a top-down view of each plot, the points form the corners of a rectangle, whose side lengths are
When h 1 and h 2 are small, the mixed partial derivative w.r.t variables x 1 and x 2 is computed as follows.
. Similarly, the mixed partial derivative is approximated as:
When h 1 and h 2 become large, (3) tells us if a plane can fit through all four points a,b,c, d (Fig. 2a) , which occurs when (3) is zero. In this domain where x 1 and x 2 only take two possible values each, a plane in the linear form f (x) = w 1 x 1 + w 2 x 2 + b is functionally equivalent to all functions of the form f (x) = f 1 (x 1 ) + f 2 (x 2 ) + b, so any deviation from the plane, e.g. Fig. 2b , becomes non-additive. Consequently, a non-zero value of (3) identifies a non-additive interaction by the definition of statistical interaction (Def. 1). What's more, the magnitude of (3) tells us the degree of deviation from the plane, or the degree of non-additivity. (Additional details in Appendix G)
Leveraging these insights about mixed partial derivatives, we now discuss the two components of our proposed interaction detection technique -ArchDetect.
As defined in §3.2 and §4, our problem is how to identify interactions of p features in X for our target data instance x and baseline x . If p = 2, then we can almost directly use (3), where a = (x 1 , x 2 ), b = (x 1 , x 2 ), c = (x 1 , x 2 ), and d = (x 1 , x 2 ). However if p > 2, all possible combinations of features in X would need to be examined to thoroughly identify just one pairwise interaction. To see this, we first rewrite (3) to accommodate p features, and square the result to measure interaction strength and be consistent with previous interaction detectors [18, 19] . The interaction strength between features i and j for a context x \{i,j} is then defined as
where each element of x \{i,j} is Bernoulli (0.5). This expectation is intractable because X has an exponential search space, so we propose the first component of ArchDetect for efficient pairwise interaction detection:
Here, we estimate the expectation by leveraging the physical meaning of the interactions and ArchAttribute's axioms via the different contexts of x in (5) as follows:
• Context of x : An important interaction is one due to multiple x features. As a concrete example, consider an image representation of a cat which acts as our target data instance.
The following higher-order interaction, if x ear = x ear and x nose = x nose and x f ur = x f ur then f (x) = high cat probability, is responsible for classifying "cat". We can detect any pairwise subset {i, j} of this interaction by setting the context as x \{i,j} using ω i,j (x ).
• Context of x : Next, we consider x \{i,j} to detect interactions via ω i,j (x ), which helps us establish ArchAttribute's completeness (Lemma 2). This also separates out effects of any higher-order baseline interactions from f (x ) in (8) (Appendix C) and recombine their effects in (11) . From an interpretability standpoint, the x \{i,j} context ranks pairwise interactions w.r.t. a standard baseline. This context is also used by ArchAttribute (2). • Other Contexts: The first two contexts accounted for any-order interactions created by either target or baseline features and a few interactions created by a mix of baseline and target features. The remaining interactions specifically require a mix of > 3 target and baseline features. This case is unlikely and is excluded, as we discuss next.
The following assumption formalizes our intuition for the Other Contexts setting where there is a mix of higher-order (> 3) target and baseline feature interactions.
Assumption 5 (Higher-Order Mixed-Interaction). For any feature set I where |I| > 3 and any pair of non-empty disjoint sets A and B where A ∪ B = I, the instances x ∈ X such that x i = x i ∀i ∈ A and x j = x j ∀j ∈ B do not cause a higher-order interaction of all features {x k } k∈I via f .
Assumption 5 has a similar intuition as ArchAttribute in §3.1 that target features do not specifically interact with baseline features. To understand this assumption, consider the original sentiment analysis example in Fig. 1 simplified as x = "bad terrible awful horrible movie" where x = "_ _ _ _ _". It is reasonable to assume that there is no special interaction created by token sets such as {bad, terrible, _ , horrible} or {_ , _ , _ , horrible} due to the meaningless nature of the "_" token.
Efficiency: In (5), ArchDetect attains interaction detection over all pairs {i, j} in O(p 2 ) calls of f . Note that in (4), most function calls are reusable during pairwise interaction detection.
In this section, the aim here is to recover arbitrary size and disjoint non-additive feature sets S = {I i } (not just pairs). ArchDetect looks at the union of overlapping pairwise interactions to obtain disjoint feature sets. Merging these pairwise interactions captures any existing higher-order interactions automatically since the existence of a higher-order interaction automatically means all its subset interactions exist ( §2). In addition, ArchDetect merges these overlapped pairwise interactions with all individual feature effects to account for all features. The time complexity of this merging process is also O(p 2 ). 
Pairwise Interaction Ranking AUC. The baseline methods fail to detect interactions suited for the desired contexts in §4.2.1.
Method
Two-way ANOVA (5) . "fixed" at n = 2 (ArchDetect) already shows good stability.
We conduct experiments first on ArchDetect in §5.2 then on ArchAttribute in §5.3. We then visualize their combined form as Archipelago in §5.3. Throughout our experiments, we commonly study BERT [13, 55] on text-based sentiment analysis and ResNet152 [24] on image classification. BERT was fine-tuned on the SST dataset [43] , and ResNet152 was pretrained on ImageNet [12] .
For sentiment analysis, we set the baseline vector x to be the tokens "_", in place of each word-token from x . For image classification, we set x to be an all-zero image, and use the Quickshift superpixel segmenter [52] as per the need for input dimensionality reduction [47] (details in Appendix B). We set h 1 = h 2 = 1 for both domains. Several methods we compare to are common across experiments, in particular IG, IH, (disjoint) MAHE, SI, STI, and Difference, defined as φ d (I) = f (x )−f (x I +x \I ).
We validate ArchDetect's performance via synthetic ground truth and redundancy experiments. Interaction Redundancy: The purpose of the next experiments is to see if ArchDetect can omit certain higher-order interactions. We study the form of (5) by examining the redundancy of interactions as new contexts are added to (5) , which we now write asω i,j (C) = 1 C C c=1 ω i,j (x c ). Let n be the number of contexts considered, and k be the number of top pairwise interactions selected after running pairwise interaction detection viaω i,j for all {i, j} pairs. Interaction redundancy is the overlap ratio of two sets of top-k pairwise interactions, one generated viaω i,j (n) and the other one viaω i,j (n − 1) for some integer n ≥ 2. We generally expect the redundancy to increase as n increases, which we initially observe in Fig. 3 . Here, "fixed" and "random" correspond to different context sequences x 1 , x 2 , . . . , x N . The "random" sequence uses random samples from X for all {x i } N i=1 , whereas the "fixed" sequence is fixed in the sense that x 1 = x , x 2 = x , and the remaining {x i } N i=3 are random samples. Experiments are done on the SST test set for BERT and 100 random test images in ImageNet for ResNet152. Notably, the "fixed" setting has very low redundancy at n = 2 (ArchDetect) versus "random". As soon as n = 3, the redundancy jumps and stabilizes quickly. These experiments support Assumption 5 and (5) to omit specified higher-order interactions. 
We study the interpetability of ArchAttribute by comparing its attribution scores to ground truth annotation labels on subsets of features. For fair comparison, we look at extreme attributions (top and bottom 10%) for each baseline method. We then visualize the combined Archipelago framework. Additional comparisons on attributions, runtime, and visualizations are shown in Appendices I, J, K.
Sentiment Analysis: For this task, we compare ArchAttribute to other explanation methods on two metrics: phrase correlation (Phrase ρ) and word correlation (Word ρ) on the SST test set (metrics are from [26]). Phrase ρ is the Pearson correlation between estimated phrase attributions and SST phrase labels (excluding prediction labels) on a 5-point sentiment scale. Word ρ is unlike our labelbased evaluations by computing the Pearson correlation between estimated word attributions and the corresponding coefficients of a global bag-of-words linear model, which is also trained on the SST dataset. In addition to the aforementioned baseline methods in §5.1, we include the state-of-the-art SCD and SOC methods for sequence models [26] in our evaluation. In Table 2 , ArchAttribute compares favorably to all methods where we consider the top and bottom 10% of the attribution scores for each method. We obtain similar performance across all other percentiles in Appendix I.
We visualize Archipelago explanations on S generated by top-3 pairwise interactions ( §4.2.2) in Fig. 4 . The sentence examples are randomly selected from the SST test set. The visualizations show interactions and individual feature effects which all have reasonable polarity and intensity. Interestingly, some of the interactions, e.g. between "lou-sy" and "un", are long range.
Image Classification: On image classification, we compare ArchAttribute to relevant baseline methods on a "Segment AUC" metric, which computes the agreement between the estimated attribution of an image segment and that segment's label. We obtain segment labels from the MS COCO dataset [29] and match them to the label space of ImageNet. All explanation attributions are computed relative to ResNet152's top-classification in the joint label space. The segment label thus becomes whether or not the segment belongs to the same class as the top-classification. Evaluation is positive attribution rank 1 2 3 4 Figure 5 : Our explanations of a COVID-19 classifier (COVID-Net) [53] on randomly selected test X-rays [9, 10] classified as COVID positive. COVID-Net accurately distinguishes COVID from pneumonia and normal X-rays. Colored outlines indicate detected feature sets with positive attribution. The explanations tend to detect on the "great vessels" outlined in green, which are mostly interactions.
conducted on all segments with valid labels in the MS COCO dev set. ArchAttribute performs especially well on extreme attributions in Table 2 , as well as all attributions (in Appendix I). : Online ad-targeting: "banner_pos" is used to target ads to a user per their "device_id".
Recommendation Task: Fig. 6 shows Archipelago's result for this task using a state-of-the-art AutoInt model [44] for adrecommendation. Here, our approach finds a positive interaction between"device_id" and "banner_pos" in the Avazu dataset [1] , meaning that the online advertisement model decides the banner position based on user device_id. Note that for this task, there are no ground truth annotations.
Attribution: Individual feature attribution methods distill any interactions of a data instance as attribution scores for each feature. Many methods require the scores to sum to equal the output [7, 32, 38, 40, 46] , such as LIME and SHAP, which train surrogate linear explainer models on feature perturbations, and IG which invokes the fundamental theorem of calculus. Other methods compute attributions from an information theoretic perspective [8] or strictly from model gradients [4, 39, 41] . These methods interpret feature importance but not feature interactions.
Feature Interaction: Feature interaction explanation methods tend to either perform interaction detection [2, 6, 16, 18, 19, 45, 48] or combined interaction detection and attribution [14, 25, 30, 31, 37, 50] . Relevant black-box interaction explainers are STI [14] which uses random feature orderings to identify contexts for a variant of (4) so that interaction scores satisfy completeness, IH [25] which extends IG with path integration for hessian computations, and MAHE [50], which trains surrogate explainer models for interaction detection and attribution. STI and IH are axiomatic and satisfy completeness but their attributions are uninterpretable ( 
Understandable and accessible explanations are cornerstones of interpretability which informed our isolation and disjoint designs of ArchAttribute and ArchDetect, respectively. Here, we develop an interpretable, model-agnostic, axiomatic, and efficient interaction explainer which achieves state-of-the-art results on multiple attribution tasks. In addition, we introduce a new axiom and generalize existing axioms to higher-order interaction settings. This provides guidance on how to design interaction attribution methods. To be able to solve the transparency issue, we need to understand feature attribution better. This work proposes interpretable and axiomatic feature interaction explanations to motivate future explorations in this area.
The purpose of this work is to provide new insights into existing and future prediction models. The explanations from Archipelago can be used by both machine learning practitioners and audiences without background expertise. The societal risk of this work is any overdependence on Archipelago.
Users of this explanation method should consider the merits of not only this method but also other explanation methods for their use cases. For example, users may want fine-grained pixel-level explanations of image classifications whereas our explanations may require superpixel segmentation. Nevertheless, we believe this work can help reveal biases in prediction models, assist in scientific discovery, and stimulate discussions on how to debug models based on feature interactions. 
For a black-box model f : R p → R which takes as input a vector with p dimensions (e.g. an image, input embedding, etc.) and maps it to a scalar output (e.g. a class logit), we can make ArchDetect more efficient by operating on a lower dimensional input encoding x ∈ R p with p dimensions.
To match the dimensionality p of the input argument of f , we define a transformation function ξ : R p → R p which takes the input encoding x in the lower dimensional space p and brings it back to the input space of f with dimensionality p . In other words, (4) becomes
Examples of input encodings are discussed for the following data types:
• For an image, we use a superpixel segmenter, which selects regions on the image. The selection is covered by the vector x ∈ {0, 1} p , which encodes which image segments have been selected. Note that wherever x is 0 corresponds to a baseline feature value (e.g. zeroed image pixels).
• For text, we use the natural correspondence between an input embedding and a word token. The selection of input embedding vectors is also covered by the vector x ∈ {0, 1} p .
• For recommendation data, we use the same type of correspondence between an input embedding and a feature field.
Similar notions of input encodings have also been used in [38, 47] .
Lemma 2 (Completeness on S). The sum of all attributions by ArchAttribute for the disjoint sets in S equals the difference of f between x and the baseline x :
Proof. Based on the definition of non-additive statistical interaction (Def. 1), a function f can be represented as a generalized additive function [48-50], here on the domain of X :
where q i (x I u i ) is a function of each interaction I u i on X ∀i = 1, . . . , η interactions, q j (x j ) is a function for each feature ∀j = 1, . . . , p, and b is a bias. The u in I u stands for "unmerged".
The disjoint sets of S = {I i } k i=1 are the result of merging overlapping interaction sets and main effect sets, so we can merge the subfunctions q(·) and q (·) of (6) whose input sets overlap to write f (x) as a sum of new functions g i (x Ii ) ∀i = 1, . . . , k:
For some {g i } k i=1 of the form of (7), we rewrite (2) by separating out the effect of index i:
Since all I ∈ S are disjoint, g j (x Ij ) can be canceled in (8) ∀j, leading to (9) . The result at (9) can also be obtained with an alternative attribution approach, as shown in Corollary 6.
Next, we compute the sum of attributions:
Corollary 6 (Completeness of a Complement). An attribution approach:
, similar to what is mentioned in [26, 28] , also satisfies the completeness axiom.
Proof. Based on Eqs. 7 -9 of Lemma 2:
We can then resume with (10) of Lemma 2.
have roots, then an interaction attribution method admits an attribution for feature set I i as ϕ i (x Ii ) ∀i = 1, . . . , k. Lemma 4 (Set Attribution on S). For x = x and a baseline x such that ϕ i (x Ii ) = 0 ∀i = 1, . . . , k, ArchAttribute satisfies the Set Attribution axiom and provides attribution ϕ i (x Ii ) for set I i ∀i.
Proof. From (9) in Lemma 2, ArchAttribute can be written as
are disjoint feature sets for the same function f in Axiom 3, g i (·) and ϕ i (·) are related by a constant bias b i :
Adding g i (x Ii ) to both sides,
We now provide counterexamples to identify situations in which the related methods do not satisfy the Set Attribution axiom.
Let f (x) = ReLU(x 1 + x 3 + 1) + ReLU(x 2 ) + 1. f (x) can be written as f (x) = ϕ 1 (x {1,3} ) + ϕ 2 (x {2} ) where ϕ 1 (x) = ReLU(x 1 + x 3 + 1), and ϕ 2 (x) = ReLU(x 2 ) + 1. According to the Set Attribution axiom, an interaction attribution method admits attributions as
The above setting serves as counterexamples to the related methods as follows:
• CD always assigns α + α α+β to I 1 and β + β α+β to I 2 , where α = ReLU(x 1 + x 3 + 1) and β = ReLU(x 2 ).
• SCD uses an expectation over an activation decomposition, which does not guarantee admission of ReLU(x 1 + x 3 + 1) for I 1 and ReLU(x 2 ) for I 2 through their respective decompositions. In the ideal case SCD becomes CD, which still does not satisfy Set Attribution from above. • IH always assigns a zero attribution to I 2 from hessian computations. IH also does not assign attributions to general sets of features. • SOC does not assign attributions to general feature sets, only contiguous feature sequences.
• Both SI and STI assign the following attribution score to I 1 :
ReLU(x 1 + x 3 + 1) − ReLU(x 1 + x 3 + 1) − ReLU(x 1 + x 3 + 1) + ReLU(x 1 + x 3 + 1).
There do not exist a selection of x 1 and x 3 such that this attribution becomes ReLU(x 1 + x 3 + 1) for all values of x 1 and x 3 .
Proof. We prove via case-by-case contradiction. Only the ReLU(x 1 + x 3 + 1) term can create an interaction between x 1 and x 3 , and this term is also the target result, so any nonzero deviation from this term via independent x 1 or x 3 effects in (12) must be countered. These independent effects manifest as the ReLU(x 1 + x 3 + 1) or ReLU(x 1 + x 3 + 1) terms respectively. Since ReLU is always non-negative, the only way either of these terms is nonzero is if it is positive, which implies that ReLU(x 1 + x 3 + 1) = x 1 + x 3 + 1 or ReLU(x 1 + x 3 + 1) = x 1 + x 3 + 1. If both terms are positive, their substitution into (12) yields ReLU(
If only one of the independent effects was positive, we also cannot assert 0 through similar simplifications. Now consider the remaining case where ReLU(x 1 + x 3 + 1) = ReLU(x 1 + x 3 + 1) = ReLU(x 1 + x 3 + 1) = 0. For any real-valued x 1 or x 3 , there can also be a negative realvalued x 3 or x 1 respectively. From either terms ReLU(x 1 + x 3 + 1) or ReLU(x 1 + x 3 + 1), we obtain ReLU(1) = 0, which is a contradiction. Proof. Since x and x only differ at I, the following is true: x \I = x \I . We can therefore write x as
Substituting this equivalence in (2), we have
Since f (x ) − f (x ) = 0, we directly obtain φ(I) = 0.
Lemma 8 (Sensitivity (b) ). If f does not functionally depend on I, then φ(I) is always zero.
Proof. Since f does not functionally depend on I,
Therefore,
Lemma 9 (Implementation Invariance). For functionally equivalent models (with the same inputoutput mapping), φ(·) are the same.
The definition of (2) only relies on function calls to f , which implies Implementation Invariance.
Lemma 10 (Linearity on S). If two models f 1 , f 2 have the same disjoint feature sets S and f = c 1 f 1 + c 2 f 2 where c 1 , c 2 are constants, then φ(I) = c 1 φ 1 (I) + c 2 φ 2 (I) ∀I ∈ S.
Proof. Since f 1 and f 2 have the same S = {I i } k i=1 , we can write f 1 and f 2 as follows via (7) in Lemma 2:
i (x Ii ) + b (2) .
By grouping terms as
From the form of (14), we can invoke (9): φ(I i ) = g i (x Ii ) − g i (x Ii ) via Lemma 2. This equation is rewritten as
i (x Ii ) − g (2) i (x Ii ) = c 1 φ 1 (I i ) + c 2 φ 2 (I i ).
By noting that S = {I i } k i=1 , this concludes the proof.
We first define symmetric feature sets as a generalization of "symmetric variables" from [46]. Feature index sets I 1 and I 2 are symmetric with respect to function f if swapping features in I 1 with the features in I 2 does not change the function, This implies that for symmetric I 1 and I 2 , their cardinalities are the same |I 1 | = |I 2 |, and they are disjoint sets in order to swap the features to any valid set index. Lemma 11 (Symmetry-Preserving). For x and x that each have identical feature values between symmetric feature sets with respect to f , the symmetric feature sets receive identical attributions φ(·).
Proof. Since x and x each have identical feature values between the symmetric feature sets,
Therefore, the symmetry implies the following for any x in the domain of f .
Setting x = x , we rewrite (15) as
Therefore, φ(I 1 ) = φ(I 2 ).
A generalized additive model f g is given by
where g i (·) can be any function of individual features x i and b is a bias. Since each x i of x ∈ X only takes on two values, a line can connect all valid points in each feature. Therefore, (16) is equivalent to
for weights w i ∈ R and the function domain being X .
For the case where p = 2, the discrete mixed partial derivative is given by (3) or
where h 1 = |x 1 − x 1 | and h 2 = |x 2 − x 2 |. Since any three points (not on the same line) define a plane of the form (17) (p = 2), we can write the fourth point as having a function value with deviation δ from the plane.
(18)
If (18) is 0, then δ = 0, which implies that f can be written as (17) . δ = 0 implies the opposite, that f cannot be written in linear form (by definition). Since (17) is equivalent to (16) in the domain of X , this implies that δ = 0 if and only if f (x) = g 1 (x 1 ) + g 2 (x 2 ) + b.
Based on Def. 1, we can conclude that a nonzero discrete mixed partial derivative w.r.t. x 1 and x 2 in the space X at p = 2 detects a non-additive statistical interaction between the two features. 
We discuss early works on feature interaction interpretation and provide a timeline for this research history in Table 4 . We also discuss mixed partial derivatives on dichotomous variables in H.3.
The notion of a feature interaction has been studied at least since the 19th century when John Lawes and Joseph Gilbert used factorial designs in agricultural research at the Rothamsted Experimental Station [11] . A factorial design is an experiment that includes observations at all combinations of categories of each factor or feature. However, the "advantages [of factorial design] had never been clearly recognised, and many research workers believed that the best course was the conceptually simple one of investigating one question at a time" [57] . In the early 20th century, Fisher et al. (1926) [17] emphasized the importance of factorial designs as being the only way to obtain information about feature interactions. Near the same time, Fisher (1921) [15] also developed one of the foundations of statistical analysis called Analysis of Variance (ANOVA) including twoway ANOVA [16] , which is a factorial method to detect pairwise feature interactions based on differences among group means in a dataset. Tukey (1949) [51] extended two-way ANOVA to test if two categorical features are non-additively related to the expected value of a outcome variable. This work set a precedent for later research on detecting feature interactions based on their nonadditive definition. Soon after, experimental designs were generalized to study feature interactions, in particular the generalized randomized block design [54] , which assigns test subjects to different categories (or blocks) between features in a way where cross-categories between features serve as interaction terms in linear regression.
There was a surge of interest in improving the analysis of feature interactions after the mid 20th century. Belsion (1959) [5] and Morgan & Sonquist (1963) [34] proposed Automatic Interaction Detection (AID) originally under a different name. AID detects interactions by subdividing data into disjoint exhaustive subsets to model an outcome based on categorical features. Based on AID, Kass (1980) [27] developed Chi-square Automatic Interaction Detection (CHAID), which determines how categorical features best combine in decision trees via a chi-square test. AID and CHAID were precursors to modern decision tree prediction models. Concurrently, Nelder (1977) [36] introduced the "Principle of Marginality" arguing that a feature interaction and its marginal variables should not be considered separately, for example in linear regression. Hamada & Wu (1992) [22] provided a contrasting view that an interaction is only important if one or both of its marginal variables are important. Around the same time, an influential book on interpreting feature interactions was published on how to test, plot, and understand interactions of two or three continuous or categorical features [3] .
At the start of the 21st century, efforts began to focus on interpreting interactions in accurate prediction models. Ai & Norton (2003) [2] proposed extracting interactions from logit and probit models via mixed partial derivatives. Gevrey 
To our knowledge, the usage of mixed partial derivatives for interaction detection on dichotomous variables (features that only take two possible values) originated at the turn of the 21st century [2, 20] , but existing methods rely on single contexts [2] or random contexts [14, 20] . Furthermore, these methods do not consider the union of overlapping pairwise interactions for disjoint higher-order interaction detection. Our choice of contexts and our disjoint interaction detection are both important to the Archipelago framework, as we discussed in §4.2 and showed through axiomatic analysis ( §3.2) and experiments ( §5.2). Table 2 . 
We run an ablation study removing the x \{i,j} baseline context from (5) for disjoint interaction detection and examine its effect on visualizations. The visualizations are shown in Fig. 21 for sentiment analysis and Figs. 22 and 23 for image classification. Top-3 and top-5 pairwise interactions are used in sentiment analysis and image classification respectively before merging the interactions.
Text input: "I regret to report that these ops are just not extreme enough ." Classification: neg Archipelago i regret to report that these ops are just not extreme enough . neg pos Difference + ArchDetect i regret to report that these ops are just not extreme enough .
IG i regret to report that these ops are just not extreme enough .
IG + ArchDetect i regret to report that these ops are just not extreme enough . Figure 11 : Text Viz. Comparison A. In the first text example, "regret, not extreme enough" is a meaningful and strongly negative interaction. In the second example, "when you begin to" interacts to diminish its overall attribution magnitude. Text input: "A lousy movie that 's not merely unwatchable , but also unlistenable ." Classification: neg Archipelago a lou -sy movie that ' s not merely un -watch -able , but also un -list -ena -ble .
Difference + ArchDetect a lou -sy movie that ' s not merely un -watch -able , but also un -list -ena -ble .
IG a lou -sy movie that ' s not merely un -watch -able , but also un -list -ena -ble .
IG + ArchDetect a lou -sy movie that ' s not merely un -watch -able , but also un -list -ena -ble . Figure 12 : Text Viz. Comparison B. In the first text example, "thought provoking" is a meaningful and strongly positive interaction. In the second example, the "lousy, un" interaction factors in a large context to make a negative text classification. Figure 13 : Text Viz. Comparison C. In the first text example, "refined, to a crystalline" is a meaningful and strongly positive interaction. In the second example, "is aptly named" is also a meaningful and strongly positive interaction. Figure 14 : Text Viz. Comparison D. In the first text example, "the ending, out" is a meaningful and negative interaction. In the second example, "a feel good, best" is a meaningful and strongly positive interaction. Figure 15 : Text Viz. Comparison E. In the first text example, "film should be, buried" is a meaningful and strongly negative interaction. In the second example, "-oherent" belongs to a negative word "incohorent". Figure 16 : Image Viz. Comparison A. In the first image example, the dog's eyes are a meaningful interaction supporting the classification. In the second example, the monkey's head is also a positive interaction. Figure 17 : Image Viz. Comparison B. In the first image example, the obelisk tip is a meaningful interaction supporting the classification. In the second example, the leopard's face is also a positive interaction. Figure 18 : Image Viz. Comparison C. In the first image example, different patches of the apron are interactions supporting the classification. In the second example, the stork's body is an interaction that strongly supports the classification. Figure 19 : Image Viz. Comparison D. In the first image example, certain small patches of the waffle iron interact, one of which supports the classification. In the second example, the leopard's face is the primary positive interaction. Figure 20 : Image Viz. Comparison E. In the first image example, different parts of the polaroid camera are interactions that positively support the classification. In the second example, the dogs' heads and body are also positive interactions.
Text input: "I regret to report that these ops are just not extreme enough ." Classification: neg w/ Baseline Context i regret to report that these ops are just not extreme enough . neg pos w/o Baseline Context i regret to report that these ops are just not extreme enough .
Text input: "It 's a worse sign when you begin to envy her condition ." Classification: neg w/ Baseline Context it ' s a worse sign when you begin to envy her condition .
w/o Baseline Context it ' s a worse sign when you begin to envy her condition .
Text input: "It 's solid and affecting and exactly as thought-provoking as it should be ." Classification: pos w/ Baseline Context it ' s solid and affecting and exactly as thought -pro -voking as it should be .
w/o Baseline Context it ' s solid and affecting and exactly as thought -pro -voking as it should be .
Text input: "A lousy movie that 's not merely unwatchable , but also unlistenable ." Classification: neg w/ Baseline Context a lou -sy movie that ' s not merely un -watch -able , but also un -list -ena -ble .
w/o Baseline Context a lou -sy movie that ' s not merely un -watch -able , but also un -list -ena -ble .
Text input: "Tsai Ming-liang has taken his trademark style and refined it to a crystalline point ." Classification: pos w/ Baseline Context ts -ai ming -liang has taken his trademark style and refined it to a crystalline point .
w/o Baseline Context ts -ai ming -liang has taken his trademark style and refined it to a crystalline point .
Text input: "As an actor , The Rock is aptly named ." Classification: pos w/ Baseline Context as an actor , the rock is apt -ly named .
w/o Baseline Context as an actor , the rock is apt -ly named .
Text input: "The ending is a cop-out ." Classification: neg w/ Baseline Context the ending is a cop -out .
w/o Baseline Context the ending is a cop -out .
Text input: "A feel-good picture in the best sense of the term ." Classification: pos w/ Baseline Context a feel -good picture in the best sense of the term .
w/o Baseline Context a feel -good picture in the best sense of the term .
Text input: "All prints of this film should be sent to and buried on Pluto ." Classification: neg w/ Baseline Context all prints of this film should be sent to and buried on pluto .
w/o Baseline Context all prints of this film should be sent to and buried on pluto .
Text input: "Arguably the year 's silliest and most incoherent movie ." Classification: neg w/ Baseline Context arguably the year ' s si -llie -st and most inc -oh -ere -nt movie .
w/o Baseline Context arguably the year ' s si -llie -st and most inc -oh -ere -nt movie . Figure 21 : Text Viz. with ArchDetect Ablation. The interactions tend to use more salient words when including the baseline context, which is proposed in ArchDetect. Figure 22 : Image Viz. with ArchDetect Ablation A. The interactions tend to focus more on salient patches of the images when including the baseline context, which is proposed in ArchDetect. Figure 23 : Image Viz. with ArchDetect Ablation B. The interactions tend to focus on salient patches of the images when including the baseline context.