Node Masking: Making Graph Neural Networks Generalize and Scale Better

Pushkar Mishra, Aleksandra Piktus, Gerard Goossen, Fabrizio SilvestriarXiv 2020

Abstract

Node Masking (NM) is a simple yet effective training technique designed to improve the generalization and scalability of Graph Neural Networks (GNNs). By randomly hiding nodes during the neighborhood aggregation process, NM prevents over-fitting to local structural redundancies and mitigates the over-smoothing effect in deep architectures. Experimental results on benchmark datasets like Cora and Reddit demonstrate significant performance gains in inductive settings and substantial computational savings when combined with inference-time caching.

Introduction

Graph Neural Networks (GNNs) have revolutionized the processing of relational data by aggregating information from a node's local neighborhood. However, this process faces two major challenges: over-fitting and over-smoothing. Over-fitting occurs because nodes often appear multiple times within their own multi-hop neighborhoods (visualized as "Aggregation Trees"), leading the model to memorize specific local patterns rather than learning general relational rules. Over-smoothing occurs as more layers are added, causing node representations in the same neighborhood to become indistinguishable, which destroys the model's classification accuracy.

Furthermore, scaling GNNs to real-world, growing graphs is computationally expensive, especially in "inductive" settings where new nodes join the network after training. While caching previous calculations can improve speed, it often degrades accuracy because the cached structures differ from the full neighborhoods seen during training.

Methodology: Node Masking

The authors introduce Node Masking (NM) as a structural regularization technique. During each training epoch, a subset of nodes is randomly "masked"—their contribution to the neighborhood aggregation is set to zero—based on a probability $p$.

Overview of learning a model H on a graph and applying it to new nodes and edges in an inductive setting.

This approach forces the GNN to:

  1. Break Redundancy: By pruning the aggregation trees, the model can no longer rely on redundant information and must learn the underlying logic of relationships.
  2. Enhance Generalization: The model sees many different "versions" of the same neighborhood, improving its ability to handle unseen structures.
  3. Enable Efficient Caching: NM prepares the model for inference-time caching by making the training trees structurally resemble the pruned trees used in efficient, cached computation.

Experimental Results

The researchers evaluated NM using popular architectures like Graph Attention Networks (GAT) and Graph Isomorphism Networks (GIN) across three benchmark datasets: Cora, PubMed, and Reddit.

  • Generalization Performance: In inductive settings with limited training data (10%), NM boosted the Macro F1 score on the Cora dataset from 40.74 to 51.25 for GAT—a significant improvement.
  • Mitigating Over-smoothing: Using the Mean Average Distance (MAD) metric, the study proved that NM maintains distinct node representations even in deep networks, preventing the "blurring" effect common in standard GNNs.
  • Scalability and Caching: In large-scale tests, caching reduced the number of unique nodes involved in computation by over 65%. When combined with NM, these cached models actually outperformed full, non-cached GNNs, bridging the gap between efficiency and accuracy.

Key Insights and Future Work

The core theoretical contribution of this work is the "Aggregation Tree" perspective, which clarifies how GNNs perceive local structures. By introducing a relational inductive bias through node masking, the model is forced to learn the logic of connections rather than specific node identities.

While highly effective, the optimal masking rate $p$ is sensitive to model depth, generally requiring more aggressive masking for deeper networks. Future research may explore applying Node Masking to complex graph tasks beyond node classification, such as link prediction or graph-level generation.

Summary updated

BibTeX
@misc{mishra2020node,
  author = {Pushkar Mishra and Aleksandra Piktus and Gerard Goossen and Fabrizio Silvestri},
  title = {{Node Masking: Making Graph Neural Networks Generalize and Scale Better}},
  year = {2020},
  eprint = {2001.07524},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2001.07524},
}
Figure