Diving into Unified Data-Model Sparsity for Class-Imbalanced Graph Representation Learning

Chunhui Zhang, Chao Huang, Yijun Tian, Qianlong Wen, Zhongyu Ouyang, Youhuan Li, Yanfang Ye, Chuxu Zhang

TL;DR

Training Graph Neural Networks (GNNs) on massive, class-imbalanced datasets is computationally grueling and often leads to biased models that neglect minority classes. The authors introduce Graph Decantation (GraphDec), a unified framework that dynamically prunes both network weights and training samples using self-supervised contrastive learning. By tracking gradient informativeness across training epochs, GraphDec uses only ~50% of the data and 50% of the model weights while outperforming state-of-the-art methods on both graph- and node-level imbalanced classification.

What Problem Does This Paper Address?

Graph representation learning faces two intertwined hurdles in real-world applications:

  1. Class Imbalance: In domains like molecular biology or fraud detection, minority classes are vastly outnumbered, causing GNNs to bias heavily toward dominant classes.
  2. Computational Overhead: Graphs feature non-Euclidean, irregular neighborhood structures. Message-passing across high-degree nodes creates massive memory and computation bottlenecks.

Existing solutions treat these problems independently—and often worsen each other. Class-rebalancing techniques (like GraphSMOTE or GraphENS) synthesize new nodes or ego-networks, multiplying the data processing load. Conversely, standard model pruning reduces parameter counts but causes GNNs to disproportionately "forget" minority-class patterns.

Methods

GraphDec tackles both issues concurrently through dynamic data and model sparsity:

[Full Graph Data] ---> [Dynamic Sparse Contrastive GNN] ---> [Gradient L2 Ranking]
                                                                    |
[Next Epoch Training Set] <--- [Cosine Decay: Top (1-ε)] + [Recycled ε from Bin]
  • Theoretical Foundation (Theorem 1): The authors prove that the optimization gap between a subset and the full dataset is bounded by the distance between their gradient vectors. Minimizing this gradient error ensures the subset faithfully mimics full-dataset training.
  • Dynamic Sparse Contrastive Pre-training: Instead of requiring supervised labels, GraphDec feeds augmented graph views into two branches—a full GNN and a dynamically pruned GNN—optimizing an InfoNCE contrastive loss.
  • Gradient-Based Decantation: Graph samples are scored and ranked by the $L_2$ norm of their gradients. Because hard or underrepresented examples produce larger gradient signals, this scoring automatically highlights minority classes.
  • Cosine Annealing & Data Recycling: Rather than permanently pruning data early on (as static "data diet" methods do), the dataset size shrinks gradually via a cosine schedule. An exploration rate $\epsilon$ continually recycles a random fraction of previously discarded samples back into the training pool.
  • Dynamic Model Pruning: GNN layer weights are pruned to target sparsity with cosine annealing, and inactive weights are periodically reactivated based on top gradient magnitudes.

Datasets

The authors evaluate GraphDec across both graph-level and node-level classification tasks:

  • Graph Classification (artificially set to a 1:9 minority-to-majority imbalance ratio): MUTAG, PROTEINS, D&D, NCI1, PTC-MR, DHFR, and REDDIT-B.
  • Node Classification:
  • Citation benchmarks with long-tailed distributions (imbalance ratio 10): Cora-LT, CiteSeer-LT, and PubMed-LT.
  • Naturally imbalanced e-commerce co-purchase graphs: Amazon-Photo ($\rho = 82$) and Amazon-Computers ($\rho = 244$).

No new raw datasets were collected; standardized benchmarks were adapted under rigorous class-imbalanced protocols.

Key Insights and Ideas

  • Sparse GNNs amplify minority signals: A full GNN produces relatively uniform gradients across majority and minority samples during contrastive learning. Crucially, dynamically pruned sparse GNNs assign significantly larger gradients to minority samples, acting as an unsupervised filter for class imbalance.
  • Data importance is dynamic, not static: One-shot data pruning permanently discards samples that seem uninformative early on. However, sample utility shifts as model representations mature. Recycling previously discarded samples prevents premature elimination and overfitting.
  • Less data + smaller model = better generalization: Counterintuitively, pruning both the model and the data down to 50% averages per round yields higher accuracy than training dense models on the full dataset, primarily by shedding noisy majority samples and regularizing representations.

Key Results

  • Graph Classification: GraphDec achieves the top rank across datasets (average rank 1.00 on Macro-F1). On MUTAG, GraphDec reaches 85.71% Macro-F1 (vs. 83.01% for the best baseline, $G^2\text{GNN}$), and 65.73% on NCI1 (vs. 64.78%), while cutting average data and weight usage in half.
  • Node Classification: GraphDec surpasses both oversampling and synthetic augmentation baselines. On Cora-LT, it scores 78.29% accuracy (compared to 77.76% for GraphENS and 76.76% for GraphSMOTE), and 92.19% on Amazon-Computers.
  • Efficiency: Across all benchmarks, GraphDec consumes less total wall-clock training time (e.g., 10.61s on PROTEINS vs. 15.00s for GraphCL and 16.00s for oversampling on an RTX 3090 GPU).

Limitations and Future Work

  • Sensitivity to Extreme Graph Sizes: On datasets with very large average graphs (such as D&D, averaging ~284 nodes per graph), GraphDec slightly trailed $G^2\text{GNN}$ on Micro-F1 (77.02% vs. 79.03%), suggesting graph-level augmentations require bespoke tuning when node counts scale significantly.
  • Theoretical Assumptions: The subset approximation guarantee (Theorem 1) relies on convexity assumptions, which do not strictly hold for deep non-linear GNN architectures.
  • Hyperparameter Overhead: Introducing cosine annealing schedules, dynamic weight reactivation intervals, and the data exploration rate $\epsilon$ expands the hyperparameter search space relative to vanilla training.

Summary updated

BibTeX
@inproceedings{zhang2023diving,
  author = {Chunhui Zhang and Chao Huang and Yijun Tian and Qianlong Wen and Zhongyu Ouyang and Youhuan Li and Yanfang Ye and Chuxu Zhang},
  title = {{Diving into Unified Data-Model Sparsity for Class-Imbalanced Graph Representation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=YCMKCwN4PQw},
}
Figure