A graph transformer with optimized attention scores for node classification
Authors:
Open Access
- 16 August 2025
- journal article
- research article
- Published by Springer Nature in Scientific Reports
- Vol. 15 (1) , 1-16
Abstract
The message-passing paradigm on graphs has significant advantages in modeling local structures, but still faces challenges in capturing global information and complex relationships. Although the Transformer architecture has become a mainstream approach for nonlocal modeling in many domains, Transformer-based architectures fail to demonstrate competitiveness in popular node-level prediction tasks when compared to mainstream graph neural network (GNN) variants. This can be attributed to the fact that existing research has largely focused on more efficient strategies to approximate the Vanilla Transformer, thereby overlooking its potential in node embedding representation learning. This paper introduces a novel graph Transformer model with optimized attention scores, named OGFormer, to address this gap. OGFormer employs a simplified single-head self-attention mechanism, incorporating several critical structural innovations in its self-attention layers to more effectively capture global dependencies within graphs. Specifically, we propose an end-to-end attention score optimization loss function, designed to suppress noisy connections and enhance the connection weights between similar nodes. Additionally, we introduce an effective structural encoding strategy integrated into the attention score computation, enabling the model to focus more on key local dependencies in the graph. Experimental results demonstrate that OGFormer achieves strong competitive performance in node classification tasks across multiple benchmark datasets, particularly in Homophilous and Heterophilous tests, surpassing current mainstream methods. Our implementation is available at https://github.com/LittleBlackBearLiXin/OGFormer.Keywords
This publication has 17 references indexed in Scilit:
- Spatial-temporal modeling for multi-scale wind speed predictions in rail transit networks: A graph neural network-based methodologyEngineering Applications of Artificial Intelligence, 2025
- SparseSwin: Swin transformer with sparse transformer blockNeurocomputing, 2024
- Graph Neural Network-Based EEG Classification: A SurveyIEEE Transactions on Neural Systems and Rehabilitation Engineering, 2024
- SDFormer: A shallow-to-deep feature interaction for knowledge graph embeddingKnowledge-Based Systems, 2023
- FLatten Transformer: Vision Transformer using Focused Linear Attention2023
- A unified deep semi-supervised graph learning scheme based on nodes re-weighting and manifold regularizationNeural Networks, 2022
- Improving Graph Neural Network Expressivity via Subgraph Isomorphism CountingIEEE Transactions on Pattern Analysis and Machine Intelligence, 2022
- Multi-Scale attributed node embeddingJournal of Complex Networks, 2021
- Exploring Structure-Adaptive Graph Learning for Robust Semi-Supervised Classification2020
- DeepGCNs: Can GCNs Go As Deep As CNNs?2019