The CAT SET on the MAT: Cross Attention for Set Matching in Bipartite Hypergraphs
Abstract
Usual relations between entities could be captured using graphs; but those of a higher-order – more so between two different types of entities (which we term "left" and "right") – calls for a "bipartite hypergraph". For example, given a left set of symptoms and right set of diseases, the relation between a set subset of symptoms (that a patient experiences at a given point of time) and a subset of diseases (that he/she might be diagnosed with) could be well-represented using a bipartite hyperedge. The state-of-the-art in embedding nodes of a hypergraph is based on learning the self-attention structure between node-pairs from a hyperedge. In the present work, given a bipartite hypergraph, we aim at capturing relations between node pairs from the cross-product between the left and right hyperedges, and term it a "cross-attention" (CAT) based model. More precisely, we pose "bipartite hyperedge link prediction" as a set-matching (SETMAT) problem and propose a novel neural network architecture called CATSETMAT for the same. We perform extensive experiments on multiple bipartite hypergraph datasets to show the superior performance of CATSETMAT, which we compare with multiple techniques from the state-of-the-art. Our results also elucidate information flow in self- and cross-attention scenarios.
1 Introduction
Relations between two entities are easily captured by a graph [25, 26], wherein a collection of pairwise edges (either directed or undirected) encapsulates the relational structure (e.g., friendship relations between two people on a social network [32, 1]). Moreover, heterogeneous graphs [31, 37] are used to capture relationship structures between entities of multiple “types” (e.g., a bibliographic network [9] between nodes of type author, paper, venue, etc.). However, when the number of types is restricted to two (say, “left” and “right”), and relations exist only across (and not among) them, we resort to a bipartite graph [20] (e.g., an author-paper bibliography network).
Nevertheless, any such relation captured by a usual network — be it homogeneous, heterogeneous, or bipartite — is strictly restricted to a pair of entities. But relations in nature, more often than not, occur between more than two entities. For example, a co-authorship network (wherein usually, a relation is said to exist between a pair of authors who have co-authored at least one article) is, in fact, a network where possibly more than two authors (all those who have co-authored at least one article) can be connected via a single higher-order relation. A collection of such higher-order relations (hyperedges) is called a hypergraph [8, 6], and is used since using a graph for the job proves to be lossy [47]. Akin to graphs, hypergraphs too have their own heterogeneous versions (those that capture higher-order relations between nodes of different types), which have been used in the literature to capture relations of the type buyer-broker-seller [7], user-location [42], etc.
While much has been done about such heterogeneous hypergraphs in the literature [12, 48], bipartite hypergraphs [49] — hypergraphs wherein each hyperedge is required to have at least one node from each one of two disjoint node-sets “left” and “right” — have seldom been talked about.
An example would be the symptoms-diseases bipartite hypergraph shown in Fig. 1, where given a (left) set of symptoms and another (right) set of diseases, every non-trivial diagnosis — one wherein the doctor identifies at least one symptom (i.e., ) in a patient and diagnoses him/her with at least one disease (i.e., ) — forms a bipartite hyperedge , and a collection of such hyperedges forms a bipartite hypergraph . For the diagnosis denotes all the its symptoms and denotes all diseases that the patient is suffering from.
Existing models use a self-attention mechanism (Hyper-SAGNN) to predict a heterogeneous hyperedge, but miss the fact that the flow of information has to be across the right and left sets, and not among them individually. In this work we too aim to learn a neural network model for predicting relations, only in a bipartite hypergraph. Going by the symptoms and diseases example in Fig. 1, we need not model the existence of a set of symptoms or a set of diseases, but the existence of a relation between a set of symptoms and a set of diseases.
We repose hyperedge prediction as a set-matching (SETMAT) problem: given two set-of-sets, what pair of sets “match” with each other? In our case, the two sets would be the left and right hyperedges, and we call it a “match” if they are linked by a bipartite hyperedge.
The following is a list of all the contributions we make in this work:
- 1.
This is the very first work on bipartite hypergraphs in machine learning, along with introduction of some novel datasets. Moreover, we introduce the problem of predicting higher-order bipartite relations in networks for the first time.
- 2.
Elucidate the drawback of usual hyperedge embedding techniques for bipartite hyperedges via a alternating positive/negative set pairs based explanation.
- 3.
Pose the above problem as a set-matching prediction problem and show theoretical equivalence of the same.
- 4.
Formulate a cross-attention framework based neural network architecture to deal with the set-matching and hence the bipartite hyperedge prediction problem.
We make our code11 1 https://github.com/govindjsk/catsetmat and all our datasets publicly available online; please refer to Section B.1 for how to access the datasets.
2 Bipartite Hyperedge Prediction
2.1 Bipartite Hypergraphs
Given are two sets of disjoint nodes: left nodes and right nodes ; a simple bipartite hypergraph is defined as , where such that there is at least one node from each node set in the elements of . However, we proceed further and define a different kind of bipartite hypergraph: a per-fixed22 2 We call it “per-fixed” and not pre-fixed, since only left and right hyperedges are fixed. one wherein basically we fix the set of left and right hyperedges beforehand. Over the node sets and , the set of potential left hyperedges and the set of potential right hyperedges could be noted. Once we fix the set of actual left hyperedges to be and actual right hyperedges to be , we could define the set of potential bipartite hyperedges as:
| (1) |
Definition 1 (Per-fixed Bipartite Hypergraph).
A per-fixed bipartite hypergraph is an ordered set of left vertices , right vertices , fixed left hyperedges , fixed right hyperedges , and bipartite hyperedges . Furthermore, denotes the set of all bipartite non-hyperedges.
A simple bipartite hypergraph is different from a usual (non-bipartite) hypergraph in that it has two disjoint sets of nodes () instead of one. On the other hand, a per-fixed bipartite hypergraph is different from the two, since we fix the sets of left and right hyperedges () beforehand, and are thence worried only about connections across them (as defined by ). An important consequence of these facts is that we need not model the existence of the left or right hyperedges individually, but focus on the cross bipartite relations instead.
Observation 1.
Given a per-fixed bipartite hypergraph , the triplet forms a bipartite graph over node sets and . Also, the triplet forms a simple bipartite hypergraph.
Note 1.
Henceforth, unless prefixed with the term “simple”, the phrase “bipartite hypergraph” would refer to a per-fixed bipartite hypergraph as per Definition 1.
2.2 The Bipartite Hyperedge Prediction Problem
In the present work, we have set out to solve the problem of bipartite hyperedge prediction (BHP), which we define as follows:
Definition 2 (Bipartite Hyperedge Prediction (BHP)).
Given , learn a BHP predictor such that for and and disjoint sets and (see Def. 1) denoting the positive and the negative class respectively, we have:
| (2) |
It is to be noted that Definition 2 considers a per-fixed bipartite hypergraph and one could also define the BHP problem for a simple bipartite hypergraph (let’s call it simple-BHP) as well. The only difference between BHP and simple-BHP would be that while for the former, the set of possible left- and right-hyperedges is fixed even before the problem is defined, for the latter, any possible left- or right-hyperedge could be chosen as arbitrary subset choices from the respective node sets. Nevertheless, the difference shows up only for bipartite non-hyperedges: for simple-BHP, we have and , but for per-fixed BHP (as per Definition 2, the set of observed left hyperedges and right hyperedges are fixed to and respectively, and then hyperedges and non-hypergedges are defined as and . We will see how existing hyperege prediction algorithms apply only to simple-BHP and fail to cater the per-fixed BHP problem.
3 Bipartite Hyperedge Set Matching Prediction (BHSMP)
3.1 Set Matching (SETMAT)
Definition 3 (Set Matching).
Given two sets-of-sets and , a set matching is defined as a relation that matches a set element to another set element . Every is called a set match (or match for short). Naturally, the set refers to the corresponding set anti-matching and an element is called a set anti-match (or anti-match or non-match for short).
Definition 4 (Set Matching Predicton (SMP)).
Given two sets-of-sets and , and a set matching , the set matching prediction problem learns an SMP predictor such that for and , we have:
| (3) |
Lemma 1.
Every bipartite hypergraph is a set-matching over its left and right hyperedges.33 3 Proof in Appendix A.1.
3.2 BHP as SMP
Lemma 2.
The BHP problem for a bipartite hypergraph can be solved by an SMP predictor for its equivalent set-matching.44 4 Proof in Appendix A.2.
The foregoing lemma states an important result: that we could solve the BHP problem using SMP. Since we have an equivalent set matching for a given hypergraph, and that we could solve the BHCP problem using SMP, let us define a new problem called the Bipartite Hyperedge Set Matching Prediction (BHSMP) problem as follows:
Definition 5 (Bipartite Hyperedge Set Matching Prediction (BHSMP)).
Given a bipartite hypergraph , a BHSMP predictor is simply defined as an SMP predictor for the equivalent set matching.
4 The Cross Attention (CAT) Framework
4.1 The Problem with usual Self-Attention
Currently, the best known model to predict hyperedges is that of Hyper-SAGNN [45] (Figure 2), which uses (1) a self-attention framework to model information flow between nodes of a hyperedge, and (2) a static-vs-dynamic comparative technique to learn hyperedge formation. But the main reason why it does not deem fit for the bipartite hyperedge scenario is that it captures information flow between all the nodes of a usual (non-bipartite) hyperedge. And for a per-fixed bipartite hypergraph, the difference is subtler: “pay heed to the cross-connections, not the self-connections.” In other words, one need not model the occurrence of individual left and right hyperedges, and instead focus on the connection between them. That is, we need not predict left and right hyperedges individually, but only predict the connections between them, since the former is already fixed to be and . For the symptoms-diseases case, the reason why Hyper-SAGNN does not apply to the BHP prediction problem is that we are interested in modeling/predicting new diagnoses involving observed symptom-sets and disease-sets. Paying simultaneous attention to symptoms, diseases and their connections (diagnoses) leads to a learning process that oscillates between the positive and negative classes. More about this would be discussed in Section 8.3.
4.2 Usual Hyper-SAGNN based Self-Attention
Let us see what effect applying Hyper-SAGNN has on a bipartite hyperedge. Consider a bipartite hypergraph . Now, let us take two sets and that are “observed” to be hyperedges. Also given are the embeddings of each node: for nodes and respectively (, ). If , and denote weight matrices for the self-attention framework of Hyper-SAGNN, we have for the potential -sized hyperedge ,
| ( to and to ) | (4) | ||||
| ( to and to ) | (5) |
where and . These values are then normalized using the softmax function as follows:
| (6) |
where and .
The dynamic embeddings of the hyperedge nodes would then be:
| (7) | ||||
| (8) |
4.3 Cross-Attention for Bipartite Hypergraphs
Going by the cross-attention paradigm, we introduce three extra attention parameters, amounting to parameters and . We redefine , , , and for and as follows:
| (9) | ||||
| (10) |
Now, the cross-attention dynamic embedding of the left and right hyperedge nodes would then be:
| (11) |
Finally, we have new embeddings of left nodes and of right nodes, all -dimensional vectors.
5 The CATSETMAT Architecture
Akin to Hyper-SAGNN (Figure 2), we define a neural network architecture called CATSETMAT (Cross ATtention for SET MATching) that has both self- as well as cross-attention layers. CATSETMAT uses structures defined in Section 4.3 that are derived from the self-attention layers in Hyper-SAGNN. A detailed network architecture is depicted in Figure 3, with three of its variants: one with no self-attention, and the others with one and two extra pairs of the same. And as explained before, we use the architecture to solve the set matching prediction (SMP) problem which in turn solves the bipartite hyperedge prediction (BHP) problem – a problem we had termed bipartite hyperedge set matching prediction (BHSMP).
Basically, it commences with the vector representations of two sets of hyperedges – one left (), and the other right (). These inputs are fed into two Hyper-SAGNN-like self-attention (SAT) blocks SAT and SAT′ separately, which have their respective parameter sets and ). The SAT-blocks give out revised embeddings and . Although this applies one round of attention to each of the left and right hyperedges, no information about the cross-connections between them have been learned by our model.
Here is where the cross-attention (CAT) block – CAT – comes into picture, not-to-mention, with its own set of parameters , , , , , . The CAT block takes the revised embeddings through equations 9–11 and returns fresh embedding vectors and – vectors we call dynamic embeddings, just as Zhang, et al. [45] do for Hyper-SAGNN. In parallel is a layer of static-weights that simply transforms the original left vectors and right vectors into static embeddings and defined by and respectively, where and . Following Zhang et al. [45], we compare the static and dynamic embeddings using the Hadamard square operator, resulting in vectors and defined as and . Finally, two positional feed-forward layers [45] and followed by a consolidating layer computes the probability that the set of nodes match or not.
5.1 Variants of CATSETMAT
We use altogether three variants of CATSETMAT: CATSETMAT-X (only CAT), CATSETMAT-SX (a pair of SAT followed by a CAT), and CATSETMAT-SXS (CATSETMAT-SX with another pair of SAT modules following CAT). Architecture diagrams for all the three variants have been shown in Figure 3.
6 Related Work
As far as usual hypergraphs are concerned, they have not been studied as much as graphs (some earlier works are are [47, 22, 7]). Of some recent approaches [5, 33, 44, 3, 10, 17, 18, 28, 41, 40, 4, 45] for hyperedge prediction and hypergraph embedding, the most recent one, viz., Hyper-SAGNN [45] performs the best. It uses a self-attention based model wherein each hyperedge is handled separately. Our approach is strongly based on theirs, and the whole concept of cross-attention (and a combination thereof with self-attention) extends their framework to set matching as well.
It is to be noted that left and right hyperedges in a bipartite hypergraph are basically sets of nodes; hence machine learning techniques to handle sets become relevant here. Deep set embedding calls for permutation-invariant neural networks, and there has been a considerable amount of work on this topic [35, 43, 36, 21, 46, 24, 38], of which we use FSPool [46], a sort-pooling based technique, as one of our baselines. Moreover, deep set-to-set matching has been performed on image data [29], but it does not apply to our problem since it uses a single universal set, as opposed to two disjoint ones in the case of a bipartite hypergraph.
Bipartite networks are so essential that Guillaume et al. [13] have argued for an underlying bipartite structure in all networks. Of late, neural network techniques for usual graphs have become widely recognized [11, 19, 14, 34] (ref. Wu et al. [39] for a survey). But the same is not true for deep bipartite networks. The CATSETMAT architecture we propose inherits attention from GAT [34] and weakly relates to BGNN [15]. Furthermore, to the best of our knowledge, there is no work that explores a bipartite hypergraph from the perspective of network science, and all of them [49, 2, 16] belong to the domain of discrete mathematics.
| Dataset | Left nodes () | Right nodes () | |||||
|---|---|---|---|---|---|---|---|
| tmdb-cc | Cast (actors) | Crew (other members) | 4,556 | 3,802 | 2,825 | 2,824 | 2,744 |
| tmdb-ck | Cast (actors) | Plot keywords | 3,156 | 1,256 | 2,669 | 2,656 | 2,621 |
| mag-acm-ak | Authors | Keywords | 1,059 | 2,338 | 1,388 | 847 | 1,379 |



