Towards Sparsification of Graph Neural Networks

Hongwu Peng, Deniz Gurevin, Shaoyi Huang, Tong Geng, Weiwen Jiang, Omer Khan, Caiwen Ding

TL;DR

This paper tackles the massive computational cost of Graph Neural Networks (GNNs) by sparsifying their weight layers. By comparing traditional "train and prune" techniques with dynamic "sparse training," the authors show that models can maintain high accuracy even when 90% of their parameters are removed, with sparse training requiring significantly fewer floating-point operations (FLOPs) during the training process itself.

What Problem Does This Paper Address?

As real-world graphs (like social networks or recommendation systems) explode in size, the GNN models used to analyze them have grown to include billions of parameters. Training and running inference on these "massive" GNNs is incredibly expensive, often requiring high-end server clusters and specialized GPUs.

While researchers have previously tried to simplify the input graph (by pruning redundant nodes or edges), sparsifying the model layers themselves is a relatively under-explored area for GNNs. This paper investigates how to directly compress GNN weight matrices to reduce memory footprint and computational overhead without sacrificing predictive performance.

Methods

The authors evaluate two primary strategies for model sparsification:

  1. Train and Prune (using SLR): This is a three-stage process. First, a dense model is trained to convergence. Second, a technique called Surrogate Lagrangian Relaxation (SLR) is used to identify redundant weights. SLR is a systematic optimization approach that helps the model converge to a sparse state faster than older methods like ADMM. Finally, the model is "fine-tuned" to recover any lost accuracy.
  2. Sparse Training (Dynamic Masking): Unlike the first method, this approach starts with a sparse model from the very first iteration. It uses a "drop-and-grow" schedule: every few iterations ($\Delta T$), the weights with the smallest magnitudes are dropped (set to zero), and an equal number of new weights are "grown" in locations where the gradients are largest. This allows the model to dynamically explore and find the most effective sparse architecture during training.
Fig. 2: Overview of two sparsification methods for neural networks: (1) train and prune and (2) sparse training.

The authors also experiment with embedding sparsification, where they prune the input node embeddings to further reduce the workload of the first neural network layer.

Datasets

The methods were tested across two primary tasks:

  • Link Prediction: Using temporal graph datasets including ia-email, wiki-talk, and stackoverflow.
  • Node Classification: Using the brain dataset (a temporal graph of brain activity) and standard GCN benchmarks: Cora, Pubmed, and CiteSeer.

Key Insights and Ideas

  • The "Occam’s Hill" Phenomenon: In many experiments, accuracy actually increased slightly as initial sparsity was introduced. This suggests that pruning acts as a form of regularization, removing "learned noise" and helping the model generalize better.
  • Sparse Training is a "Green" Alternative: Because sparse training never requires a fully dense model, it drastically reduces the total training FLOPs. For the brain dataset, it required less than 1/7th the FLOPs of the traditional train-and-prune method.
  • Robustness at the Edge: Sparse training proved much more resilient than SLR-based pruning under "extreme" sparsity (above 90%). While SLR accuracy often plummeted at these levels, the dynamic nature of sparse training allowed it to maintain a much higher performance floor.
  • Input vs. Model Sparsity: For link prediction tasks, the first layer of the network often accounts for over 90% of the total computation. In these cases, sparsifying the input embeddings is just as important as sparsifying the model weights.
Fig. 4: Iterative drop & grow based sparse training process.

Key Results

  • Efficiency: On the ia-email and wiki-talk datasets, combining sparse training with sparse embeddings resulted in a 10x reduction in total training FLOPs compared to dense baselines.
  • Accuracy: For link prediction, models maintained nearly baseline accuracy even at 90.6% sparsity.
  • Node Classification: On the brain dataset, sparse training achieved significantly higher accuracy than the SLR method at extreme sparsity levels, as shown in the steep drop-offs for the blue and green lines in the "brain" plot below.
Accuracy vs. Sparsity across different datasets

Limitations and Future Work

While the paper demonstrates theoretical computational savings via FLOP counts, it does not measure actual wall-clock time speedups on specific hardware. Sparse operations can be tricky to optimize on standard GPUs, which often prefer dense, regular data.

The authors suggest that future work should explore other sparsification techniques, such as the Lottery Ticket Hypothesis (LTH), and investigate how these methods translate into real-world system speedups on various hardware accelerators.

Summary updated

Abstract

As real-world graphs expand in size, larger GNN models with billions of parameters are deployed. High parameter count in such models makes training and inference on graphs expensive and challenging. To reduce the computational and memory costs of GNNs, optimization methods such as pruning the redundant nodes and edges in input graphs have been commonly adopted. However, model compression, which directly targets the sparsification of model layers, has been mostly limited to traditional Deep Neural Networks (DNNs) used for tasks such as image classification and object detection. In this paper, we utilize two state-of-the-art model compression methods (1) train and prune and (2) sparse training for the sparsification of weight layers in GNNs. We evaluate and compare the efficiency of both methods in terms of accuracy, training sparsity, and training FLOPs on real-world graphs. Our experimental results show that on the ia-email, wiki-talk, and stackoverflow datasets for link prediction, sparse training with much lower training FLOPs achieves a comparable accuracy with the train and prune method. On the brain dataset for node classification, sparse training uses a lower number FLOPs (less than 1/7 FLOPs of train and prune method) and preserves a much better accuracy performance under extreme model sparsity.
BibTeX
@inproceedings{peng2022towards,
  author = {Hongwu Peng and Deniz Gurevin and Shaoyi Huang and Tong Geng and Weiwen Jiang and Omer Khan and Caiwen Ding},
  title = {{Towards Sparsification of Graph Neural Networks}},
  booktitle = {ICCD},
  year = {2022},
}
Figure