📄 Paper
Heterogeneous Graph Attention Network [arxiv]
Ziniu Hu, et al. WWW 20
📝 Key Point
- Web-scale Heterogeneous Graph를 Transformer 구조를 활용하여 학습
- GNN method와 Side Information 활용 가능
- Meta-path를 직접 설정하지 않음
- Timestamp를 포함하는 Dynamic Heterogenous Graph 활용
1. Abstract
- Web-scale Heterogeneous Graph를 모델링하기 위한 Heterogeneous Graph Transformer(HGT) 제안
- 각 edge에 대한 Heterogeneous Attention을 특성화하기 위해 node type과 edge type에 따라 다른 parameter 설계
- Dynamic Heterogeneous Graph를 처리하기 위해 임의의 기간으로 동적 구조적 의존성을 캡쳐할 수 있는 relative temporal encoding 기술 도입
- Web-scale Heterogeneous Graph를 처리하기 위해 효율적이고 확장 가능한 학습이 가능하도록 mini-batch graph sampling 알고리즘인 HGSampling 설계
2. HGT
1) Heterogeneous Mutual Attention
- edge type 별 노드 사이의 유사성 계산
- source node가 각 edge를 통해 target node에 주는 영향력 계산
- Multi-head Attention 대신 Heterogeneous Mutual Attention 사용
- 핵심 구조는 Multi-head Attention과 동일
- target node는 Query 벡터, source node는 Key 벡터로 매핑
- node type, edge type에 따라 weight 다르게 적용
2) Heterogeneous Message Passing
- source node의 정보를 target node로 전달
- node type, edge type에 따라 weight 다르게 적용
3) Target-Specific Aggregation
- source node의 정보를 통합하여 target node의 contextualized representation 생성
- edge type 별로 Attention과 Message를 곱하여 representation 생성
- edge type 별 representation들을 합하여 linear layer에 통과시킴
- 이전 layer의 output을 더하는 방식으로 residual connection 추가
- 이 과정을 L번 반복하여 target node의 contextualized representation 생성
Relative Temporal Encoding

HGSampling
Inductive Timestamp Assignment
3. Experiments
4. PyG
GNN 모델을 쉽게 활용할 수 있도록 구축된 PyTorch Geometric 라이브러리에서 HGT 모델을 제공하고있다.
from torch_geometric.nn import HGTConv
Document
https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.conv.HGTConv.html#torch_geometric.nn.conv.HGTConv
5. References
https://greeksharifa.github.io/machine_learning/2021/10/02/HGT/
https://www.pyg.org/ns-newsarticle-accelerating-graph-learning-with-hgt