cs.LGFeb 23, 2026

VecFormer: Towards Efficient and Generalizable Graph Transformer with Graph Token Attention

Authors: Jingbo Zhou, Jun Xia, Siyuan Li, Yunfan Liu, Wenjun Wang, Yufei Huang, Changxi Chi, Mutian Hong, 

Organizations: Zhejiang University Hangzhou, Zhejiang, China · Westlake University Hangzhou, Zhejiang, China · Hong Kong University of Science and Technology (Guangzhou) Guangzhou, Guangdong, China · Tongji University Shanghai, China · 

Abstract

Graph Transformer has demonstrated impressive capabilities in the field of graph representation learning. However, existing approaches face two critical challenges: (1) most models suffer from exponentially increasing computational complexity, making it difficult to scale to large graphs; (2) attention mechanisms based on node-level operations limit the flexibility of the model and result in poor generalization performance in out-of-distribution (OOD) scenarios. To address these issues, we propose VecFormer (the Vector Quantized Graph Transformer), an efficient and highly generalizable model for node classification, particularly under OOD settings. VecFormer adopts a two-stage training paradigm. In the first stage, two codebooks are used to reconstruct the node features and the graph structure, aiming to learn the rich semantic Graph Codes. In the second stage, attention mechanisms are performed at the Graph Token level based on the transformed cross codebook, reducing computational complexity while enhancing the model's generalization capability. Extensive experiments on datasets of various sizes demonstrate that VecFormer outperforms the existing Graph Transformer in both performance and speed.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. TopoFormer: Topology Meets Attention for Graph Learning

    Jul 30, 2026Md Joshem Uddin, Astrit Tola, Cuneyt Gurcan Akcora +1Graph Representation LearningGraph Classification

  2. Graph Tokenization for Bridging Graphs and Transformers

    Mar 11, 2026Zeyuan Guo, Enmao Diao, Cheng Yang +1Graph Representation LearningTransformer

  3. The Universal Classifier for Graph Learning

    Sep 28, 2026Ben Finkelshtein, André Linhares, Petar Veličković +2Graph Representation LearningGraph Foundation Models