Attribute-Assisted Heterogeneous Graph Representation
local graph
Chapter 4 — Attribute-Assisted Heterogeneous Graph Representation
Section titled “Chapter 4 — Attribute-Assisted Heterogeneous Graph Representation”Abstract The previous heterogeneous graph representation methods mainly focus on preserving the complex interactions and rich semantics into node representation. As a matter of fact, diverse types of nodes in heterogeneous graph are assisted with different attributes, providing valuable side information for depicting the characteristics of nodes. Integrating attribution information is also desired for heterogeneous graph representation in a real-world application. Fortunately, heterogeneous graph neural networks naturally provide an alternative way to achieve this, meanwhile, have powerful representation ability. In this chapter, we introduce three attribute-assisted heterogeneous graph representation models including heterogeneous graph attention network (HAN), heterogeneous graph propagation network (HPN), and heterogeneous graph structure learning (HGSL), which simultaneously utilize both complex structural information and rich attribute information to learn node representation.
4.1 Introduction
Section titled “4.1 Introduction”Besides complex structures and rich semantics, real-world heterogeneous graphs (HGs) are usually associated with diverse types of attributes, called attribute-assisted HGs, providing valuable side information for depicting the characteristics of nodes. For example, in the ACM graph, the user’s attribute mainly consists of name, age, and gender, while the paper’s attribute usually involves a set of keywords. Ignoring such attributes may lead to sub-optimal heterogeneous graph representation. How to integrate attribution information into node representation is a realistic demand of real-world HG representation.
Heterogeneous graph neural network (HGNN), as a powerful deep learning based technology, naturally provides an elegant way to achieve this. Specifically, HGNN takes node attributes to initial node representation, and then aggregates diverse types of neighbors to update node representation, which simultaneously utilizes both complex structural information and rich attribute information to learn node representations. In this chapter, we introduce three attribute-assisted heterogeneous
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2022 C. Shi et al., Heterogeneous Graph Representation Learning and Applications, Artificial Intelligence: Foundations, Theory, and Algorithms, https://doi.org/10.1007/978-981-16-6166-2_4
graph representation models including Heterogeneous graph Attention Network (named HAN), Heterogeneous graph Propagation Network (named HPN), and Heterogeneous Graph Structure Learning (named HGSL). HAN is a classical HGNN which leverages both node- and semantic-level attention to learn node representation in a hierarchical manner. To alleviate the deep degradation phenomenon (a.k.a, semantic confusion), HPN improves the aggregating process of HGNN via emphasizing the characteristic of each node. After that, to further discover and learn graph structures, HGSL jointly learns the heterogeneous graph and the GNN parameters for downstream tasks.
4.2 Heterogeneous Graph Attention Network
Section titled “4.2 Heterogeneous Graph Attention Network”4.2.1 Overview
Section titled “4.2.1 Overview”A recent research trend in deep learning is the attention mechanism, which deals with variable sized data and encourages the model to focus on the most salient parts of data. It has demonstrated the effectiveness in deep neural network framework and is widely applied to various applications, such as text analysis [1], knowledge graph [28], and image processing [37]. Graph Attention Network (GAT) [33], a novel convolution-style graph neural network, leverages attention mechanism for the homogeneous graph which includes only one type of nodes or links.
Despite the success of attention mechanism in deep learning, it has not been considered in the graph neural network framework for heterogeneous graph. As a matter of fact, the real-world graph usually comes with multi-types of nodes and edges, which we uniformly call heterogeneous graph. Because the heterogeneous graph contains more comprehensive information and rich semantics, it has been widely used in many data mining tasks. Meta-path [31] is a widely used structure to capture the semantics. As can be seen in Fig. 4.1, depending on the meta-paths, the relation between nodes in the heterogeneous graph can have different semantics. Due to the complexity of heterogeneous graph, traditional graph neural network cannot be directly applied to heterogeneous graph.
Based on the above analysis, when designing graph neural network architecture with attention mechanism for heterogeneous graph, we need to address the following new requirements. (1) Heterogeneity of graph. The heterogeneity is an intrinsic property of heterogeneous graph, i.e., various types of nodes and edges. How to handle such complex structural information and preserve the diverse feature information simultaneously is an urgent problem that needs to be solved. (2) Semantic-level attention. Different meaningful and complex semantic information are involved in heterogeneous graph, which is usually reflected by meta-paths [31]. Different meta-paths in heterogeneous graph may extract diverse semantic information. How to select the most meaningful meta-paths and fuse the semantic information for the specific task is an open problem [2, 23, 29]. (3) Node-level attention. In a heterogeneous graph, nodes can be connected via various types of relation, e.g., meta-path. Given a meta-path, each node has lots of meta-path based neighbors. How to distinguish the subtle difference of their neighbors and select some informative neighbors is required. For each node, node-level attention aims to learn the importance of meta-path based neighbors and assigns different attention values to them. Therefore, how to design a model which can discover the subtle differences of neighbors and learn their weights properly will be desired.
[!visual-conversion] Converted from the description in the surrounding text and caption.
flowchart LR
subgraph a["(a) Node types"]
Actor((Actor))
Movie[Movie]
Director((Director))
end
subgraph b["(b) IMDB heterogeneous graph"]
Actor -->|acts in| Movie
Director -->|directs| Movie
end
subgraph c["(c) Meta-paths"]
c1["MAM: Movie-Actor-Movie"]
c2["MDM: Movie-Director-Movie"]
end
subgraph d["(d) m1 and its meta-path neighbors"]
m1[m1] --- m2[m2]
m1 --- m3[m3]
end
Fig. 4.1 An illustrative example of a heterogeneous graph (IMDB). (a) Three types of nodes (i.e., actor, movie, director). (b) A heterogeneous graph IMDB consists of three types of nodes and two types of connections. (c) Two meta-paths involved in IMDB (i.e., Movie–Actor–Movie and Movie–Director–Movie). (d) Movie and its meta-path based neighbors (i.e., , , and )
In this section, we introduce a novel Heterogeneous graph Attention Network, named HAN, which considers both node-level and semantic-level attentions. In particular, given the node features as input, we use the type-specific transformation matrix to project different types of node features into the same space. Then the node-level attention is able to learn the attention values between the nodes and their meta-path based neighbors, while the semantic-level attention aims to learn the attention values of different meta-paths for the specific task in the heterogeneous graph. Based on the learned attention values in terms of the two levels, our model can get the optimal combination of neighbors and multiple meta-paths in a hierarchical manner, which enables the learned node representations to better capture the complex structure and rich semantic information in a heterogeneous graph. After that, the overall model can be optimized via backpropagation in an end-to-end manner.
[!visual-conversion] Converted from the description in the surrounding text.
flowchart LR
Input[Node features, multiple types] --> Proj["Type-specific transformation -> unified feature space"]
Proj --> NodeAttn["(a) Node-level attention: learns weight of each meta-path based node pair"]
NodeAttn --> SemAttn["(b) Semantic-level attention: learns weight of each meta-path, fuses semantic-specific representations"]
SemAttn --> Pred["(c) Prediction: loss + end-to-end optimization"]
Fig. 4.2 The overall framework of the proposed HAN. (a) All types of nodes are projected into a unified feature space and the weight of meta-path based node pair can be learned via node-level attention. (b) Joint learning the weight of each meta-path and fuse the semantic-specific node representation via semantic-level attention. (c) Calculate the loss and end-to-end optimization for the proposed HAN
4.2.2 The HAN Model
Section titled “4.2.2 The HAN Model”In this section, we provide more details about HAN. Specifically, this model follows a hierarchical attention structure: node-level attention → semantic-level attention. Figure 4.2 presents the whole framework of HAN. First, we propose a node-level attention to learn the weight of meta-path based neighbors and aggregate them to get the semantic-specific node representation. After that, HAN can tell the difference of meta-paths via semantic-level attention and get the optimal weighted combination of the semantic-specific node representation for the specific task.
4.2.2.1 Node-Level Attention
Section titled “4.2.2.1 Node-Level Attention”Before aggregating the information from meta-path neighbors for each node, we should notice that the meta-path based neighbors of each node play a different role and show different importance in learning node representation for the specific task. Here we introduce node-level attention can learn the importance of meta-path based neighbors for each node in a heterogeneous graph and aggregate the representation of these meaningful neighbors to form a node representation.
Due to the heterogeneity of nodes, different types of nodes have different feature spaces. Therefore, for each type of nodes (e.g., node with type ), we design the type-specific transformation matrix to project the features of different types of nodes into the same feature space. Unlike [10], the type-specific transformation matrix is based on node-type rather than edge-type. The projection process can be shown as follows:
where and are the original and projected feature of node , respectively. By type-specific projection operation, the node-level attention can handle arbitrary types of nodes.
After that, we leverage self-attention [32] to learn the weight among various kinds of nodes. Given a node pair which are connected via meta-path , the node-level attention can learn the importance which means how important node will be for node . The importance of meta-path based node pair can be formulated as follows:
Here denotes the deep neural network which performs the node-level attention. Given meta-path , is shared for all meta-path based node pairs. It is because there are some similar connection patterns under one meta-path. The above Eq. (4.2) shows that given meta-path , the weight of meta-path based node pair depends on their features. Please note that, is asymmetric, i.e., the importance of node to node and the importance of node to node can be quite different. It shows node-level attention can preserve the asymmetry which is a critical property of heterogenous graph.
Then we inject the structural information into the model via masked attention which means we only calculate the for nodes , where denotes the meta-path based neighbors of node (include itself). After obtaining the importance between meta-path based node pairs, we normalize them to get the weight coefficient via softmax function:
where denotes the activation function, denotes the concatenate operation, and is the node-level attention vector for meta-path . As we can see from Eq. (4.3), the weight coefficient of depends on their features. Also please note that the weight coefficient is asymmetric which means they make different contribution to each other. This asymmetry is not only because the concatenate order in the numerator, but also because they have different neighbors so the normalize term (denominator) will be quite difference.
Then, the meta-path based representation of node can be aggregated by the neighbor’s projected features with the corresponding coefficients as follows:
where is the learned representation of node for the meta-path . To better understand the aggregating process of node level, we also give a brief explanation in Fig. 4.3a. Every node representation is aggregated by its neighbors. Since the attention weight is generated for single meta-path, it is semantic specific and able to capture one kind of semantic information.
Since heterogeneous graph present the scale-free property, the variance of graph data is quite high. To tackle the above challenge, we extend node-level attention to multihead attention so that the training process is more stable. Specifically, we repeat the node-level attention for times and concatenate the learned representations as the semantic-specific representation:
[!visual-conversion] Converted from the surrounding description: node-level aggregation weights a node’s meta-path based neighbors (asymmetric attention ); semantic-level aggregation then weights and fuses the resulting per-meta-path representations.
flowchart LR
subgraph a["(a) Node-level aggregating"]
hi["h_i"] --- eij["attention e_ij^Phi"]
hj["h_j (meta-path neighbor)"] --- eij
eij --> zPhi["z_i^Phi (semantic-specific embedding)"]
end
subgraph b["(b) Semantic-level aggregating"]
zPhi1["z_i^Phi1"] --> beta["attention beta over meta-paths"]
zPhi2["z_i^Phi2"] --> beta
beta --> zi["z_i (final embedding)"]
end
Fig. 4.3 Explanation of aggregating process in both node level and semantic level. (a) Node-level aggregating. (b) Semantic-level aggregating Fig. 4.3 Explanation of aggregating process in both node level and semantic level. (a) Node-level aggregating. (b) Semantic-level aggregating
Given the meta-path set , after feeding node features into node-level attention, we can obtain groups of semantic-specific node representations, denoted as .
4.2.2.2 Semantic-Level Attention
Section titled “4.2.2.2 Semantic-Level Attention”Generally, every node in a heterogeneous graph contains multiple types of semantic information, and semantic-specific node representation can only reflect node from one aspect. To learn a more comprehensive node representation, we need to fuse multiple semantics which can be revealed by meta-paths. To address the challenge of meta-path selection and semantic fusion in a heterogeneous graph, we propose a novel semantic-level attention to automatically learn the importance of different meta-paths and fuse them for the specific task. Taking groups of semantic-specific node representations learned from node-level attention as input, the learned weights of each meta-path can be shown as follows:
Here denotes the deep neural network which performs the semantic-level attention. It shows that the semantic-level attention can capture various types of semantic information behind a heterogeneous graph.
To learn the importance of each meta-path, we first transform semantic-specific representation through a non-linear transformation (e.g., one-layer MLP). Then we measure the importance of the semantic-specific representation as the similarity of transformed representation with a semantic-level attention vector . Furthermore, we average the importance of all the semantic-specific node representation which can be explained as the importance of each meta-path. The importance of each meta-path, denoted as , is shown as follows:
where is the weight matrix, is the bias vector, is the semantic-level attention vector. Note that for the meaningful comparison, all above parameters are shared for all meta-paths and semantic-specific representation. After obtaining the importance of each meta-path, we normalize them via softmax function. The weight of meta-path , denoted as , can be obtained by normalizing the above importance of all meta-paths using softmax function,
which can be interpreted as the contribution of the meta-path for specific task. Obviously, the higher , the more important meta-path is. Note that for different tasks, meta-path may have different weights. With the learned weights as coefficients, we can fuse these semantic-specific representations to obtain the final representation as follows:
To better understand the aggregating process of semantic level, we also give a brief explanation in Fig.4.3b. The final representation is aggregated by all semantic-specific representation. Then we can apply the final representation to specific tasks and design different loss function. For semi-supervised node classification, we can minimize the Cross-Entropy over all labeled node between the ground truth and the prediction:
where is the parameter of the classifier, is the set of node indices that have labels, and are the labels and representations of labeled nodes. With the guide of labeled data, we can optimize the proposed model via back propagation and learn the representations of nodes.
4.2.3 Experiments
Section titled “4.2.3 Experiments”4.2.3.1 Experimental Settings
Section titled “4.2.3.1 Experimental Settings”Datasets The experiments are conducted on three heterogeneous graphs including DBLP, ACM, and IMDB.
Baselines We compare with some state-of-the-art baselines, including the (heterogeneous) graph representation methods (i.e., DeepWalk [26], ESim [29], metapath2vec [4], and HERec [30]) and graph neural network-based methods (i.e., GCN [20] and GAT [33]), to verify the effectiveness of the proposed HAN. To verify the effectiveness of our node-level attention and semantic-level attention, respectively, we also test two variants of HAN (i.e., HAN and HAN).
[1] https://dblp.uni-trier.de. [2] http://dl.acm.org/. [3] https://www.kaggle.com/carolzhangdc/imdb-5000-moviedataset.
Implementation Details For the proposed HAN, we randomly initialize parameters and optimize the model with Adam [19]. For the proposed HAN, we set the learning rate to 0.005, the regularization parameter to 0.001, the dimension of the semantic-level attention vector to 128, the number of attention head to 8, and the dropout of attention to 0.6. And we use early stopping with a patience of 100, i.e. we stop training if the validation loss does not decrease for 100 consecutive epochs. To make our experiments repeatable, we make our dataset and codes publicly available at website.⁴
4.2.3.2 Classification
Section titled “4.2.3.2 Classification”Here we employ KNN classifier with to perform node classification. Since the variance of graph-structured data can be quite high, we repeat the process for 10 times and report the averaged Macro-F1 and Micro-F1 in Table 4.1.
Based on Table 4.1, we can see that HAN achieves the best performance. For traditional heterogeneous graph representation method, ESim which can leverage multiple meta-paths performs better than metapath2vec. Generally, graph neural network-based methods which combine the structure and feature information, e.g., GCN and GAT, usually perform better. To go deep into these methods, compared to simply average over node neighbors, e.g., GCN and HAN, GAT and HAN can weigh the information properly and improve the performance of the learned representation. Compared to GAT, the proposed HAN, which designs for heterogeneous graph, captures the rich semantics successfully and shows its superiority. Also, without node-level attention (HAN) or semantic-level attention (HAN), the performance becomes worse than HAN, which indicates the importance of modeling the attention mechanism on both of the nodes and semantics. Note that in ACM and IMDB, HAN improves classification results more significantly than in DBLP. Mainly because APCPA is much more important than the rest meta-paths.
Through the above analysis, we can find that the proposed HAN achieves the best performance on all datasets. The results demonstrate that it is quite important to capture the importance of nodes and meta-paths in heterogeneous graph analysis.
4.2.3.3 Analysis of Hierarchical Attention Mechanism
Section titled “4.2.3.3 Analysis of Hierarchical Attention Mechanism”A salient property of HAN is the incorporation of the hierarchical mechanism, which takes the importance of node neighbors and meta-paths into consideration in learning representative representation. Recall that we have learned the node-level attention weight and the semantic-level attention weight . To better
⁴ https://github.com/Jhy1993/HAN.
Table 4.1 Quantitative results (%) on the node classification task (bold means the best results)
[!visual-conversion] Table 4.1 (printed p. 80) scan-verified and corrected: the OCR pass lost all numeric data for this table, leaving 1300+ lines of repeated column-header fragments (“20%”, “Macro-F1”, …) with no values. Rebuilt against
assets/pages/page-084.png.
| Dataset | Metric | Training | DeepWalk | mp2vec | ESim | HERec | GCN | GAT | HAN | HAN | HAN |
|---|---|---|---|---|---|---|---|---|---|---|---|
| ACM | Macro-F1 | 20% | 77.25 | 65.09 | 77.32 | 66.17 | 86.81 | 86.23 | 88.15 | 89.04 | 89.40 |
| 40% | 80.47 | 69.93 | 80.12 | 70.89 | 87.68 | 87.04 | 88.41 | 89.41 | 89.79 | ||
| 60% | 82.55 | 71.47 | 82.44 | 72.38 | 88.10 | 87.56 | 87.91 | 90.00 | 89.51 | ||
| 80% | 84.17 | 73.81 | 83.00 | 73.92 | 88.29 | 87.33 | 88.48 | 90.17 | 90.63 | ||
| Micro-F1 | 20% | 76.92 | 65.00 | 76.89 | 66.03 | 86.77 | 86.01 | 87.99 | 88.85 | 89.22 | |
| 40% | 79.99 | 69.75 | 79.70 | 70.73 | 87.64 | 86.79 | 88.31 | 89.27 | 89.64 | ||
| 60% | 82.11 | 71.29 | 82.02 | 72.24 | 88.12 | 87.40 | 87.68 | 89.85 | 89.33 | ||
| 80% | 83.88 | 73.69 | 82.89 | 73.84 | 88.35 | 87.11 | 88.26 | 89.95 | 90.54 | ||
| DBLP | Macro-F1 | 20% | 77.43 | 90.16 | 91.64 | 91.68 | 90.79 | 90.97 | 91.17 | 92.03 | 92.24 |
| 40% | 81.02 | 90.82 | 92.04 | 92.16 | 91.48 | 91.20 | 91.46 | 92.08 | 92.40 | ||
| 60% | 83.67 | 91.32 | 92.44 | 92.80 | 91.89 | 90.80 | 91.78 | 92.38 | 92.80 | ||
| 80% | 84.81 | 91.89 | 92.53 | 92.34 | 92.38 | 91.73 | 91.80 | 92.53 | 93.08 | ||
| Micro-F1 | 20% | 79.37 | 91.53 | 92.73 | 92.69 | 91.71 | 91.96 | 92.05 | 92.99 | 93.11 | |
| 40% | 82.73 | 92.03 | 93.07 | 93.18 | 92.31 | 92.16 | 92.38 | 93.00 | 93.30 | ||
| 60% | 85.27 | 92.48 | 93.39 | 93.70 | 92.62 | 91.84 | 92.69 | 93.31 | 93.70 | ||
| 80% | 86.26 | 92.80 | 93.44 | 93.27 | 93.09 | 92.55 | 92.69 | 93.29 | 93.99 | ||
| IMDB | Macro-F1 | 20% | 40.72 | 41.16 | 32.10 | 41.65 | 45.73 | 49.44 | 49.78 | 50.87 | 50.00 |
| 40% | 45.19 | 44.22 | 31.94 | 43.86 | 48.01 | 50.64 | 52.11 | 50.85 | 52.71 | ||
| 60% | 48.13 | 45.11 | 31.68 | 46.27 | 49.15 | 51.90 | 51.73 | 52.09 | 54.24 | ||
| 80% | 50.35 | 45.15 | 32.06 | 47.64 | 51.81 | 52.99 | 52.66 | 51.60 | 54.38 | ||
| Micro-F1 | 20% | 46.38 | 45.65 | 35.28 | 45.81 | 49.78 | 55.28 | 54.17 | 55.01 | 55.73 | |
| 40% | 49.99 | 48.24 | 35.47 | 47.59 | 51.71 | 55.91 | 56.39 | 55.15 | 57.97 | ||
| 60% | 52.21 | 49.09 | 35.64 | 49.88 | 52.29 | 56.44 | 56.09 | 56.66 | 58.32 | ||
| 80% | 54.33 | 48.81 | 35.59 | 50.99 | 54.61 | 56.97 | 56.38 | 56.49 | 58.51 |
[!visual-conversion] Converted from the description in the surrounding text: paper P831 (ACM) connects, via the Paper–Author–Paper meta-path, to P699 and P133 (Data Mining), P2384 and P2328 (Database), and P1973 (Wireless Communication); node-level attention assigns P831 itself the highest weight.
flowchart LR
P831((P831)) -->|node attn: highest| P831
P831 -->|Data Mining| P699[P699]
P831 -->|Data Mining| P133[P133]
P831 -->|Database| P2384[P2384]
P831 -->|Database| P2328[P2328]
P831 -->|Wireless Comm.| P1973[P1973]
Fig. 4.4 Meta-path based neighbors of node P831 and corresponding attention values (different colors mean different classes, e.g., green means Data Mining, blue means Database, orange means Wireless Communication). (a) Meta-path based neighbors of P831. (b) Attention values of P831’s neighbors
understand the importance of the neighbors and meta-paths, we provide a detailed analysis on the hierarchical attention mechanism.
Analysis of Node-Level Attention As mentioned before, given a specific task, our model can learn the attention values between nodes and its neighbors in a meta-path. Some important neighbors which are useful for the specific task tend to have larger attention values. Here we take the paper P8315 in ACM dataset as an illustrative example. Given a meta-path Paper–Author–Paper which describes the co-author of different papers, we enumerate the meta-path based neighbors of paper P831 and their attention values are shown in Fig. 4.4. From Fig. 4.4a, we can see that P831 connects to P6996 and P1337, which all belong to Data Mining; connects to P23848 and P23289 while P2384 and P2328 both belong to Database; connects to P197310 while P1973 belongs to Wireless Communication. From Fig. 4.4b, we can see that paper P831 gets the highest attention value from node-level attention which means the node itself plays the most important role in learning its representation. It is reasonable because all information supported by neighbors are usually viewed as
[5] Xintao Wu, Daniel Barbara, Yong Ye. Screening and Interpreting Multi-item Associations Based on Log-linear Modeling, KDD’03. [6] Xintao Wu, Jianpin Fan, Kalpathi Subramanian. B-EM: a classifier incorporating bootstrap with EM approach for data mining, KDD’02. [7] Daniel Barbara, Carlotta Domeniconi, James P. Rogers. Detecting outliers using transduction and statistical testing, KDD’06. [8] Walid G. Aref, Daniel Barbara, Padmavathi Vallabhaneni. The Handwritten Trie: Indexing Electronic Ink, SIGMOD’95. [9] Daniel Barbara, Tomasz Imielinski. Sleepers and Workaholics: Caching Strategies in Mobile Environments, VLDB’95. [10] Hector Garcia-Holina, Daniel Barbara. The cost of data replication, SIGCOMM’81.
nd of supplementary information. Beyond itself, P699 and P133 get the second 1st largest attention values. This is because P699 and P133 also belong to Data Mining and they can make significant contribution to identify the class of P831. The rest neighbors get minor attention values because they do not belong to Data Mining and cannot make important contribution to identify the P831’s class. Based on the above analysis, we can see that the node-level attention can tell the difference among neighbors and assigns higher weights to some meaningful neighbors.
Analysis of Semantic-Level Attention As mentioned before, the proposed HAN can learn the importance of meta-paths for the specific task. To verify the ability of semantic-level attention, taking DBLP and ACM as examples, we report the clustering results (NMI) of single meta-path and corresponding attention values in Fig.4.5. Obviously, there is a positive correlation between the performance of a single meta-path and its attention value. For DBLP, HAN gives APCPA the largest weight, which means that HAN considers the APCPA as the most critical meta-path in identifying the author’s research area. It makes sense because the author’s research area and the conferences they submitted are highly correlated. For example, some natural language processing researchers mainly submit their papers to ACL or EMNLP, whereas some data mining researchers may submit their papers to KDD or WWW. Meanwhile, it is difficult for APA to identify the author’s research area well. If we treat these meta-paths equally, e.g., HAN, the performance will drop significantly. Based on the attention values of each meta-path, we can find that the meta-path APCPA is much more useful than APA and APTPA. So even the proposed HAN can fuse them, APCPA still plays a leading role in identifying the author’s research area while APA and APTPA do not. It also explains why the performance of HAN in DBLP may not be as significant as in ACM and IMDB. We get the similar conclusions on ACM. For ACM, the results show that HAN gives the most considerable weight to PAP. Since the performance of PAP is slightly better than
[!visual-conversion] Bar charts (not precisely re-creatable without the source values): NMI scores for each single meta-path on DBLP and on ACM, paired with that meta-path’s learned semantic-level attention weight. On DBLP, APCPA receives much higher attention and NMI than APA and APTPA; on ACM, PAP receives the highest attention, closely followed by PSP.
Fig. 4.5 Performance of single meta-path and corresponding attention value. (a) NMI values on DBLP. (b) NMI values on ACM

