Skip to content
ImagineWorld

Attribute-Assisted Heterogeneous Graph Representation

node_idnode-book_heterogeneous-graph-representations_chapter-04-attribute-assisted-heterogeneous-graph-representation
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num4
chapter_titleAttribute-Assisted Heterogeneous Graph Representation
governed_byCORPUS
constitutional_citationCONSTITUTION
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.

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.

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 m1m_1 and its meta-path based neighbors (i.e., m1m_1, m2m_2, and m3m_3)

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

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.

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 ϕi\phi_i), we design the type-specific transformation matrix Mϕi\mathbf{M}_{\phi_i} 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:

hi′=Mϕi⋅hi,(4.1)\mathbf{h}_i' = \mathbf{M}_{\phi_i} \cdot \mathbf{h}_i, \tag{4.1}

where hi\mathbf{h}_i and hi′\mathbf{h}_i' are the original and projected feature of node ii, 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 (i,j)(i, j) which are connected via meta-path Φ\Phi, the node-level attention eijΦe_{ij}^{\Phi} can learn the importance eijΦe_{ij}^{\Phi} which means how important node jj will be for node ii. The importance of meta-path based node pair (i,j)(i, j) can be formulated as follows:

eijΦ=attnode(hi′,hj′;Φ).(4.2)e_{ij}^{\Phi} = att_{node}(\mathbf{h}_i', \mathbf{h}_j'; \Phi). \tag{4.2}

Here attnodeatt_{node} denotes the deep neural network which performs the node-level attention. Given meta-path Φ\Phi, attnodeatt_{node} 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 Φ\Phi, the weight of meta-path based node pair (i,j)(i, j) depends on their features. Please note that, eijΦe_{ij}^{\Phi} is asymmetric, i.e., the importance of node ii to node jj and the importance of node jj to node ii 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 eijΦe_{ij}^{\Phi} for nodes j∈NiΦj \in \mathcal{N}_i^{\Phi}, where NiΦ\mathcal{N}_i^{\Phi} denotes the meta-path based neighbors of node ii (include itself). After obtaining the importance between meta-path based node pairs, we normalize them to get the weight coefficient αijΦ\alpha_{ij}^{\Phi} via softmax function:

αijΦ=softmaxj(eijΦ)=exp⁡(σ(aΦ⊤⋅[hi′∥hj′]))∑k∈NiΦexp⁡(σ(aΦ⊤⋅[hi′∥hk′])),(4.3)\alpha_{ij}^{\Phi} = \text{softmax}_j \left( e_{ij}^{\Phi} \right) = \frac{\exp \left( \sigma (\mathbf{a}_\Phi^{\top} \cdot [\mathbf{h}_i' \| \mathbf{h}_j']) \right)}{\sum_{k \in \mathcal{N}_i^{\Phi}} \exp \left( \sigma (\mathbf{a}_\Phi^{\top} \cdot [\mathbf{h}_i' \| \mathbf{h}_k']) \right)}, \tag{4.3}

where σ\sigma denotes the activation function, ∥\| denotes the concatenate operation, and aΦ\mathbf{a}_\Phi is the node-level attention vector for meta-path Φ\Phi. As we can see from Eq. (4.3), the weight coefficient of (i,j)(i, j) depends on their features. Also please note that the weight coefficient αijΦ\alpha_{ij}^{\Phi} 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 ii can be aggregated by the neighbor’s projected features with the corresponding coefficients as follows:

