Cluster-GCN

On this page 7

Cluster-GCN is a training algorithm for graph convolutional networks that partitions a large graph into dense clusters and trains on one small group of clusters at a time, so each mini-batch is a subgraph that fits in GPU memory. In graph learning, a branch of artificial intelligence concerned with networks and relational data, it was one of the first methods to train deep GCNs on graphs with millions of nodes without exploding memory or computation.

The method was introduced in 2019 by researchers from Google and academic collaborators. Its central insight is that graph clustering keeps most edges inside each batch, which makes subgraph training efficient while losing relatively little of the neighborhood information that a full-batch graph convolutional network would use.

Why full-batch GCN training does not scale

A standard graph convolutional network computes each node’s representation by neighborhood aggregation, so one layer touches every edge in the graph. Full-batch training must therefore hold the embeddings of all nodes for every layer in memory, which grows as the number of nodes times layers times hidden size.

Naive mini-batching does not solve this. To compute a node’s output in an L-layer network, the algorithm needs its L-hop neighborhood, which grows exponentially with depth in typical graphs. This neighborhood explosion means that a batch of a few hundred nodes can require most of the graph after only three or four layers.

The table below summarizes how the main training regimes behave on large graphs.

Training regimeMemory per stepCost per epochMain limitation
Full-batch GCNAll nodes and all layersLinear in edgesDoes not fit large graphs in memory
Node-wise mini-batchFull L-hop neighborhoodsExponential in depthNeighborhood explosion
Neighbor samplingSampled neighborhoodsGrows with fan-out per layerRedundant computation across batches
Cluster-GCNNodes in selected clustersLinear in edgesDrops edges between clusters
Training regimes for graph convolutional networks

How Cluster-GCN builds mini-batches

Cluster-GCN builds mini-batches in two stages: offline partitioning and online batch assembly. First, a graph clustering algorithm, usually METIS, divides the node set into many clusters with few edges between them, which maximizes the embedding utilization of each batch.

During training, each step selects one or more clusters, extracts the induced subgraph on their nodes, and runs a complete forward and backward pass of the GCN on that subgraph only. Because every node’s neighbors are mostly inside the same cluster, the computed embeddings are close to their full-graph values, and no layer needs nodes from outside the batch.

The original algorithm adds a stochastic multiple partitions scheme. The graph is split into many small clusters, and each batch combines several randomly chosen clusters and restores the edges between them. This reduces the bias caused by fixed partitions and balances label distributions across batches.

The following table describes the main hyperparameters and their effects.

HyperparameterEffectPractical guidance
Number of partitionsSmaller clusters, more batchesHundreds to thousands for large graphs
Clusters per batchLarger, less biased subgraphsIncrease until memory is nearly full
Partitioning methodEdge retention within batchesMETIS is the common default
Number of layersReceptive field inside the clusterTwo to five in most reports
Diagonal enhancementStabilizes deeper networksUseful above three layers
Key Cluster-GCN hyperparameters

Training deeper networks with diagonal enhancement

Because memory no longer grows with neighborhood size, Cluster-GCN makes deeper graph convolutional networks practical. The authors reported that very deep GCNs were difficult to optimize, and proposed a diagonal enhancement of the normalized adjacency matrix that gives each node’s own features more weight than its neighbors.

This adjustment counteracts over-smoothing, the tendency of repeated aggregation to make node embeddings indistinguishable. Deeper models still face over-smoothing and over-squashing, so the extra layers help mainly on graphs where long-range structure carries signal.

Cluster-GCN compared with other scalable GNN methods

Cluster-GCN belongs to the family of subgraph sampling methods, which differ from neighbor sampling approaches such as GraphSAGE and from layer-wise samplers such as FastGCN. The comparison below highlights where each method fits.

MethodSampling unitStrengthWeakness
GraphSAGEFixed neighbors per node and layerSimple, works inductivelyCost grows with depth
FastGCNNodes per layerLow per-layer costSparse connections between layers
Cluster-GCNGraph clustersLow memory, deep modelsPartition bias, preprocessing cost
GraphSAINTRandom subgraphs with normalizationUnbiased estimatesMore sampling variance
Precomputation methodsNone, features propagated onceVery fast trainingLimited nonlinear depth
Scalable training methods for graph neural networks

In practice, Cluster-GCN is a strong choice for transductive node classification on a single very large graph. For inductive settings with many new nodes, neighbor sampling or full-neighborhood inference is often simpler to deploy.

Limitations and practical considerations

The main weakness of Cluster-GCN is partition bias. Edges between clusters are ignored unless their clusters land in the same batch, and clusters can be internally homogeneous in labels, which makes gradients noisy and can slow convergence.

  • Preprocessing cost: METIS partitioning of a graph with billions of edges takes significant time and memory.
  • Inference mismatch: full-graph inference can differ from subgraph training, so evaluation should use the same propagation scheme.
  • Heterophily: on graphs where linked nodes differ, clustering preserves less useful structure.
  • Dynamic graphs: frequent edge changes require repartitioning or tolerance of stale clusters.

Major graph libraries, including PyTorch Geometric and the Deep Graph Library, provide ready-made cluster loaders, so the method can be adopted without custom partitioning code.

The short version

Some networks are huge, with millions of people, products or pages. A graph neural network learns from each item and its connections. On a huge network, that does not fit in memory.

Cluster-GCN cuts the network into tightly connected groups, like dividing a country into neighborhoods. It then trains on a few groups at a time. Most connections stay inside a group, so little is lost. The key takeaway: study the network piece by piece, choosing pieces that hold together well.

Where it makes a difference

An online retailer wants to predict the category of each product in a co-purchase graph of about two million products and sixty million edges, where an edge links items often bought together. Only a minority of products carry trusted category labels, and full-batch training of a four-layer GCN would need far more memory than a single GPU provides.

The engineering team partitions the graph into 1,500 clusters with METIS and trains with 20 random clusters per batch. Peak GPU memory stays at a few gigabytes, an epoch completes in minutes, and the four-layer model outperforms a two-layer baseline on held-out labels. The outcome is consistent category assignment for unlabeled products, which improves catalog search and filtering.