arXiv(opens in a new tab)Computer ScienceJun 2021

Manuscript Offprint

arXiv:2106.08541

Distilling Self-Knowledge From Contrastive Links to Classify Graph Nodes Without Passing Messages

Yi Luo, Aiguo Chen, Ke Yan, Ling Tian

Abstract

Nowadays, Graph Neural Networks (GNNs) following the Message Passing paradigm become the dominant way to learn on graphic data. Models in this paradigm have to spend extra space to look up adjacent nodes with adjacency matrices and extra time to aggregate multiple messages from adjacent nodes. To address this issue, we develop a method called LinkDist that distils self-knowledge from connected node pairs into a Multi-Layer Perceptron (MLP) without the need to aggregate messages. Experiment with 8 real-world datasets shows the MLP derived from LinkDist can predict the label of a node without knowing its adjacencies but achieve comparable accuracy against GNNs in the contexts of semi- and full-supervised node classification. Moreover, LinkDist benefits from its Non-Message Passing paradigm that we can also distil self-knowledge from arbitrarily sampled node pairs in a contrastive way to further boost the performance of LinkDist.

1 Introduction

Graphs are universal representations for many real-world data containing pairwise relationship. For example, academic papers and their citation relationship can construct a graph, where the papers are represented as nodes with their encoded abstracts as node features. If one paper cites another, their nodes are connected in that graph. Graphs like this are usually called citation networks [15]. Likewise, we have co-purchase networks [14], co-authorship networks [16], protein-protein interaction networks (PPI), post-post co-comment networks [8], and so on [17].

Due to the wide application of graphs, researchers propose more and more methods to mine information from graphs. A well-investigated family of methods is Graph Neural Networks (GNNs) [18]. They combine node features and the structural information of graphs to study the representations of nodes for downstream tasks, such as Node Classification where the goal is to classify nodes by assigning proper labels to them.

Many Graph Neural Networks follow the Message Passing paradigm [5] which contains three steps:

  1. Each node passes its representation to its adjacent nodes
  2. Each node aggregates the representations it receives
  3. Each node transforms the aggregated information to get its newest representation

For example, a layer in Graph Convolutional Network (GCN) [12] aggregates each node’s received messages by computing their average and transforms the averaged messages with a linear transformation.

This paradigm applies Neural Networks to graphs and makes learning on graphs flexible and powerful. However, it still has some drawbacks.

  • Predicting a single node’s label has to aggregate information from multiple adjacent nodes, making the computation heavy and costing extra space to look up adjacent nodes (usually with the adjacency matrix).
  • Passing messages is not easy in practice. For batching purposes, we have to group nodes by their degrees (as the number of their adjacent nodes) and invokes message passing group by group if the graph is too large to manipulate its adjacency matrix.
  • Relying on information from adjacent nodes takes the graph time and effort to propagate messages onto all nodes when new nodes or new edges are inserted.

One way to rectify some of the aforementioned issues is Knowledge Distillation [6]. Knowledge Distillation is to transfer the knowledge from a well-trained teacher network to a smaller student network for deployment purposes. For example, when the spaces and computing resources on devices are too limited to store adjacency matrices or aggregate multiple messages timely, we can distil the knowledge from a trained GCN into a Multi-Layer Perceptron (MLP) [2] and deploy the MLP alone onto those devices. The deployed MLP can predict without the need to aggregate information from adjacent nodes, thus it can be light-weighted and fast. However, when graphs change, the MLP still has to study the updated knowledge about every single node from the GCN again. This makes Knowledge Distillation hard to apply to dynamic graphs.

However, we observe that the MLP distilled from a trained GCN can sometimes outperform the original GCN, as our experiment in Section 4 shows. It suggests that Message Passing may not be essential if we can find a way to distil the structural knowledge into MLPs. Inspired by this, we propose to distil knowledge from node pairs. Specifically, we predict the label of a node by its features with an MLP and predict the label of its adjacent node with a forked layer. In the meantime, we maximize the agreement of these two predictions by distilling their knowledge into each other. After that, we omit the forked layer and get an MLP that contains distilled structural knowledge. This method, named LinkDist, is light-weighted, fast, and easy to implement. When graphs change, LinkDist adjusts its parameters instead of propagating messages to all nodes. While addressing all the three challenges in Message Passing, the Node Classification experiment in Section 4 shows that the MLPs derived from LinkDist can predict with comparable accuracy against GNNs.

References (20)