Source scan (printed p. 82): the bar charts of Fig. 4.5 — quantitative values are not recoverable from the prose summary, so the raster is retained.
4.3 Heterogeneous Graph Propagation Network
Section titled “4.3 Heterogeneous Graph Propagation Network”PSP, so HAN can achieve good performance by simple average operation. We can see that semantic-level attention can reveal the difference between these meta-paths and weights them adequately.
The detailed method description and validation experiments can been seen in [35].
4.3.1 Overview
Section titled “4.3.1 Overview”Recently, several HGNNs [13, 13, 35, 38] have been proposed to better analyze heterogeneous graphs, which usually follow two step aggregating process in a hierarchical manner: aggregate neighbors via single meta-path in node level and then aggregate rich semantics via multiple meta-paths in semantic level. When applying HGNNs in practice, we find an important phenomenon, called semantic confusion. Similar to over-smoothing in homogeneous GNNs [18], semantic confusion means HGNNs inject confused semantics extracted via multiple meta-paths into node representation, which makes the learned node representation indistinguishable and leads to worse performance with more hidden layers. Figure 4.6 shows the clustering performance of HAN on ACM academic graph [35]. It clearly displays that with the growth of model depth, the performance of HGNNs is getting worse and worse.
Semantic confusion makes HGNNs hard to become a really deep model, which severely limits their representation capabilities and hurts the performance of downstream tasks. Alleviating the semantic confusion phenomenon to build a more powerful deeper HGNNs is an urgent problem.
In this section, we theoretically analyze the semantic confusion in HGNNs and prove that HGNNs and multiple meta-paths based random walk [22] are essentially equivalent. Then we propose a novel Heterogeneous Graph Propagation Network (HPN) to alleviate semantic confusion from the perspective of multiple meta-paths based random walk, which mainly consists of two parts: semantic propagation mechanism and semantic fusion mechanism. Besides aggregating information from meta-path based neighbors, the semantic propagation mechanism also absorbs node’s local semantics with a proper weight. So even with more hidden layers, semantic propagation mechanism can capture the characteristics of each node rather than inject confused semantics into node representation and thus alleviates semantic confusion. The semantic fusion mechanism aims to learn the importance of meta-paths and fuses them for comprehensive node representation.
[!visual-conversion] Scatter-plot visualization (not precisely re-creatable without the source coordinates): as HAN’s depth grows from 1 to 5 layers, paper embeddings colored by research area move from well-separated clusters (1 layer) to an indistinguishable mix (4+ layers) — the “semantic confusion” effect described in the text.
Fig. 4.6 The clustering results and visualization of paper representations via HAN with different layers. Each point denotes one paper and corresponding color indicates the label (i.e., research areas). With the growth of model depth, semantic confusion happens which means the learned node representations become indistinguishable. For example, the paper representations belonging to different research areas which are learned via 1-layer HAN located in different positions, while the paper representations learned via 4-layer HAN mixed together. (a) Cluster results of HAN with 1, 2, 3, 4, 5 layers. (b) Paper representation via 1-layer HAN. (c) Paper representation via 2-layer HAN. (d) Paper representation via 3-layer HAN. (e) Paper representation via 4-layer HAN

Source scan (printed p. 84): the five scatter plots of Fig. 4.6 — cluster geometry is not recoverable from the prose summary, so the raster is retained.
4.3.2 Semantic Confusion Analysis
Section titled “4.3.2 Semantic Confusion Analysis”We first give a brief review of HGNNs, and then prove that HGNNs and multiple meta-paths based random walk are essentially equivalent. Lastly, we explain why semantic confusion happens from the perspective of limit distribution of multiple meta-paths based random walk.
4.3.2.1 Heterogeneous Graph Neural Network
Section titled “4.3.2.1 Heterogeneous Graph Neural Network”As shown in Fig.4.3, HGNNs (e.g., HAN) aggregate information from multiple meta-paths and update node representation in both node level and semantic level. Specially, as shown in Fig.4.3a, given a meta-path and node , node level attention in HAN aggregates the meta-path based neighbors with attentions to learn the semantic-specific node representation for node . Given one meta-path , the node-level aggregating is defined as:
where denotes node feature matrix, where the -th row corresponds to the -th node. And is an activate function, the element of denotes the learned attention weight between meta-path based node pair via node-level attention by the -th layer. Note that is a (row-normalized) probability matrix and denotes the learned representation matrix by the -th layer, where the -th row corresponds to the -th node. As shown in Fig.4.3b, given a node and a set of meta-paths , semantic-level aggregating in HAN fuses semantic-specific node representations with attentions to get the final representation for node . The semantic-level aggregating is shown as follows:
where denotes the final node representation.
4.3.2.2 Relationship Between HGNNs and Multiple Meta-Paths Based Random Walk
Section titled “4.3.2.2 Relationship Between HGNNs and Multiple Meta-Paths Based Random Walk”As a classical heterogeneous graph algorithm, multiple meta-paths based random walk [22] mainly contains: single meta-path based random walk and multiple meta-path combinations. Given a meta-path , we have the meta-path based probability matrix whose element denotes the transition probability from node to via meta-path . Then, the -step single meta-path based random walk is defined as:
where denotes the distribution of -step single meta-path based random walk. Considering a set of meta-paths and their weights , the -step multiple meta-paths based random walk is defined as:
where denotes the distribution of -step multiple meta-paths based random walk. For -step single meta-path based random walk:
Theorem 1 Assuming a heterogeneous graph is aperiodic and irreducible, if we take the limit , then -step meta-path based random walk will converge to a meta-path specific limit distribution which is independent of nodes:
Different nodes connected via some relationships will influence each other and [18] demonstrates the influence distribution between two nodes is proportional to random walk distribution, shown as the following theorem:
Theorem 2 ([18]) For the aggregation models (e.g., graph neural networks) on homogeneous graph, if the graph is aperiodic and irreducible, then the influence distribution of node is equivalent, in expectation, to the -step random walk distribution.
By Theorems 1 and 2, we conclude the influence distribution revealed by single meta-path based random walk is independent of nodes. Comparing Eq.4.11 with Eq.4.13, we find they both propagate and aggregate information via meta-path . The difference is that is a parameter matrix learned via node-level attention, while is a pre-defined matrix. Since and are both probability matrix, they are actually meta-path related Markov Chain. So we find that node-level aggregation in HGNNs is essentially equivalent to meta-path based random walk if activate function is a linear function. So, if we stack infinite layers in node-level aggregating, the learned node representations will only be influenced by the meta-path and therefore are independent of nodes. So the learned node representations cannot capture the characteristics of each node and therefore are indistinguishable. For -step multiple meta-paths based random walk, we have:
Theorem 3 Assuming -step single meta-path based random walk is independent of each other; if we take the limit , then the limit distribution of -step multiple meta-paths based random walk is a weighted combination of single meta-path based random walk limit distribution, shown as follows:
By Theorems 2 and 3, we conclude the influence distribution revealed by multiple meta-paths based random walk is independent of nodes. Comparing Eq. 4.12 with Eq. 4.14, we can see that they both combine multiple meta-paths according to their weights. The difference is that semantic-level aggregating in HAN leverages neural network to learn the weight of meta-path , while multiple meta-paths based random walk assigns pre-defined weight to meta-path by hand. Recall that in node-level aggregation, the node representations learned via single meta-path cannot capture the characteristics of each node and therefore are indistinguishable. In semantic-level aggregation, HGNNs fuse multiple node representations learned via multiple node-level aggregations with semantic-wise weights. In summary, the final node representations learned via node and semantic level were only influenced by a set of meta-paths and still remain indistinguishable, which is the critical limitation of HGNNs and leads to semantic confusion.
4.3.3 The HPN Model
Section titled “4.3.3 The HPN Model”4.3.3.1 Semantic Propagation Mechanism
Section titled “4.3.3.1 Semantic Propagation Mechanism”Given one meta-path , the semantic propagation mechanism first projects node into semantic space via semantic projection function . Then, it aggregates information from meta-path based neighbors via semantic aggregation function to learn semantic-specific node representation, shown as follows:
here X denotes initial feature matrix and Z^Φ denotes semantic-specific node representation. To handle heterogeneity graph, the semantic projection function f_Φ projects node into semantic space, shown as follows:
where is the projected node feature matrix, and denote weight matrix and bias vector for meta-path , respectively. To alleviate semantic confusion, we design semantic aggregation function , shown as follows:
where denotes node representation learned by -th layer semantic propagation mechanism and we take it as the semantic-specific node representation . Note that reflects the characteristics of each node in meta-path (also can be viewed as ) and means aggregating information from meta-path based neighbors. Here is a weight scalar which indicates the importance of characteristic of node in aggregating process.
Why Semantic Aggregation Function Works Here we establish the relationship between semantic aggregation function and -step meta-path based random walk with restart. -step meta-path based random walk with restart for node is defined as:
where is a one-hot vector of node , means the restart probability. For -step meta-path based random walk with restart:
Theorem 4 Assuming a heterogeneous graph is aperiodic and irreducible, if we take the limit , then -step meta-path based random walk with restart will converge to which is related to the start node :
By Theorems 2 and 4, we conclude that the influence distribution revealed by meta-path based random walk with restart is related to nodes. Comparing Eq. 4.19 to Eq. 4.20, we find they both emphasis node’s local semantics with a proper weight . By Theorem 4, we can see that the semantic aggregation function absorbs node’s local semantics and makes semantic-specific node representation distinguish from each other even if we take the limit . So semantic propagation mechanism can alleviate the semantic confusion.
4.3.3.2 Semantic Fusion Mechanism
Section titled “4.3.3.2 Semantic Fusion Mechanism”Generally, every node in a heterogeneous graph contains multiple types of semantic information and semantic-specific node representation can only reflect node from one aspect. To describe node more comprehensively, we leverage multiple meta-paths to capture rich semantics and describe node from different aspects.
Given a set of meta-paths , we have group semantic-specific node representations . Then, we propose the semantic fusion mechanism to fuse them for the specific task. Taking groups of semantic-specific node representations learned from semantic propagation mechanism as input, the final node representation learned via semantic fusion mechanism is shown as follows:
Intuitively, not all meta-paths should be treated equally. So semantic fusion mechanism should be able to tell the difference of meta-paths and assign different weights to them. To learn the importance of meta-paths, we project each semantic-specific node representation into the same latent space and adopt semantic fusion vector to learn the importance of meta-paths. The importance of meta-path , denoted as , is defined as:
where and denote weight matrix and bias vector, respectively, which are shared for all meta-paths. Note that all parameters in semantic fusion mechanism are shared for all nodes and semantics. After obtaining the importance of meta-paths, we normalize them via softmax function to get the weight of each meta-path. The weight of meta-path , denoted as , is defined as:
Obviously, the higher , the more important meta-path is. With the learned weights as coefficients, we can fuse semantic-specific representations to obtain the final representation as follows:
Then we can optimize the whole model for the specific task and learn the final node representation. Note that semantic fusion mechanism is quite flexible and be optimized for various types of tasks. For different tasks, each semantic may make different contribution which means may change a lot. For semi-supervised node classification, we calculate Cross-Entropy and update parameters in HPN:
where is a projection matrix which projects the node representation as a node label vector, is the set of labeled nodes, and are the label vector and representation of the labeled node , respectively.
For unsupervised node recommendation, we leverage BPR loss with negative sampling [34] to update parameters in HPN:
where and denote the set of observed (positive) node pairs and the set of negative node pairs sampled from all unobserved node pairs, respectively.
4.3.4 Experiments
Section titled “4.3.4 Experiments”4.3.4.1 Experimental Settings
Section titled “4.3.4.1 Experimental Settings”Datasets Three datasets including Yelp, ACM, and IMDB, and MovieLens (ML for short) are used to evaluate the proposed model.
Baselines HPN is compared with some state-of-the-art baselines, including the (heterogeneous) graph representation including metapath2vec [4] and HERec [30], and (heterogeneous) GNNs including GCN [20], GAT [33], PPNP [21], HAN [35], MEIRec [6], MAGNN [8], and HGT [14] to verify the effectiveness of the proposed HPN. Meanwhile, we also test two variants of HPN (i.e., HPN and HPN) to verify the effectiveness of different parts in our model.
[11] https://www.yelp.com. [12] http://dl.acm.org/. [13] https://www.kaggle.com/carolzhangdc/imdb-5000-moviedataset. [14] https://grouplens.org/datasets/movielens/.
4.3.4.2 Clustering
Section titled “4.3.4.2 Clustering”Following the previous work [35], we get the learned node representations of all models via feed forward, and then leverage classical node clustering to test their effectivenesses. Here we utilize the -Means to perform node clustering and the number of clusters is set to the number of classes, then select and to evaluate the clustering task and report the averaged results of 10 runs in Table 4.2.
As can be seen, the proposed HPN performs significantly better than all baselines. It shows the importance of alleviating semantic confusion in HGNNs. We also find that graph neural networks always perform better than graph representation methods. Moreover, heterogeneous graph neural networks including HAN, MEIRec, HGT, MAGNN, and HPN outperform homogeneous GNNs because they can capture rich semantics and describe the characteristic of node more comprehensively. Note that the performance of HPN and HPN both show different degradations, which imply the importance of semantic propagation mechanism and semantic fusion mechanism. Based on the above analysis, we can find that the proposed HPN can propagate and fuse semantic information effectively and shows significant improvements.
4.3.4.3 Robustness to Model Depth
Section titled “4.3.4.3 Robustness to Model Depth”A salient property of HPN is the incorporation of the semantic propagation mechanism which is able to alleviate the semantic confusion and build a deeper and more powerful HGNN. Comparing to the previous HGNNs (e.g., HAN), the proposed HPN can stack more layers and learn more representative node representation. To show the superiority of semantic propagation in HPN, we test HAN and HPN with 1, 2, 3, 4, 5 layers, shown in Fig. 4.7.
As can be seen, with the growth of model depth, the performance of HAN performs worse and worse on both ACM and IMDB and we believe this phenomenon is the semantic confusion, leading to the degradation of previous heterogeneous GNNs (e.g., HAN). Obviously, semantic confusion makes HGNNs hard to become a really deep model, which severely limits their representation capabilities and hurts the performance of downstream tasks (e.g., node clustering). On the other hand, with the growth of model depth, the performance of the proposed HPN is getting better and better, indicating that semantic propagation mechanism is able to effectively alleviate the semantic confusion. So even stacking for more layers, the node representations learned via the proposed HPN are still distinguishable. In summary, the proposed HPN is able to capture high-order semantics and learns more representative node representation with deeper architecture, rather than learning indistinguishable node representation.
The detailed method description and validation experiments can been seen in [15].
Table 4.2 Quantitative results (%) on the node clustering task. The larger values, the better performance (bold means the best results)
| Datasets | Metrics | mp2vec | HERec | GCN | GAT | PPNP | MEIRec | HAN | HGT | MG | HPNpro | HPNfus | HPN |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Yelp | NMI | 42.04 | 0.30 | 32.58 | 42.30 | 40.60 | 30.09 | 45.46 | 47.82 | 47.56 | 44.36 | 12.86 | 48.90 |
| ARI | 38.27 | 0.41 | 23.30 | 41.52 | 37.72 | 27.88 | 41.39 | 42.91 | 43.24 | 42.57 | 10.54 | 44.89 | |
| ACM | NMI | 21.22 | 40.70 | 51.40 | 57.29 | 61.68 | 61.56 | 61.56 | 60.89 | 64.12 | 65.60 | 67.55 | 68.21 |
| ARI | 21.00 | 37.13 | 53.01 | 60.43 | 65.15 | 61.46 | 64.39 | 59.85 | 66.29 | 69.30 | 71.53 | 72.33 | |
| IMDB | NMI | 1.20 | 1.20 | 5.45 | 8.45 | 10.20 | 11.32 | 10.87 | 11.59 | 11.79 | 9.45 | 12.01 | 12.31 |
| ARI | 1.70 | 1.65 | 4.40 | 7.46 | 8.20 | 10.40 | 10.01 | 9.92 | 10.32 | 8.02 | 12.32 | 12.55 |
[!visual-conversion] Line charts (not precisely re-creatable without the source values): as model depth grows from 1 to 5 layers, HAN’s NMI declines on ACM, IMDB, and Yelp (semantic confusion), while HPN’s NMI improves or stays stable on all three datasets over the same depth range.
Fig. 4.7 Three line graphs showing NMI values for HAN and HPN across layers 1 to 5 for datasets ACM, IMDB, and Yelp

