Abstract
Distilling high-accuracy Graph Neural Networks (GNNs) to low-latency multilayer perceptrons (MLPs) on graph tasks has become a hot research topic. However, conventional MLP learning relies almost exclusively on graph nodes and fails to effectively capture the graph structural information. Previous methods address this issue by processing graph edges into extra inputs for MLPs, but such graph structures may be unavailable for various scenarios. To this end, we propose Prototype-Guided Knowledge Distillation (PGKD), which does not require graph edges (edge-free setting) yet learns structure-aware MLPs. Our insight is to distill graph structural information from GNNs. Specifically, we first employ the class prototypes to analyze the impact of graph structures on GNN teachers, and then design two losses to distill such information from GNNs to MLPs. Experimental results on popular graph benchmarks demonstrate the effectiveness and robustness of the proposed PGKD.
Introduction
In graph machine learning, a fundamental trade-off exists between accuracy and latency. Graph Neural Networks (GNNs) achieve state-of-the-art results through "message passing," which aggregates information from a node's neighbors. However, this neighborhood fetching mechanism introduces significant latency, making GNNs difficult to deploy in real-time applications. Conversely, Multi-Layer Perceptrons (MLPs) offer high inference speed by treating nodes independently but typically underperform on graph tasks as they ignore structural information (edges).
Previous distillation methods attempting to bridge this gap often require graph edges during training. However, in many real-world scenarios, edges may be missing due to data corruption or restricted due to privacy concerns. This paper introduces Prototype-Guided Knowledge Distillation (PGKD), an "edge-free but structure-aware" approach that enables MLPs to capture graph structural knowledge without requiring explicit edge information during distillation.
Methodology
The core of PGKD lies in using "class prototypes"—representative embedding vectors for each node category—as proxies for the missing graph structure. This framework, illustrated in Figure 1, introduces two novel loss functions to guide the MLP student:
- Intra-class Loss: Leveraging the principle of homophily (connected nodes often share the same class), PGKD calculates a prototype for each class as the mean vector of its constituent nodes. The intra-class loss pulls individual node representations toward their respective class prototypes. This approach is computationally efficient, scaling linearly ($O(n \times K)$), and is more robust to noise than pairwise node comparisons.
- Inter-class Loss: To capture heterophily patterns, where certain classes are naturally more related, the inter-class loss forces the MLP student to mimic the relative distance patterns between class prototypes observed in the GNN teacher.
By integrating these losses with standard classification and logit-based distillation, the MLP learns the structural effects on the feature space without ever accessing the adjacency matrix.
Experimental Setup
PGKD was evaluated on seven diverse graph benchmarks, including small-scale datasets (Cora, Citeseer, Pubmed, A-computer), large-scale datasets (Arxiv, Twitch-gamer with >160k nodes), and heterophilous graphs (Penn94). The experiments encompassed both transductive and inductive settings to assess generalization.
Results and Analysis
Experimental results demonstrate that PGKD consistently outperforms existing edge-free distillation methods like GLNN. Key findings include:
- Superior Accuracy and Stability: PGKD achieved higher accuracy across all datasets, with a notable 1.86% improvement on Pubmed in inductive settings. It also exhibited lower variance across runs, indicating a more stable training process.
- Scalability: The linear complexity of PGKD allows it to scale effectively to massive datasets like Arxiv, where performance gains remained statistically significant ($p < 0.05$).
- Robustness to Noise: PGKD acts as a powerful denoiser. Even under heavy Gaussian noise in node features, PGKD-trained MLPs maintained significantly higher accuracy than baseline models.
- Visual Confirmation: As shown in Figure 2, t-SNE visualizations reveal that PGKD-trained MLPs produce tighter, more separable clusters that closely mirror the high-quality representations of the GNN teacher, unlike vanilla MLPs or other distillation techniques.
Discussion and Future Work
While PGKD offers significant advantages in efficiency and accuracy for edge-free distillation, it does introduce a slight computational overhead during training compared to vanilla knowledge distillation. Additionally, a performance gap remains between transductive and inductive settings on certain datasets. Future research could explore extending the prototype concept to other graph tasks, such as link prediction or complex graph-based reasoning, by developing more sophisticated prototype generation strategies beyond simple class labels.
Summary updated