7 Experiments
We perform bipartite hyperedge prediction experiments on some real-world datasets. Apart from the baselines described in Section 7.1, we use three versions of CATSETMAT: CATSETMAT-X (only CAT), CATSETMAT-SX (a pair of SAT followed by a CAT), and CATSETMAT-SXS (CATSETMAT-SX with another pair of SAT modules following CAT). Refer Table 1 for details about datasets and Figure 4 for distribution of bipartite hyperedge sizes therein. Details about data preparation and other reproducibility details could be found in Appendix B.
7.1 Baselines
As discussed in Section 6, we prepare four classes of baselines: node2vec-based, bipartite-graph-based, set-embedding-based and hyperedge-prediction-based, each of which has been described below.
- 1.
node2vec-based:
n2v-cross-mean, n2v-full-mean, n2v-cross-min, n2v-full-min. More details could be found in Appendix B.3.1. - 2.
Bipartite-graph-based: Since our hypergraph could be interpreted as a bipartite “graph” (Observation 1), we prepare some baselines on bipartite versions of two popular link prediction algorithms [23]: Common Neighbor (CN) [26] and Adamic Adar (AA) [1]. Please refer to Appendix B.3.2 for more details on how these features are computed for a bipartite hypergraph.
- 3.
- 4.
Hyperedge-prediction-based (Hyper-SAGNN): We use the existing best performing algorithm Hyper-SAGNN [45] for hyperedge prediction, wherein we interpret our bipartite hypergraph as a usual one as per Observation 1. We use the same experiment settings as Zhang et al. [45] and their architecture as shown in Figure 2.
8 Results and Discussion
| Algorithm | tmdb-cc | tmdb-ck | mag-acm-ak |
|---|---|---|---|
| bipartite-AA-min | |||
| bipartite-CN-min | |||
| bipartite-AA-max | |||
| bipartite-CN-max | |||
| bipartite-AA-avg | |||
| bipartite-CN-avg | |||
| n2v-cross-mean | |||
| n2v-full-mean | |||
| n2v-cross-min | |||
| n2v-full-min | |||
| FSPool | |||
| Hyper-SAGNN | |||
| CATSETMAT-X | |||
| CATSETMAT-SX | |||
| CATSETMAT-SXS |
The results for hyperedge prediction on a few datasets have been listed in Table 2, where each baseline class (see Section 7.1) has been separated by a horizontal line. For each algorithm, and each dataset, we report the %AUC test scores for the SMBHP problem (see Definition 5). In each case, we see that our algorithm CATSETMAT performs the best unanimously. More observations are described in the following sections (Sections 8.1–8.2). An explanation of the poor performance of some state-of-the-art algorithms has been provided in Section 8.3.
8.1 Baselines
Although bipartite link prediction algorithms (bipartite-AA-min–bipartite-CN-avg) perform poorly with AUCs ranging from – and – for the first two datasets, for mag-acm-ak, some of them perform considerably better with AUCs going up to as well. These algorithms heavily depend on the interconnectivity between the left and right hyperedges, and it seems to be the best in the mag-acm-ak dataset. The next set of algorithms – the four node2vec-based ones – perform much better than the foregoing group, but still lag behind CATSETMAT by huge margins. Surprisingly, the bipartite graph based algorithms outperform the node2vec ones for the last dataset. This only shows that performances vary dramatically from dataset to dataset.
The next two algorithms – FSPool and Hyper-SAGNN, though being cutting-edge deep learning approaches in their respective fields (viz., set and hyperedge embeddings respectively), fail to capture the desired bipartite hypergraph structure. The main reason for this, as has been explained in Section 8.3, is that they struggle to learn a consistent representation of nodes since the same set of nodes get involved in bipartite hyperedges (positive class) as well as bipartite non-hyperedges (negative class) simultaneously. Moreover, Hyper-SAGNN also shows quite a high amount of deviation (; as per Table 2), which is undesirable of any machine learning algorithm. But this only shows the huge dependence of Hyper-SAGNN on the data preparation process (i.e., negative-sampling and train-test split) that we perform five times. More about this has been discussed in Section 8.3, where we use the learning curves (Figures 5 and 6) to compare FSPool’s and Hyper-SAGNN’s respective behaviour w.r.t. CATSETMAT.






