Graph Transformer Networks

Seongjun Yun, Minbyul Jeong, Raehyun Kim, Jaewoo Kang, Hyunwoo J. Kim

TL;DR

Graph Transformer Networks (GTNs) move beyond standard Graph Neural Networks by learning to generate their own graph structures from heterogeneous data. Instead of relying on human experts to manually define "meta-paths" (complex relationships like Author-Paper-Venue), GTNs use a novel transformer layer to identify and weight the most useful multi-hop connections for a specific task in an end-to-end fashion.

What Problem Does This Paper Address?

Most Graph Neural Networks (GNNs) operate under two restrictive assumptions: the graph structure is fixed and it is homogeneous (all nodes and edges are of the same type).

In the real world, data is rarely that simple. Consider a citation network: it contains different node types (Authors, Papers, Conferences) and different edge types (Author-writes-Paper, Paper-published in-Conference). To handle this "heterogeneous" data, researchers typically use meta-paths—pre-defined sequences of relations (e.g., Author-Paper-Author) that transform the complex graph into a simpler one.

The bottleneck? These meta-paths must be hand-crafted by domain experts. If you miss a crucial relationship or the graph data is noisy, the GNN's performance suffers. The authors of this paper asked: Can we build a model that discovers these important relationships automatically?

Methods

The core innovation is the Graph Transformer (GT) Layer, which treats meta-path discovery as a differentiable optimization problem.

The Graph Transformer (GT) Layer

Here is how the GT layer works:

  1. Soft Selection of Edge Types: Given a set of adjacency matrices (one for each edge type in the heterogeneous graph), the GT layer performs a $1 \times 1$ convolution followed by a softmax. This effectively "softly selects" which edge types are important.
  2. Matrix Multiplication for Meta-paths: To create a multi-hop relationship (a meta-path), the layer multiplies two of these softly-selected adjacency matrices together. Mathematically, if matrix $A$ represents "Author-Paper" and matrix $B$ represents "Paper-Conference," then $A \times B$ represents the "Author-Conference" relationship.
  3. The Identity Trick: A clever addition is including the Identity matrix in the candidate set. This allows the model to "skip" a multiplication, enabling it to learn variable-length meta-paths (e.g., a 2-hop path even if the model has 3 layers).

To build the full Graph Transformer Network (GTN), these layers are stacked and combined with standard graph convolutions.

The Graph Transformer Network (GTN) Architecture
  1. Stacking for Length: By stacking $l$ GT layers, the model can learn meta-paths of length up to $l+1$.
  2. Ensemble GCNs: The final architecture generates multiple different meta-path graphs in parallel using multi-channel $1 \times 1$ convolutions. It then runs a standard Graph Convolutional Network (GCN) on each generated graph and concatenates the results for the final prediction.

Datasets

The authors evaluated GTNs on three standard heterogeneous graph benchmarks for node classification:

  • DBLP: A citation network (Nodes: Author, Paper, Conference).
  • ACM: A citation network (Nodes: Paper, Author, Subject).
  • IMDB: A movie database (Nodes: Movie, Actor, Director).

No new benchmarks were introduced; instead, the focus was on outperforming models that relied on manually engineered features for these existing sets.

Key Insights and Ideas

  • End-to-End Meta-path Discovery: The most significant "aha moment" is that we no longer need a domain expert to tell the model that "Author-Paper-Venue" is a useful feature; the model learns it directly from the gradients.
  • Interpretability via Attention: Because the model uses a softmax-based selection (similar to attention), we can inspect the weights to see which meta-paths the model prioritized. For example, in DBLP, the model correctly identified that the "Paper-Conference" relationship was vital for predicting an author's research area.
  • Robustness to Noise: Because the model "softly" selects edges, it can learn to ignore noisy or irrelevant connections that would typically degrade the performance of a standard GNN.

Key Results

GTNs achieved state-of-the-art performance across all three datasets, notably outperforming the Heterogeneous Graph Attention Network (HAN). This is a significant milestone because HAN requires manually defined meta-paths, whereas GTN discovers them automatically.

  • DBLP: GTN achieved an F1 score of 94.18, beating HAN (92.83).
  • IMDB: GTN showed a massive jump to 60.92, compared to HAN's 56.77 and GAT's 58.14.
  • Variable Length: An ablation study confirmed that including the Identity matrix was crucial. This was especially true for the IMDB dataset, where shorter meta-paths proved more effective than the maximum length allowed by the stacked layers.

Limitations and Future Work

  • Computational Complexity: Matrix multiplication of large adjacency matrices is computationally expensive ($O(N^3)$ in the worst case, though sparsity helps). Scaling this approach to massive graphs with millions of nodes remains a challenge.
  • Base Model Constraints: The current implementation uses standard GCNs as the "back-end." The authors suggest that combining GT layers with more advanced GNNs (like GAT or GraphSAGE) could yield even better results.
  • Task Generalization: While highly effective for node classification, applying GTNs to other graph-based tasks like link prediction or graph-level classification is a promising direction for future research.

Summary updated

BibTeX
@inproceedings{yun2019graph,
  author = {Seongjun Yun and Minbyul Jeong and Raehyun Kim and Jaewoo Kang and Hyunwoo J. Kim},
  title = {{Graph Transformer Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=jutMp8HcSIY},
}
Figure