Source scan (printed p. 93): the line charts of Fig. 4.7 — quantitative values are not recoverable from the prose summary, so the raster is retained. Fig. 4.7 Clustering results of HAN/HPN with 1,2,3,4,5 layers. (a) ACM. (b) IMDB. (c) Yelp
4.4 Heterogeneous Graph Structure Learning
Section titled “4.4 Heterogeneous Graph Structure Learning”4.4.1 Overview
Section titled “4.4.1 Overview”Most HGNNs follow a message passing scheme where the node representation is learned by aggregating and transforming the representations of its original neighbors [11, 39, 42] or meta-path based neighbors [8, 14, 35, 38], which rely on one fundamental assumption, i.e., the raw heterogeneous graph structure is good. However, as heterogeneous graphs are usually extracted from complex interaction systems by some pre-defined rules, such assumption cannot be always satisfied. One reason is that, these interaction systems inevitably contain some uncertain information or mistakes. Taking a user–item graph built from recommendation as an example, it is well accepted that users may misclick some unwanted items, bringing noisy information to the graph. The other reason is that, the heterogeneous graphs are often extracted with data cleaning, feature extraction, and feature transformation by some pre-defined rules, which are usually independent to the downstream tasks and lead to the gap between the extracted graph and the optimal graph structure for the downstream tasks. Therefore, learning an optimal heterogeneous graph for GNN is a fundamental problem.
Recently, to alleviate the limitation of GNNs and adaptively learn graph structures for GNNs, graph structure learning (GSL) methods [3, 7, 16, 17] are proposed to jointly learn the GNN parameters and graph structure simultaneously. However, these methods cannot be directly applied to HGs with the following challenges: (1) The heterogeneity of graphs. When learning a homogeneous graph with only one type of relation, we usually only need to parameterize one adjacency matrix. However, a heterogeneous graph consists of multiple relations, each of which reflects one aspect of the heterogeneous graph. Treating the heterogeneous graph as a homogeneous graph and failure to distinguish between these heterogeneous relations will inevitably restrict the capability of graph structure learning, but how to deal with this heterogeneity is a challenging problem. (2) The complex interactions in heterogeneous graphs. Different relations and node features have complex interactions, which drives the formation of different kinds of underlying graph structure [40]. Moreover, the combination of different relations further forms
.large number of high-order relationships with diverse semantics, which also implies distinct ways of graph generation. The heterogeneous graph structure will be affected by all these factors; therefore, these complex interactions must be thoroughly considered in heterogeneous graph structure learning.
In this section, we introduce an interesting work that makes the first attempt to investigate Heterogeneous Graph Structure Learning for graph neural networks, called HGSL. In HGSL, the heterogeneous graph and the GNN parameters are jointly learned towards better node classification performance. Particularly, in the graph learning part, aiming to capture the heterogeneous metric of different relation generation, each relation subgraph is separately learned. Specifically, for each relation, three types of candidate graphs, i.e. the feature similarity graph, feature propagation graphs, and semantic graphs, are generated by mining the complex correlations from heterogeneous node features and graph structures. The learned graphs are further fused to a heterogeneous graph and fed to a GNN. The graph learning parameters and the GNN parameters are jointly optimized towards classification objective.
4.4.2 The HGSL Model
Section titled “4.4.2 The HGSL Model”We firstly introduce some basic concepts and formalize the problem of heterogeneous graph structure learning as follows:
Definition 1 Node-Relation Triple A node-relation triple describes that two nodes (head node) and (tail node) are connected by relation . We further define the type mapping functions that map the relation to its head node type and tail node type, respectively.
Example 1 In a user–item heterogeneous graph, say (a user buys an item), then we have and .
Definition 2 Relation Subgraph Given a heterogeneous graph , a relation subgraph is a subgraph of that contains all node-relation triples with relation . The adjacency matrix of is , where if exists in , otherwise . denotes the relation subgraph set of all the relation subgraphs in , i.e. .
Definition 3 Heterogeneous Graph Structure Learning (HGSL) Given a heterogeneous graph , the task of heterogeneous graph structure learning is to jointly learn a heterogeneous graph structure, i.e. a new relational subgraph set , and the parameters of GNN for downstream tasks.
4.4.2.1 Model Framework
Section titled “4.4.2.1 Model Framework”Figure 4.8a illustrates the framework of the proposed HGSL. As we can see, given a heterogeneous graph, HGSL firstly constructs the semantic representation matrices
[!visual-conversion] Converted from the surrounding model description.
flowchart TB
subgraph a["(a) Model framework"]
HG["Heterogeneous graph G: original A_r, node features, meta-path semantics Z"] --> FeatGraph["Feature graph S_r^Feat"]
HG --> SemGraph["Semantic graph S_r^Sem"]
FeatGraph --> Fuse["Fuse with original A_r -> learned A_r'"]
SemGraph --> Fuse
Fuse --> GNN["GNN + regularizer"] --> Loss["Regularized classification loss (joint optimization)"]
end
subgraph b["(b) Feature graph generator"]
Feat[Node features] --> FS["Feature similarity graph (metric learning)"]
FS --> FP["Feature propagation graph (via topology)"]
FS --> ChAttn["Channel attention"]
FP --> ChAttn
ChAttn --> FeatGraphOut["Feature graph S_r^Feat"]
end
subgraph c["(c) Semantic graph generator"]
MP["M meta-paths"] --> SemRep["Meta-path based semantic representations Z"] --> SemGraphOut["Semantic graph S_r^Sem"]
end
Fig. 4.8 Overview of the HGSL framework. (a) Model framework. (b) Feature graph generator. (c) Semantic graph generator
by meta-path based node representations from meta-paths. Afterwards, the heterogeneous graph structure and GNN parameters are trained jointly. For the graph learning part, HGSL takes the information from the original relation subgraph, the node features, and the semantic representations as input and generates relation subgraphs separately. Specifically, taking relation as an example, HGSL learns a feature graph and a semantic graph and fuse them with the original graph to obtain the learned relation subgraph . Then, the learned subgraphs are fed into a GNN and a regularizer to perform node classification with regularization. By minimizing the regularized classification loss, HGSL optimizes the graph structure and the GNN parameters jointly.
4.4.2.2 Feature Graph Generator
Section titled “4.4.2.2 Feature Graph Generator”Since the original graph may not be optimal for downstream task, a natural idea would be to augment the original graph structure via fully utilizing the rich information inside heterogeneous node features. Usually, there are two factors that affect the formation of graph structure based on features. One is the similarity between node features, and the other is the relationship between node feature and relation in HG [36]. As shown in Fig.4.8b, we first propose to generate a feature similarity graph that captures the potential relationship generated by node features via heterogeneous feature projection and metric learning. Then we propose to generate the feature propagation graph, by propagating feature similarity matrices through topology structure. Finally, the generated feature similarity graph and feature propagation graph are aggregated to a final feature graph through a channel attention layer.
Feature Similarity Graph
The feature similarity graph determines the possibility of an edge with type between two nodes based on node features. Specifically, for each node of type with feature vector , we adopt a type-specific mapping layer to project the feature to a -dimensional common feature :
where denotes a non-linear activation function, and denote the mapping matrix and the bias vector of type , respectively. Then, for a relation , we perform metric learning on the common features and obtain the learned feature similarity graph , where the edge between nodes and is obtained by:
where is the threshold that controls the sparsity of feature similarity graph, and larger implies a more sparse feature similarity graph. is a K-head weighted cosine similarity function defined as:
where denotes the Hadamard product, and is the learnable parameter matrix of that weights the importance of different dimensions of the feature vectors. By performing metric learning as in Eq. 4.30 and ruling out edges with little feature similarity by threshold , HGSL learns the candidate feature similarity graph .
Feature Propagation Graph
The feature propagation graph is the underlying graph structure generated by the interaction between node features and topology structure. The key insight is that two nodes with similar features may have similar neighbors. Therefore, the process of generating feature propagation graph is two-fold: Firstly, generate the feature similarity graphs, i.e. find the similar nodes; secondly, propagate the feature similarity graph by topological structure to generate new edges, i.e. find the neighbors of the nodes with similar features.
Specifically, for each relation , assume that we have two types of nodes and , and the topology structure between them is . For the nodes with the same type , we can obtain the feature similarity:
where the threshold controls the sparsity of feature similarity graph . is the metric learning function in the framework of Eq.4.30 with different parameters . Then we can model the head feature propagation graph using and as follows:
As we can see, the feature similarity is propagated through the original graph topological structure and further generates the potential feature propagation graph structure. As for the nodes with the same type , similar to Eq.4.31, we can obtain the corresponding feature similarity graph with parameters . Therefore, the corresponding feature propagation graph can be obtained as follows:
Now, we have generated one feature similarity graph and two feature propagation graphs and . The overall feature graph for relation , denoted as , can be obtained by fusing these graphs through a channel attention layer [38]:
where is the stacked matrix of the feature candidate graphs, and denotes a channel attention layer with parameters which performs convolution on the input using . In this way, HGSL balances the importance of each candidate feature graph for each relation by learning different weights, respectively.
4.4.2.3 Semantic Graph Generator
Section titled “4.4.2.3 Semantic Graph Generator”The semantic graph is generated depending on the high-order topology structure in HG, describing the multi-hop structural interactions between two nodes. Notably, in heterogeneous graphs, these high-order relationships differ from each other with different semantics determined by meta-paths. In light of this, we propose to learn semantic graph structures from different semantics.
iven a meta-path with the corresponding relations , a straightforward way to generate semantic graph would be fusing the adjacency matrices, i.e. [38]. However, this method not only costs large memory with the computation of stacking multiple layers of adjacency matrices, but also discards the intermediate nodes which lead to information loss [8].
Alternatively, we propose a semantic graph generator shown in Fig. 4.8c. The semantic graph generator generates the potential semantic graph structure by metric learning on trained meta-path based node representations. Specifically, for an interested meta-path set with meta-paths, HGSL uses trained MP2Vec [5] representations, denoted as , to generate semantic graphs. Since the training process of semantic representations is off-line, the computation cost and model complexity is largely reduced. Moreover, thanks to the mechanism of heterogeneous skip-gram, the information of intermediate nodes is well preserved.
After obtaining the semantic representations , for each meta-path , we generate a candidate semantic subgraph adjacency matrix , where each edge is calculated by:
where stands for the th row of , and is the metric learning function with parameters . We can see that a relation will generate candidate semantic subgraphs, so the overall semantic subgraph for relation , denoted as , can be obtained by aggregating them:
where is the stacked matrix of candidate semantic graphs. denotes a channel attention layer whose weight matrix represents the importance of different meta-path based candidate graphs. After we obtain the aggregated semantic graph , the overall generated graph structure for relation can be obtained by aggregating the learned feature graph and semantic graph along with the original graph structure:
where is the stacked matrix of the candidate graphs. is the channel attention layer whose weight matrix denotes the importance of candidate graphs in fusing the overall relation subgraph . With a new relation adjacency matrix for each relation , a new heterogeneous graph structure is generated, i.e. .
4.4.2.4 Optimization
Section titled “4.4.2.4 Optimization”In this section, we show how HGSL jointly optimizes the graph structure and the GNN parameters for downstream task. Here we focus on GCN [20] and node classification. Please note that, with the learned graph structure , our model can be applied to other homogeneous or heterogeneous GNN methods and other tasks. A two layer GCN with parameters on the learned graph structure , can be described as:
where is the original node feature matrix, i.e. if the dimensions of all features are identical; otherwise, we use the common feature to construct , i.e. . The adjacency matrix is constructed from the learned heterogeneous graph by considering all nodes as one type. , where . Thus, the classification loss of GNN, i.e. , on the learned graph can be obtained by:
where is the predicted label of node and measures the difference between prediction and the true label such as cross-entropy.
Since graph structure learning methods enable the original GNN with stronger ability to fit the downstream task, it would be easier for them to over-fit. Thus, we apply regularization term to the learned graph as follows:
This term encourages the learned graph to be sparse. The overall loss can be obtained by:
By minimizing , HGSL optimizes heterogeneous graph structure and the GNN parameters jointly towards better downstream task performance.
4.4.3 Experiments
Section titled “4.4.3 Experiments”4.4.3.1 Experimental Settings
Section titled “4.4.3.1 Experimental Settings”Datasets Three datasets including Yelp,¹⁵ ACM,¹⁶ and DBLP¹⁷ are used to evaluate the proposed model.
Baselines HGSL are compared with eleven state-of-the-art representation methods including four homogeneous graph representation methods, i.e., DeepWalk [27], GCN [20], GAT [33], and GraphSAGE [9], four heterogeneous graph representation methods, i.e., MP2Vec [5], HAN [35], HeGAN [12], and GTN [38], and three graph structure learning related methods, i.e. LDS [7], Pro-GNN [17], and Geom-GCN [25].
Experimental Settings For all GNN-related models, the number of layers is set as 2 for a fair comparison. The feature dimension in common space and the representation dimension for all methods are set as 16 and 64, respectively. We choose the popular meta-paths adopted in previous methods [5, 24, 35] for meta-path based models and report the best result. For our proposed model, we use 2-head cosine similarity function defined in Eq. 4.30, i.e. . We set learning rate and weight decay as 0.01 and 0.0005, respectively. Other hyper-parameters, namely , and , are tuned by grid search. The code and datasets are publicly available on Github.¹⁸
4.4.3.2 Node Classification
Section titled “4.4.3.2 Node Classification”In this section, the performance of HGSL on node classification task is shown. Macro-F1 and Micro-F1 are selected as the metrics for evaluation. The mean and standard deviation of percentage of the metric values are shown in Table 4.3, from which we have following observations: (1) With the capability to adaptively learn the heterogeneous graph structure, HGSL consistently outperforms all the baselines. It demonstrates the effectiveness of our proposed model. (2) Graph structure learning methods generally outperform the original GCN since it enables GCN to aggregate feature from the learned structure. (3) HGNN methods, i.e. HAN, GTN, and HGSL achieve better performance compared to GNNs since the heterogeneity is addressed. (4) GNN-based methods mostly outperform random walk-based graph representation methods since the node features are utilized. This phenomenon becomes more obvious when it comes to Yelp dataset, since the node features, i.e. keywords, are helpful in classifying business categories.
[15] https://www.yelp.com. [16] http://dl.acm.org/. [17] https://dblp.uni-trier.de. [18] https://github.com/Andy-Border/HGSL.
Table 4.3 Performance evaluation of node classification (mean in percentage ± standard deviation) (bold means the best results)
| DBLP | ACM | Yelp | |
|---|---|---|---|
| Macro-F1 | Micro-F1 | Macro-F1 | |
| DeepWalk | 88.00 ± 0.47 | 89.13 ± 0.41 | 80.65 ± 0.60 |
| GCN | 83.38 ± 0.67 | 84.40 ± 0.64 | 91.32 ± 0.61 |
| GAT | 77.59 ± 0.72 | 78.63 ± 0.72 | 92.96 ± 0.28 |
| GraphSage | 78.37 ± 1.17 | 79.39 ± 1.17 | 91.19 ± 0.36 |
| MP2Vec | 88.86 ± 0.19 | 89.98 ± 0.17 | 78.63 ± 0.11 |
| HAN | 90.53 ± 0.24 | 91.47 ± 0.22 | 91.67 ± 0.39 |
| HeGAN | 87.02 ± 0.37 | 88.34 ± 0.38 | 82.04 ± 0.77 |
| GTN | 90.42 ± 1.29 | 91.41 ± 1.09 | 91.91 ± 0.58 |
| LDS | 75.65 ± 0.20 | 76.63 ± 0.18 | 92.14 ± 0.16 |
| Pro-GNN | 89.20 ± 0.15 | 90.28 ± 0.16 | 91.62 ± 1.28 |
| Geom-GCN | 79.43 ± 1.01 | 80.94 ± 1.06 | 70.20 ± 1.23 |
| HGSL | 91.92 ± 0.11 | 92.77 ± 0.11 | 93.48 ± 0.59 |
4.4.3.3 Importance Analysis of Candidate Graphs
Section titled “4.4.3.3 Importance Analysis of Candidate Graphs”In order to investigate whether HGSL can distinguish the importance of candidate graphs, we analyze the weight distribution of the channel attention layer for fusing each relation subgraphs, i.e. the weights of in Eq. 4.37, on three datasets. We train HGSL 20 times and set all the thresholds of HGSL as 0.2. The attention distributions are shown in Fig. 4.9. As we can observe, for relation subgraphs in ACM and DBLP, the original graph structure is the most important structure for GNN-based classification. However, as for Yelp, the channel attention values of different relation subgraphs differ from each other. Specifically, for B-U (business-user) and B-L (business-rating level) relation subgraphs, the feature graphs are assigned with large channel attention value in graph structure learning. This phenomenon implies that the information in node features plays a more important role than that of semantic representations which agrees with the previously discussed experiments and further demonstrates the capability of HGSL in adaptively learning a larger channel attention value for more important information.
The detailed method description and validation experiments can been seen in [41].
[!visual-conversion] Box plots (not precisely re-creatable without the source values): channel-attention weight distributions over 20 training runs. For ACM and DBLP, the original relation subgraph dominates the attention weight. For Yelp, attention is more spread out, with the B-U (business-user) and B-L (business-rating level) relations giving unusually large weight to the feature graph.
Fig. 4.9 Channel attention distributions of relation subgraphs. (a) ACM. (b) DBLP. (c) Yelp