8.2 CATSETMAT
Finally, the last three algorithms – the ones we have proposed as part of this work – are the best performing ones among the lot. For tmdb-cc, we see that our best method is better than the group-wise next best (i.e., n2v-full-mean), which has an AUC of only . Another of our methods (CATSETMAT-SXS) performs the best for tmdb-ck, with a much higher improvement of as compared to n2v-cross-mean, the group-wise next best. For both these datasets, we obtain quite high AUC values of around –, but the same is not true for mag-acm-ak, for which the best performance is limited to , albeit given by our algorithm CATSETMAT-SX. Although this is a much lower score as compared to the other two datasets, but it is higher than bipartite-AA-avg, which is the best performing baseline. Barring our algorithms CATSETMAT-X, CATSETMAT-SX, and CATSETMAT-SXS, no other algorithm consistently performs well on all the three datasets. While at least one dataset deemed problematic for each of the baselines, these three algorithms remained consistent for all datasets. Moreover, no baseline touched the AUC mark except the CATSETMAT-based algorithms. We credit this success to the cross-attention paradigm, which focuses on the cross-links more than on the left and right hyperedges, thereby avoiding the positive-negative dilemma as explained in Section 8.3, where we make use of Figure 7 to explain the better performance of our algorithm.



Although the CAT module (see Figure 3) is our main contribution in this work, adding more SAT layers is expected to model the individual left- and right-hyperedges as well, since it might capture some inner domain-specific relational structure in each of them. We can clearly see this effect being illustrated in Table 2, wherein adding only one pair of SAT modules before CAT (in CATSETMAT-SX) boosts the performances of a purely CAT-based algorithm CATSETMAT-X by upto , , and for the three datasets respectively. While the addition of another pair of SAT modules (CATSETMAT-SXS) shows the potential of improving the AUC performance by an additional for tmdb-cc, but same is not true for the tmdb-ck and mag-acm-ak, where the performance instead drops by and respectively. This effect could be attributed to over-fitting due to an increase in model parameters. As a result of this, we conclude that addition of more number of SAT modules would not further boost the performance, and so, it should be limited to a single pair of SAT modules before CAT, as done in CATSETMAT-SX. The difference is also clear from the learning curves in Figure 7, where the relative epoch-by-epoch performance of each variant could be observed.
8.3 The Positive-Negative Dilemma
It is clear that our algorithm works well, and hence the baselines fail to capture the “bipartiteness” for hyperlink prediction. Figures 5, 6, and 7 depict the AUC learning curves for FSPool, Hyper-SAGNN, and CATSETMAT respectively on the three datasets. We could see that unlike CATSETMAT, the baselines FSPool and Hyper-SAGNN do not seem to converge, and keep oscillating around an AUC of 50%.
We reason for this behavior as follows. A careful look at the definition of a per-fixed bipartite hypergraph (Definition 1) would reveal a straightforward yet important fact: that left and right sets of hyperedges are fixed in advance. What makes this factor interesting is another definition: that of bipartite non-hyperedges (again, Definition 1) or the negative class, which ensures that each negative sample would be formed from the same fixed left and right hyperedges that formed samples from the positive class. What is striking to observe is that there is nothing that stops a left hyperedge that involves in forming a positive sample from getting involved in forming a negative sample as well. The same could also be said for a right hyperedge . As a result, we observe that the positive and the negative samples are built from mostly (if not entirely) the same left and right hyperedges.
When an algorithm that treats the entire hyperedge as a whole is deployed to embed it, it keeps getting confused, as to how to train the parameters to account for both classes simultaneously. Thus, it does not settle for a stable output for both as well as , owing to and ’s simultaneous association with both the classes. This is what algorithms like Hyper-SAGNN and FSPool suffer from, when it comes to a per-fixed bipartite hypergraph.
8.4 An Additional Experiment to Understand the Positive-Negative Dilemma
The attention parameters , , and that the Hyper-SAGNN formulation uses keep getting modified as per the positive and negative class labels, and since in our case, the bipartite hyperedges and bipartite non-hyperedges both use the same set of left and right hyperedges (owing to them being fixed), we perform an experiment that undoes this effect. For this, we change our negative sampling method to a “sized-random” [27] technique and use the following, we essentially change the “per-fixed” hypergraph (from Definition 1) to a “simple” hypergraph.
The exact procedure is as follows: Given a hypergraph :


