1 Introduction
Graph neural networks (GNNs), which expand upon conventional deep neural networks (DNNs) to process graph-structured data, have recently drawn significant attention from both academia and industry [
1]. Owing to their excellent representation capability, GNN models have been successfully deployed in various applications, e.g., social network analysis [
2], citation graph mining [
3], and traffic flow prediction [
4] and notably, in Next-Generation IoT scenarios [
5], where real-time processing and efficient data management are paramount. The exceptional performance of GNNs stems from generalizing both deep learning and graph processing. Given an input graph, GNNs use iterative aggregation to combine information from neighboring nodes, and neural network operators to learn non-linear relationships between nodes, so as to capture hierarchical patterns in the target graph [
6]. This enables the model to learn the distinctive properties of individual nodes, edges, or the entire graph, and then generalize to previously unobserved graphs. This capability of GNNs to capture relational patterns is powerfully exemplified in visual scene understanding tasks, such as human-object interaction (HOI) detection [
7]. As shown in Fig. 1, GNNs achieve relational reasoning by constructing structured graphs from visual inputs. First, human and object instances are localized using object detectors. Subsequently, a human-object association graph is dynamically built based on a learnable adjacency matrix. Through iterative message passing and node updates, the graph structure is continuously refined to enhance relational reasoning capabilities, ultimately producing interaction results such as “person, lick, knife”, which vividly demonstrating how GNNs can model complex relational structures.
However, this expressiveness comes at the cost of substantial computational overhead, causing inference performance bottlenecks that hinder scalability in large-scale or real-time applications [
8–
10]. This deficiency originates from limitations in both algorithm and hardware perspectives [
11]. On the one hand, GNNs attribute their superior performance to the capability of taking both node features and graph structure as input to obtain node representations. This is done by a message passing process, in which each node aggregates features from its neighbors and updates its own representation using a neural network. The computational cost of such aggregation scales exponentially with not only the graph size and the connection complexity, but also the dimensionality of the feature vectors [
12]. On the other hand, the graph adjacency matrices often have severely imbalanced non-zero data distributions, extremely high sparsity reaching up to 99.9%, and very large matrix graph size [
13]. This makes current DNN-oriented accelerators unsuitable for GNNs. Due to the high latency, GNN inference computation can only be performed offline in advance or with specialized hardware modules [
12,
13].
Particularly, this paper focuses on effectively and efficiently reducing the explosive complexity of GNN inference, from the algorithm perspective. We propose a novel framework, termed EBP (Entropy-Based Pruning), to support jointly pruning both the input graph and the GNN model and transform such redundancy reduction into GNN inference acceleration. Note that EBP is general and can work well with any specific GNN models, e.g., GCN [
14], GAT [
15], and GCNII [
16]. Specifically, we have made the following contributions in this work.
•A preliminary study was conducted to investigate the execution time of different stages in GNN inference, which inspired us to design the pruning framework.
•A novel pruning framework, EBP, is proposed to jointly simplify the graph and the model for GNN inference. To be specific, EBP considers both graph entropy and model entropy, which are carefully designed to reflect the information characteristics and computation redundancy. Two pruning schemes, EBP-G and EBP-M, are proposed to simplify the input graph and the GNN model, respectively.
•By extensive experiments with typical GNN models and benchmark datasets, we verify the effectiveness and superiority of EBP, and compare it with other state-of-the-art solutions.
The rest of this paper is organized as follows. The related studies are briefly reviewed in Section 2. The proposed framework, EBP, is elaborately introduced in Section 3. Extensive experimental results and the corresponding analysis are given in Section 4. Finally, we conclude this paper in Section 5.
2 Related Work
2.1 Graph Neural Networks
GNNs are a class of deep learning models that generalize neural networks to operate on irregular, non-Euclidean data structures represented as graphs [
1]. By iteratively exchanging information between neighboring nodes in graph through message passing [
6], GNNs can effectively transform a node’s high-dimensional input features into a low-dimensional embedding to facilitate downstream tasks like classification. Typically, a standard message passing process consists of three main steps, namely, message generation, message aggregation, and node-state update, each of which has unique computational characteristics [
12].
In general, there are two types of GNNs, i.e., spectral GNNs and spatial GNNs. On the one hand, spectral GNNs, such as GCN [
14] and GCNII [
16], define convolutions in the Fourier domain by utilizing the graph Laplacian. GCN is a pioneering GNN architecture that learns node representations by performing localized spectral convolutions on graphs, and GCNII extends GCN by introducing initial residual connections and identity mappings to alleviate the over-smoothing issue.
On the other hand, spatial GNNs, exemplified by GAT [
15], perform convolutions directly on the graph by aggregating feature information from a node’s spatial neighbors. GAT leverages self-attention mechanisms to compute node representations, allowing it to capture varying structural information and dependencies within the graph more effectively.
2.2 Efficient GNN Inference
As the graph size grows, the computational complexity and memory demands of GNNs increase exponentially. To optimize the efficiency of GNN inference, existing approaches can be broadly categorized into two types: simplifying the graph or simplifying the model.
On the one hand, graph sparsification attempts to remove redundant or less important edges to make the graph sparser, while still remaining effective learning performance. DropEdge [
17] randomly remove edges in training in a heuristic manner to ensure fast execution and resolve over-smoothing issues. In NeuralSparse [
18] and SGCN [
19], graph sparsification is transformed into an optimization problem.
On the other hand, model compression tries to compress a complex model into a lightweight one with fewer parameters to save the computational cost. UGS [
12] employs the lottery ticket hypothesis to iteratively sparsify the input graph and simplify the GNN model. However, it utilizes an unstructured pruning technique that is incompatible with common computing hardware, and thus cannot accelerate inference [
20]. It is then followed by a similar work in [
21]. Alternatively, SCP proposes a soft channel pruning scheme based on the ladder pruning pattern to accelerate GNN inference [
22]. Except for pruning, knowledge distillation and quantization are also commonly used for compressing GNN models and accelerating inference processes [
23].
3 EBP
3.1 Motivations
The GNN inference process based on message-passing [
6] is generally comprised of three main stages, including message generation, message aggregation, and node-state update. We measure the execution time for each stage for two state-of-the-art GNN models (GCN and GAT) on three datasets (Cora, Citeseer, and PubMed). The experimental results on time breakdown are shown in Fig. 2.
The results demonstrate that the message generation and aggregation stages generally dominate the total inference cost, caused by the large graph size and the large feature dimension. Meanwhile, the time cost for the update stage in GNN inference is almost negligible. These observations motivate us to design a pruning framework that jointly optimizes the graph structure and the model parameters so as to accelerate GNN inference. From these two perspectives, we propose a graph-oriented pruning scheme EBP-G, and a model-oriented pruning scheme EBP-M, respectively, as shown in Fig. 3. It is worth noting that these two approaches offer the flexibility to be utilized independently or conjointly, tailored to the constraints and needs of the particular application context [
12,
22].
3.2 EBP-G: Simplifying Graph via Pruning
In 1948, Shannon has proposed the concept of information theory as a measure of information uncertainty. The entropy can be defined as [
24]:
where H, Pj, and J denote the entropy, the probability of an event j, and the total number of events, respectively. We can know that the lower the entropy, the less uncertainty in the information, making it more useful. Nevertheless, a single information entropy can’t fully reflect both the link structures and the node features. Thus, we propose a new entropy-based metric that take both of them into consideration for measuring edge importance, which is defined as:
where Δ
He denotes the entropy difference for removing edge
e,
and
denote the entropy differences of link structures and node features, and
λ denotes the balancing hyper-parameter, respectively. Specifically, a larger
λ amplifies the influence of structural entropy in edge importance evaluation, causing the pruning procedure to place greater emphasis on preserving the graph topology, whereas a smaller
λ reduces the contribution of structural information and shifts the pruning decision toward node feature distributions. Based on the definition of entropy, we aim to reduce the overall entropy of the graph as much as possible by removing edges. To achieve this, we calculate Δ
He for each edge
e, sort all the edges in descending order of the difference values, and then remove a given proportion of top-ranked edges. This graph sparsification process helps to preserve as much valuable information within the graph as possible. Inspired by [
25], we give the definition of
Hs and
Hf, respectively.
3.2.1 Hs
We use Hs to measure the complexity of graph networks and the information within link structures. It is defined based on the normalized node degree in graph. Specifically, for a graph G with the 1st-order adjacency matrix A, we can easily obtain the 2nd-order matrix A2=AAT, and its normalized form as:
where j and k denotes the index of row and column of A2, respectively. From A, we can also generate the degree vector d, where d (j)=, and its normalized form dn as:
Using the normalized degree of a node j, dn (j), as the basic event in (1), Hs can be defined as:
However, for a large graph, the computational cost of calculating the difference between
Hs and
Hs' caused by removing each edge would be considerably high, resulting in intolerable latency for real-time applications [
8,
10]. As state-of-the-art GNN models often achieve the best performance with no more than three layers [
26], we can limit the computation above within only a small, local sub-graph comprised of the two nodes of edge
e and their neighboring nodes, thereby constraining the computational overhead within acceptable bounds.
3.2.2 Hf
We use Hf to measure the complexity and diversity of the node feature distribution. To compare the similarity of the node embeddings of adjacent nodes, we use the dot product () of output node embedding x of node pairs, , as the basic event in (1). Then, Hf can be defined as:
Note that due to the concern on computational cost, we also limit the computation within the same sub-graph as that of Hs.
3.3 EBP-M: Simplifying Model via Pruning
The most important issue in neural network pruning is to determine the subset of unimportant weights or channels to be removed. Considering the current hardware limitation [
22], we leverage structured pruning and propose an entropy-based metric to assess the channel importance. Given a GNN layer
l, we generate the embeddings of node features at this layer, denoted by the matrix
xl, based on the previous layer’s embeddings and the graph structure. In view of the observation that the activation outputs of intermediate layers largely reflect the discriminative ability of different filters [
27], we apply Softmax to normalize each column (i.e., feature channel) of
xl so as to obtain the basic entropy unit. The entropy probability for feature channel
j of node
i is calculated as:
where denotes the feature value for channel j of node i at layer l. Then, the model entropy can be defined as:
The value of such a model entropy indicates the importance of a given channel. Higher entropy indicates the channel has stronger discriminative ability and contributes more, while lower entropy suggests less significant contribution. Based on this principle, we can rank all the channels according to their entropy values. Following a predetermined pruning ratio, we prioritize the removal of channels with the lowest current entropy values [
22].
4 Performance Evaluation
4.1 Experimental Settings
4.1.1 Datasets
In the experiments, we evaluate EBP on three popular semi-supervised datasets with different scales and characteristics, including Cora, Citeseer, and PubMed [
12,
14]. More detailed statistics of these datasets are given in Table 1. We conduct node classification tasks on these benchmark datasets [
12,
17,
22].
4.1.2 Models
The effectiveness and generalizability of our EBP were verified on three popular models, including Graph Convolution Network (GCN) [
14], Graph Attention Network (GAT) [
15], and Graph Convolution Network via Initial residual and Identity mapping (GCNII) [
16].
4.1.3 Baselines
To verify the performance of our proposed EBP framework, in addition to the original baseline (with no modification), we adopt the following approaches for comparison: Firstly, EBP-G is compared with the graph sparsification methods in DropEdge [
17] and UGS [
12]. Secondly, EBP-M is compared with random channel pruning [
28] and SCP [
22] (Note that UGS is not selected for comparison here, as it is based on unstructured weight pruning). Lastly, we compare the entire EBP framework with UGS and SCP.
4.1.4 Implementation Details
All the experimental results are developed on PyTorch Geometric (PyG) framework [
29]. The model training and the pruning operations are all conducted on NVIDIA RTX A6000 based on PyTorch version 2.6.0 with CUDA 12.1 support. The speedup measurement experiments are conducted on a server with Intel Xeon 8260L CPU and 40 GB of memory. Following [
14–
16], we choose a two-layer architecture with a hidden layer of 512 channels for GCN and GAT, and an eight-layer architecture for GCNII. The learning rate is 8e-3 for Cora, and 1e-2 for the other two datasets. The weight decay is 8e-5 for Cora, and 5e-4 for the other two datasets. Besides, the hyper-parameter
λ in EBP-G is set as 1 by default. Referring to the settings in existing studies [
12,
21,
22], in our experiments we consider graph sparsity ratios up to 66%, and channel pruning ratios up to 90%.
4.2 Results and Analysis
4.2.1 Results on EBP-G
We first investigated the impact of graph sparsification on inference accuracy, and present experimental results of GCN/GAT/GCNII on Cora/Citeseer/PubMed in Fig. 4. We can make the following observations. Firstly, EBP-G exhibits superior performance compared to the other two schemes in the majority of cases, or at minimum, achieves competitive performance results. This is especially noticeable when the sparsity ratio is relatively low (< 0.5). We can even observe that the inference accuracy after sparsification surpasses the baseline, which could be attributed to the alleviation of noise and over-smoothing effects [
1]. However, excessive sparsity can significantly alter the graph structure and harm the inference accuracy for all methods, indicating graph sparsity should be applied with moderation [
12,
21]. Secondly, among the three methods, DropEdge demonstrates the poorest performance, indicating that the removal of unimportant edges should follow certain principles. This is what both EBP-G and UGS try to emphasize and solve. Thirdly, among the graphs studied, Cora appears to be the most sensitive to sparsification. When applying EBP-G to the three models, Cora shows an accuracy loss ranging from 2.7% to 3.3% when the sparsity ratio is 0.5. Meanwhile, Citeseer and Pubmed are more robust to sparsification, with accuracy losses of only 0.7%~1.9% and 0.3%~1.7%, respectively. This aligns with the findings reported in [
12].
4.2.2 Results on EBP-M
We then investigated the impact of model pruning on inference accuracy, and present experimental results of GCN/GAT/GCNII on Cora/Citeseer/PubMed in Fig. 5. We can find that EBP-M maintains high inference accuracy, generally outperforming the other two comparative approaches. Among the 81 pruning ratio points in the nine sub-figures in Fig. 5, EBP-M has achieved higher accuracy than the baseline (0~ +1.7%) for 66 of them, while in the remaining 15 cases EBP-M has shown slightly lower accuracy than the baseline (–0.6%~0). This indicates that EBP-M, through its carefully designed entropy-based pruning criteria, can precisely select and remove unimportant feature channels to mitigate overfitting, while simultaneously reducing computational complexity and overhead.
Moreover, the experimental results given in Fig. 4 and Fig. 5 suggest that in the process of GNN inference optimization, it is advisable to prioritize the pruning of model parameters other than the sparsification of input graph, which could minimize the potential negative impact on inference accuracy.
4.2.3 Results on EBP
We conducted a comprehensive comparison of EBP and UGS, both of which propose to co-simplify the graph and the model. Due to the limited space, we only present the results of GCN on Cora and GAT on Citeseer, under two fixed model pruning ratio (i.e., 50% and 90%), respectively. The results are shown in Fig. 6 and Fig. 7. Our observations indicate that EBP and UGS exhibit comparable overall performance. However, it is important to note that structured pruning generally results in more significant accuracy degradation as compared to non-structured sparsity [
30]. This finding highlights the effectiveness and efficiency of EBP’s entropy-based pruning approach. Moreover, unlike EBP, UGS cannot speedup inference on current general-purpose hardware, which will be demonstrated in our subsequent experiments.
4.2.4 Results on Speedup
Beyond accuracy, we investigated how EBP accelerate the GNN inference tasks, using the GCN model. Firstly, we evaluated the acceleration performance under two separate conditions (i.e., simplifying graph or model), and the results are shown in Fig. 8. On the one hand, the speedup ratios of EBP-G fall within the range of 1 to 2. Under the same sparsity conditions, these ratios vary significantly across different datasets. This variation can be attributed to the differences in graph structures and feature dimensions among the datasets (as shown in Table 1), leading to diverse computational complexities. On the other hand, EBP-M can achieve a speedup ratio of up to 6 to 7 times through model pruning. Moreover, the speedup ratios across the three datasets are generally close to each other. This consistency is due to the proportional reduction in matrix computations brought about by pruning being uniform across datasets.
Then, we compared EBP with UGS and SCP under a fixed sparsity ratio of 0.5. The results are shown in Fig. 9. Since UGS adopts unstructured weight pruning, it cannot achieve any speedup on common general-purpose computation hardware, such as GPU or CPU. Thus, it shows a constant speedup ratio. It is obvious that EBP outperforms the other two schemes on all three datasets. From Fig. 9(a) and Fig. 6(b), a sacrifice of approximately 3% in accuracy can yield a speedup of over 7 times.
Lastly, we compared EBP with UGS and SCP using a fixed model pruning ratio of 0.5, as shown in Fig. 10. It is obvious that EBP outperforms the other two schemes. Since SCP does not incorporate graph sparsification, it exhibits a constant speedup ratio solely derived from model pruning. Again, EBP outperforms the other two schemes on all three datasets.
4.2.5 Ablation Study
In this subsection, we investigated the impact of hyper-parameter λ on graph sparsity. The results are shown in Fig. 11. From a holistic perspective, overly emphasizing either the link structure (Hs) or node features (Hf) proves to be sub-optimal. A more appropriate approach is to combine both, allowing each to play its role. Based on the results presented in Fig. 11, we selected λ=1 by default in our experiments to balance the weights attributed to these two components.
5 Conclusion
In this paper, we study how to reduce computational complexity to accelerate GNN inference from the perspective of entropy. We propose EBP, a novel framework that combines well-designed graph entropy and model entropy, to address the challenge of how to identify the appropriate redundant parts to be removed in GNN inference. Extensive experiments with typical GNN models and popular graph datasets have indicated that EBP is characterized by its implementation flexibility, hardware compatibility, and high performance in terms of accuracy and speedup.
The limitation of the current method lies in its reliance on manually tuning pruning thresholds, lacking adaptive and automated mechanisms. In future work, we plan to extend the definitions of graph and model entropies to incorporate more sophisticated factors, such as multi-modal correlations in heterogeneous graphs [
23] and integrate techniques such as reinforcement learning to transition from manual threshold tuning to an adaptive, automated pruning framework. This will enhance the performance of EBP on complex GNN models and large-scale datasets [
1], making it more suitable for diverse and dynamic real-world applications.