Scalable Deep Metric Learning on Attributed Graphs

Xiang Li, Gagan Agrawal, Ruoming Jin, Rajiv Ramnath · DOI

TL;DR

This paper introduces a highly scalable approach to deep metric learning on massive attributed graphs. By combining Generalized PageRank filtering with a mini-batch tuplet loss, the proposed DMT and DMAT-i algorithms eliminate the need for expensive full-graph convolutions and explicit tuplet sampling, scaling effortlessly to graphs with 10 million nodes while delivering state-of-the-art consistency across classification, clustering, and link prediction tasks.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) and contrastive learning methods have become the standard for learning node representations on attributed graphs. However, they hit a hard wall when scaling to massive networks.

Traditional deep metric learning (DML) aims to pull similar nodes closer and push different ones apart, but it requires explicit, expensive sampling of "tuplets" and complex searches for "hard" negative examples. Meanwhile, standard Graph Convolutional Networks (GCNs) suffer from over-smoothing and high memory overhead because they require processing the entire graph structure or large neighborhoods during training. This paper tackles a critical question: How can we make deep metric learning scalable and efficient for large-scale attributed graphs without sacrificing downstream performance?

Methods

The authors decouple graph structure aggregation from neural network training using a multi-stage approach:

  1. Graph Filtering instead of GCNs: The authors replace traditional GCN layers with a scalable, parallelizable graph smoothing filter based on Generalized PageRank (GPR) via Bidirectional Propagation (GnnBP). This pre-computes the structural context for node attributes.
  2. Mini-batch Natural Tuplets: Instead of explicitly sampling positive and negative pairs (which is computationally prohibitive), they treat each shuffled mini-batch as a natural tuplet, eliminating sampling overhead entirely.
  3. DMT & DMAT-i Algorithms: They introduce two variants based on an extended multi-class tuplet loss function:
  4. DMT (Semi-supervised): Leverages available labels to identify multiple positives and negatives within a batch.
  5. DMAT-i (Unsupervised): Targets unsupervised learning by generating augmented views of the filtered features (via column masking) and optimizing a contrastive-style tuplet loss.
Schematic of DMAT-i architecture showing graph filtering, augmentation, and metric distance measurement.

Datasets

The framework was evaluated on eight real-world benchmark datasets:

  • Citation Networks: Cora, Pubmed, Citeseer
  • Academic/Co-authorship Networks: ACM, DBLP, Coauthor CS, Coauthor PHY
  • E-commerce Graphs: Amazon Photo

Additionally, synthetic graphs were generated using PaRMAT to evaluate scalability up to 10 million nodes.

Key Insights and Ideas

  • The Mini-Batch Shortcut: Shuffling mini-batches naturally provides a diverse mix of positive and negative samples, completely bypassing the need for explicit, expensive tuplet sampling algorithms.
  • Filtering Breeds Hardness: Applying a GPR-based graph filter doesn't just smooth features; it actually increases the "hardness" of negative samples. This accelerates training and boosts the model's discriminative power.
  • Theoretical Bridge: For the first time, the paper mathematically connects multi-class tuplet loss to contrastive learning, providing a generalization error bound for downstream node classification that justifies why contrastive learning works so well from a metric learning perspective.

Key Results

  • Unprecedented Scalability: As shown in Figure 2, while all baseline methods hit a GPU memory ceiling and fail on graphs larger than $10^6$ nodes, DMAT-i seamlessly scales to $10^7$ nodes.
Fig. 2: Scalability of Different Frameworks: Training Time vs. No. of Nodes in Graph
  • Blazing Fast Convergence: DMAT-i converges significantly faster than competitive baselines. For instance, on the Coauthor PHY dataset, DMAT-i takes around 33 seconds to converge, whereas a strong baseline like AGE takes nearly 6,800 seconds.
  • Robust Downstream Performance: Across node clustering, node classification, and link prediction, DMAT-i and DMT consistently match or outperform state-of-the-art methods (like GCA and ProGCL) without the massive memory footprint.

Limitations and Future Work

  • False Negatives in Unsupervised Learning: The unsupervised DMAT-i algorithm can occasionally suffer from "false negatives" (treating nodes of the same latent class as negatives because labels are missing), though the authors bound this effect theoretically.
  • Hyperparameter Sensitivity: The framework relies heavily on the initial graph filtering step; optimizing the filter hyperparameters ($\alpha$ and propagation steps) automatically for different graph topologies remains an open area for improvement.

Summary updated

BibTeX
@inproceedings{li2023scalable,
  author = {Xiang Li and Gagan Agrawal and Ruoming Jin and Rajiv Ramnath},
  title = {{Scalable Deep Metric Learning on Attributed Graphs}},
  booktitle = {CSoNet},
  year = {2023},
}
Figure