Question: Represent the article for finding a single-sentence TLDR

Question: We introduce simple, efficient algorithms for computing a MinHash of a probability distribution, suitable for both sparse and dense data, with equivalent running times to the state of the art for both cases. The collision probability of these algorithms is a new measure of the similarity of positive vectors which we investigate in detail. We describe the sense in which this collision probability is optimal for any Locality Sensitive Hash based on sampling. We argue that this similarity measure is more useful for probability distributions than the similarity pursued by other algorithms for weighted MinHash, and is the natural generalization of the Jaccard index. MinHashing BID0 is a popular Locality Sensitive Hashing algorithm for clustering and retrieval on large datasets. Its extreme simplicity and efficiency, as well as its natural pairing with MapReduce and key-value datastores, have made it a basic building block in many domains, particularly document clustering BID0 BID1 and graph clustering BID2 BID3.Given a finite set U, and a uniformly random permutation π, the map X → arg min i∈X π(i) provides a representation of any subset X of U that is stable under small changes to X. If X, Y are both subsets of U the well-known Jaccard index BID4 Practically, this random permutation is generated by applying some hash function to each i with a fixed random seed, hence "MinHashing."In order to hash objects other than sets, Chum et al. BID5 introduced two algorithms for incorporating weights in the computation of MinHashes. The first algorithm associates constant global weights with the set members, suitable for idf weighting. The collision probability that is ∑ i∈X∩Y wi ∑ i∈X∪Y wi. The second algorithm computesMinHashes of vectors of positive integers, yielding a collision probability of J W (x, y) = ∑ i min (x i, y i) ∑ i max (x i, y i) Subsequent work BID6 BID8 has improved the efficiency of the second algorithm and extended it to arbitrary positive weights, while still achieving J W as the collision probability. J W is one of several generalizations of the Jaccard index to non-negative vectors. It is useful because it is monotonic with respect to the L 1 distance between x and y when they are both L 1 normalized, but it is unnatural in many ways for probability distributions. If we convert sets to binary vectors x, y, with x i, y i ∈ {0, 1}, then J W (x, y) = J(X, Y). But if we convert these vectors to probability distributions by normalizing them so that x i ∈ {0, As a consequence, switching a system from an unweighted MinHash to a MinHash based on J W will generally decrease the collision probabilities. Furthermore, J W is insensitive to important differences between probability distributions. It counts all differences on an element in the same linear scale regardless of the mass the distributions share on that element. For instance, J W ((a, b, c, 0), (a, b, 0, c)) = J W ((a + c, b), (a, b + c)). This makes it a poor choice when the ultimate goal is to measure similarity using an expression based in information-theory or likelihood where having differing support typically in the worst possible score. For a drop-in replacement for the Jaccard index that treats its input as a probability distribution, we'd like it to have the following properties. 2) Not lower than the Jaccard Index when applied to discrete uniform distributions. 3) Sensitive to changes in support, in a similar way to information-based measures. 4) Easily achievable as a collision probability. J W fails all but the last.1) It isn't scale invariant, J W (αx, y) ̸ = J W (x, y).2) If the vectors are normalized to make it scale invariant, the values drop below the corresponding Jaccard index (equation 1.) 3) It is insensitive to changes in support. 4) Good algorithms exist, but they are non-trivial. Existing work has thoroughly explored improvements to Chum et al.'s second algorithm, while leaving their first untouched. In this work we instead take their first algorithm as a starting point. We extend it to arbitrary positive vectors (rather than sets with constant global weights) and analyze the . In doing so, we find that the collision probability is a new generalization of the Jaccard Index to positive vectors, which we here call J P. DISPLAYFORM0 The names used here, J W and J P, are chosen to reflect how each function interprets x and y, and the conditions under which they match the original Jaccard index. J W treats a difference in magnitude the same as any other difference, so treats vectors as "weighted sets." J P is scale invariant, so any input is treated the same as a corresponding probability distribution. The primary contribution of this work is to derive and analyze J P, and to show that in many situations where the objects being hashed are probability distributions, J P is a more useful collision probability than J W.We will describe the sense in which J P is an optimal collision probability for any LSH based on sampling. We will prove that if the collision probability of a sampling algorithm exceeds J P on one pair, it must sacrifice collisions on a pair that has higher J P.We will motivate J P's utility by showing experimentally that it has a tighter relationship to the JensenShannon divergence than J W, and is more closely centered around the Jaccard index than J W. We will even show empirically that in some circumstances, it is better for retrieving documents that are similar under J W than J W itself (and consequently, sometimes better for retrieving based on L 1 -distance.) Let h: [n] → be a pseudo-random hash mapping every element 1 ≤ i ≤ n to an independent uniform random value in. Over a non-negative vector x, define DISPLAYFORM0 For brevity, we will be using the extended real number system in which 1/∞:= 0. Each term is an exponentially distributed random variable with rate x i, DISPLAYFORM1 so it follows that DISPLAYFORM2 This well known and beautiful property of exponential random variables derives from the fact that DISPLAYFORM3 Proof. Any monotonic transform on DISPLAYFORM4 will not change the arg min, so multiplying each x i by a positive α won't either. H(αx) = H(x). Thus for x i, y i > 0 DISPLAYFORM5 ). ). Consequently, Repeating this process for all i in the intersection yields DISPLAYFORM0 DISPLAYFORM1 Continuing the notational convention, we will refer to hashing algorithms that achieve J P as their pair collision probability as P-MinHashes, and algorithms that achieve J W as W-MinHashes. While J P's expression is superficially awkward, we can aid intuition by representing it in other ways. The simplest interpretation is to view it as a variant of J W. We rewrite J W allowing one input to be rescaled before computing each term, DISPLAYFORM0 j ) and choose the vector α to maximize this generalized J W. If α i x i > y i, increasing α i raises only the denominator. If α i x i < y i, increasing α i raises the numerator more than the denominator. So the optimal α sets α i x i = y i, and in J P.We can derive a more powerful representation by viewing the P-MinHash algorithm itself geometrically. A vector of k + 1 exponential random variables, when normalized to sum to 1, is a uniformly distributed random point on the unit k-simplex. Every point in the unit k-simplex is also a probability distribution over k+1 elements. Using these two facts we can construct the PMinHash as a function of the simplex as illustrated in FIG2.For a probability distribution x, mark the point on the unit simplex corresponding to x, (x 1, . . ., x k+1), and connect it to each of the corners of the simplex. These edges divide it into k + 1 smaller simplices that fill the unit simplex. Each internal simplex has volume proportional to the coordinate of x opposite to its unique exterior face. As a , a uniformly chosen point on the unit simplex will land in one of the sub-simplices with probability given by x. P-MinHashing is equivalent to sampling in this fashion, but holding the chosen point constant when sampling from each new distribution. The match probability is then proportional to the sum of the intersections of simplices that share an external face. This representation makes several properties obvious on small examples that we prove generally in the next section. When MinHashing is used with a key-value store, high collision probabilities are generally more efficient than low collision probabilities, because as we discuss in section VI, it is much cheaper to lower them than to raise them. For this reason, we are interested in the question of the highest collision probability that can be achieved through sampling. The constraint that the samples follow each distribution forces the collision probability to remain discriminative, but given that constraint, we would like to make it as high as possible to maximize flexibility and efficiency. Suppose for two distributions, x and y, we want to choose a joint distribution that maximizes Pr[H(x) = H(y)]. If we were concerned with only these two particular distributions in isolation, the upper bound of Pr[H(x) = H(y)] is given by the Total Variation distance, or equivalently 1 − L 1 (x, y)/2. Meeting this bound requires the probability mass where x exceeds y to be perfectly coupled with the mass where y exceeds x. Both the mass they share and the mass they do not must be perfectly aligned. Rather than just two, we want to create a joint distribution (or coupling) of all possible distributions on a given space where the collision probability for any pair is as high as possible. It is always possible to increase the collision probability of one pair at the expense of another so long as the chosen pair has not hit the Total Variation limit, so the kind of optimality we are aiming for is Pareto optimality. This requires that no collision probability be able to exceed ours everywhere; any gain on one pair must have a corresponding loss on another. This by itself would not be a very consequential bound for its retrieval performance. We really only desire high collision probabilities for items that are similar, and we would happily lower the collision probability of a dissimilar pair to increase it for a similar pair. However we are able to prove something stronger by examining the pair whose collisions must be sacrificed. To increase the collision probability for one pair above its J P, you must always sacrifice collisions on a pair with even higher J P. To get better recall on one pair, you must always give up recall on an even better pair. The Jaccard index itself is optimal on uniform distributions, and the short proof is a model for the general case. Proof. Let Z be the symmetric difference of X and To prove the same claim on J P for all distributions, we need a few tools. We can rearrange J P to separate the two iteration indices within the max. To analyze J P we will need to refer to each term in its outer sum via subscript. DISPLAYFORM0 DISPLAYFORM1 DISPLAYFORM2 We will also use quantifiers in this subscript to indicate a partial sum, i.e. DISPLAYFORM3 Consider two linear combinations of these distributions with coefficients α and β. DISPLAYFORM0 Proof. For a given i, if every max chooses the same side, J P (x, y) i = min(x i, y i). x i /y i has both an arg max and arg min for which this is true. This gives us part 1. DISPLAYFORM1 Thus, we can form x ′, y ′ by merging the mass of x k, x l into one element and y k, y l into one element and have DISPLAYFORM2.. w n be distributions with disjoint support, and consider J P (α · w, β · w). Repeat the merging process until all elements of each w i are merged into one. This gives us.This ordering also lets us work more effectively with the z distributions we constructed in theorem II.1. This lemma contains all the algebra needed for the main proof. DISPLAYFORM3 Working first with the lower group of indices, FIG2, the green regions of x and y could be shifted to overlap more and improve the collision probability of this pair, but any modification that achieves that would worsen at least one of collision probabilities between x or y and z green (both of which have higher collision probability than the (x, y) pair.) DISPLAYFORM4 And since DISPLAYFORM5 we also know that DISPLAYFORM6 which gives us part 1. Now, continuing on to the upper group of indices, DISPLAYFORM7. By noting that the choices within the max are preserved, we conclude part 3. Finally, having bounded all indices, part 4: DISPLAYFORM8 We now have the tools to prove the optimality of J P. DISPLAYFORM9. This implies that no method of sampling from discrete distributions can have collision probabilities dominating J P. J P is Pareto optimal. Furthermore, J P (x, z) ≥ J P (x, y) and J P (y, z) ≥ J P (x, y). To exceed J P (x, y), G must sacrifice at least one pair that is closer under J P than (x, y).Proof. Let m be the number of elements i for which J P (x, y) i < min(x i, y i).In the base case where m = 0, J P (x, y) = ∑ i min(x i, y i) which cannot be improved. Assume the proposition to be proved is true ∀x, ∀y, and ∀p < m. By IV.2.1 we know that m ≤ n − 2, since at least the two endpoints of the sorted list have reached their upper bound. We proceed by induction on m. As in theorem II.1, for each a where DISPLAYFORM10. Reorder i according to the sorting of such that DISPLAYFORM11 ). Now consider a new sampling method, G. The following events are pairwise disjoint by inspection. DISPLAYFORM12 So their probabilities are constrained. DISPLAYFORM13 When these probabilities are given by J P they already sum to 1. DISPLAYFORM14 must be true. Since the two cases are symmetric, we will assume the first one: DISPLAYFORM15 and we are done. Otherwise, DISPLAYFORM16, and the terms i ≥ a must compensate for the loss on the terms i < a, so Pr[DISPLAYFORM17, so these terms have exhausted z a and cannot be increased. Using IV.3.1 and IV.3 we know that this adds at least one additional term that is fully consumed, i.e. the size of {i :, z). By IV.3 we know that J P (x, z a) ≥ J P (x, y) and by induction we know J P (x, z) ≥ J P (x, z a), so we conclude J P (x, z) ≥ J P (x, y) and symmetrically J P (y, z) ≥ J P (x, y). FIG5 shows the mechanism of the proof intuitively. On three element distributions, two of the elements are fully constrained, in this case the blue and red terms, so we construct our adversarial z around green. On three elements, no induction is necessary and the diagram itself proves the relationship. DISPLAYFORM18 Since J P is only Pareto optimal, we should be able to find a sampling method that exceeds it for some pairs but is below it on others. We can generalize our algorithm to construct such a method. Consider arranging the elements of the state space as the leaves of a tree. Internal nodes in the tree are given the weight of the sum of their children, and each is assigned its own exponential hash. Perform P-MinHash among the children of the root node. If the selected node is a leaf, emit it as the sample. If it is an internal node, recurse and repeat. In this generalization, our original algorithm is represented by making all elements direct children of the root. We can prioritize collisions on an index i by placing it closer to the root node than all others; in particular, the tree FIG2 ). Since i and its internal-node sibling form a two element distribution, by lemma 3 the probability of a collision on i will be min(x i, y i) for all x, y. What of J W then? Is it another Pareto optimum? It is not, it is dominated by J P. Proof. The lower bound becomes clear by rewriting J W in a similar form to J P. DISPLAYFORM19 To achieve this lower bound, we can transform the distributions by moving the "excess" mass to new elements. DISPLAYFORM20 Shifting the mass in this way has no effect on J W, but it decreases J P to equal J W. x ′ and y ′ can be expressed as linear combinations over the three sets of indices, so using lemma IV.2.2, DISPLAYFORM21 To achieve the upper bound, 1 − p, consider inverting this transformation, reallocating the p extra mass to maximize J P (x ′′, y ′′) while holding J W (x ′′, y ′′) constant. To avoid increasing J W, we must add the mass to disjoint elements, so divide the indices into two sets, X, Y. We find that if we distribute the mass proportional to the original value, J P reaches the total variation limit regardless of the choice of X, Y. Let |X|:= ∑ i∈X min(x i, y i). DISPLAYFORM22 We can express this as a linear combination of two distributions with disjoint support. DISPLAYFORM23 Since p is the total variation distance of x and y, 1 − p is the maximum collision probability that is possible between two distributions in any context, so it is the upper bound here as well. This gives us some insight into how J P and J W differ. J P ranks distributions as more similar than J W if their extra mass is on elements that both distributions share. Like 1 − J W, 1 − J P is a metric on probability distributions. Theorem IV.6. 1 − J P is a proper metric on P where P(Ω) is the space of probability distributions over a finite set Ω.Proof. Symmetry is obvious. Non-degeneracy over P follows from DISPLAYFORM24 The triangle inequality follows from being a collision prob- DISPLAYFORM25 for any distribution z. But by the union bound, DISPLAYFORM0 The algorithm we've presented so far is suitable for sparse data such as documents or graphs. It is linear in the number of non-zeros, equivalent to Ioffe 2010 BID6. On dense data (such a image feature histograms BID7) there's significant overlap in the supports of each distribution, so rehashing each element for every distribution wastes Algorithm 2: Dense and Continuous P-MinHash. "Global-Bound" A* Sampling BID9 with a fixed seed.input: sample space Ω, sigma-finite measure µ, proposal sigma-finite measure λ, finite upper bound, B:= max(µ(i)/λ(i)) shared random seed s output: Stable sample from (Ω, F, µ) DISPLAYFORM0 work. With a shared stream of sorted hashes, we expect the hash we select for each distribution to be biased towards the beginning of the stream, and closer to the beginning when the data is denser. Therefore one might expect that we could improve performance by searching only some prefix of the stream to find our sample. A* Sampling (Maddison, Tarlow, and Minka 2014 BID9) explores this idea thoroughly, and we lean on it heavily in this section. In particular, we use their "Global Bound" algorithm, and essentially just run it with a fixed random seed (algorithm 2.) We leave the proof of running time and of correctness as a sampling method to that work, and limit our discussion to the proof of the ing collision probability. (Their derivation uses Gumbel variables and maxima. We use exponential variables and minima to make the continuity with the rest of our work clear, which is achieved by a simple change of variables.)The key insight of A* Sampling is that when a (possibly infinite) stream of independent exponential random variables is ordered, the exact marginal distributions of each variable can be computed as a function of the rank and the previous variables. If the vector of sorted exponential variables is e with corresponding parameter vector x, then once e 1,..., e k−1 are all known, the distribution of e k is a truncated exponential with rate |x \ ∪ k i=1 x i | truncated from below at e k−1. The "statelessness" of exponential variables makes this truncation easy to accomplish. Simply generate the desired exponential, and add e k−1 to shift it. To change the parameters of those exponentials and find the new minimum element, only a small prefix of the list must be examined. The running time of finding the new minimum is a function of the difference between the two vectors of parameters, and has equivalent running time to rejection sampling. This gives algorithm 2 equivalent running time to the state of the art for computing a MinHash of dense data, Shrivastava 2016 BID7. Because algorithm 2 admits an unbounded list of random variables, it is also applicable to continuous distributions, as the paper BID9 describes in detail. Let's first show that algorithm 2 gives J P (µ, ν) when Ω is finite. Indeed, this construction is simply an alternative way of finding the minimum − log U i /µ i. A* sampling merely reads off the minimum of − log U i /λ i * λ i /µ i = − log U i /µ i, and similar for ν. To prove the general case for infinite Ω, we need to first define what we mean by J P (µ, ν) in that setting. One option is to replace all the summation by integrals in the formula BID1. This runs into two difficulties however: 1) A probability space Ω may not be a subset of R n. 2) Either µ or ν could be singular. Instead, we define it as a limit over increasingly finer finite partitions of Ω. More formally, Definition V.1. Assume J P (µ, ν) is defined as before when |Ω| < ∞, we define DISPLAYFORM1 where F ranges over finite partitions of the space Ω, and µ F denotes the push-forward of µ with respect to the map π: Ω → F, π(x) = Q ∈ F iff x ∈ Q. (µ F is simply a coarsified probability measure on the finite space F where it (tautologically) assigns probability µ(Q) to the element Q ∈ F.)First we verify that the definition above coincides with J P when Ω is finite. DISPLAYFORM2, with strict inequality if both µ, ν have nonzero masses on those two elements. Proof. By considering J P (µ, ν) as the probability that the argmin's of two lists of independent exponentials land on the same index 1 ≤ i * ≤ n, and using the fact that the minimum of two independent exponentials is an exponential with the sum of the parameters, we can couple the four argmin's arising from µ, ν, µ ′, ν ′ and conclude by inspection. The lemma shows that any partition of Ω will lead to a J P that's greater than or equal to the original J P. So the infimum is achieved with the most refined partition, namely Ω itself. J P Jensen−Shannon Divergence DISPLAYFORM3 count Fig. 3: The Jensen-Shannon divergence compared with J P and J W on pairs of normalized unigram term vectors of random web documents. JSD has a much tighter relationship with J P than J W. We show exact bounds for J W against JSD and approximate bounds for J P against JSD where DISPLAYFORM4 The curve that appears to lower bound JSD against J P is violated on 10 −7 of the pairs. The left graph shows the joint distribution of J P and J W and the bounds we prove. The right graph shows the conditional distributions of J P and J W against the (set) Jaccard index of the terms. We show the distribution of the log of their ratios against the Jaccard index and highlight the median. J P is generally centered around the Jaccard index, while J W is consistently centered below, as predicted by their behavior on uniform distributions. Finally we show that A* sampling applied to µ and ν simultaneously has a collision probability equal to J P (µ, ν) as defined above. Theorem V.3. Given two probability measures µ and ν on an arbitrary Polish space Ω, both absolutely continuous with respect to a common third measure λ, it is possible to apply A* sampling with base distribution λ, either in-order or with a hierarchical partition of Ω, to sample from µ and ν simultaneously. Further, the probability of the procedure terminating at the same point p ∈ Ω for both µ and ν is exactly J P (µ, ν).Proof. The first statement follow from the procedural definition of A* sampling described in BID9. For the second statement, since in-order A* is proven equivalent to hierarchical partition A* in BID9, we are free to choose any partition to our convenience. The natural choice is then the partition used in the definition of J P (µ, ν).More precisely, we know there is a finite partition: Precision/recall curves illustrating the typical case of retrieval using a key-value store. Each point represents outputting o independent sums of a hashes each, for a collision probability of 1 DISPLAYFORM5 DISPLAYFORM6 The cost in storage and CPU is dominated by o, so we connect these points to show the trade-offs possible at similar cost.representative of each part Q ∈ F are jointly distributed as exponentials with rate λ(Q) with common seed. Let U, V be the two coupled A* processes restricted to F. Either one of them does not terminate, or they both terminate and collide conditionally with probability J P (µ F, ν F). In other words, letting P(T) be the probability that both terminate at F level, and AC(U, V ; F) be the collision probability of U, V restricted to F, then AC(U, V ; DISPLAYFORM7 So AC(U, V ; F) is squeezed between J P (µ, ν)P(T) and J P (µ, ν) + ϵ. Since P(T) → 1 and ϵ → 0 under a refinement sequence F, we get in the limit DISPLAYFORM8 To determine whether the difference between J P and J W matters in practice and whether achieving J P as a collision probability is a useful goal, we computed both for a large sample of pairs of unigram term vectors of web documents. From an index of 6.6 billion documents, we selected pairs using a sum of 2 W-MinHashes to perform importance sampling. We computed several similarity scores for 100 million pairs of normalized unigram term vectors, and weighted them by the inverse of their sampling probability to simulate an unbiased sample of all non-zero pairs. The Jensen-Shannon divergence (JSD) defines the information loss that from representing two distributions using a model that is an equal mixture of them, and as such is the ideal criterion to form informationpreserving clusters of items of equal importance. Like both J W and J P it is bounded, symmetric, and monotonic in a metric distance. Due to these properties, as well as its popularity, we use it here as a basis for comparison. J P has a much tighter relationship with the JensenShannon divergence than J W as shown in figure 3. Tight bounds on JSD as a function of J W are given by J W's monotonic relationship with Total Variation, as described by BID10. Let p be the total variation distance, and d(p) = = p extends these to J W. These same bounds apply to J P as well, but J P has a much tighter relationship with what appears to be a much higher lower bound. We have approached finding this lower bound with large differential equations that we have only solved numerically, but small examples form good approximate bounds. On 2 element distributions, JSD has a direct relationship with J P, and only 1 × 10 −7 of the pairs fall below the ing curve, d(1 − J P). No pairs in our sample had JSD more than 0.0077 below it. In contrast, J W puts 7 × 10 −3 of the pairs below this curve, with the farthest point 0.16 below. We also compare both J P and J W to the Jaccard index of the set of terms, and compute a kernel density estimate of the log of their ratios. J P is generally centered around the Jaccard index, while J W is consistently centered below, as predicted by their behavior on uniform distributions. This makes P-MinHash less disruptive as a drop-in replacement for an unweighted MinHash. Parameters of the system such as the number of hashes or the length of concatenated hashes are likely to continue to function well. In the typical case of retrieval using a key-value store, performance is characterized by cheap ANDs and expensive ORs. BID11 To reduce the collision probability we can sum multiple hashes to form keys, but to raise the collision probability, we must output multiple independent keys. This lets us apply an asymmetric sigmoid to the collision probabilities, DISPLAYFORM0 with o independent outputs of a summed hashes each. Assuming that the cost of looking up hashes dominates the cost of generating them, ANDs are essentially free, while CPU and storage cost are both linear in the number of ORs. Furthermore, as a increases linearly, o must increase exponentially to keep the inflection point of the sigmoid in the same place. For instance, if the sigmoid passes through (0.5, 0.5), then o ≈ log2 a. This gives a significant performance advantage to algorithms with higher collision probabilities, and thus to J P over J W. Lowering the probability is much cheaper than raising it. The effect of this is demonstrated in FIG6. Unsurprisingly from the tightness of the joint distribution, PMinHash achieves better precision and recall retrieving low JSD documents for a given cost. More surprising is that it also achieves slightly better precision and recall on retrieving high J W documents when the cost is low, even though this is the task W-MinHashes are designed for. The reason for this can be seen from the upper bound, J P ≤ 2J W /(1 + J W). On items that achieve this bound, the collision probability when summing two hashes, (2x/(1+x)) 2, is similar to 4x 2 near 0 and similar to x near 1. This in effect gives it the recall of 1 hash with the precision of 2 hashes on this subset of items, and thus a better precision/recall trade-off overall. We've described a new generalization of the Jaccard index, and shown several qualities that motivate it as the natural extension to probability distributions. In particular, we proved that it is optimal on all distributions in the same sense that the Jaccard index is optimal on uniform distributions. We've demonstrated its utility by showing J P's similarity in practice to the Jensen-Shannon divergence, a popular clustering criterion. We've described two MinHashing algorithms that achieve this as their collision probability with equivalent running time to the state of the art on both sparse and dense data.

Represent the TLDR for finding the corresponding scientific article

The minimum of a set of exponentially distributed hashes has a very useful collision probability that generalizes the Jaccard Index to probability distributions.

represent the short summary for finding the corresponding scientific article (long)

Fewshot example: "Explaining Multivariate Time Series Models by finding important observations in time using Counterfactuals" == "We propose a method to automatically compute the importance of features at every observation in time series, by simulating counterfactual trajectories given previous observations. We define the importance of each observation as the change in the model output caused by replacing the observation with a generated one. Our method can be applied to arbitrarily complex time series models. We compare the generated feature importance to existing methods like sensitivity analyses, feature occlusion, and other explanation baselines to show that our approach generates more precise explanations and is less sensitive to noise in the input signals. Multi-variate time series data are ubiquitous in application domains such as healthcare, finance, and others. In such high stakes applications, explaining the model outcome is crucial to build trust among end-users. Finding the features that drive the output of time series models is a challenging task due to complex non-linear temporal dependencies and cross-correlations in the data. The explainability problem is significantly exacerbated when more complex models are used. Most of the current work in time series settings focus on evaluating globally relevant features ). However, often global feature importance represents relevant features for the entire population, that may not characterize local explanations for individual samples. Therefore we focus our work on individualized feature importance in time series settings. In addition, besides identifying relevant features, we also identify the relevant time instances for those specific features, i.e., we identify the most relevant observations. To the best of our knowledge this is the first sample-specific feature importance explanation benchmark at observation level for time series models. In this work, we propose a counterfactual based method to learn the importance of every observation in a multivariate time series model. We assign importance by evaluating the expected change in model prediction had an observation been different. We generate plausible counterfactual observations based on signal history, to asses temporal changes in the underlying dynamics. The choice of the counterfactual distribution affects the quality of the explanation. By generating counterfactuals based on signal history, we ensure samples are realistic under individual dynamics, giving explanations that are more reliable compared to other ad-hoc counterfactual methods. In this section we describe our method, Feed Forward Counterfactual (FFC), for generating explanation for time series models. A feature is considered important if it affects the model output the most. In time series, the dynamics of the features also change over time, which may impact model outcome. As such it is critical to also identify the precise time points of such changes. In order to find important observations for highdimensional time series models, we propose to use a counterfactual based method. Specifically, (a) (b) FFC procedure: CounterfactualXt is generated using signal history. We look into the difference of the original output yt andŷ (i,t) where observation x (i,t) is replaced with a counterfactual. we assign importance to an observation x i,t (feature i at time t) based on its effect on the model output at time T (> t). We replace observation x i,t with a counterfactualx i,t, to evaluate this effect. Figure 1 demonstrates how importance of a feature is characterized by replacing an observation with a counterfactual. Multi-variate time series data is available in the form of X (n) ∈ R d×T (where d is the number of features with T observations over time) for n ∈ [N] samples. We are interested in black-box estimators that receive observations up to time t, x t ∈ R d, and generate output y t at every time point t ∈ [T]. F denotes the target black-box model we wish to explain through the proposed approach called FFC. For exposition, throughout the paper, the index n over samples has been dropped for notational clarity. We index features with subscript i. x −i,t indicates features at time t excluding feature i. The notation used for exposition work is briefly summarized in Table 1. Observed outcome of the black-box model F, at time t Generative Model and Estimator Gi: Latent encoding of history up to t Table 1: Notation used in the paper. We assign importance score to each observation x i,t for t ∈ [T] and i ∈ [d], following the definition: Definition 1. Feature Importance: The importance of the observation i at time t, denoted by Imp(i, t) is defined as E p(xi,t|X0:t−1) [|F(X 0:t) − F(X 0:t−1, x −i,t,x i,t)|], where | · | denotes the absolute value andx i,t is the counterfactual sample. That is, the importance of an observation for feature i at time t is defined as the change in model output when the observation is replaced by a generated counterfactual. The counterfactual observation can come from any distribution, however the quality of the counterfactual random variable directly affects the quality of the explanation. We generate the counterfactual sample conditioned on signal history up to time t by sampling from the distribution p(x i,t |X 0:t−1). Using a conditional generator guarantees that our counterfactuals are sampled not only within domain but also specifically likely under the individual sample X (n), as opposed to having a generator that models data across population. Conditioning on the history also allows us to learn the dynamics of the signal and therefore generate a plausible counterfactual given the past observations. p(x t |X 0:t−1) represents the distribution at time t, if there were no change in the dynamics of the signals. The counterfactualx i,t is sampled from the marginal distribution p(bx i,t |X 0:t−1), obtained from p(x t |X 0:t−1). Let F(X 0:t−1, x −i,t,x i,t) be the output of the model at time T, when x i,t is replaced by the generated counterfactualx i,t. We estimate feature importance Imp(i, t) as E p(xi,t|X0:t−1) [|F(X 0:t) − F(X 0:t−1, x −i,t,x i,t)|], summarized in figure 2(b). Our proposed method has the following compelling properties in explaining the estimator F: Time Importance (TI) For every time series, highlighting relevant time events for different features is important for actionability of the explanations. For instance in a clinical setting, just knowing a feature like heart rate is relevant, is not sufficient to intervene -it is also important to know when a deterioration had happened. With FFC, the most eventful time instances can be obtained as: We can thus rank time instances in order of importance. That is, time t 1 t 2, if Feature Importance (FI) At any time instance t, our method assigns importance to every feature of x i,t. The magnitude of our importance function reflects relative importance. Comparing the importance values across features gives the flexibility to report a subset of important features at each time point t and also reflects the correlation between various features of the time series. We approximate the conditional distribution of p(x t |X 0:t−1) using a recurrent latent variable generator model G, introduced in. The architecture we use is provided in Figure 2(a). The conditional generator G models p(x t |z t−1) where z t−1 ∈ R k is the latent representation of history of the time series up to time t. The latent representation is a continuous random variable, modeling the distribution parameters. We only use past information in the time series to reflect temporal dependencies. Using the recurrent structure allows us to model a non-stationary generative model that can also handle varying length of observations. Implementation details of the generator are in the Appendix. Our counterfactuals are not derived by looking at future values which could be done for reliable imputation. Counterfactuals should represent the past dynamics. Note that our derived feature importance is limited by the quality of imputation that may have been utilized by the black-box risk predictor. For experimental evaluation on the effect of generator specifications on counterfactuals and the quality of explanations, see Section 4.1. The proposed procedure is summarized in Algorithm 1. We assume that we are given a trained block box model F, and the data (without labels) it had been trained on. Using the training data, we first train the generator that generates the conditional distribution, (denoted by G). In our implementation we model x as a multivariate Gaussian with full covariance to model all existing correlation between features. The counterfactualx i,t is then sampled from G and passed to the black-box model to evaluate the effect on the black-box outcome. A common method of explaining model performance, in time-series deep learning, is via visualization of activations of latent layers (; ;) Return Importance_M atrix sensitivity analysis . Understanding latent representations, sensitivity and its relationship to overall model behavior is useful for model debugging. However, these but are too refined to be useful to the end users like clinicians. Attention models (; ;) are the most commonly known explanation mechanisms for sequential data. However, because of the complex mappings to latent space in recurrent models, attention weights cannot be directly attributed to individual observations of the time series . To resolve this issue to some extent, propose an attention model for mortality prediction of ICU patients based on clinical visits. However attention weights may not be consistent as explanations . In vision, prior works tackle explainability from the counterfactual perspective, finding regions of the image that affect model prediction the most. assumes higher importance for inputs that when replaced by an uninformative reference value, maximally change the classifier output. A criticism to such methods is that they may generate out-of-distribution counterfactuals, leading to unreliable explanations. address this issue for images using conditional generative models for inpainting regions with realistic counterfactuals. Evaluating sample based feature importance remains largely unstudied for time series models. While more widely studied for image classification, these methods cannot be directly extended to time series models due to complex time-series dynamics. Most efforts in this domain focus on population level feature importance . is one of the few methods addressing sample based feature importance and use a method similar to , called "feature occlusion". They replace each time series observation by a sample from uniform noise to evaluate its effect on model outcome to attribute feature importance. We argue that carefully choosing the counterfactual selection policy is necessary for derive reliable importances. Specifically, replacing observations with noisy out-of-domain samples can lead to arbitrary changes to model output that are not reflective of systematic behavior in the domain. Even if an observation is sampled from the domain distribution, it does not characterize temporal dynamics and dependencies well enough, potentially highlighting features that only reflect global model behavior, as opposed to sample specific feature importance. We therefore model the data-distribution in order to generate reliable counterfactuals. We demonstrate the implications of the choice of the generator (and hence the counterfactuals) on the quality of explanation. We evaluate our explainability method for finding important features in time series on 2 simulated datasets and 2 real datasets. Our goal is two-fold a) comparison to existing feature importance baselines in time series and b) evaluating the choice of generators on the quality of counterfactuals and explanations. We compare to existing feature importance baselines described below: 1. Feature Occlusion (FO) : Method introduced in. This method is an ad-hoc approach for generating counterfactuals. When replacing x i,t with a random sample from the uniform distribution, the change in model output defines the importance for x i,t. We augment the method introduced in by sampling counterfactuals from the bootstrapped distribution over each feature. This avoids generating out-of-distribution samples. 3. Sensitivity Analysis (SA): This method evaluates the sensitivity of the output to every observation, by taking the derivative of y t with respect to x i,t, at every time point. 4. LIME : One of the most commonly used explainabilty methods that assigns local importance to features. Although LIME does not assign temporal importance, for this baseline, we use LIME at every time point to generate feature importances. Evaluating the quality of explanations is challenging due to the lack of a gold standard/ground truth for the explanations. Additionally, explanations are reflective of model behavior, therefore such evaluations are tightly linked to the reliability of the model itself. Therefore we created the simulated environment in order to test our method. In this experiment, we simulate a time series data such that only one feature determines the outcome. Specifically, the outcome (label) changes to 1 as soon as a spike is observed in the relevant feature. We keep the task fairly simple for two main reasons: 1) to ensure that the black-box classifier can indeed learn the right relation between the important feature and the outcome, which allows us to focus on evaluating the quality of the explanations without worrying about the quality of the classifier. 2) to have a gold standard for the explanations since the exact important event predictive of the outcome are known. We expect the explanations to assign importance only to the one relevant feature, at the exact time of spike, even in the presence of spikes in other non-relevant features. To simulate these data, we generate d = 3 (independent) sequences as a standard non-linear auto-regressive moving average (NARMA) time series of the form:, where the order is 2 and u ∼ Normal(0, 0.01). We add linear trends to the features and introduce random spikes over time for every feature. Note that since spikes are not correlated over time, no of the generators (used in FFC, AFO, FO) will learn to predict it. The important feature in this setting is feature 1. The complete procedure is described in Appendix A.2.1. We train an RNN-based black-box model on this data, ing in AUC= 0.99 on the test set. Figure 7 demonstrates explanations of each of the compared approaches on simulated data for 2 test samples. As shown in Figure 7 (a), Sensitivity analysis does not pick up on the importance of the spike. Feature occlusion gives false positive importance to spikes that happen in non-important signals as well as the important one. Augmented feature occlusion resolves this problem since it samples the counterfactuals from the data distribution, however, it generates noisier as it samples from the bootstrap distribution. The proposed method (FFC) only assigns importance to the first feature at the time of spike. Hence, FFC generates fewer false relevance scores. Note that all baseline methods provide an importance for evry sample at every time point. The true explanation should highlight feature 1 at time points of spike. Using this ground truth, we evaluate the AUROC and AUPRC of the generated explanations denoted by (exp). II, we also show in the third column that the log-probabilities of our counterfactuals are higher under the true distribution. The first simulation does not necessarily evaluate feature importance under complex state dynamics as is common in applications. In this simulation, we create a dataset with complex dynamics with known ground truth explanations. The dataset consists of multivariate time series signals with 3 features. A Hidden Markov Model with 2 latent states, with linear transition matrix and multivariate normal emission probabilities is used to simulate observations. The the outcome y is a random variable, which, in state 1, is only affected by feature 1 and in state 2, only affected by feature 2. Also, we add non-stationarity to the time series by modeling the state transition probabilities as a function of time. The ground truth explanation for output at time T is the observation x i,t where i is the feature that drives the output in the current state and t indicates when feature i became important. In a time series setting, a full explanation for outcome at t = T should include the most important feature variable as well as the time point of importance (here state change). Figure 4 demonstrates assigned importance for a time series sample. The shaded regions indicate the top 5 important observations (x i,t) for each method, the color indicating the corresponding feature i. AFO, FO and FFC are able to learn the state dynamics and are able to find the important feature of each state. However, the top importance values in AFO and FO do not correspond to the important time points. Only in FFC, the top important observations are indicative of state changes. Table 2 shows the performance compared to ground-truth explanations for this data. As mentioned earlier, the quality of explanations rely on the quality of the counterfactuals. The counterfactuals should reflect the underlying latent dynamics for an individual sample. Counterfactuals under the marginal (as used by AFO) need not be likely for a specific sample. The conditional distribution we use, on the other hand, models the underlying characteristic of an individual sample, while the marginal is an average over the population. Counterfactuals unlikely under an individual patient's dynamics can in inaccurate importance assignments since they can potentially overestimate the change in model outcome significantly. We demonstrate this by evaluating the log probability of the counterfactual under the true generator distribution p * (x t |X 0:t−1). Results are summarized in Table 2, Column 3. Since we simulate data using an HMM, we can analytically derive the distribution p * (x i,t |X 0:t−1). Details of the derivation are included in Appendix A.2.1. Following the procedure in Algorithm 1, we train a conditional generators for non-static time series features. We compare across all four existing methods by visualizing importance scores over time. Figure 5 shows an example trajectory of a patient and the predicted outcome. We plot the importance score over time for top 3 signals, selected by each method. Shaded regions in bottom four rows indicate the most important observations, color representing the feature. As shown in Figure 5, counterfactual based methods mostly agree and pick the same signals as important features. We further evaluate this by looking into accordance scores among methods, indicating the percentage of agreement. This analysis is provided in the Appendix A.3, and the heat map in Figure 10 demonstrates the average score across test samples. However, the methods don't agree on the exact time importance. As we observe in Figure 5 and other patient trajectories, FFC assigns importance to observations at the precise times of signal change. This is exactly as expected from the method. The FFC counterfactual is conditioned on patient history and thus the counterfactual represents an observation assuming a patient had not change state. Since evaluation of explanations can be subjective, we also use intervention information present in patient records to evaluate clinical applicability across baselines. Clinicians intervene with a medication or procedure when there is a notable, adverse change in patient trajectory. Therefore, picking up the most relevant features before an intervention onset is indicative of clinical validity of the method. While we cannot directly associate an intervention with a specific cause (observation), we look at the overall distribution of signals considered important by each of the methods, prior to intervention onset. Figure 6 shows these histograms for a number of interventions. We see consistent This experiment evaluates the utility of our method for attributing importance to GHG tracers across different locations in California. The GHG data consists of 15 time series signals from 2921 grid cells. A target time series is a synthetic signal of GHG concentrations. We use an RNN model to estimate GHG concentrations using all tracers. Evaluating which tracers are most useful in reconstructing this synthetic signal can be posed as a feature importance problem for weather modeling over time. In order to quantitatively evaluate the proposed method on real data, we evaluate how well the method performs at selecting globally relevant methods as a proxy. We aggregate the importance of all features over time (and training samples) and retrain the black-box by i) removing top 10 relevant features as indicated by each method ii) using top 3 relevant features only. The performance summary is provided in Table 3 suggesting that among methods that derive instance wise feature importance over time, FFC also generates reasonable global relevance of features. Results for both MIMIC-III and GHG datasets are summarized in We additionally evaluate the quality of the proposed FFC method using the randomization tests proposed as'Sanity Checks' in. Two randomization tests are designed to test for sensitivity of the explanations to i) the black-box model parameters using a model parameter randomization test, and ii) sensitivity to data labels using a using a data randomization test. We conduct this evaluation for Simulation Data II. This test evaluates how different explanations are when the black-box model is trained on permuted labels (breaking the correlation between features and output label). If explanations truly rely on the output labels, as suggested in our definition, then the explanation quality should differ significantly when a model trains on permuted labels. We evaluate the drop in the AUROC and AUPRC of the generated explanations compared to the ground truth. This test evaluates how different explanation quality is when the parameters of the model are arbitrarily shuffled. Significant differences in generated explanations suggests the proposed method is sensitive to black-box model parameters. , these tests are conducted for saliency map methods for images by evaluating the distance between saliency maps for different randomizations. The are included for Simulated Data II, measured with AUROC and AUPRC as ground-truth explanations are available. The of both tests are included in Table 4. They indicate the drops in explanation performance for both randomization tests. The performance of the model used for model randomization test drops to 0.52 AUROC as opposed to 0.95 for the original trained model on this simulated task (Simulation Data II). For data randomization, performance of the model drops to 0.62 from 0.95 in terms of AUROC. AUROCs and AUPRCs for FFC drop the most, suggesting the FFC explanation method is sensitive to perturbations in output labels (as tested by the data randomization test) and to randomization in model parameters. Significant deterioration compared to explanation performance in Table 2 (for Simulation Data II) indicates that the proposed method passes the sanity checks. We propose a new definition for obtaining sample-based feature importance for high-dimensional time series data. We evaluate the importance of each feature at every time point, to locate highly important observations. We define important observations as those that cause the biggest change in model output had they been different from the actual observation. This counterfactual observation is generated by modeling the conditional distribution of the underlying data dynamics. We propose a generative model to sample such counterfactuals. We evaluate and compare the proposed definition and algorithm to several existing approaches. We show that our method is better at localizing important observations over time. This is one of the first methods that provides individual feature importance over time. Future extension to this work will include analysis on real datasets annotated with feature importance explanations. The method will also be extended to evaluate change in risk based on most relevant subsets of observations. A.1 SIMULATED DATA I To simulate these data, we generate d = 3 (independent) sequences as a standard non-linear autoregressive moving average (NARMA) time series. Note also that we add linear trends to features 1 and 2 of the form: x(t + 1) = 0.5x(t) + 0.5x(t) l−1 i=0 x(t − l) + 1.5u(t − (l − 1))u(t) + 0.5 + α d t for t ∈, α > 0 (0.065 for feature 2 and 0.003 for feature 1), and where the order l = 2, u ∼ Normal(0, 0.03). We additionally add linear trends to features. We add spikes to each sample (uniformly at random over time) and for every feature d following the procedure below: where κ > 0 indicates the additive spike. The label y t = 1 ∀t > t 1, where t 1 = min g d, i.e. the label changes to 1 when a spike is encountered in the first feature and is 0 otherwise. We sample our time series using the python TimeSynth 1 package. Number of samples generated: 10000 (80%,20% split). The output y t at every step is assigned using the logit in 3. Depending on the hidden state at time t, only one of the features contribute to the output and is deemed influential to the output. The true conditional distribution can be derived using the forward algorithm as follows: where, where p(s t−1 |X 0:t−1) is estimated using the forward algorithm. Our generator G i is trained using an RNN (GRU). We model the latent state z t with a multivariate Gaussian with diagonal covariance and observations with a multivariate Gaussian with full covariance. The counterfactual for observation i at time t can now be sampled by marginalizing over other features at time t. i.e, x i,t ∼ x−i p(x|X 0:t−1). Feature selection and data processing: For this experiment, we select adult ICU admission data from the MIMIC dataset. We use static patients' static, vital measurements and lab for the analysis. The task is to predict 48 hour mortality based on 48 hours of clinical data, therefor we remove samples with less than 48 hours of data. Parameter Settings for conditional Generator: The recurrent network with specifications show in 8 learns a hidden latent vector h t representing the history. h t is then concatenated with x −i,t and fed into a non-linear 1-layer MLP to model the conditional distribution p(x i, t|X 0:t−1). Additional importance plots are provided in Figure 9. Adam (learning rate = 0.0001, β 1 = 0.9, β 2 = 0.999, weight decay = 0) Accordance testing: For this test we look into how much different baselines agree on important feature assignment. As we observed from the experiments, counterfactual methods mostly agree on the most important features for individual samples. We define accordance score between 2 methods as the percentage of top n signals both identified as important. A score of 80 means on average over the test data, 80 of the assignments were similar. This is depicted in Figure 10. In this section we compare the run-time across multiple baselines. Table 9 shows inference runtime for all the baseline methods on a machine with Quadro 400 GPU and Intel(R) Xeon(R) CPU E5-1620 v4 @ 3.50GHz CPU. The runtime for the counterfactual approaches (FFC, FO and AFO) depends only on the length of the time series. It is also the case for FFC since the conditional generator models the joint distribution of all features. This is an advantage, over approaches like LIME, the runtime depends both on the length of the signal as well as the number of features. Overall, FFC performs reasonably compared to ad-hoc counterfactual approaches, since inference on the RNN conditional generator is efficient. This is one of the reasons that the RNN generator model is used to approximate the conditional distribution. Table 9: Run-time for simulated data and MIMIC experiment. Parameter Settings for Generator: The settings are provided in Table 10. Figure 11 shows the training loss of black-box that was used to present feature important in Section 4.4."

We prove that for a large class of functions f there exists an interval certified robust network approximating f up to arbitrary precision.


Question: Represent the text to find a very short summary (1-2 sentences max)

Question: Recently, progress has been made towards improving relational reasoning in machine learning field. Among existing models, graph neural networks (GNNs) is one of the most effective approaches for multi-hop relational reasoning. In fact, multi-hop relational reasoning is indispensable in many natural language processing tasks such as relation extraction. In this paper, we propose to generate the parameters of graph neural networks (GP-GNNs) according to natural language sentences, which enables GNNs to process relational reasoning on unstructured text inputs. We verify GP-GNNs in relation extraction from text. Experimental on a human-annotated dataset and two distantly supervised datasets show that our model achieves significant improvements compared to the baselines. We also perform a qualitative analysis to demonstrate that our model could discover more accurate relations by multi-hop relational reasoning. Recent years, graph neural networks (GNNs) have been applied to various fields of machine learning, including node classification BID10, relation classification BID22, molecular property prediction BID6, few-shot learning BID5, and achieve promising on these tasks. These works have demonstrated GNNs' strong power to process relational reasoning on graphs. Relational reasoning aims to abstractly reason about entities/objects and their relations, which is an important part of human intelligence. Besides graphs, relational reasoning is also of great importance in many natural language processing tasks such as question answering, relation extraction, summarization, etc. Consider the example shown in Fig. 1, existing relation extraction models could easily extract the facts that Luc Besson directed a film Léon: The Professional and that the film is in English, but fail to infer the relationship between Luc Besson and English without multi-hop relational reasoning. By considering the reasoning patterns, one can discover that Luc Besson could speak English following a reasoning logic that Luc Besson directed Léon: The Professional and this film is in English indicates Luc Besson could speak English. However, most existing GNNs can only process multi-hop relational reasoning on pre-defined graphs and cannot be directly applied in natural language relational reasoning. Enabling multi-hop relational reasoning in natural languages remains an open problem. To address this issue, in this paper, we propose graph neural networks with generated parameters (GP-GNNs), to adapt graph neural networks to solve the natural language relational reasoning task. GP-GNNs first constructs a fully-connected graph with the entities in the sequence of text. After that, it employs three modules to process relational reasoning: an encoding module which enables edges to encode rich information from natural languages, a propagation module which propagates relational information among various nodes, and a classification module which makes predictions with node representations. As compared to traditional GNNs, GP-GNNs could learn edges' parameters from natural languages, extending it from performing inferring on only non-relational graphs or graphs with a limited number of edge types to unstructured inputs such as texts. In the experiments, we apply GP-GNNs to a classic natural language relational reasoning task: relation extraction from text. We carry out experiments on Wikipedia corpus aligned with Wikidata knowledge base BID25 Figure 1: An example of relation extraction from plain text. Given a sentence with several entities marked, we model the interaction between these entities by generating the weights of graph neural networks. Modeling the relationship between "Léon" and "English" as well as "Luc Besson" helps discover the relationship between "Luc Besson" and "English".model outperforms other state-of-the-art models on relation extraction task by considering multihop relational reasoning. We also perform a qualitative analysis which shows that our model could discover more relations by reasoning more robustly as compared to baseline models. Our main contributions are in two-fold: We extend a novel graph neural network model with generated parameters, to enable relational message-passing with rich text information, which could be applied to process relational reasoning on unstructured inputs such as natural languages. We verify our GP-GNNs in the task of relation extraction from text, which demonstrates its ability on multi-hop relational reasoning as compared to those models which extract relationships separately. Moreover, we also present three datasets, which could help future researchers compare their models in different settings. GNNs were first proposed in BID21 and are trained via the Almeida-Pineda algorithm BID1. Later the authors in BID12 replace the Almeida-Pineda algorithm with the more generic backpropagation and demonstrate its effectiveness empirically. BID6 propose to apply GNNs to molecular property prediction tasks. BID5 shows how to use GNNs to learn classifiers on image datasets in a few-shot manner. BID6 study the effectiveness of message-passing in quantum chemistry. BID4 apply message-passing on a graph constructed by coreference links to answer relational questions. There are relatively fewer papers discussing how to adapt GNNs to natural language tasks. For example, BID14 propose to apply GNNs to semantic role labeling and BID22 apply GNNs to knowledge base completion tasks. BID31 apply GNNs to relation extraction by encoding dependency trees, and De Cao et al. FORMULA2 apply GNNs to multi-hop question answering by encoding co-occurence and co-reference relationships. Although they also consider applying GNNs to natural language processing tasks, they still perform message-passing on predefined graphs. introduces a novel neural architecture to generate a graph based on the textual input and dynamically update the relationship during the learning process. In sharp contrast, this paper focuses on extracting relations from real-world relation datasets. Relational reasoning has been explored in various fields. For example, BID20 propose a simple neural network to reason the relationship of objects in a picture, BID26 build up a scene graph according to an image, and BID9 model the interaction of physical objects. In this paper, we focus on the relational reasoning in natural language domain. Existing works BID27 BID13 DISPLAYFORM0 Figure 2: Overall architecture: the encoding module takes a sequence of vector representations as inputs, and output a transition matrix as output; the propagation module propagates the hidden states from nodes to its neighbours with the generated transition matrix; the classification module provides task-related predictions according to nodes representations.the pair-wise relationship between entities in certain situations. For example, BID27 ) is one of the earliest works that applies a simple CNN to this task, and BID28 further extends it with piece-wise max-pooling. BID16 propose a multi-window version of CNN for relation extraction. BID13 study an attention mechanism for relation extraction tasks. BID18 predict n-ary relations of entities in different sentences with Graph LSTMs. BID11 treat relations as latent variables which are capable of inducing the relations without any supervision signals. BID29 show that the relation path has an important role in relation extraction. BID15 show the effectiveness of LSTMs BID7 in relation extraction. BID2 proposed a walk-based model to do relation extraction. The most related work is BID24, where the proposed model incorporates contextual relations with attention mechanism when predicting the relation of a target entity pair. The drawback of existing approaches is that they could not make full use of the multi-hop inference patterns among multiple entity pairs and their relations within the sentence. We first define the task of natural language relational reasoning. Given a sequence of text with m entities, it aims to reason on both the text and entities and make a prediction of the labels of the entities or entity pairs. In this section, we will introduce the general framework of GP-GNNs. GP-GNNs first build a fullyconnected graph G = (V, E), where V is the set of entities, and each edge DISPLAYFORM0 l−1 extracted from the text. After that, GP-GNNs employ three modules including encoding module, propagation module and classification module to proceed relational reasoning, as shown in Fig. 2. The encoding module converts sequences into transition matrices corresponding to edges, i.e. the parameters of the propagation module, by DISPLAYFORM0 where f (·) could be any model that could encode sequential data, such as LSTMs, GRUs, CNNs, E(·) indicates an embedding function, and θ n e denotes the parameters of the encoding module of n-th layer. The propagation module learns representations for nodes layer by layer. The initial embeddings of nodes, i.e. the representations of layer 0, are task-related, which could be embeddings that encode features of nodes or just one-hot embeddings. Given representations of layer n, the representations of layer n + 1 are calculated by DISPLAYFORM0 where N (v i) denotes the neighbours of node v i in graph G and σ(·) denotes non-linear activation function. Generally, the classification module takes node representations as inputs and outputs predictions. Therefore, the loss of GP-GNNs could be calculated as DISPLAYFORM0 where θ c denotes the parameters of the classification module, K is the number of layers in propagation module and Y denotes the ground truth label. The parameters in GP-GNNs are trained by gradient descent methods. Relation extraction from text is a classic natural language relational reasoning task. Given a sentence s = (x 0, x 1, . . ., x l−1), a set of relations R and a set of entities in this sentence V s = {v 1, v 2, . . ., v |Vs|}, where each v i consists of one or a sequence of tokens, relation extraction from text is to identify the pairwise relationship r vi,vj ∈ R between each entity pair (v i, v j).In this section, we will introduce how to apply GP-GNNs to relation extraction. To encode the context of entity pairs (or edges in the graph), we first concatenate the position embeddings with word embeddings in the sentence: DISPLAYFORM0 where x t denotes the word embedding of word x t and p i,j t denotes the position embedding of word position t relative to the entity pair's position i, j (Details of these two embeddings are introduced in the next two paragraphs.) After that, we feed the representations of entity pairs into encoder f (·) which contains a bi-directional LSTM and a multi-layer perceptron: DISPLAYFORM1 where n denotes the index of layer 1, [·] means reshaping a vector as a matrix, BiLSTM encodes a sequence by concatenating tail hidden states of the forward LSTM and head hidden states of the backward LSTM together and MLP denotes a multi-layer perceptron with non-linear activation σ. Word Representations We first map each token x t of sentence {x 0, x 1, . . ., x l−1} to a kdimensional embedding vector x t using a word embedding matrix W e ∈ R |V |×dw, where |V | is the size of the vocabulary. Throughout this paper, we stick to 50-dimensional GloVe embeddings pre-trained on a 6 billion corpus BID19.Position Embedding In this work, we consider a simple entity marking scheme 2: we mark each token in the sentence as either belonging to the first entity v i, the second entity v j or to neither of those. Each position marker is also mapped to a d p -dimensional vector by a position embedding matrix P ∈ R 3×dp. We use notation p i,j t to represent the position embedding for x t corresponding to entity pair (v i, v j). Next, we use Eq. to propagate information among nodes where the initial embeddings of nodes and number of layers are further specified as follows. The Initial Embeddings of Nodes Suppose we are focusing on extracting the relationship between entity v i and entity v j, the initial embeddings of them are annotated as h vi = a subject, and h vj = a object, while the initial embeddings of other entities are set to all zeros. We set special values for the head and tail entity's initial embeddings as a kind of "flag" messages which we expect to be passed through propagation. Annotators a subject and a object could also carry the prior knowledge about subject entity and object entity. In our experiments, we generalize the idea of Gated Graph Neural Networks BID12 by setting a subject = [1; 0] and a object = [0; 1] 3.Number of Layers In general graphs, the number of layers K is chosen to be of the order of the graph diameter so that all nodes obtain information from the entire graph. In our context, however, since the graph is densely connected, the depth is interpreted simply as giving the model more expressive power. We treat K as a hyper-parameter, the effectiveness of which will be discussed in detail (Sect. 5.4). The output module takes the embeddings of the target entity pair (v i, v j) as input, which are first converted by: DISPLAYFORM0 where represents element-wise multiplication. This could be used for classification: DISPLAYFORM1 where r vi,vj ∈ R, and MLP denotes a multi-layer perceptron module. We use cross entropy here as the classification loss DISPLAYFORM2 where r vi,vj denotes the relation label for entity pair (v i, v j) and S denotes the whole corpus. In practice, we stack the embeddings for every target entity pairs together to infer the underlying relationship between each pair of entities. We use PyTorch BID17 to implement our models. To make it more efficient, we avoid using loop-based, scalar-oriented code by matrix and vector operations. Our experiments mainly aim to: showing that our best models could improve the performance of relation extraction under a variety of settings; illustrating that how the number of layers affect the performance of our model; and performing a qualitative investigation to highlight the difference between our models and baseline models. In both part and part, we do three subparts of experiments: (i) we will first show that our models could improve instance-level relation extraction on a human annotated test set, and (ii) then we will show that our models could also help enhance the performance of bag-level relation extraction on a distantly labeled test set 4, and (iii) we also split a subset of distantly labeled test set, where the number of entities and edges is large. Distantly labeled set BID24 have proposed a dataset with Wikipedia corpora. There is a small difference between our task and theirs: our task is to extract the relationship between every pair of entities in the sentence, whereas their task is to extract the relationship between the given entity pair and the context entity pairs. Therefore, we need to modify their dataset: We added reversed edges if they are missing from a given triple, e.g. if triple (Earth, part of, Solar System) exists in the sentence, we add a reversed label, (Solar System, has a member, Earth), to it; For all of the entity pairs with no relations, we added "NA" labels to them. 5 We use the same training set for all of the experiments. Human annotated test set Based on the test set provided by BID24, 5 annotators 6 are asked to label the dataset. They are asked to decide whether or not the distant supervision is right for every pair of entities. Only the instances accepted by all 5 annotators are incorporated into the human annotated test set. There are 350 sentences and 1,230 triples in this test set. Dense distantly labeled test set We further split a dense test set from the distantly labeled test set. Our criteria are: the number of entities should be strictly larger than 2; and there must be at least one circle (with at least three entities) in the ground-truth label of the sentence BID0. This test set could be used to test our methods' performance on sentences with the complex interaction between entities. There are 1,350 sentences and more than 17,915 triples and 7,906 relational facts in this test set. We select the following models for comparison, the first four of which are our baseline models. Context-Aware RE, proposed by BID24. This model utilizes attention mechanism to encode the context relations for predicting target relations. It was the state-of-the-art models on Wikipedia dataset. This baseline is implemented by ourselves based on authors' public repo 8.Multi-Window CNN. BID27 utilize convolutional neural networks to classify relations. Different from the original version of CNN proposed in BID27, our implementation, follows BID16, concatenates features extracted by three different window sizes: 3, 5, 7.PCNN, proposed by BID28. This model divides the whole sentence into three pieces and applies max-pooling after convolution layer piece-wisely. For CNN and following PCNN, the entity markers are the same as originally proposed in BID27.LSTM or GP-GNN with K = 1 layer. Bi-directional LSTM BID23 could be seen as an 1-layer variant of our model. GP-GNN with K = 2 or K = 3 layerss. These models are capable of performing 2-hop reasoning and 3-hop reasoning, respectively. We select the best parameters for the validation set. We select non-linear activation functions between relu and tanh, and select d n among {2, 4, 8, 12, 16} 9. We have also tried two forms of adjacent matrices: tied-weights (set A (n) = A (n+1) ) and untied-weights. Table 1 shows our best hyper-parameter settings, which are used in all of our experiments. Hyper-parameters Value learning rate 0.001 batch size 50 dropout ratio 0.5 hidden state size 256 non-linear activation σ relu embedding size for #layers = 1 8 embedding size for #layers = 2 and 3 12 adjacent matrices untied Table 1: Hyper-parameters settings. So far, we have only talked about the way to implement sentence-level relation extraction. To evaluate our models and baseline models in bag-level, we utilize a bag of sentences with given entity pair to score the relations between them. BID28 formalize the bag-level relation extraction as multi-instance learning. Here, we follow their idea and define the score function of entity pair and its corresponding relation r as a max-one setting: TAB3 and 3, we can see that our best models outperform all the baseline models significantly on all three test sets. These indicate our model could successfully conduct reasoning on the fully-connected graph with generated parameters from natural language. These also indicate that our model not only performs well on sentence-level relation extraction but also improves on bag-level relation extraction. Note that Context-Aware RE also incorporates context information to predict the relation of the target entity pair, however, we argue that Context-Aware RE only models the co-occurrence of various relations, ignoring whether the context relation participates in the reasoning process of relation extraction of the target entity pair. Context-Aware RE may introduce more noise, for it may mistakenly increase the probability of a relation with the similar topic with the context relations. We will give samples to illustrate this issue in Sect. 5.5. Another interesting observation is that our #layers=1 version outperforms CNN and PCNN in these three datasets. One probable reason is that sentences from Wikipedia corpus are always complex, which may be hard to model for CNN and PCNN. Similar are also reached by BID30. Table 4: Sample predictions from the baseline models and our GP-GNN model. Ground truth graphs are the subgraph in Wikidata knowledge graph induced by the sets of entities in the sentences. The models take sentences and entity markers as input and produce a graph containing entities (colored and bold) and relations between them. Although "No Relation" is also be seen as a type of relation, we only show other relation types in the graphs. DISPLAYFORM0 The number of layers represents the reasoning ability of our models. A K-layer version has the ability to infer K-hop relations. To demonstrate the effects of the number of layers, we also compare our models with different numbers of layers. From TAB3, we could see that on all three datasets, 3-layer version achieves the best. We could also see from FIG0 that as the number of layers grows, the curves get higher and higher precision, indicating considering more hops in reasoning leads to better performance. However, the improvement of the third layer is much smaller on the overall distantly supervised test set than the one on the dense subset. This observation reveals that the reasoning mechanism could help us identify relations especially on sentences where there are more entities. We could also see that on the human annotated test set 3-layer version to have a greater improvement over 2-layer version as compared with 2-layer version over 1-layer version. It is probably due to the reason that bag-level relation extraction is much easier. In real applications, different variants could be selected for different kind of sentences or we can also ensemble the prediction from different models. We leave these explorations for future work. − −−−− → z to find the fact (BankUnited Center, located in, English). Note that (BankUnited Center, located in, English) is even not in Wikidata, but our model could identify this fact through reasoning. We also find that Context-Aware RE tends to predict relations with similar topics. For example, in the third case, share boarder with and located in are both relations about territory issues. Consequently, Context-Aware RE makes a mistake by predicting (Kentucky, share boarder with, Ohio). As we have discussed before, this is due to its mechanism to model co-occurrence of multiple relations. However, in our model, since Ohio and Johnson County have no relationship, this wrong relation is not predicted. We addressed the problem of utilizing GNNs to perform relational reasoning with natural languages. Our proposed models, GP-GNNs, solves the relational message-passing task by encoding natural language as parameters and performing propagation from layer to layer. Our model can also be considered as a more generic framework for graph generation problem with unstructured input other than text, e.g. images, videos, audios. In this work, we demonstrate its effectiveness in predicting the relationship between entities in natural language and bag-level and show that by considering more hops in reasoning the performance of relation extraction could be significantly improved.

represent the short summary for finding the corresponding scientific article (long).

A graph neural network model with parameters generated from natural languages, which can perform multi-hop reasoning.

Represent the short summary for finding the corresponding scientific article (long)

We provide insightful understanding of sequence-labeling NER and propose to use two types of cross structures, both of which bring theoretical and empirical improvements.