Source scan (printed p. 102): the box plots of Fig. 4.9 — distributions are not recoverable from the prose summary, so the raster is retained.
4.5 Conclusions
Section titled “4.5 Conclusions”In attribute-assisted HG, diverse types of nodes are assisted with different attributes, reflecting the characteristics of nodes. In this chapter, we introduce three attribute-assisted HG representation models including HAN, HPN, and HGSL, which simultaneously integrate both structural information and attribute information into the node representations. Taking node attributes and graph structures as inputs, HAN learns the importance of neighbor and meta-path and then aggregates them to learn node representation in a hierarchical manner. Further, HPN improves the node-level aggregating process in HAN via emphasizing the local semantic of each node, significantly alleviating the deep degradation phenomenon (a.k.a, semantic confusion). After that, HGSL mines the complex correlations from heterogeneous node features and graph structures, and then jointly learns the GNN parameters and graph structure simultaneously.
References
Section titled “References”-
Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. In: International Conference on Learning Representations (2015)
-
Chen, T., Sun, Y.: Task-guided and path-augmented heterogeneous network embedding fo author identification. In: Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, pp. 295–304 (2017)
-
Chen, Y., Wu, L., Zaki, M.J.: Deep iterative and adaptive learning for graph neural networks. Preprint. arXiv:1912.07832 (2019)
-
Dong, Y., Chawla, N.V., Swami, A.: metapath2vec: Scalable representation learning for heterogeneous networks. In: Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 135–144 (2017)
-
Dong, Y., Chawla, N.V., Swami, A.: metapath2vec: Scalable representation learning for heterogeneous networks. In: Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 135–144 (2017)
-
Fan, S., Zhu, J., Han, X., Shi, C., Hu, L., Ma, B., Li, Y.: Metapath-guided heterogeneous graph neural network for intent recommendation. In: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2478–2486. ACM, New York (2019)
-
Franceschi, L., Niepert, M., Pontil, M., He, X.: Learning discrete structures for graph neural networks. In: International Conference on Machine Learning, pp. 1972–1982 (2019)
-
Fu, X., Zhang, J., Meng, Z., King, I.: MAGNN: metapath aggregated graph neural network for heterogeneous graph embedding. In: Proceedings of The Web Conference, pp. 2331–2341 (2020)
-
Hamilton, W.L., Ying, R., Leskovec, J.: Inductive representation learning on large graphs. In: Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 1024–1034 (2017)
-
Hamilton, W., Bajaj, P., Zitnik, M., Jurafsky, D., Leskovec, J.: Embedding logical queries on knowledge graphs. In: Advances in Neural Information Processing Systems, pp. 2030–2041 (2018)
-
Hong, H., Guo, H., Lin, Y., Yang, X., Li, Z., Ye, J.: An attention-based graph neural network for heterogeneous structural learning. In: Proceedings of the AAAI Conference on Artificial Intelligence, pp. 4132–4139 (2020)
-
Hu, B., Fang, Y., Shi, C.: Adversarial learning on heterogeneous information networks. In: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 120–129 (2019)
-
Hu, L., Yang, T., Shi, C., Ji, H., Li, X.: Heterogeneous graph attention networks for semi-supervised short text classification. In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, pp. 4820–4829 (2019)
-
Hu, Z., Dong, Y., Wang, K., Sun, Y.: Heterogeneous graph transformer. In: Proceedings of The Web Conference 2020, pp. 2704–2710 (2020)
-
Ji, H., Wang, X., Shi, C., Wang, B., Yu, P.: Heterogeneous graph propagation network. IEEE Trans. Knowl. Data Eng. (2021)
-
Jiang, B., Zhang, Z., Lin, D., Tang, J., Luo, B.: Semi-supervised learning with graph learning-convolutional networks. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11313–11320 (2019)
-
Jin, W., Ma, Y., Liu, X., Tang, X., Wang, S., Tang, J.: Graph structure learning for robust graph neural networks. In: Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 66–74 (2020)
-
Keyulu, X., Chengtao, L., Yonglong, T., Tomohiro, S., Ken-ichi, K., Stefanie, J.: Representation learning on graphs with jumping knowledge networks. In: International Conference on Machine Learning, pp. 5453–5462 (2018)
-
Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization. In: International Conference on Learning Representations (2015)
-
Kipf, T. N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: International Conference on Learning Representations (2017)
-
Klicpera, J., Bojchevski, A., G{“u}nnemann, S.: Predict then propagate: graph neural networks meet personalized pagerank. In: International Conference on Learning Representations (2019)
-
Lee, S., Park, S., Kahng, M., Lee, S.-G.: PathRank: ranking nodes on a heterogeneous graph for flexible hybrid recommender systems. Expert Syst. Appl. 40(2), 684–697 (2013)
-
Li, X., Wu, Y., Ester, M., Kao, B., Wang, X., Zheng, Y.: Semi-supervised clustering in attributed heterogeneous information networks. In: Proceedings of the 26th International Conference on World Wide Web, pp. 1621–1629 (2017)
-
Lu, Y., Shi, C., Hu, L., Liu, Z.: Relation structure-aware heterogeneous information network embedding. In: Proceedings of the AAAI Conference on Artificial Intelligence, pp. 4456–4463 (2019)
-
Pei, H., Wei, B., Chang, K.C., Lei, Y., Yang, B.: Geom-GCN: geometric graph convolutional networks. In: International Conference on Learning Representations (2020)
-
Perozzi, B., Al-Rfou, R., Skiena, S.: DeepWalk: online learning of social representations. In: Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 701–710 (2014)
-
Perozzi, B., Al-Rfou, R., Skiena, S.: DeepWalk: online learning of social representations. In: Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 701–710 (2014)
-
Schlichtkrull, M., Kipf, T.N., Bloem, P., van den Berg, R., Titov, I., Welling, M.: Modeling relational data with graph convolutional networks. In: European Semantic Web Conference, pp. 593–607. Springer, Berlin (2018)
-
Shang, J., Qu, M., Liu, J., Kaplan, L.M., Han, J., Peng, J.: Meta-path guided embedding for similarity search in large-scale heterogeneous information networks. CoRR abs/1610.09769 (2016)
-
Shi, C., Hu, B., Zhao, W.X., Philip, S.Y.: Heterogeneous information network embedding for recommendation. IEEE Trans. Knowl. Data Eng. 31(2), 357–370 (2018)
-
Sun, Y., Han, J., Yan, X., Yu, P.S., Wu, T.: PathSim: meta path-based top-k similarity search in heterogeneous information networks. VLDB 4(11), 992–1003 (2011)
-
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: Neural Information Processing Systems (NIPS 2017), pp. 5998–6008 (2017)
-
Veli{\v{c}}kovi{‘c}, P., Cucurull, G., Casanova, A., Romero, A., Li{`o}, P., Bengio, Y.: Graph attention networks. In: International Conference on Learning Representations (2018)
-
Wang, X., He, X., Wang, M., Feng, F., Chua, T.-S.: Neural graph collaborative filtering. In: SIGIR’19: Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 165–174 (2019)
-
Wang, X., Ji, H., Shi, C., Wang, B., Ye, Y., Cui, P., Yu, P.S.: Heterogeneous graph attention network. In: The World Wide Web Conference, pp. 2022–2032 (2019)
-
Wang, X., Zhu, M., Bo, D., Cui, P., Shi, C., Pei, J.: AM-GCN: adaptive multi-channel graph convolutional networks. In: Gupta, R., Liu, Y., Tang, J., Prakash, B.A. (eds.) Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (2020)
-
Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., Zemel, R., Bengio, Y.: Show, attend and tell: neural image caption generation with visual attention. In: International Conference on Machine Learning, pp. 2048–2057 (2015)
-
Yun, S., Jeong, M., Kim, R., Kang, J., Kim, H.J.: Graph transformer networks. In: Advances in Neural Information Processing Systems, pp. 11960–11970 (2019)
-
Zhang, C., Song, D., Huang, C., Swami, A., Chawla, N.V.: Heterogeneous graph neural network. In: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 793–803 (2019)
-
Zhang, C., Swami, A., Chawla, N.V.: SHNE: representation learning for semantic-associated heterogeneous networks. In: Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, pp. 690–698 (2019)
-
Zhao, J., Wang, X., Shi, C., Hu, B., Song, G., Ye, Y.: Heterogeneous graph structure learning for graph neural networks. In: 35th AAAI Conference on Artificial Intelligence (AAAI) (2021)
-
Zhao, J., Wang, X., Shi, C., Liu, Z., Ye, Y.: Network schema preserving heterogeneous information network embedding. In: 29th International Joint Conference on Artificial Intelligence, pp. 1366–1372 (2020)