Papers › Heterogeneous Graph Transformer

Heterogeneous Graph Transformer

3 Mar 2020arXiv:2003.01332archive 2025-07-28

Ziniu Hu, Yuxiao Dong, Kuansan Wang, Yizhou Sun

Recent years have witnessed the emerging success of graph neural networks (GNNs) for modeling structured data. However, most GNNs are designed for homogeneous graphs, in which all nodes and edges belong to the same types, making them infeasible to represent heterogeneous structures. In this paper, we present the Heterogeneous Graph Transformer (HGT) architecture for modeling Web-scale heterogeneous graphs. To model heterogeneity, we design node- and edge-type dependent parameters to characterize the heterogeneous attention over each edge, empowering HGT to maintain dedicated representations for different types of nodes and edges. To handle dynamic heterogeneous graphs, we introduce the relative temporal encoding technique into HGT, which is able to capture the dynamic structural dependency with arbitrary durations. To handle Web-scale graph data, we design the heterogeneous mini-batch graph sampling algorithm---HGSampling---for efficient and scalable training. Extensive experiments on the Open Academic Graph of 179 million nodes and 2 billion edges show that the proposed HGT model consistently outperforms all the state-of-the-art GNN baselines by 9%--21% on various downstream tasks.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2003.01332")

Code

Syntology Ran 1 of 6 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 1 ran with no contract checked.

By repository: official repository: 6 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

acbull/pyHGT officialmentioned in papermentioned on GitHubpytorchMIT report
acbull/pyHGT mentioned on GitHubpytorch report
syyunn/node2vec mentioned on GitHubMIT report
dmlc/dgl pytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

6 samples harvested; 1 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran
5unverified

Licence: 0 of the 6 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from acbull/pyHGT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_n_params acbull/pyHGT/ogbn-mag/pyHGT/utils.py official repository ran MIT (permissive) · c6acd3e400fc2676 · report
dcg_at_k acbull/pyHGT/pyHGT/utils.py official repository unverified MIT (permissive) · 98dab8054ae3ccee · report
mean_reciprocal_rank acbull/pyHGT/pyHGT/utils.py official repository unverified MIT (permissive) · b7094768238a0bdb · report
ndcg_at_k acbull/pyHGT/pyHGT/utils.py official repository unverified MIT (permissive) · 46e47a2c4cf98c1f · report
renamed_load acbull/pyHGT/pyHGT/data.py official repository unverified MIT (permissive) · 391651c3e47960ca · report
to_torch acbull/pyHGT/pyHGT/data.py official repository unverified MIT (permissive) · f8a36842e8bfa621 · report

Tasks

Graph SamplingHeterogeneous Node ClassificationNode Property Prediction

Datasets

Introduced by this paper, per the archive.

OAG-Venue

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Heterogeneous Node Classification ACM (Heterogeneous Node Classification) HGT Macro-F1 91.12 #8 of 11 Archive leaderboard report
Heterogeneous Node Classification ACM (Heterogeneous Node Classification) HGT Micro-F1 91.00 #8 of 11 Archive leaderboard report
Heterogeneous Node Classification DBLP (Heterogeneous Node Classification) HGT Macro-F1 93.01 #6 of 11 Archive leaderboard report
Heterogeneous Node Classification DBLP (Heterogeneous Node Classification) HGT Micro-F1 93.49 #6 of 11 Archive leaderboard report
Heterogeneous Node Classification Freebase (Heterogeneous Node Classification) HGT Macro-F1 29.28 #6 of 9 Archive leaderboard report
Heterogeneous Node Classification Freebase (Heterogeneous Node Classification) HGT Micro-F1 60.51 #6 of 9 Archive leaderboard report
Heterogeneous Node Classification IMDB (Heterogeneous Node Classification) HGT Macro-F1 63.00 #5 of 11 Archive leaderboard report
Heterogeneous Node Classification IMDB (Heterogeneous Node Classification) HGT Micro-F1 67.20 #5 of 11 Archive leaderboard report
Heterogeneous Node Classification OAG-L1-Field HGT MRR 82.16 #5 of 5 Archive leaderboard report
Heterogeneous Node Classification OAG-L1-Field HGT NDCG 84.13 #5 of 5 Archive leaderboard report
Heterogeneous Node Classification OAG-Venue HGT MRR 29.82 #4 of 5 Archive leaderboard report
Heterogeneous Node Classification OAG-Venue HGT NDCG 47.31 #4 of 5 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (TransE embs) Ext. data No #27 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (TransE embs) Number of params 26877657 #27 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (TransE embs) Test Accuracy 0.4982 ± 0.0013 #27 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (TransE embs) Validation Accuracy 0.5124 ± 0.0046 #27 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (LADIES Sample) Ext. data No #29 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (LADIES Sample) Number of params 21173389 #29 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (LADIES Sample) Test Accuracy 0.4927 ± 0.0061 #29 of 39 Archive leaderboard report
Node Property Prediction ogbn-mag HGT (LADIES Sample) Validation Accuracy 0.4989 ± 0.0047 #29 of 39 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerReLUResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections