HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Enhancing Graph Transformers with Hierarchical Distance Structural Encoding

Yuankai Luo Hongkang Li Lei Shi Xiao-Ming Wu

Enhancing Graph Transformers with Hierarchical Distance Structural Encoding

Abstract

Graph transformers need strong inductive biases to derive meaningful attention scores. Yet, current methods often fall short in capturing longer ranges, hierarchical structures, or community structures, which are common in various graphs such as molecules, social networks, and citation networks. This paper presents a Hierarchical Distance Structural Encoding (HDSE) method to model node distances in a graph, focusing on its multi-level, hierarchical nature. We introduce a novel framework to seamlessly integrate HDSE into the attention mechanism of existing graph transformers, allowing for simultaneous application with other positional encodings. To apply graph transformers with HDSE to large-scale graphs, we further propose a high-level HDSE that effectively biases the linear transformers towards graph hierarchies. We theoretically prove the superiority of HDSE over shortest path distances in terms of expressivity and generalization. Empirically, we demonstrate that graph transformers with HDSE excel in graph classification, regression on 7 graph-level datasets, and node classification on 11 large-scale graphs, including those with up to a billion nodes.

Code Repositories

luoyk1999/hdse
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
graph-classification-on-cifar10-100kGraphGPS + HDSE
Accuracy (%): 76.180±0.277
graph-classification-on-peptides-funcGraphGPS + HDSE
AP: 0.7156±0.0058
graph-regression-on-zinc-500kGraphGPS + HDSE
MAE: 0.062

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Enhancing Graph Transformers with Hierarchical Distance Structural Encoding | Papers | HyperAI