GNNs-to-MLPs by Teacher Injection and Dirichlet Energy Distillation

Ziang Zhou, Zhihao Ding, Jieming Shi, Qing Li, Shiqi Shen · OpenReview

Abstract

Graph Neural Networks (GNNs) are fundamental to graph-based learning and excel in node classification tasks. However, GNNs suffer from scalability issues due to the need for multi-hop data during inference, limiting their use in latency-sensitive applications. Recent studies attempt to distill GNNs into multi-layer perceptrons (MLPs) for faster inference. They typically treat GNN and MLP models as single units for distillation, insufficiently utilizing the fine-grained knowledge within GNN layers. In this paper, we propose TINED, a novel method that distills GNNs to MLPs layer-wise through Teacher Injection with fine-tuning and Dirichlet Energy Distillation techniques. We analyze key operations in GNN layers, feature transformation (FT) and graph propagation (GP), and identify that an FT performs the same computation as a fully-connected (FC) layer in MLPs. Thus, we propose directly injecting valuable teacher parameters of an FT in a GNN into an FC layer of the student MLP, assisted by fine-tuning. In TINED, FC layers in an MLP mirror the order of the corresponding FTs and GPs in GNN. We provide a theoretical bound on the approximation of GPs. Moreover, we observe that in a GNN layer, FT and GP operations often have opposing smoothing effects: GP is aggressive, while FT is conservative, in smoothing. Using Dirichlet energy, we design a DE ratio to quantify these smoothing effects and propose Dirichlet Energy Distillation to distill these characteristics from GNN layers to MLP layers. Extensive experiments demonstrate that TINED achieves superior performance over GNNs and state-of-the-art distillation methods under various settings across seven datasets.

Introduction

Graph Neural Networks (GNNs) are the gold standard for learning on graphs, but they face significant inference latency challenges. Because GNNs rely on "message passing"—fetching data from a node's multi-hop neighbors—they are computationally expensive and difficult to scale in real-time applications. Multi-Layer Perceptrons (MLPs) offer a faster alternative by treating nodes independently, but they typically fail to capture structural relationships.

TINED (Teacher Injection and Dirichlet Energy Distillation) is a novel framework that transforms slow GNNs into lightning-fast MLPs without sacrificing accuracy. By directly "injecting" trained GNN parameters into the MLP and using Dirichlet Energy to mimic the GNN's unique smoothing behavior layer-by-layer, TINED achieves up to a 94x speedup while often outperforming its own GNN teacher.

Methodology

TINED bridges the GNN-MLP gap through two primary techniques:

  1. Teacher Injection (TI): A standard GNN layer consists of Feature Transformation (FT) and Graph Propagation (GP). Since the FT operation is mathematically identical to a Fully-Connected (FC) layer in an MLP, TINED directly copies the weights from the teacher GNN’s FT layers into the student MLP’s layers. This provides a superior starting point for subsequent fine-tuning.
  2. Dirichlet Energy Distillation (DED): Dirichlet energy measures the "smoothness" of node embeddings across a graph. TINED calculates a "DE ratio" for every layer of the teacher GNN and forces the student MLP layers to match these specific smoothing/diversifying patterns.

Key Insight: Opposing Smoothing Effects

A core discovery of this work is that FT and GP operations in a GNN act as opposing forces. As shown in the figure below, GP operations aggressively smooth data (making neighbors similar, thus lowering Dirichlet energy), while FT operations are conservative or even diversify the data (increasing Dirichlet energy). Matching this specific "tug-of-war" in an MLP is key to capturing the structural logic of the GNN.

Dirichlet Energy (DE) Ratio of FT and GP operations across different datasets and layers.

Experimental Results

The researchers evaluated TINED across seven benchmarks, including small/medium datasets (Cora, Citeseer, Pubmed, Amazon-computer, Amazon-photo) and large-scale OGB datasets (Arxiv, Products).

  • Superior Accuracy: On Citeseer, TINED improved upon the GNN teacher by 3.94% and outperformed the previous state-of-the-art (GLNN) by 3.21%.
  • Massive Speedup: TINED is 94x faster than a 2-layer GraphSAGE teacher and 733x faster than a 3-layer version during inference.
  • Scalability and Robustness: TINED successfully handled the massive OGB-Products dataset where other methods failed due to memory constraints. It also showed significant gains on heterophilic datasets (Squirrel, Amazon-ratings), where neighbors are often dissimilar.

Conclusion

TINED demonstrates that layer-wise distillation of internal GNN behaviors—specifically feature transformation and smoothing characteristics—allows MLPs to effectively learn graph structures. While currently limited by a layer-dependency between teacher and student, future work will explore flexible architectures and more complex graph types like heterogeneous and dynamic graphs.

Summary updated

BibTeX
@inproceedings{zhou2025gnns,
  author = {Ziang Zhou and Zhihao Ding and Jieming Shi and Qing Li and Shiqi Shen},
  title = {{GNNs-to-MLPs by Teacher Injection and Dirichlet Energy Distillation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=nshtqLv4r4},
}
Figure