GraphMAE: Self-Supervised Masked Graph Autoencoders

Zhenyu Hou, Xiao Liu, Yukuo Cen, Yuxiao Dong, Hongxia Yang, Chunjie Wang, Jie Tang

Introduction

Self-supervised learning (SSL) has fundamentally changed the landscape of artificial intelligence, particularly in Natural Language Processing (NLP) and Computer Vision (CV). While generative models like BERT and Masked Autoencoders (MAE) have become standard in these fields, Graph Neural Networks (GNNs) have primarily relied on contrastive learning. Contrastive methods, though effective, require complex data augmentations and negative sampling strategies. GraphMAE introduces a generative framework that demonstrates how simple masked autoencoders can outperform these complex contrastive methods on graph-structured data.

Addressing the GAE Dilemmas

Traditional Graph Autoencoders (GAEs) have historically underperformed due to four primary "dilemmas" identified by the authors:

  1. Structural Over-emphasis: A focus on link prediction rather than semantic feature learning.
  2. Lack of Robustness: Susceptibility to learning trivial identity functions without input corruption.
  3. The MSE Trap: Sensitivity of Mean Squared Error to varying feature scales and high dimensionality.
  4. Weak Decoders: Insufficient expressiveness in simple MLP-based decoders.

The GraphMAE Architecture

GraphMAE addresses these issues through a novel "Masked Graph Autoencoder" design. The core process involves randomly masking a portion of node features and tasking the model with their reconstruction.

The core mechanism of GraphMAE: reconstructing masked node features using Scaled Cosine Error.

Key Components

  • GNN-based Decoder: Unlike standard GAEs, GraphMAE employs a GNN as the decoder. This allows the model to leverage local graph structure to reconstruct missing node information from neighbors, bridging the semantic gap between latent codes and raw features.
  • Re-mask Decoding: To ensure the decoder relies on context rather than the node's own latent representation, the encoder's output for masked nodes is replaced with a learnable [DMASK] token before decoding.
  • Scaled Cosine Error (SCE): Replacing MSE, SCE uses cosine similarity to provide robustness against feature norms. A scaling factor $\gamma$ is applied to focus the model on "hard" reconstruction targets, preventing training collapse.

Experimental Evaluation

The authors evaluated GraphMAE across 21 public datasets, covering node classification, graph classification, and transfer learning.

Ablation study showing the performance gain from each design component of GraphMAE, leading to a final accuracy of 84.2 on Cora.

As shown in the ablation study, each component—from the GNN decoder to the Scaled Cosine Error—contributes significantly to the model's performance. GraphMAE consistently achieves state-of-the-art results. On the Cora dataset, it reached 84.2% accuracy, significantly outperforming the original GAE (71.5%) and surpassing top contrastive methods like BGRL. In transfer learning tasks pre-trained on the ZINC15 molecular dataset, GraphMAE demonstrated superior transferability for molecular property prediction, suggesting it captures meaningful structural patterns.

Conclusion and Future Work

GraphMAE proves that generative SSL is a highly effective paradigm for graph representation learning. By focusing on feature reconstruction with expressive decoders and robust loss functions, it overcomes the limitations of previous GAEs. Future research may explore more sophisticated masking strategies, such as subgraph masking, and the development of discrete "visual words" for graphs to move beyond raw feature reconstruction.

Summary updated

BibTeX
@inproceedings{hou2022graphmae,
  author = {Zhenyu Hou and Xiao Liu and Yukuo Cen and Yuxiao Dong and Hongxia Yang and Chunjie Wang and Jie Tang},
  title = {{GraphMAE: Self-Supervised Masked Graph Autoencoders}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2022},
}
Figure