ziΦ=σ(∑j∈NiΦαijΦ⋅hj′),(4.4)z_i^{\Phi} = \sigma \left( \sum_{j \in \mathcal{N}_i^{\Phi}} \alpha_{ij}^{\Phi} \cdot \mathbf{h}_j' \right), \tag{4.4}

where ziΦz_i^{\Phi} is the learned representation of node ii for the meta-path Φ\Phi. 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 αijΦ\alpha_{ij}^{\Phi} 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 KK times and concatenate the learned representations as the semantic-specific representation:

ziΦ=∥k=1Kσ(∑j∈NiΦαijΦ⋅hj′).(4.5)z_i^{\Phi} = \parallel_{k=1}^{K} \sigma \left( \sum_{j \in \mathcal{N}_i^{\Phi}} \alpha_{ij}^{\Phi} \cdot \mathbf{h}_j' \right). \tag{4.5}

[!visual-conversion] Converted from the surrounding description: node-level aggregation weights a node’s meta-path based neighbors (asymmetric attention eijΦe_{ij}^\Phi); 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 {Φ0,Φ1,…,ΦP}\{\Phi_0, \Phi_1, \ldots, \Phi_P\}, after feeding node features into node-level attention, we can obtain PP groups of semantic-specific node representations, denoted as {ZΦ0,ZΦ1,…,ZΦP}\{\mathbf{Z}_{\Phi_0}, \mathbf{Z}_{\Phi_1}, \ldots, \mathbf{Z}_{\Phi_P}\}.

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 PP groups of semantic-specific node representations learned from node-level attention as input, the learned weights of each meta-path (βΦ0,βΦ1,…,βΦP)(\beta_{\Phi_0}, \beta_{\Phi_1}, \ldots, \beta_{\Phi_P}) can be shown as follows:

(βΦ0,βΦ1,…,βΦP)=attsem(ZΦ0,ZΦ1,…,ZΦP).(4.6)(\beta_{\Phi_0}, \beta_{\Phi_1}, \ldots, \beta_{\Phi_P}) = att_{sem}(\mathbf{Z}_{\Phi_0}, \mathbf{Z}_{\Phi_1}, \ldots, \mathbf{Z}_{\Phi_P}). \tag{4.6}

Here attsematt_{sem} 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 q\mathbf{q}. 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 wΦiw_{\Phi_i}, is shown as follows:

wΦi=1∣V∣∑i∈VqT⋅tanh⁡(W⋅ziΦ+b),(4.7)w_{\Phi_i} = \frac{1}{|\mathcal{V}|} \sum_{i \in \mathcal{V}} \mathbf{q}^{\mathrm{T}} \cdot \tanh(\mathbf{W} \cdot \mathbf{z}_i^{\Phi} + \mathbf{b}), \tag{4.7}

where W\mathbf{W} is the weight matrix, b\mathbf{b} is the bias vector, q\mathbf{q} 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 Φi\Phi_i, denoted as βΦi\beta_{\Phi_i}, can be obtained by normalizing the above importance of all meta-paths using softmax function,

βΦi=exp⁡(wΦi)∑i=1Pexp⁡(wΦi),(4.8)\beta_{\Phi_i} = \frac{\exp(w_{\Phi_i})}{\sum_{i=1}^{P} \exp(w_{\Phi_i})}, \tag{4.8}

which can be interpreted as the contribution of the meta-path Φi\Phi_i for specific task. Obviously, the higher βΦi\beta_{\Phi_i}, the more important meta-path Φi\Phi_i is. Note that for different tasks, meta-path Φi\Phi_i may have different weights. With the learned weights as coefficients, we can fuse these semantic-specific representations to obtain the final representation Z\mathbf{Z} as follows:

Z=∑i=1PβΦi⋅ZΦi.(4.9)\mathbf{Z} = \sum_{i=1}^{P} \beta_{\Phi_i} \cdot \mathbf{Z}_{\Phi_i}. \tag{4.9}

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:

L=−∑l∈YLYlln⁡(C⋅Zl),(4.10)L = - \sum_{l \in \mathcal{Y}_L} \mathbf{Y}^l \ln(\mathbf{C} \cdot \mathbf{Z}^l), \tag{4.10}

where C\mathbf{C} is the parameter of the classifier, YL\mathcal{Y}_L is the set of node indices that have labels, Yl\mathbf{Y}^l and Zl\mathbf{Z}^l 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.

Datasets The experiments are conducted on three heterogeneous graphs including DBLP1^1, ACM2^2, and IMDB3^3.

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., HANnd_{nd} and HANsem_{sem}).

[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 q\mathbf{q} to 128, the number of attention head KK 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.⁴

Here we employ KNN classifier with k=5k = 5 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 HANnd_{nd}, 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 (HANnd_{nd}) or semantic-level attention (HANsem_{sem}), 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 αijΦ\alpha_{ij}^{\Phi} and the semantic-level attention weight βΦi\beta_{\Phi_i}. 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.

DatasetMetricTrainingDeepWalkmp2vecESimHERecGCNGATHANnd_{nd}HANsem_{sem}HAN
ACMMacro-F120%77.2565.0977.3266.1786.8186.2388.1589.0489.40
40%80.4769.9380.1270.8987.6887.0488.4189.4189.79
60%82.5571.4782.4472.3888.1087.5687.9190.0089.51
80%84.1773.8183.0073.9288.2987.3388.4890.1790.63
Micro-F120%76.9265.0076.8966.0386.7786.0187.9988.8589.22
40%79.9969.7579.7070.7387.6486.7988.3189.2789.64
60%82.1171.2982.0272.2488.1287.4087.6889.8589.33
80%83.8873.6982.8973.8488.3587.1188.2689.9590.54
DBLPMacro-F120%77.4390.1691.6491.6890.7990.9791.1792.0392.24
40%81.0290.8292.0492.1691.4891.2091.4692.0892.40
60%83.6791.3292.4492.8091.8990.8091.7892.3892.80
80%84.8191.8992.5392.3492.3891.7391.8092.5393.08
Micro-F120%79.3791.5392.7392.6991.7191.9692.0592.9993.11
40%82.7392.0393.0793.1892.3192.1692.3893.0093.30
60%85.2792.4893.3993.7092.6291.8492.6993.3193.70
80%86.2692.8093.4493.2793.0992.5592.6993.2993.99
IMDBMacro-F120%40.7241.1632.1041.6545.7349.4449.7850.8750.00
40%45.1944.2231.9443.8648.0150.6452.1150.8552.71
60%48.1345.1131.6846.2749.1551.9051.7352.0954.24
80%50.3545.1532.0647.6451.8152.9952.6651.6054.38
Micro-F120%46.3845.6535.2845.8149.7855.2854.1755.0155.73
40%49.9948.2435.4747.5951.7155.9156.3955.1557.97
60%52.2149.0935.6449.8852.2956.4456.0956.6658.32
80%54.3348.8135.5950.9954.6156.9756.3856.4958.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., HANsem_{sem}, 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

page-086.png

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 HANsem_{sem} 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].

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

page-088.png

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.

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 Φ1\Phi_1 and node ii, node level attention in HAN aggregates the meta-path Φ1\Phi_1 based neighbors {1,2,3,4}\{1,2,3,4\} with attentions {αi1Φ1,αi2Φ1,αi3Φ1,αi4Φ1}\{\alpha_{i1}^{\Phi_1}, \alpha_{i2}^{\Phi_1}, \alpha_{i3}^{\Phi_1}, \alpha_{i4}^{\Phi_1}\} to learn the semantic-specific node representation ziΦ1z_i^{\Phi_1} for node ii. Given one meta-path Φ\Phi, the node-level aggregating is defined as:

ZΦ,0=X,ZΦ,1=σ(αΦ,0⋅ZΦ,0),⋯ ,ZΦ=ZΦ,k=σ(αΦ,k−1⋅ZΦ,k−1),(4.11)\begin{aligned} \mathbf{Z}^{\Phi,0} &= \mathbf{X}, \\ \mathbf{Z}^{\Phi,1} &= \sigma \left( \boldsymbol{\alpha}^{\Phi,0} \cdot \mathbf{Z}^{\Phi,0} \right), \\ &\cdots, \\ \mathbf{Z}^{\Phi} &= \mathbf{Z}^{\Phi,k} = \sigma \left( \boldsymbol{\alpha}^{\Phi,k-1} \cdot \mathbf{Z}^{\Phi,k-1} \right), \end{aligned} \tag{4.11}

where X\mathbf{X} denotes node feature matrix, where the ii-th row corresponds to the ii-th node. And σ\sigma is an activate function, the element αijΦ,k\alpha_{ij}^{\Phi,k} of αΦ,k\boldsymbol{\alpha}^{\Phi,k} denotes the learned attention weight between meta-path based node pair (i,j)(i,j) via node-level attention by the kk-th layer. Note that αΦ,k\boldsymbol{\alpha}^{\Phi,k} is a (row-normalized) probability matrix and ZΦ,k\mathbf{Z}^{\Phi,k} denotes the learned representation matrix by the kk-th layer, where the ii-th row corresponds to the ii-th node. As shown in Fig.4.3b, given a node ii and a set of meta-paths {Φ1,Φ2,⋯ ,ΦP}\{\Phi_1, \Phi_2, \cdots, \Phi_P\}, semantic-level aggregating in HAN fuses PP semantic-specific node representations {ziΦ1,⋯ ,ziΦP}\left\{z_i^{\Phi_1}, \cdots, z_i^{\Phi_P}\right\} with attentions {βΦ1,⋯ ,βΦP}\left\{\beta_{\Phi_1}, \cdots, \beta_{\Phi_P}\right\} to get the final representation zi\mathbf{z}_i for node ii. The semantic-level aggregating is shown as follows:

Z=∑p=1PβΦp⋅ZΦp,(4.12)\mathbf{Z} = \sum_{p=1}^{P} \beta_{\Phi_p} \cdot \mathbf{Z}^{\Phi_p}, \tag{4.12}

where Z\mathbf{Z} 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 Φ\Phi, we have the meta-path based probability matrix MΦ\mathbf{M}^{\Phi} whose element MijΦ\mathbf{M}_{ij}^{\Phi} denotes the transition probability from node ii to jj via meta-path Φ\Phi. Then, the kk-step single meta-path based random walk is defined as:

πΦ,k=MΦ⋅πΦ,k−1,(4.13)\pi^{\Phi,k} = \mathbf{M}^{\Phi} \cdot \pi^{\Phi,k-1}, \tag{4.13}

where πΦ,k\pi^{\Phi,k} denotes the distribution of kk-step single meta-path based random walk. Considering a set of meta-paths {Φ1,Φ2,⋯ ,Φp}\{\Phi_1, \Phi_2, \cdots, \Phi_p\} and their weights {wΦ1,wΦ2,⋯ ,wΦp}\{w_{\Phi_1}, w_{\Phi_2}, \cdots, w_{\Phi_p}\}, the kk-step multiple meta-paths based random walk is defined as:

πk=∑p=1PwΦp⋅πΦp,k,(4.14)\pi^k = \sum_{p=1}^P w_{\Phi_p} \cdot \pi^{\Phi_p,k}, \tag{4.14}

where πk\pi^k denotes the distribution of kk-step multiple meta-paths based random walk. For kk-step single meta-path based random walk:

Theorem 1 Assuming a heterogeneous graph is aperiodic and irreducible, if we take the limit k→∞k \to \infty, then kk-step meta-path based random walk will converge to a meta-path specific limit distribution πΦ,lim⁡\pi^{\Phi,\lim} which is independent of nodes:

πΦ,lim⁡=MΦ⋅πΦ,lim⁡.(4.15)\pi^{\Phi,\lim} = \mathbf{M}^{\Phi} \cdot \pi^{\Phi,\lim}. \tag{4.15}

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 IiI_i of node ii is equivalent, in expectation, to the kk-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 Φ\Phi. The difference is that αΦ,k\boldsymbol{\alpha}^{\Phi,k} is a parameter matrix learned via node-level attention, while MΦ\mathbf{M}^{\Phi} is a pre-defined matrix. Since MΦ\mathbf{M}^{\Phi} and αΦ,k\boldsymbol{\alpha}^{\Phi,k} 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 ZΦZ^{\Phi} will only be influenced by the meta-path Φ\Phi and therefore are independent of nodes. So the learned node representations cannot capture the characteristics of each node and therefore are indistinguishable. For kk-step multiple meta-paths based random walk, we have:

Theorem 3 Assuming kk-step single meta-path based random walk is independent of each other; if we take the limit k→∞k \rightarrow \infty, then the limit distribution of kk-step multiple meta-paths based random walk is a weighted combination of single meta-path based random walk limit distribution, shown as follows:

πlim⁡=∑p=1PwΦp⋅πΦp,lim⁡.(4.16)\pi^{\lim} = \sum_{p=1}^{P} w_{\Phi_p} \cdot \pi^{\Phi_p,\lim}. \tag{4.16}

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 βΦp\beta_{\Phi_p}, while multiple meta-paths based random walk assigns pre-defined weight wΦpw_{\Phi_p} to meta-path Φp\Phi_p 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.

Given one meta-path Φ\Phi, the semantic propagation mechanism PΦ\mathcal{P}_{\Phi} first projects node into semantic space via semantic projection function fΦf_{\Phi}. Then, it aggregates information from meta-path based neighbors via semantic aggregation function gΦg_{\Phi} to learn semantic-specific node representation, shown as follows:

ZΦ=PΦ(X)=gΦ(fΦ(X)),(4.17)Z^{\Phi} = \mathcal{P}_{\Phi}(\mathbf{X}) = g_{\Phi}(f_{\Phi}(\mathbf{X})), \tag{4.17}

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:

HΦ=fΦ(X)=σ(X⋅WΦ+bΦ),(4.18)\mathbf{H}^{\Phi} = f_{\Phi}(\mathbf{X}) = \sigma(\mathbf{X} \cdot \mathbf{W}^{\Phi} + \mathbf{b}^{\Phi}), \tag{4.18}

where HΦ\mathbf{H}^{\Phi} is the projected node feature matrix, WΦ\mathbf{W}^{\Phi} and bΦ\mathbf{b}^{\Phi} denote weight matrix and bias vector for meta-path Φ\Phi, respectively. To alleviate semantic confusion, we design semantic aggregation function gΦg_{\Phi}, shown as follows:

ZΦ,k=gΦ(ZΦ,k−1)=(1−γ)⋅MΦ⋅ZΦ,k−1+γ⋅HΦ,(4.19)\mathbf{Z}^{\Phi,k} = g_{\Phi}(\mathbf{Z}^{\Phi,k-1}) = (1 - \gamma) \cdot \mathbf{M}^{\Phi} \cdot \mathbf{Z}^{\Phi,k-1} + \gamma \cdot \mathbf{H}^{\Phi}, \tag{4.19}

where ZΦ,k\mathbf{Z}^{\Phi,k} denotes node representation learned by kk-th layer semantic propagation mechanism and we take it as the semantic-specific node representation ZΦ\mathbf{Z}^{\Phi}. Note that HΦ\mathbf{H}^{\Phi} reflects the characteristics of each node in meta-path Φ\Phi (also can be viewed as ZΦ,0\mathbf{Z}^{\Phi,0}) and MΦ⋅ZΦ,k−1\mathbf{M}^{\Phi} \cdot \mathbf{Z}^{\Phi,k-1} means aggregating information from meta-path based neighbors. Here γ\gamma is a weight scalar which indicates the importance of characteristic of node in aggregating process.

Why Semantic Aggregation Function gΦg_{\Phi} Works Here we establish the relationship between semantic aggregation function gΦg_{\Phi} and kk-step meta-path based random walk with restart. kk-step meta-path based random walk with restart for node ii is defined as:

πΦ,k(i)=(1−γ)⋅MΦ⋅πΦ,k−1(i)+γ⋅i,(4.20)\pi^{\Phi,k}(i) = (1 - \gamma) \cdot \mathbf{M}^{\Phi} \cdot \pi^{\Phi,k-1}(i) + \gamma \cdot i, \tag{4.20}

where ii is a one-hot vector of node ii, γ\gamma means the restart probability. For kk-step meta-path based random walk with restart:

Theorem 4 Assuming a heterogeneous graph is aperiodic and irreducible, if we take the limit k→∞k \to \infty, then kk-step meta-path based random walk with restart will converge to πΦ,lim⁡(i)\pi^{\Phi,\lim}(i) which is related to the start node ii:

πΦ,lim⁡(i)=γ⋅(I−(1−γ)⋅MΦ)−1⋅i.(4.21)\pi^{\Phi,\lim}(i) = \gamma \cdot (\mathbf{I} - (1 - \gamma) \cdot \mathbf{M}^{\Phi})^{-1} \cdot i. \tag{4.21}

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 γ\gamma. By Theorem 4, we can see that the semantic aggregation function gΦg_{\Phi} absorbs node’s local semantics and makes semantic-specific node representation ZΦ,k\mathbf{Z}^{\Phi,k} distinguish from each other even if we take the limit k→∞k \to \infty. So semantic propagation mechanism can alleviate the semantic confusion.

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 {Φ1,Φ2,⋯ ,ΦP}\{\Phi_1, \Phi_2, \cdots, \Phi_P\}, we have PP group semantic-specific node representations {ZΦ1,ZΦ2,⋯ ,ZΦP}\{\mathbf{Z}^{\Phi_1}, \mathbf{Z}^{\Phi_2}, \cdots, \mathbf{Z}^{\Phi_P}\}. Then, we propose the semantic fusion mechanism F\mathcal{F} to fuse them for the specific task. Taking PP groups of semantic-specific node representations learned from semantic propagation mechanism as input, the final node representation Z\mathbf{Z} learned via semantic fusion mechanism F\mathcal{F} is shown as follows:

Z=F(ZΦ1,ZΦ2,⋯ ,ZΦP).(4.22)\mathbf{Z} = \mathcal{F}(\mathbf{Z}^{\Phi_1}, \mathbf{Z}^{\Phi_2}, \cdots, \mathbf{Z}^{\Phi_P}). \tag{4.22}

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 q\mathbf{q} to learn the importance of meta-paths. The importance of meta-path Φp\Phi_p, denoted as wΦpw_{\Phi_p}, is defined as:

wΦp=1∣V∣∑i∈VqT⋅tanh⁡(W⋅ziΦp+b),(4.23)w_{\Phi_p} = \frac{1}{|\mathcal{V}|} \sum_{i \in \mathcal{V}} \mathbf{q}^\mathrm{T} \cdot \tanh(\mathbf{W} \cdot \mathbf{z}_i^{\Phi_p} + \mathbf{b}), \tag{4.23}

where W\mathbf{W} and b\mathbf{b} 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 Φp\Phi_p, denoted as βΦp\beta_{\Phi_p}, is defined as:

βΦp=exp⁡(wΦp)∑p=1Pexp⁡(wΦp).(4.24)\beta_{\Phi_p} = \frac{\exp(w_{\Phi_p})}{\sum_{p=1}^P \exp(w_{\Phi_p})}. \tag{4.24}

Obviously, the higher βΦp\beta_{\Phi_p}, the more important meta-path Φp\Phi_p is. With the learned weights as coefficients, we can fuse PP semantic-specific representations to obtain the final representation Z\mathbf{Z} as follows:

Z=∑p=1PβΦp⋅ZΦp.(4.25)\mathbf{Z} = \sum_{p=1}^P \beta_{\Phi_p} \cdot \mathbf{Z}^{\Phi_p}. \tag{4.25}

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 βΦp\beta_{\Phi_p} may change a lot. For semi-supervised node classification, we calculate Cross-Entropy and update parameters in HPN:

L=−∑l∈YLYl⋅ln⁡(Zl⋅C),(4.26)\mathcal{L} = - \sum_{l \in \mathcal{Y}_L} \mathbf{Y}_l \cdot \ln(\mathbf{Z}_l \cdot \mathbf{C}), \tag{4.26}

where C\mathbf{C} is a projection matrix which projects the node representation as a node label vector, YL\mathcal{Y}_L is the set of labeled nodes, Yl\mathbf{Y}_l and Zl\mathbf{Z}_l are the label vector and representation of the labeled node ll, respectively.

For unsupervised node recommendation, we leverage BPR loss with negative sampling [34] to update parameters in HPN:

L=−∑(u,v)∈Ωlog⁡σ(zu⊤zv)−∑(u,v′)∈Ω−log⁡σ(−zu⊤zv′),(4.27)\mathcal{L} = - \sum_{(u,v) \in \Omega} \log \sigma \left( \mathbf{z}_u^\top \mathbf{z}_v \right) - \sum_{(u,v') \in \Omega^-} \log \sigma \left( -\mathbf{z}_u^\top \mathbf{z}_{v'} \right), \tag{4.27}

where (u,v)∈Ω(u,v) \in \Omega and (u,v′)∈Ω−(u,v') \in \Omega^- denote the set of observed (positive) node pairs and the set of negative node pairs sampled from all unobserved node pairs, respectively.

Datasets Three datasets including Yelp11^{11}, ACM12^{12}, and IMDB13^{13}, and MovieLens14^{14} (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., HPNpro_{pro} and HPNfus_{fus}) 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/.

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 KK-Means to perform node clustering and the number of clusters KK is set to the number of classes, then select NMINMI and ARIARI 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 HPNpro_{pro} and HPNfus_{fus} 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.

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)

DatasetsMetricsmp2vecHERecGCNGATPPNPMEIRecHANHGTMGHPNproHPNfusHPN
YelpNMI42.040.3032.5842.3040.6030.0945.4647.8247.5644.3612.8648.90
ARI38.270.4123.3041.5237.7227.8841.3942.9143.2442.5710.5444.89
ACMNMI21.2240.7051.4057.2961.6861.5661.5660.8964.1265.6067.5568.21
ARI21.0037.1353.0160.4365.1561.4664.3959.8566.2969.3071.5372.33
IMDBNMI1.201.205.458.4510.2011.3210.8711.5911.799.4512.0112.31
ARI1.701.654.407.468.2010.4010.019.9210.328.0212.3212.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

page-097.png

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”

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.

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 ⟨vi,r,vj⟩\langle v_i, r, v_j \rangle describes that two nodes viv_i (head node) and vjv_j (tail node) are connected by relation r∈Rr \in \mathcal{R}. We further define the type mapping functions ϕh,ϕt:R→T\phi_h, \phi_t : \mathcal{R} \to \mathcal{T} that map the relation to its head node type and tail node type, respectively.

Example 1 In a user–item heterogeneous graph, say r=“UI”r = \text{“UI”} (a user buys an item), then we have ϕh(r)=“User”\phi_h(r) = \text{“User”} and ϕt(r)=“Item”\phi_t(r) = \text{“Item”}.

Definition 2 Relation Subgraph Given a heterogeneous graph G=(V,E,F)G = (V, E, \mathcal{F}), a relation subgraph GrG_r is a subgraph of GG that contains all node-relation triples with relation rr. The adjacency matrix of GrG_r is Ar∈R∣Vϕh(r)∣×∣Vϕt(r)∣\mathbf{A}_r \in \mathbb{R}^{|\mathcal{V}_{\phi_h(r)}| \times |\mathcal{V}_{\phi_t(r)}|}, where Ar[i,j]=1\mathbf{A}_r[i, j] = 1 if ⟨vi,r,vj⟩\langle v_i, r, v_j \rangle exists in GrG_r, otherwise Ar[i,j]=0\mathbf{A}_r[i, j] = 0. A\mathcal{A} denotes the relation subgraph set of all the relation subgraphs in GG, i.e. A={Ar,r∈R}\mathcal{A} = \{\mathbf{A}_r, r \in \mathcal{R}\}.

Definition 3 Heterogeneous Graph Structure Learning (HGSL) Given a heterogeneous graph GG, the task of heterogeneous graph structure learning is to jointly learn a heterogeneous graph structure, i.e. a new relational subgraph set A′\mathcal{A}', and the parameters of GNN for downstream tasks.

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

Z\mathcal{Z} by meta-path based node representations from MM 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 r1r_1 as an example, HGSL learns a feature graph Sr1Feat\mathbf{S}_{r_1}^{Feat} and a semantic graph Sr1Sem\mathbf{S}_{r_1}^{Sem} and fuse them with the original graph Ar1\mathbf{A}_{r_1} to obtain the learned relation subgraph Ar1′\mathbf{A}_{r_1}'. 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.

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 SrFS\mathbf{S}_{r}^{FS} determines the possibility of an edge with type r∈Rr \in \mathcal{R} between two nodes based on node features. Specifically, for each node viv_i of type ϕ(vi)\phi(v_i) with feature vector fi∈R1×dϕ(vi)\mathbf{f}_i \in \mathbb{R}^{1 \times d_{\phi(v_i)}}, we adopt a type-specific mapping layer to project the feature fi\mathbf{f}_i to a dcd_c-dimensional common feature fi′∈R1×dc\mathbf{f}_i' \in \mathbb{R}^{1 \times d_c}:

fi′=σ(fi⋅Wϕ(vi)+bϕ(vi)),(4.28)\mathbf{f}_i' = \sigma \left( \mathbf{f}_i \cdot \mathbf{W}_{\phi(v_i)} + \mathbf{b}_{\phi(v_i)} \right), \tag{4.28}

where σ(⋅)\sigma(\cdot) denotes a non-linear activation function, Wϕ(vi)∈Rdϕ(vi)×dc\mathbf{W}_{\phi(v_i)} \in \mathbb{R}^{d_{\phi(v_i)} \times d_c} and bϕ(vi)∈R1×dc\mathbf{b}_{\phi(v_i)} \in \mathbb{R}^{1 \times d_c} denote the mapping matrix and the bias vector of type ϕ(vi)\phi(v_i), respectively. Then, for a relation rr, we perform metric learning on the common features and obtain the learned feature similarity graph SrFS∈R∣Vϕh(r)∣×∣Vϕt(r)∣\mathbf{S}_{r}^{FS} \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}|}, where the edge between nodes viv_i and vjv_j is obtained by:

