Dataset Condensation Atlas

Method · Gradient matching

GCond

Graph Condensation for Graph Neural Networks

Wei Jin, Lingxiao Zhao, Shichang Zhang, Yozen Liu, Jiliang Tang, Neil Shah

ICLR 2022 · first public 2021-10-14 · arXiv 2110.07580

paper ↗code ↗landmark✓ full text read

In one paragraph

Introduces GCond, which condenses a large graph into a small synthetic graph and features by imitating the GNN training trajectory on the original graph through a gradient-matching loss, jointly synthesizing node features and structure so that GNNs trained on the condensed graph transfer across architectures; reports approximating original test accuracy by 95.3% on Reddit, 99.8% on Flickr and 99.0% on Citeseer while shrinking graph size by over 99.9%.

Explained

What came before

Prior graph-size reduction was graph sparsification (drop edges to preserve pairwise distances/cuts/eigenvalues) and graph coarsening (group nodes into super-nodes), neither of which is optimized for downstream GNN accuracy and neither of which reduces node attributes. Dataset distillation (DD) and dataset condensation (DC, gradient matching) had solved the analogous problem for images but assume independent, Euclidean samples.

The problem

Image-style condensation cannot be applied to graphs because nodes are interdependent through edges (message passing couples every node to its neighborhood), so there is no notion of condensing "one sample" independently of the rest of the graph; the paper also observes that the discrete adjacency matrix has O(N'^2) parameters if learned freely, which overfits as the condensed graph grows.

The idea

Treat graph condensation as the same gradient-matching bi-level problem as image DC (match per-step GNN parameter gradients between condensed and real data across random initializations), but resolve the graph-specific coupling by parameterizing the condensed adjacency matrix as a function of the condensed node features (an MLP over pairs of feature vectors) instead of a free parameter, so structure and features are optimized jointly but structure never needs its own O(N'^2) parameter block.

How it works

Optimizes condensed features $\mathbf{X}'$ and an MLP $g_\Phi$ that outputs $\mathbf{A}'=g_\Phi(\mathbf{X}')$ (symmetrized sigmoid of an MLP over concatenated node-feature pairs); condensed labels $\mathbf{Y}'$ are fixed to match the real class distribution and never learned. In the loop: a GNN (SGC used for the condensation objective, GCN for evaluation) is initialized from a distribution $P_{\theta_0}$, trained for one step at a time on both the condensed graph and a class-wise sampled batch of real nodes (with sampled neighbors), and $\mathbf{X}'$/$\Phi$ are updated to minimize the cosine-distance gradient-matching loss $\sum_t D(\nabla_\theta \mathcal{L}(\mathrm{GNN}_{\theta_t}(\mathbf{A}',\mathbf{X}'),\mathbf{Y}'), \nabla_\theta \mathcal{L}(\mathrm{GNN}_{\theta_t}(\mathbf{A},\mathbf{X}),\mathbf{Y}))$, summed per class to ease optimization. $\mathbf{X}'$ and $\Phi$ are updated in alternating blocks of epochs rather than jointly. After training, small edge weights in $\mathbf{A}'$ are thresholded away to sparsify storage. A "graphless" variant, GCond-x, fixes $\mathbf{A}'=\mathbf{I}$ and only learns $\mathbf{X}'$.

Evidence

Table 2 (GCN evaluator, hard labels, node classification, 10 repeats): on Cora at r=1.3% GCond reaches 79.8% vs. 81.2% whole-dataset accuracy; on Reddit at r=0.1% GCond reaches 89.6% vs. 93.9% whole (the abstract's headline 95.3%-of-original number); on Flickr at r=1% GCond reaches 47.1% vs. 47.1% whole (matches exactly); the largest gap is ogbn-arxiv at r=0.05%, 61.3% vs. 71.4% whole. GCond beats random, herding, k-center and graph-coarsening baselines by a large margin at the smallest ratios (Obs 1). Table 3/4 show cross-architecture transfer (APPNP/Cheby/GCN/GraphSAGE/SGC/MLP/GAT) with no more than a few points of drop. Table 5 reports storage: Reddit condenses from 435.5MB/153,932 nodes to 0.4MB/153 nodes. Key ablation: GCond-x (features only, identity adjacency) matches GCond within a point or two on 11 of 15 dataset/ratio combinations, showing that most of the gradient-matching signal is absorbed into node features even when no explicit structure is learned; explicit structure mainly helps cross-architecture generalization and interpretability rather than raw accuracy.

Limitations

The gap to whole-dataset accuracy grows on the largest, most heterophilous graph tested (ogbn-arxiv); node labels are fixed rather than learned/relabeled; only single-label transductive/inductive node classification is addressed, with graph-level classification and multi-label settings left as future work (stated in the conclusion); jointly optimizing features and structure is unstable enough to require an alternating-block schedule rather than joint gradient descent; and the learned structure is sometimes uninterpretable (a near star-graph on Reddit), suggesting the structure channel can degenerate to a trivial solution the accuracy metric cannot detect.

Written by the atlas from the paper's full text. Check the paper for exact numbers.

Where it sits

Design choices

What is storedgraph-structure
Labelshard
Prior / networks usedrandom-networks
Optimization regimesingle-level
Largest scale evaluatedlarge-scale-other

Builds on

Built on by

Abstract (verbatim from arXiv)

Given the prevalence of large-scale graphs in real-world applications, the storage and time for training neural models have raised increasing concerns. To alleviate the concerns, we propose and study the problem of graph condensation for graph neural networks (GNNs). Specifically, we aim to condense the large, original graph into a small, synthetic and highly-informative graph, such that GNNs trained on the small graph and large graph have comparable performance. We approach the condensation problem by imitating the GNN training trajectory on the original graph through the optimization of a gradient matching loss and design a strategy to condense node futures and structural information simultaneously. Extensive experiments have demonstrated the effectiveness of the proposed framework in condensing different graph datasets into informative smaller graphs. In particular, we are able to approximate the original test accuracy by 95.3% on Reddit, 99.8% on Flickr and 99.0% on Citeseer, while reducing their graph size by more than 99.9%, and the condensed graphs can be used to train various GNN architectures.Code is released at https://github.com/ChandlerBang/GCond.

BibTeX (generated; prefer the venue's official entry)
@article{jin2021graph,
  title   = {Graph Condensation for Graph Neural Networks},
  author  = {Wei Jin and Lingxiao Zhao and Shichang Zhang and Yozen Liu and Jiliang Tang and Neil Shah},
  journal = {ICLR 2022},
  year    = {2021}
}

Nearby in Gradient matching

2025-11

Linear Gradient Matching — Dataset Distillation for Pre-Trained Self-Supervised Vision Models

George Cazenavette, Antonio Torralba, Vincent Sitzmann · NeurIPS 2025notablePre-training & transferpaper ↗code ↗

2025-05

PRISM — PRISM: Video Dataset Condensation with Progressive Refinement and Insertion for Sparse Motion

Jaehyun Choi, Jiwan Hur, Gyojin Han et al. · CVPR 2026notableVideopaper ↗

2025-02

GRADMM — Synthetic Text Generation for Training Large Language Models via Gradient Matching

Dang Nguyen, Zeman Li, Mohammadhossein Bateni et al. · ICML 2025notableTextpaper ↗code ↗

2024-04

Distilled Datamodel with Reverse Gradient Matching

Jingwen Ye, Ruonan Yu, Songhua Liu et al. · CVPR 2024notablepaper ↗

2023-12

Static-dynamic video DD — Dancing with Still Images: Video Distillation via Static-Dynamic Disentanglement

Ziyu Wang, Yue Xu, Cewu Lu et al. · CVPR 2024coreVideopaper ↗code ↗