NAGphormer: A Tokenized Graph Transformer for Node Classification in Large Graphs
Jinsong Chen, Kaiyuan Gao, Gaichao Li, Kun He
Abstract
The graph Transformer emerges as a new architecture and has shown superior performance on various graph mining tasks. In this work, we observe that existing graph Transformers treat nodes as independent tokens and construct a single long sequence composed of all node tokens so as to train the Transformer model, causing it hard to scale to large graphs due to the quadratic complexity on the number of nodes for the self-attention computation. To this end, we propose a Neighborhood Aggregation Graph Transformer (NAGphormer) that treats each node as a sequence containing a series of tokens constructed by our proposed Hop2Token module. For each node, Hop2Token aggregates the neighborhood features from different hops into different representations and thereby produces a sequence of token vectors as one input. In this way, NAGphormer could be trained in a mini-batch manner and thus could scale to large graphs. Moreover, we mathematically show that as compared to a category of advanced Graph Neural Networks (GNNs), the decoupled Graph Convolutional Network, NAGphormer could learn more informative node representations from the multi-hop neighborhoods. Extensive experiments on benchmark datasets from small to large are conducted to demonstrate that NAGphormer consistently outperforms existing graph Transformers and mainstream GNNs. Code is available at https://github.com/JHL-HUST/NAGphormer .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 992843c1-ccf3-4be9-b445-ae7dcc99bca9Cited by top-tier papers92
- Simplifying and Empowering Transformers for Large-Graph RepresentationsQitian Wu, Wentao Zhao, Chenxiao Yang, Hengrui Zhang et al.NeurIPS 2023 · 318 citations
- LLaGA: Large Language and Graph AssistantRunjin Chen, Tong Zhao, Ajay Kumar Jaiswal, Neil Shah et al.ICML 2024 · 180 citations
- Forest-Based Graph Learning for Semi-Supervised Node ClassificationJin Li, Shenghao Gao, Kaichen Zhang, Xinlong Chen et al.ICLR 2026 · 132 citations
- Polynormer: Polynomial-Expressive Graph Transformer in Linear TimeChenhui Deng, Zichao Yue, Zhiru ZhangICLR 2024 · 81 citations
- Graph Mamba: Towards Learning on Graphs with State Space ModelsAli Behrouz, Farnoosh HashemiKDD 2024 · 63 citations
Builds on19
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Simple and Deep Graph Convolutional NetworksMing Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding et al.ICML 2020 · 1,910 citations
- Do Transformers Really Perform Badly for Graph Representation?Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng et al.NeurIPS 2021 · 1,632 citations
- On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng et al.ICML 2020 · 1,388 citations
Related papers
- Tokenphormer: Structure-aware Multi-token Graph Transformer for Node ClassificationZijie Zhou, Zhaoqi Lu, Xuekai Wei, Rongqin Chen et al.AAAI 2025 · 5 citations
- HubGT: Fast Graph Transformer with Decoupled Hierarchy LabelingNingyi Liao, Zihao Yu, Siqiang Luo, Gao CongNeurIPS 2025 · 3 citations
- VCR-Graphormer: A Mini-batch Graph Transformer via Virtual ConnectionsDongqi Fu, Zhigang Hua, Yan Xie, Jin Fang et al.ICLR 2024 · 47 citations
- A Scalable and Effective Alternative to Graph TransformersKaan Sancak, Zhigang Hua, Jin Fang, Yan Xie et al.AAAI 2025 · 5 citations
- Primphormer: Efficient Graph Transformers with Primal RepresentationsMingzhen He, Ruikai Yang, Hanling Tian, Youmei Qiu et al.ICML 2025