SrFS[i,j]={ΓrFS(fi′,fj′)if ΓrFS(fi′,fj′)≥ϵFS0otherwise,(4.29)\mathbf{S}_{r}^{FS}[i, j] = \begin{cases} \Gamma_{r}^{FS}(\mathbf{f}_i', \mathbf{f}_j') & \text{if } \Gamma_{r}^{FS}(\mathbf{f}_i', \mathbf{f}_j') \geq \epsilon^{FS} \\ 0 & \text{otherwise}, \end{cases} \tag{4.29}

where ϵFS∈[0,1]\epsilon^{FS} \in [0, 1] is the threshold that controls the sparsity of feature similarity graph, and larger ϵFS\epsilon^{FS} implies a more sparse feature similarity graph. ΓrFS\Gamma_{r}^{FS} is a K-head weighted cosine similarity function defined as:

ΓrFS(fi′,fj′)=1K∑kcos⁡(wk,rFS⊙fi′,wk,rFS⊙fj′),(4.30)\Gamma_{r}^{FS}(\mathbf{f}_i', \mathbf{f}_j') = \frac{1}{K} \sum_{k} \cos \left( \mathbf{w}_{k, r}^{FS} \odot \mathbf{f}_i', \mathbf{w}_{k, r}^{FS} \odot \mathbf{f}_j' \right), \tag{4.30}

where ⊙\odot denotes the Hadamard product, and WrFS=[wk,rFS]\mathbf{W}_{r}^{FS} = [\mathbf{w}_{k, r}^{FS}] is the learnable parameter matrix of ΓrFS\Gamma_{r}^{FS} 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 ϵFS\epsilon^{FS}, HGSL learns the candidate feature similarity graph SrFS\mathbf{S}_{r}^{FS}.

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 rr, assume that we have two types of nodes Vϕh(r)V_{\phi_h(r)} and Vϕt(r)V_{\phi_t(r)}, and the topology structure between them is Ar∈R∣Vϕh(r)∣×∣Vϕt(r)∣\mathbf{A}_r \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}|}. For the nodes vi,vj∈Vϕh(r)v_i, v_j \in V_{\phi_h(r)} with the same type ϕh(r)\phi_h(r), we can obtain the feature similarity:

