Automatic Graph Topology-Aware Transformer

Chao Wang, Jiaxuan Zhao, Lingling Li, Licheng Jiao, Fang Liu, Shuyuan Yang

TL;DR

EGTAS (Evolutionary Graph Transformer Architecture Search) is a new framework that automates the design of Graph Transformers by jointly optimizing their high-level "macro" topology and low-level "micro" graph-aware strategies. By using a surrogate model to predict performance, EGTAS efficiently discovers architectures that outperform both state-of-the-art human-designed models and previous automated search methods across a wide range of node and graph-level tasks.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) are powerful but often suffer from over-smoothing, where node representations become indistinguishable as the network gets deeper. Transformers have been introduced to graph learning to capture global dependencies, but they require specific "graph-aware" strategies (like positional encodings or modified attention matrices) to understand structural data.

Currently, designing a Graph Transformer is a "daunting and resource-intensive" task. Researchers must manually decide:

  1. Macro-topology: How to connect blocks (e.g., using skip connections like ResGCN or Jumping Knowledge).
  2. Micro-strategies: Which GNN operators to use, how to encode positions (Laplacian vs. SVD), and how to mask the attention matrix.

Existing Neural Architecture Search (NAS) for graphs usually focuses on either the macro or micro level, but rarely both. EGTAS fills this gap by providing a unified search space and an efficient way to navigate it.

Methods

The authors propose a Surrogate-Assisted Evolutionary Search framework consisting of three main pillars:

  • Unified Search Space:
    • Macro Level: Includes four topology designs (Vanilla, JK, Residual, GCNII) and three combination modes (Before, Alternate, Parallel) for GNN and Transformer blocks.
  • Micro Level: Includes choices for GNN blocks (GCN, SAGE, GAT, etc.), three types of Positional Embeddings (PE), three Attention Matrix (AM) strategies, and four model scales (Mini to Large).
  • Generic Architectural Coding: Architectures are represented as integer vectors (chromosomes), making them compatible with standard evolutionary operators like crossover and mutation.
  • Surrogate-Assisted Search: Training every candidate architecture is computationally prohibitive. Instead, EGTAS trains a small sample of architectures to build a surrogate model (e.g., Random Forest or Gaussian Process). This model predicts the performance of new candidates during the evolutionary process, drastically reducing the search time.

Datasets

The framework was evaluated on a comprehensive suite of benchmarks:

  • Node Classification: Cora, Computers, PubMed, Wisconsin, Flickr, and large-scale datasets like ogbn-arxiv and ogbn-products.
  • Graph Classification: Molecular datasets including DHFR_MD, ogbg-molbbbp, ogbg-molbace, and ogbg-molhiv.
  • Benchmarking GNNs: ZINC (regression), PATTERN, CLUSTER, MNIST, and CIFAR10.

Key Insights and Ideas

  • Joint Search is Non-Negotiable: The authors performed ablation studies comparing "Macro-only" and "Micro-only" searches. They found that neither alone could match the performance of the joint search, proving that topology and graph-aware strategies are deeply interdependent.
  • No "Silver Bullet" Architecture: The visualization of searched architectures showed that the "optimal" design varies significantly by dataset. For example, large-scale graphs like ogbn-products favored larger model scales and specific attention masks, while smaller datasets performed better with simpler, shallower configurations.
  • Alleviating Over-smoothing Automatically: By including topologies like GCNII and JK-net in the search space, the framework naturally gravitates toward designs that maintain feature diversity even in deep networks.
  • Efficiency via Prediction: The surrogate model approach allows the system to "evaluate" thousands of architectures in seconds. The authors found that the total search cost is dominated by the initial sampling phase (~17 hours), which is still significantly faster than manual tuning.

Key Results

  • State-of-the-Art Performance: EGTAS outperformed top-tier manual models like Graphormer and GMT, as well as automated baselines like AutoGT.
  • Node Classification: On ogbn-products, EGTAS achieved 82.15% accuracy, surpassing the best manual GNN/GT baselines.
  • Graph Classification: EGTAS achieved the top average rank (AR=1.0) across all tested molecular property prediction tasks.
  • Benchmarking GNNs: It set new benchmarks on the CLUSTER (79.236%) and CIFAR10 (74.308%) datasets, showing strong versatility across different data types (social networks vs. image-to-graph).

Limitations and Future Work

  • Multi-Objective Search: The current version focuses primarily on accuracy/performance. The authors suggest that future iterations should include latency and parameter count as objectives to recommend models suitable for mobile or real-time deployment.
  • Heterophily: The paper primarily tests on homophilous graphs (where similar nodes connect). Exploring architectures specifically for heterophilous graphs (where dissimilar nodes connect) is a noted direction for future research.
  • Parallelization: While the surrogate model is fast, the initial training of sample architectures could be further optimized through better parallelization strategies.

Summary updated

BibTeX
@article{wang2025automatic,
  author = {Chao Wang and Jiaxuan Zhao and Lingling Li and Licheng Jiao and Fang Liu and Shuyuan Yang},
  title = {{Automatic Graph Topology-Aware Transformer}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2025},
  doi = {10.1109/tnnls.2024.3440269},
}
Figure