- 1.
Initialize , the set of bipartite non-hyperedges.
- 2.
Pick a hyperedge
- 3.
Pick a random set of left nodes such that , and a random set of right nodes such that . Define .
- 4.
If , repeat Step 3. Else, add the new bipartite non-hyperedge to .
- 5.
Repeat steps 2–4 until .
Performing Hyper-SAGNN on this simpler hypergraph, surprisingly enough, makes the result totally different! Hyper-SAGNN now reports a test AUC of a whopping (see Figure 8) on mag-acm-ak, a dataset that was the toughest to handle as per Table 2. It is also advisable to see how well the learning curve boosts-up with this version of the data. It is clear from the foregoing arguments that there exists a positive-negative dilemma in usual hyperedge embedding approaches as far as bipartite hypergraphs are concerned. The unusually higher variance of observed in Table 2 for Hyper-SAGNN on mag-acm-ak could be easily attributed to this dilemma.
9 Conclusion and Future Work
A bipartite hypergraph is a peculiar data structure almost never studied in network analysis. We formalize almost all notions of this structure with standard notations used for graphs and usual hypergraphs, and introduce the bipartite hyperedge prediction problem. However, since we were able to establish an equivalence between this problem and set-matching, we could propose a solution for the latter and use it for the former. We could successfully posit that focusing on cross-attention plays a significant role in capturing bipartite relations well. An important insight that we were able establish was the existence of a positive-negative dilemma in existing cutting-edge algorithms like Hyper-SAGNN designed for the very job of hyperedge prediction.
The behavior of bipartite hypergraphs is close to unknown among researchers. We try to shed some light on one aspect of their application on a problem having real-world implications – the hyperedge prediction problem. But a lot of problems remain unanswered. Also, a variety of higher-order relations still remain to be modeled: e.g., a -partite hypergraph. Another huge area that needs attention is the preparation and analysis of more and more bipartite hypergraph real-world datasets. We leave these problems as future work.
Broader Impact (As required by NeurIPS)
The focus of our research is a special higher-order structure that shows up in the real-world more often than expected. Co-morbidity, drug-abuse warning, complex chemical reactions, etc. all involve a higher-order bipartite relational structure. Not-to-mention, other areas such as entertainment, meta-research, fashion-technology, etc. also exhibit bipartite higher-order relationships. Never in the past have these hypergraphs been analyzed with the lens of applicability, let alone from the perspective of machine learning. Our work is the first of the hopefully many forthcoming pieces of research that explore bipartite hypergraphs in such detail. Long have networks been modeled as standard pairwise-edged graphs; the interest in higher-order relations is increasing rapidly, which would call for such research areas to be explored for novel applications of the same.
References
- [1] Lada A Adamic and Eytan Adar. Friends and neighbors on the web. Social networks, 25(3):211–230, 2003.
- [2] Chidambaram Annamalai. Finding perfect matchings in bipartite hypergraphs. In Proceedings of the twenty-seventh annual ACM-SIAM symposium on Discrete algorithms, pages 1814–1823. SIAM, 2016.
- [3] Song Bai, Feihu Zhang, and Philip HS Torr. Hypergraph convolution and hypergraph attention. arXiv preprint arXiv:1901.08150, 2019.
- [4] Sambaran Bandyopadhyay, Kishalay Das, and M Narasimha Murty. Line hypergraph convolution network: Applying graph convolution for hypergraphs. arXiv preprint arXiv:2002.03392, 2020.
- [5] Austin R Benson, Rediet Abebe, Michael T Schaub, Ali Jadbabaie, and Jon Kleinberg. Simplicial closure and higher-order link prediction. Proceedings of the National Academy of Sciences, 115(48):E11221–E11230, 2018.
- [6] C. Berge and E. Minieka. Graphs and Hypergraphs. Graphs and Hypergraphs. North-Holland Publishing Company, 1973.
- [7] Phillip Bonacich, Annie Cody Holdren, and Michael Johnston. Hyper-edges and multidimensional centrality. Social networks, 26(3):189–203, 2004.
- [8] Alain Bretto. Hypergraph theory: An introduction. Mathematical Engineering. Cham: Springer, 2013.
- [9] Hongbo Deng, Jiawei Han, Michael R Lyu, and Irwin King. Modeling and exploiting heterogeneous bibliographic networks for expertise ranking. In Proceedings of the 12th ACM/IEEE-CS joint conference on Digital Libraries, pages 71–80, 2012.
- [10] Yifan Feng, Haoxuan You, Zizhao Zhang, Rongrong Ji, and Yue Gao. Hypergraph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3558–3565, 2019.
- [11] Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pages 855–864, 2016.
- [12] Huan Gui, Jialu Liu, Fangbo Tao, Meng Jiang, Brandon Norick, and Jiawei Han. Large-scale embedding learning in heterogeneous event data. In 2016 IEEE 16th International Conference on Data Mining (ICDM), pages 907–912. IEEE, 2016.
- [13] Jean-Loup Guillaume and Matthieu Latapy. Bipartite structure of all complex networks. Information processing letters, 90(5):215–221, 2004.
- [14] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pages 1024–1034, 2017.
- [15] Chaoyang He, Tian Xie, Yu Rong, Wenbing Huang, Yanfang Li, Junzhou Huang, Xiang Ren, and Cyrus Shahabi. Bipartite graph neural networks for efficient node representation learning. arXiv preprint arXiv:1906.11994, 2019.
- [16] Olga Heismann. The hypergraph assignment problem. PhD thesis, Technische Universitaet Berlin, 2014.
- [17] Jie Huang, Chuan Chen, Fanghua Ye, Jiajing Wu, Zibin Zheng, and Guohui Ling. Hyper2vec: Biased random walk for hyper-network embedding. In International Conference on Database Systems for Advanced Applications, pages 273–277. Springer, 2019.
- [18] Jianwen Jiang, Yuxuan Wei, Yifan Feng, Jingxuan Cao, and Yue Gao. Dynamic hypergraph neural networks. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence (IJCAI), pages 2635–2641, 2019.
- [19] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
- [20] Maksim Kitsak, Fragkiskos Papadopoulos, and Dmitri Krioukov. Latent geometry of bipartite networks. Physical Review E, 95(3):032309, 2017.
- [21] Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In International Conference on Machine Learning, pages 3744–3753, 2019.
- [22] Dong Li, Zhiming Xu, Sheng Li, and Xin Sun. Link prediction in social networks based on hypergraph. In Proceedings of the 22nd International Conference on World Wide Web, pages 41–42, 2013.
- [23] David Liben-Nowell and Jon Kleinberg. The link-prediction problem for social networks. Journal of the American society for information science and technology, 58(7):1019–1031, 2007.
- [24] Changping Meng, Jiasen Yang, Bruno Ribeiro, and Jennifer Neville. Hats: A hierarchical sequence-attention framework for inductive set-of-sets embeddings. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 783–792, 2019.
- [25] Mark Ed Newman, Albert-László Ed Barabási, and Duncan J Watts. The structure and dynamics of networks. Princeton university press, 2006.
- [26] Mark EJ Newman. The structure and function of complex networks. SIAM review, 45(2):167–256, 2003.
- [27] Prasanna Patil, Govind Sharma, and M Narasimha Murty. Negative sampling for hyperlink prediction in networks. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pages 607–619. Springer, 2020.
- [28] Josh Payne. Deep hyperedges: A framework for transductive and inductive learning on hypergraphs. arXiv preprint arXiv:1910.02633, 2019.
- [29] Yuki Saito, Takuma Nakamura, Hirotaka Hachiya, and Kenji Fukumizu. Deep set-to-set matching and learning. arXiv preprint arXiv:1910.09972, 2019.
- [30] Arnab Sinha, Zhihong Shen, Yang Song, Hao Ma, Darrin Eide, Bo-June Hsu, and Kuansan Wang. An Overview of Microsoft Academic Service (MAS) and Applications. In Proceedings of the 24th International Conference on World Wide Web (WWW), pages 243–246, 2015.
- [31] Yizhou Sun and Jiawei Han. Mining heterogeneous information networks: principles and methodologies. Synthesis Lectures on Data Mining and Knowledge Discovery, 3(2):1–159, 2012.
- [32] Amanda L Traud, Peter J Mucha, and Mason A Porter. Social structure of facebook networks. Physica A: Statistical Mechanics and its Applications, 391(16):4165–4180, 2012.
- [33] Ke Tu, Peng Cui, Xiao Wang, Fei Wang, and Wenwu Zhu. Structural deep embedding for hyper-networks. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
- [34] Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
- [35] Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
- [36] Edward Wagstaff, Fabian Fuchs, Martin Engelcke, Ingmar Posner, and Michael A. Osborne. On the limitations of representing functions on sets. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 6487–6494, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
- [37] Yueyang Wang, Ziheng Duan, Binbing Liao, Fei Wu, and Yueting Zhuang. Heterogeneous attributed network embedding with graph convolutional networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 10061–10062, 2019.
- [38] Chris Wendler, Markus Püschel, and Dan Alistarh. Powerset convolutional neural networks. In Advances in Neural Information Processing Systems, pages 927–938, 2019.
- [39] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2020.
- [40] Naganand Yadati, Madhav Nimishakavi, Prateek Yadav, Vikram Nitin, Anand Louis, and Partha Talukdar. Hypergcn: A new method for training graph convolutional networks on hypergraphs. In Advances in Neural Information Processing Systems, pages 1509–1520, 2019.
- [41] Naganand Yadati, Vikram Nitin, Madhav Nimishakavi, Prateek Yadav, Anand Louis, and Partha Talukdar. Link prediction in hypergraphs using graph convolutional networks. OpenReview, 2019.
- [42] Dingqi Yang, Bingqing Qu, Jie Yang, and Philippe Cudre-Mauroux. Revisiting user mobility and social relationships in lbsns: A hypergraph embedding approach. In The World Wide Web Conference, pages 2147–2157, 2019.
- [43] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in neural information processing systems, pages 3391–3401, 2017.
- [44] Muhan Zhang, Zhicheng Cui, Shali Jiang, and Yixin Chen. Beyond link prediction: Predicting hyperlinks in adjacency space. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
- [45] Ruochi Zhang, Yuesong Zou, and Jian Ma. Hyper-sagnn: a self-attention based graph neural network for hypergraphs. arXiv preprint arXiv:1911.02613, 2020.
- [46] Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. Fspool: Learning set representations with featurewise sort pooling. arXiv preprint arXiv:1906.02795, 2019.
- [47] Dengyong Zhou, Jiayuan Huang, and Bernhard Schölkopf. Learning with hypergraphs: Clustering, classification, and embedding. In Advances in neural information processing systems, pages 1601–1608, 2007.
- [48] Yu Zhu, Ziyu Guan, Shulong Tan, Haifeng Liu, Deng Cai, and Xiaofei He. Heterogeneous hypergraph embedding for document recommendation. Neurocomputing, 216:150–162, 2016.
- [49] Inna Zverovich and Igor Zverovich. Bipartite bihypergraphs: a survey and new results. Discrete mathematics, 306(8-9):801–811, 2006.
Appendix A Proofs
A.1 Proof of Lemma 1
Proof.
Given a bipartite hypergraph , consider and as two sets-of-sets. Now consider the following claim:
-
Claim: Sets (see Definition 1) and are equivalent.
Proof of Claim.
The map defined by is bijective since its inverse is defined by . Hence, the claim. ∎
Using the same bijective map in the Proof of Claim above, we have:
Hence the relation:
is a set matching over sets-of-sets and as per Definition 3. ∎
A.2 Proof of Lemma 2
Proof.
Given , fix and as positive and negative classes respectively. Consider hyperedges , be such that and .
Now, consider ’s equivalent matching and learn an SMP predictor . Then, we have and . Hence, from eq. (3) in Definition 4, we have . Now, if we define a derived BHP predictor as , we get:
Hence, since , , , were arbitrarily selected as per and , the foregoing arguments make satisfy the BHP condition given in eq. (2) from Definition 2. ∎
Appendix B Details on Experiments
B.1 Data Description
All datasets we have prepared are available on the following link:
https://www.dropbox.com/s/cxykmi37695jlcw/catsetmat_data.zip?dl=0
Let us discuss the datasets one by one.
B.1.1 TMDB Cast-Crew (tmdb-cc)
We take a subset of movies from The Movie Database (TMDB; https://www.themoviedb.org/) available as a Kaggle (https://www.kaggle.com/) dataset named TMDB 5000 Movie Dataset (https://www.kaggle.com/tmdb/tmdb-movie-metadata). The node sets considered here are those of movie-actors and the movie-crew (set of other important people involved in a movie, such as directors, producers, etc.). Every bipartite hyperedge contains a set of actors (the cast; the left nodes) and a set of crew-members (the right nodes) who participated in at least one movie.
B.1.2 TMDb Cast-Keywords (tmdb-ck)
TMDB also gives information about plot keywords that hint at the content of a movie. A bipartite hyperedge would contain a set of actors (the cast; the left nodes) and a set of keywords (the right nodes) related to least one movie.
B.1.3 MAG ACM Authors-Keywords (mag-acm-ak)
This is a bibliographic network from Microsoft Academic Graph (MAG) [30], from which we choose those publications that appeared in conferences and journals associated with Association for Computing Machinery (ACM; https://www.acm.org/). The two node sets used are those of authors (the left node set) and (research-based) keywords (the right node set), and each bipartite hyperedge contains a set of co-authors and a set of keywords at least one of their papers has been tagged with.
Note: The raw data for MAG is not available directly and it’s a long process to collect portions of it. However, there used to be an online source that had official links to download the whole MAG dataset. We have an earlier version of the data downloaded with us, and this processing was made on that dataset. Nevertheless, the prepared data directly consumable by our code is available via the Dropbox link given earlier.
B.2 Data Preparation
B.2.1 Processing Data
We start with a raw dataset consisting of multiple entities, of which we choose two. Then we fetch bipartite hyperedges, which are merely events occurring at a given point of time (e.g., a movie getting released, or a paper getting published, etc.); this gives us sets of higher-order co-occurrences of the two entities we chose. Next, we apply a couple of filters to refine the data:
- 1.
Time filter: We filter the data into events occurring at time .
- 2.
Occurrence frequency filter: We only keep those nodes in the node-sets and that have their occurrence count within a particular range .
- 3.
Size filter: We only keep those bipartite hyperedges that have left and right hyperedge sizes (individually) in the range .
Please note that the filters are applied sequentially, and the prepared data is stored as a two-column (left hyperedge, right hyperedge) CSV file.
B.2.2 Negative Sampling
For the BHP problem, each bipartite hyperedge is considered to be a positive example (), and each non-hyperedge , a negative class sample. But since the negative patterns are too many, we avoid the problem of class imbalance by negative class sampling. For this, we first pick two random hyperedges: one from left, and the other from right, , and tag the pair as a negative class pattern () if they aren’t connected via a bipartite hyperedge (i.e., if ). We use a negative-to-positive ratio of .
B.2.3 Train-Test Split
We split the bipartite hyperedges and sampled bipartite non-hyperedges (sampled as mentioned in Section B.2.2 above) into train and test data using a train-test split ratio. For mag-acm-ak, we create validation data as well, using as train-validation-test proportions, and perform hyperparameter tuning on the validation data, as described in Section B.4.2. For each dataset-algorithm combination, we perform five experiments, performing a separate split and a separate negative sampling for each. This also introduces a standard deviation in our results, which we report in the main paper.
B.3 Baselines
Barring the “node2vec-based” and the “bipartite-graph-based” baselines, we have explained all baselines in the main paper. Here is a detailed description of how both of them were created.
B.3.1 Node2vec-based
For these set of baselines, we convert the bipartite hypergraph into a usual graph by expanding each bipartite hyperedge into a set of three types of edges:
- •
Cross-edges
- •
Left self-edges
- •
Right self-edges
Next, we embed each node into its node2vec [11] features and find cosine similarity between the incident nodes of each edge. Finally, we either take a mean or a min of that score and call it a prediction score. We use the same settings used in Hyper-SAGNN [45] for their node2vec based baselines.
- 1.
n2v-cross-mean: For node2vec-cross-mean, we take and define the score to be:
(12) - 2.
n2v-full-mean:
(13) where denotes the full set of edges.
- 3.
n2v-cross-min:
(14) - 4.
n2v-full-min:
(15)
B.3.2 Bipartite-graph-based
To create these baselines, we first convert our bipartite hypergraph into an induced bipartite graph by defining as:
and then compute the bipartite versions of the Common Neighbor (CN) and the Adamic Adar (AA) scores as follows:
where “L” and “R” stand for left and right scores respectively. If denotes the neighbors of a node (or union of neighbors of a set of nodes), we can define the individual scores as (note that left nodes have neighbors in the right and vice-versa):
We thus have and scores for each left-right vertex pair. Using this, we find the similarity scores for a left-right hyperedge pair as:
where we use three choices for the Aggregate function and two for Algo, thereby forming the six baselines:
- 1.
bipartite-AA-min: Aggregate=Minimum; Algo=AA
- 2.
bipartite-CN-min: Aggregate=Minimum; Algo=CN
- 3.
bipartite-AA-max: Aggregate=Maximum; Algo=AA
- 4.
bipartite-CN-max: Aggregate=Maximum; Algo=CN
- 5.
bipartite-AA-avg: Aggregate=Average; Algo=AA
- 6.
bipartite-CN-avg: Aggregate=Average; Algo=CN
B.4 Hyperparameter Settings
B.4.1 Baselines
There are no parameters for CN and AA scores for the bipartite graph based baselines. For the node2vec-based baselines, we use embedding dimension as , and other node2vec parameters are taken from Hyper-SAGNN. For FSPool and HyperSAGNN, we take the latent dimension as and other parameters are as per Hyper-SAGNN. We tried this with other dimensions as well, but the best results were on this configuration.
B.4.2 Hyperparameter tuning for CATSETMAT
We fix some hyperparameters as per Hyper-SAGNN, and for the embedding dimension and the learning rate, we perform a hyperparameter tuning, as shown in Figure 9, and then pick them to be and respectively. We use the Adam optimization algorithm for our tasks. The initial embeddings that we use in our model are from node2vec (an alternating random walk on nodes and hyperedges respectively), just as Hyper-SAGNN does.