NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Evaluating Graph Generative Models with Contrastively Learned Features

Hamed Shirzad, Kaveh Hassani, Danica J. Sutherland

TL;DR

Evaluating how well a model generates graphs is notoriously difficult because there is no "ImageNet for graphs" to provide a standard feature extractor. This paper demonstrates that instead of using traditional local statistics or randomly initialized neural networks, we should use self-supervised contrastive learning to train domain-specific feature extractors. This approach leads to much more reliable and robust evaluation metrics for Graph Generative Models (GGMs).

The Evaluation Bottleneck in Graph Generation

In the world of images, generative models (like GANs or Diffusion models) are typically evaluated using metrics like the Fréchet Inception Distance (FID), which relies on a pre-trained Inception network to extract meaningful features. Graphs, however, lack a universal equivalent. A "good" molecule looks fundamentally different from a "good" social network or a "good" power grid.

Currently, researchers use two main approaches to evaluate GGMs:

  1. Traditional Metrics: Comparing local statistics like degree distributions or cluster counts.
  2. Random GNNs: Using the representations of a randomly initialized Graph Neural Network (GNN) as a feature extractor.

The problem is that traditional metrics are "blind" to global structure, while random GNNs are often too weak to distinguish between subtle graph isomorphisms. Without a universal "Graph ImageNet" to provide a pre-trained backbone, the field lacks a gold-standard evaluation tool.

Proposed Methodology: Contrastive Learning for Evaluation

The authors propose a pipeline that uses the training data itself to "teach" an evaluator what matters in a specific graph domain before any generation happens.

Proposed evaluation pipeline using contrastively trained encoders
  • Self-Supervised Contrastive Learning: As shown in the pipeline above, they train a Graph Isomorphism Network (GIN) using methods like GraphCL and InfoGraph. The model learns by trying to keep the representations of two "augmented" versions of the same graph close together while pushing different graphs apart.
  • Better Augmentations: The authors argue that standard graph augmentations (like dropping edges) aren't enough. They propose using subgraph "crops", which forces the model to learn that a part of a graph represents the whole, creating better overlap in the feature space.
  • Lipschitz Constraints: To ensure the evaluation metric is stable, they enforce a layer-wise Lipschitz constraint (similar to spectral normalization). This ensures that a small change in the graph (like adding one edge) doesn't result in a massive, unpredictable jump in the feature representation.
  • Hybrid Features (GSNs): Recognizing that GNNs and local statistics have different "blind spots," they incorporate local counts (node degrees and clustering coefficients) directly into the GNN as input features, effectively creating a Graph Substructure Network (GSN).

Key Insights and Ideas

  • The Blind Spot Duality: The authors prove that GNNs and local metrics are complementary. They provide examples of graphs that a GNN thinks are identical but local metrics can distinguish, and vice versa. This justifies the "hybrid" approach of putting local stats into the GNN.
  • Randomness is a Weak Baseline: While previous work suggested random GNNs were "good enough" for evaluation, this paper shows they fail significantly when faced with "mode collapse" (where a generator just outputs the same graph over and over).
  • Domain-Specific "ImageNet": Since we can't have one universal graph model, the core insight is that the training set of the generative model itself is the best source of supervision for the evaluator. By learning the features of the real data via contrastive learning, the evaluator becomes a "specialist" for that specific dataset.

Key Results

The authors evaluated their approach across six diverse datasets, including synthetic graphs (Lobster, 2D Grids, Community) and real-world networks (Proteins, Ego networks, Zinc molecules). They tested their metrics by intentionally perturbing graph datasets (e.g., rewiring edges or dropping modes) and measuring how well the metrics correlated with the degree of "damage."

Rank correlation of evaluation metrics under various graph perturbations
  • Superior Correlation: As seen in the violin plots above, contrastively trained models (GraphCL, in green) showed significantly higher and more stable Spearman rank correlation with perturbation levels compared to randomly initialized GNNs (GIN-Random, in orange). In many cases, GraphCL achieved near-perfect 1.0 correlation, while random GNNs hovered much lower and exhibited high variance.
  • Detecting Mode Collapse: In the "mode-dropping" and "mode-collapse" tests, the proposed self-supervised features were far more sensitive to the loss of diversity in the generated samples than traditional methods.
  • Stability: The inclusion of Lipschitz constraints and subgraph cropping consistently improved the reliability of the metrics across different random seeds and datasets.

Limitations and Future Work

  • Regularity Sensitivity: On highly regular synthetic graphs (like 2D Grids), the added structural features sometimes made the model too sensitive, causing the correlation to drop slightly as the model "over-focused" on tiny discrepancies.
  • Computational Overhead: Unlike a random GNN, this method requires a pre-training phase on the training data. While this is a one-time cost per dataset, it is more computationally intensive than "plug-and-play" metrics.
  • Future Directions: The authors suggest that future work could involve domain-specific augmentations (e.g., using chemically valid transformations for molecules) to make the contrastive feature extractor even more specialized.

Summary updated

BibTeX
@inproceedings{shirzad2022evaluating,
  author = {Hamed Shirzad and Kaveh Hassani and Danica J. Sutherland},
  title = {{Evaluating Graph Generative Models with Contrastively Learned Features}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=wjdC47o4Zb},
}
Figure