SGHormer: An Energy-Saving Graph Transformer Driven by Spikes

Huizhe Zhang, Jintang Li, Liang Chen, Zibin ZhengarXiv 2024 · DOI

Introduction

Graph Transformers (GTs) have emerged as a powerful paradigm for modeling complex relational data, from molecular structures to social networks. However, their widespread adoption is hindered by high computational costs, primarily due to the quadratic complexity of self-attention and the reliance on full-precision floating-point operations (FLOPs). These factors limit the scalability of GTs and their deployment on energy-constrained edge devices.

SGHormer addresses this "energy crisis" by introducing a biologically inspired approach: Spiking Neural Networks (SNNs). By utilizing sparse, binary signals (spikes) instead of continuous values, SGHormer achieves performance comparable to state-of-the-art Graph Transformers while consuming up to 153x less energy.

Methodology: The SGHormer Architecture

SGHormer is the first framework to fully integrate spiking neurons into a Graph Transformer architecture. The model consists of several key innovations designed to maintain representational power while operating on binary signals.

Overview of the SGHormer architecture, including the Rate-based Encoder, SGSA, and SRB modules.

Core Components

  • Rate-based Encoder: Node features and structural information (e.g., Laplacian or Random-walk encodings) are converted into temporal sequences of binary spikes.
  • Spiking Graph Self-Attention (SGSA): This module replaces the standard softmax-based attention. By using spiking neurons to binarize attention scores, expensive matrix multiplications are transformed into efficient additions, significantly reducing Synaptic Operations (SOPs).
  • Spiking Rectify Block (SRB): To mitigate information loss during binarization, the SRB acts as a recovery mechanism, reconstructing high-precision embeddings by analyzing the statistical distribution of spikes across time steps.
  • Hybrid Structure: The model combines a Spiking Multi-Layer Perceptron (SMLP) for global context with a Message Passing Neural Network (MPNN) to preserve local graph topology simultaneously.

Key Insights: Spiking Attention and Temporal Intensity

A critical discovery in this work is that spiking neurons can effectively capture attention patterns similar to the traditional softmax function. This suggests that high-precision decimals are not strictly necessary for identifying node importance. Furthermore, SGHormer utilizes the temporal dimension of SNNs—where the timing of a spike indicates feature intensity—to preserve complex information despite the binary nature of the signals.

Experimental Results

The model was evaluated on the Benchmarking-GNNs suite (ZINC, MNIST, CIFAR10, PATTERN, CLUSTER) and the Open Graph Benchmark (ogbg-molhiv, ogbg-molpcba).

Comparison of SGHormer (ours) against state-of-the-art Graph Transformers and GNNs across five benchmarks.

Performance and Efficiency

  • Accuracy: On the ZINC dataset, SGHormer achieved a Mean Absolute Error (MAE) of 0.117, outperforming traditional models like GCN and GIN. It remains highly competitive with top-tier full-precision models like SAN and GPS.
  • Energy Savings: SGHormer demonstrates massive efficiency gains. On average, it consumes 153x less energy than standard GTs. On the PATTERN dataset, energy usage was reduced by approximately 294x (1.64 mJ for SGHormer vs. an average of 483.33 mJ for others).
  • Scalability: The model maintains a smaller parameter footprint and lower memory usage across almost all tested datasets compared to its full-precision counterparts.

Conclusion and Future Work

SGHormer proves that spiking models can bridge the gap between efficiency and accuracy in graph learning. While the model shows some sensitivity to datasets with very simple features (e.g., CLUSTER), its massive energy savings represent a significant step toward sustainable AI. Future research will focus on optimizing performance for low-dimensional features and leveraging specialized neuromorphic hardware to fully realize these theoretical energy gains in real-world applications.

Summary updated

BibTeX
@misc{zhang2024sghormer,
  author = {Huizhe Zhang and Jintang Li and Liang Chen and Zibin Zheng},
  title = {{SGHormer: An Energy-Saving Graph Transformer Driven by Spikes}},
  year = {2024},
  eprint = {2403.17656},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.17656},
}
Figure