A Graph is Worth 1-bit Spikes: When Graph Contrastive Learning Meets Spiking Neural Networks

Jintang Li, Huizhe Zhang, Ruofan Wu, Zulun Zhu, Baokun Wang, Changhua Meng, Zibin Zheng, Liang Chen

TL;DR

Graph Contrastive Learning (GCL) typically relies on memory-heavy 32-bit representations, making it expensive to deploy on resource-constrained devices. This paper introduces SPIKEGCL, a novel framework that leverages brain-inspired Spiking Neural Networks (SNNs) to compress graph embeddings into 1-bit binary spikes. This approach slashes representation storage by 32x and significantly reduces energy consumption, all while maintaining state-of-the-art accuracy.

What Problem Does This Paper Address?

Self-supervised learning—specifically Graph Contrastive Learning (GCL)—has become the go-to method for training Graph Neural Networks (GNNs) without labeled data. However, to achieve high accuracy, current GCL methods rely on large, full-precision (32-bit floating-point) hidden dimensions.

Comparison of standard GCL and SpikeGCL representations

As real-world graphs explode in size (such as Amazon's product network or the Microsoft Academic Graph), these 32-bit representations create massive computational, memory, and energy bottlenecks. This makes deploying advanced graph models on edge devices or in low-power environments nearly impossible. The authors tackle this by asking: Can we learn sparse, binarized (1-bit), yet highly generalizable graph representations?

Methods

To solve this, the authors combine GCL with Spiking Neural Networks (SNNs). SNNs mimic biological brains by communicating via discrete, sparse binary signals ("spikes") rather than continuous numbers.

The SpikeGCL framework and embedding generation process

The proposed framework, SPIKEGCL, introduces several clever innovations to make this integration seamless and efficient:

  • Feature Partitioning (Instead of Repetition): SNNs require sequential (time-series) inputs to accumulate "membrane potential" and fire spikes. Standard approaches just copy a static graph $T$ times, which is computationally wasteful. Instead, SPIKEGCL slices the node features into $T$ non-overlapping groups, feeding them sequentially. This drastically reduces memory overhead.
  • Binarizing Representations: The sliced features are passed through an encoder consisting of shared GNN layers followed by a spiking neuron (like an Integrate-and-Fire model). If the neuron's accumulated voltage crosses a threshold, it outputs a 1; otherwise, a 0.
  • Blockwise Surrogate Gradient Learning: Training deep SNNs is notoriously difficult due to the vanishing gradient problem, which is caused by the approximations needed to backpropagate through non-differentiable spikes. SPIKEGCL solves this by dividing the network into blocks across the time dimension and training them locally with gradient isolation, preventing the gradients from vanishing over long sequences.
  • Contrastive Objective: The 1-bit spikes are mapped via a simple network to calculate a margin ranking loss, pushing the representations of augmented (corrupted) graph views away from the original graph views.

Datasets

The authors evaluated SPIKEGCL across 9 standard benchmark graphs of varying scales and densities:

  • Co-purchase networks: Amazon-Photo, Amazon-Computer
  • Co-author networks: Coauthor-CS, Coauthor-Physics
  • Citation networks: Cora, CiteSeer, PubMed
  • Large-scale Open Graph Benchmark (OGB) datasets: ogbn-arXiv, ogbn-MAG

Key Insights and Ideas

  • Theoretical Bridge Between SNNs and GNNs: The authors don't just provide empirical results; they mathematically prove that a spiking GNN can approximate a standard full-precision GNN. Specifically, the approximation error shrinks at a rate of $O(1/T)$ as the number of time steps ($T$) increases.
  • Binarization Doesn't Mean "Brain Damage": Intuitively, dropping from 32-bit floats to 1-bit integers should destroy a model's expressiveness. However, SPIKEGCL proves that if the binary representations are learned contrastively over time steps, they disentangle the input features perfectly and retain the structural graph information.
  • Slicing Beats Copying: The simple trick of partitioning node features across time steps instead of repeating the whole graph is a massive unlock for applying SNNs to static data, bypassing the usual memory bottlenecks of neuromorphic algorithms.

Key Results

  • Massive Compression: SPIKEGCL achieves a ~32x reduction in representation storage by moving from 32-bit floats to 1-bit spikes.
  • Energy Efficiency: On the large-scale MAG dataset, SPIKEGCL consumes up to ~7x less theoretical energy and requires ~1/60th the parameter size compared to standard full-precision GCL methods.
  • State-of-the-Art Accuracy: Despite the extreme compression, SPIKEGCL retains about 95%–99% of the performance capability of full-precision models, and in some cases (like on the Cora and PubMed datasets), it actually outperforms them.
  • Lightning Fast Convergence: Thanks to the blockwise training strategy, SPIKEGCL converges in just 1-2 epochs, vastly outpacing traditional negative-sample-based GCL methods.

Limitations and Future Work

  • Evaluation Protocol: The paper relies on linear evaluation (training a linear classifier on top of the frozen representations). This assumes the downstream task can be solved linearly, which isn't always true for complex real-world applications.
  • Theoretical Assumptions: The mathematical guarantees assume the spiking neurons use a "reset by subtraction" mechanism (subtracting the threshold from the voltage after firing). It may not hold perfectly for neurons that simply "reset to zero."
  • Future Directions: The authors suggest exploring non-uniform feature partitioning (e.g., using clustering methods to group similar features together) rather than simple uniform slicing, which could further improve the expressiveness of the spikes. They also note the need to test on ultra-massive graphs (billions of nodes) in the future.

Summary updated

BibTeX
@inproceedings{li2024graph,
  author = {Jintang Li and Huizhe Zhang and Ruofan Wu and Zulun Zhu and Baokun Wang and Changhua Meng and Zibin Zheng and Liang Chen},
  title = {{A Graph is Worth 1-bit Spikes: When Graph Contrastive Learning Meets Spiking Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=LnLySuf1vp},
}
Figure