SrFH[i,j]={ΓrFH(fi,fj)ΓrFH(fi,fj)≥ϵFP0otherwise,(4.31)\mathbf{S}_r^{FH}[i, j] = \begin{cases} \Gamma_r^{FH}(\mathbf{f}_i, \mathbf{f}_j) & \Gamma_r^{FH}(\mathbf{f}_i, \mathbf{f}_j) \geq \epsilon^{FP} \\ 0 & \text{otherwise}, \end{cases} \tag{4.31}

where the threshold ϵFP\epsilon^{FP} controls the sparsity of feature similarity graph SrFH\mathbf{S}_r^{FH}. ΓrFH\Gamma_r^{FH} is the metric learning function in the framework of Eq.4.30 with different parameters WrFH\mathbf{W}_r^{FH}. Then we can model the head feature propagation graph SrFPH∈R∣Vϕh(r)∣×∣Vϕt(r)∣\mathbf{S}_r^{FPH} \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}|} using SrFH\mathbf{S}_r^{FH} and Ar\mathbf{A}_r as follows:

SrFPH=SrFHAr.(4.32)\mathbf{S}_r^{FPH} = \mathbf{S}_r^{FH} \mathbf{A}_r. \tag{4.32}

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 Vϕt(r)V_{\phi_t(r)} with the same type ϕt(r)\phi_t(r), similar to Eq.4.31, we can obtain the corresponding feature similarity graph SrFT\mathbf{S}_r^{FT} with parameters WrFT\mathbf{W}_r^{FT}. Therefore, the corresponding feature propagation graph SrFPT\mathbf{S}_r^{FPT} can be obtained as follows:

