Tailoring Self-Attention for Graph via Rooted Subtrees

Siyuan Huang, Yunchong Song, Jiayue Zhou, Zhouhan Lin
2/12/2026

Official code: LUMIA-Group/SubTree-Attention (11 stars, PyTorch, last commit 2024-10-09).

Abstract

Attention mechanisms have made significant strides in graph learning, yet they still exhibit notable limitations: local attention faces challenges in capturing long-range information due to the inherent problems of the message-passing scheme, while global attention cannot reflect the hierarchical neighborhood structure and fails to capture fine-grained local information. In this paper, we propose a novel multi-hop graph attention mechanism, named Subtree Attention (STA), to address the aforementioned issues. STA seamlessly bridges the fully-attentional structure and the rooted subtree, with theoretical proof that STA approximates the global attention under extreme settings. By allowing direct computation of attention weights among multi-hop neighbors, STA mitigates the inherent problems in existing graph attention mechanisms. Further we devise an efficient form for STA by employing kernelized softmax, which yields a linear time complexity. Our resulting GNN architecture, the STAGNN, presents a simple yet performant STA-based graph neural network leveraging a hop-aware attention strategy. Comprehensive evaluations on ten node classification datasets demonstrate that STA-based models outperform existing graph transformers and mainstream GNNs. The code is available at https://github.com/LUMIA-Group/SubTree-Attention.

View on arXivView PDF

Code Implementations(1)

PyTorch

Official implementation for "Tailoring Self-Attention for Graph via Rooted Subtrees" (NeurIPS2023)

111Shell, PythonOct 6, 20232 years ago
attention-mechanismgnngraph-algorithmsgraph-attention-networksgraph-neural-networks+5 more

Similar Papers

Cite this paper

@article{huang2026tailoring,
  title  = {Tailoring Self-Attention for Graph via Rooted Subtrees},
  author = {Siyuan Huang and Yunchong Song and Jiayue Zhou and Zhouhan Lin},
  year   = {2026},
  eprint = {2310.05296},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2310.05296},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.05296.svg)](https://codeofpaper.com/paper/2310.05296)

Discussion