SrFPT=ArSrFT.(4.33)\mathbf{S}_r^{FPT} = \mathbf{A}_r \mathbf{S}_r^{FT}. \tag{4.33}

Now, we have generated one feature similarity graph SrFS\mathbf{S}_r^{FS} and two feature propagation graphs SrFPH\mathbf{S}_r^{FPH} and SrFPT\mathbf{S}_r^{FPT}. The overall feature graph for relation rr, denoted as SrFeat∈R∣Vϕh(r)∣×∣Vϕt(r)∣\mathbf{S}_r^{Feat} \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}|}, can be obtained by fusing these graphs through a channel attention layer [38]:

SrFeat=ΨrFeat([SrFS,SrFPH,SrFPT]),(4.34)\mathbf{S}_r^{Feat} = \Psi_r^{Feat}([\mathbf{S}_r^{FS}, \mathbf{S}_r^{FPH}, \mathbf{S}_r^{FPT}]), \tag{4.34}

where [SrFS,SrFPH,SrFPT]∈R∣Vϕh(r)∣×∣Vϕt(r)∣×3[\mathbf{S}_r^{FS}, \mathbf{S}_r^{FPH}, \mathbf{S}_r^{FPT}] \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}| \times 3} is the stacked matrix of the feature candidate graphs, and ΨrFeat\Psi_r^{Feat} denotes a channel attention layer with parameters WΨ,rFeat∈R1×1×3\mathbf{W}_{\Psi,r}^{Feat} \in \mathbb{R}^{1 \times 1 \times 3} which performs 1×11 \times 1 convolution on the input using softmax(WΨ,rFeat)\text{softmax}(\mathbf{W}_{\Psi,r}^{Feat}). In this way, HGSL balances the importance of each candidate feature graph for each relation rr by learning different weights, respectively.

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 PP with the corresponding relations r1∘r2∘⋯∘rlr_1 \circ r_2 \circ \cdots \circ r_l, a straightforward way to generate semantic graph would be fusing the adjacency matrices, i.e. Ar1⋅Ar2⋯Arl\mathbf{A}_{r_1} \cdot \mathbf{A}_{r_2} \cdots \mathbf{A}_{r_l} [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 P={P1,P2,…,PM}\mathcal{P} = \{P_1, P_2, \ldots, P_M\} with MM meta-paths, HGSL uses trained MP2Vec [5] representations, denoted as Z={ZP1,ZP2,⋯ ,ZPM∈R∣V∣×d}\mathcal{Z} = \{\mathbf{Z}_{P_1}, \mathbf{Z}_{P_2}, \cdots, \mathbf{Z}_{P_M} \in \mathbb{R}^{|V| \times d}\}, 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 Z\mathcal{Z}, for each meta-path PmP_m, we generate a candidate semantic subgraph adjacency matrix Sr,mMP∈R∣Vϕh(r)∣×∣Vϕt(r)∣\mathbf{S}_{r,m}^{MP} \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}|}, where each edge is calculated by:

Sr,mMP[i,j]={Γr,mMP(zim,zjm)if Γr,mMP(zim,zjm)≥ϵMP0otherwise,(4.35)\mathbf{S}_{r,m}^{MP}[i, j] = \begin{cases} \Gamma_{r,m}^{MP}(\mathbf{z}_i^m, \mathbf{z}_j^m) & \text{if } \Gamma_{r,m}^{MP}(\mathbf{z}_i^m, \mathbf{z}_j^m) \geq \epsilon^{MP} \\ 0 & \text{otherwise,} \end{cases} \tag{4.35}

where zim\mathbf{z}_i^m stands for the iith row of ZPm\mathbf{Z}_{P_m}, and Γr,mMP\Gamma_{r,m}^{MP} is the metric learning function with parameters WΓr,mMP\mathbf{W}_{\Gamma_{r,m}^{MP}}. We can see that a relation rr will generate MM candidate semantic subgraphs, so the overall semantic subgraph for relation rr, denoted as SrSem\mathbf{S}_r^{Sem}, can be obtained by aggregating them:

SrSem=ΨrMP([Sr,1MP,Sr,2MP,⋯ ,Sr,MMP]),(4.36)\mathbf{S}_r^{Sem} = \Psi_r^{MP} \left( \left[ \mathbf{S}_{r,1}^{MP}, \mathbf{S}_{r,2}^{MP}, \cdots, \mathbf{S}_{r,M}^{MP} \right] \right), \tag{4.36}

where [Sr,1MP,Sr,2MP,…,Sr,MMP][\mathbf{S}_{r,1}^{MP}, \mathbf{S}_{r,2}^{MP}, \ldots, \mathbf{S}_{r,M}^{MP}] is the stacked matrix of MM candidate semantic graphs. ΨrMP\Psi_r^{MP} denotes a channel attention layer whose weight matrix WΨrMP∈R1×1×M\mathbf{W}_{\Psi_r^{MP}} \in \mathbb{R}^{1 \times 1 \times M} represents the importance of different meta-path based candidate graphs. After we obtain the aggregated semantic graph SrSem\mathbf{S}_r^{Sem}, the overall generated graph structure Ar′\mathbf{A}_r' for relation rr can be obtained by aggregating the learned feature graph and semantic graph along with the original graph structure:

Ar′=Ψr([SrFeat,SrSem,Ar]),(4.37)\mathbf{A}_r' = \Psi_r \left( \left[ \mathbf{S}_r^{Feat}, \mathbf{S}_r^{Sem}, \mathbf{A}_r \right] \right), \tag{4.37}

where [SrFeat,SrSem,Ar]∈R∣Vϕh(r)∣×∣Vϕt(r)∣×3[\mathbf{S}_r^{Feat}, \mathbf{S}_r^{Sem}, \mathbf{A}_r] \in \mathbb{R}^{|V_{\phi_h(r)}| \times |V_{\phi_t(r)}| \times 3} is the stacked matrix of the candidate graphs. Ψr\Psi_r is the channel attention layer whose weight matrix WΨr∈R1×1×3\mathbf{W}_{\Psi_r} \in \mathbb{R}^{1 \times 1 \times 3} denotes the importance of candidate graphs in fusing the overall relation subgraph Ar′\mathbf{A}_r'. With a new relation adjacency matrix Ar′\mathbf{A}_r' for each relation rr, a new heterogeneous graph structure is generated, i.e. A′={Ar′,r∈R}\mathcal{A}' = \{\mathbf{A}_r', r \in \mathcal{R}\}.

In this section, we show how HGSL jointly optimizes the graph structure A′\mathcal{A}' and the GNN parameters for downstream task. Here we focus on GCN [20] and node classification. Please note that, with the learned graph structure A′\mathcal{A}', our model can be applied to other homogeneous or heterogeneous GNN methods and other tasks. A two layer GCN with parameters θ=(W1,W2)\theta = (W_1, W_2) on the learned graph structure A′\mathcal{A}', can be described as:

fθ(X,A′)=softmax(A^σ(A^XW1)W2),(4.38)f_{\theta}(\mathbf{X}, \mathcal{A}') = \text{softmax} \left( \hat{\mathbf{A}} \sigma \left( \hat{\mathbf{A}} \mathbf{X} W_1 \right) W_2 \right), \tag{4.38}

where X\mathbf{X} is the original node feature matrix, i.e. X[i,:]=fiT\mathbf{X}[i,:] = \mathbf{f}_i^T if the dimensions of all features are identical; otherwise, we use the common feature to construct X\mathbf{X}, i.e. X[i,:]=fiT\mathbf{X}[i,:] = \mathbf{f}_i^T. The adjacency matrix A′\mathbf{A}' is constructed from the learned heterogeneous graph A′\mathcal{A}' by considering all nodes as one type. A^=D~−1/2(A′+I)D~−1/2\hat{\mathbf{A}} = \tilde{\mathbf{D}}^{-1/2}(\mathbf{A}' + \mathbf{I})\tilde{\mathbf{D}}^{-1/2}, where D~ii=1+∑jAij′\tilde{\mathbf{D}}_{ii} = 1 + \sum_j \mathbf{A}'_{ij}. Thus, the classification loss of GNN, i.e. LGNN\mathcal{L}_{GNN}, on the learned graph can be obtained by:

LGNN=∑vi∈VLℓ(fθ(X,A′)i,yi),(4.39)\mathcal{L}_{GNN} = \sum_{v_i \in V_L} \ell \left( f_{\theta}(\mathbf{X}, \mathcal{A}')_i, y_i \right), \tag{4.39}

where fθ(X,A′)if_{\theta}(\mathbf{X}, \mathcal{A}')_i is the predicted label of node vi∈VLv_i \in V_L and ℓ(⋅,⋅)\ell(\cdot, \cdot) measures the difference between prediction and the true label yiy_i 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 Lreg\mathcal{L}_{reg} to the learned graph as follows:

Lreg=α∥A′∥1.(4.40)\mathcal{L}_{reg} = \alpha \|\mathbf{A}'\|_1. \tag{4.40}

This term encourages the learned graph to be sparse. The overall loss L\mathcal{L} can be obtained by:

L=LGNN+Lreg.(4.41)\mathcal{L} = \mathcal{L}_{GNN} + \mathcal{L}_{reg}. \tag{4.41}

By minimizing L\mathcal{L}, HGSL optimizes heterogeneous graph structure and the GNN parameters θ\theta jointly towards better downstream task performance.

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 dcd_c and the representation dimension dd 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. K=2K = 2. We set learning rate and weight decay as 0.01 and 0.0005, respectively. Other hyper-parameters, namely εFS,εFP,εMP\varepsilon^{FS}, \varepsilon^{FP}, \varepsilon^{MP}, and α\alpha, are tuned by grid search. The code and datasets are publicly available on Github.¹⁸

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)

DBLPACMYelp
Macro-F1Micro-F1Macro-F1
DeepWalk88.00 ± 0.4789.13 ± 0.4180.65 ± 0.60
GCN83.38 ± 0.6784.40 ± 0.6491.32 ± 0.61
GAT77.59 ± 0.7278.63 ± 0.7292.96 ± 0.28
GraphSage78.37 ± 1.1779.39 ± 1.1791.19 ± 0.36
MP2Vec88.86 ± 0.1989.98 ± 0.1778.63 ± 0.11
HAN90.53 ± 0.2491.47 ± 0.2291.67 ± 0.39
HeGAN87.02 ± 0.3788.34 ± 0.3882.04 ± 0.77
GTN90.42 ± 1.2991.41 ± 1.0991.91 ± 0.58
LDS75.65 ± 0.2076.63 ± 0.1892.14 ± 0.16
Pro-GNN89.20 ± 0.1590.28 ± 0.1691.62 ± 1.28
Geom-GCN79.43 ± 1.0180.94 ± 1.0670.20 ± 1.23
HGSL91.92 ± 0.1192.77 ± 0.1193.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 Ψr\Psi_r 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

page-106.png

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.

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.

  1. Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. In: International Conference on Learning Representations (2015)

  2. 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)

  3. Chen, Y., Wu, L., Zaki, M.J.: Deep iterative and adaptive learning for graph neural networks. Preprint. arXiv:1912.07832 (2019)

  4. 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)

  5. 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)

  6. 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)

  7. 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)

  8. 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)

  9. 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)

  10. 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)

  11. 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)

  12. 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)

  13. 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)

  14. Hu, Z., Dong, Y., Wang, K., Sun, Y.: Heterogeneous graph transformer. In: Proceedings of The Web Conference 2020, pp. 2704–2710 (2020)

  15. Ji, H., Wang, X., Shi, C., Wang, B., Yu, P.: Heterogeneous graph propagation network. IEEE Trans. Knowl. Data Eng. (2021)

  16. 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)

  17. 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)

  18. 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)

  1. Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization. In: International Conference on Learning Representations (2015)

  2. Kipf, T. N., Welling, M.: Semi-supervised classification with graph convolutional networks. In: International Conference on Learning Representations (2017)

  3. Klicpera, J., Bojchevski, A., G{“u}nnemann, S.: Predict then propagate: graph neural networks meet personalized pagerank. In: International Conference on Learning Representations (2019)

  4. 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)

  5. 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)

  6. 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)

  7. Pei, H., Wei, B., Chang, K.C., Lei, Y., Yang, B.: Geom-GCN: geometric graph convolutional networks. In: International Conference on Learning Representations (2020)

  8. 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)

  9. 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)

  10. 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)

  11. 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)

  12. 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)

  13. 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)

  14. 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)

  15. 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)

  16. 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)

  17. 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)

  18. 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)

  19. 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)

  20. 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)

  21. 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)

  1. 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)

  2. 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)

  3. 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)