Abstract
Generating realistic graphs at scale remains a significant challenge due to the quadratic complexity of dense adjacency matrix representations. Most current graph diffusion models fail to scale beyond small molecules as they attempt to predict relationships between every possible node pair. We present SparseDiff, a novel discrete diffusion framework that leverages graph sparsity to generate large-scale graphs (up to ~2,500 nodes) with high efficiency. By employing a sparse noise model and a denoising network that operates on randomly sampled "query edges," SparseDiff achieves state-of-the-art results while significantly reducing memory overhead and training time compared to traditional dense models.
1. Introduction
The "quadratic wall" is a well-known bottleneck in graph generative modeling. For a graph with $N$ nodes, a dense representation requires $N^2$ potential edges. While manageable for small molecules (e.g., $N < 30$), this complexity becomes prohibitive for proteins, citation networks, or social circles where $N$ can reach thousands. Previous attempts to scale these models often relied on rigid structural assumptions, such as hierarchical clustering, which can limit generalization. SparseDiff addresses this by embracing the inherent sparsity of real-world graphs, treating the absence of edges as a primary feature rather than a computational burden.
2. Methodology
SparseDiff rethinks the standard diffusion pipeline through three key innovations designed for scalability.
2.1 Sparse Noise Model
Unlike Gaussian noise models that fill the adjacency matrix with non-zero values, SparseDiff uses a discrete marginal transition model. This transition is mathematically biased toward "non-existent" edges, ensuring that the graph remains sparse even in its noisy intermediate states. This preservation of sparsity is critical for maintaining computational efficiency throughout the diffusion trajectory.
2.2 Sparse Denoising Network and Query Edges
To avoid the $O(N^2)$ cost of standard Graph Transformers, SparseDiff introduces a "convolutional attention" mechanism. Instead of attending to all node pairs, the model focuses on a subset of edges:
- Existing noisy edges: To preserve and refine the current topology.
- Query edges ($E_q$): A small, randomly sampled subset of all possible node pairs.
This approach acts as a form of "mini-batching" for edges. By training on these random subsets, the model serves as an unbiased estimator of the full graph distribution, allowing it to learn global structures without ever loading the full adjacency matrix into memory.
2.3 Iterative Inference
During generation, SparseDiff does not attempt to predict the entire graph in a single step. It progressively reconstructs the adjacency structure by iteratively sampling and denoising subsets of edges. This iterative process allows for high-resolution generation while keeping the memory footprint constant regardless of the total graph size.
3. Experimental Evaluation
The framework was evaluated across a diverse set of benchmarks ranging from small molecules to large-scale networks:
- Small-scale: QM9 and MOSES (drug-sized molecules).
- Synthetic: Planar and Stochastic Block Model (SBM) graphs.
- Large-scale: Ego (citation networks), Protein (amino acid interactions), Facebook (social circles), and CORA (a citation dataset with 2,485 nodes).
4. Results and Discussion
SparseDiff demonstrates superior scalability and efficiency without compromising generative quality.
- Scalability: SparseDiff successfully generated graphs for the CORA dataset (2,485 nodes), a feat previously unattainable for dense diffusion models like DiGress, which typically fail beyond 200 nodes.
- Efficiency: On the Ego dataset, the model achieved a fourfold speedup in convergence. For SBM graphs, it reduced GPU memory consumption to just 31.8% of the dense baseline, enabling training on consumer-grade hardware where other models would crash.
- Quality: The model achieved state-of-the-art performance on the Frechet ChemNet Distance (FCD) for molecular datasets and outperformed existing scalable baselines (e.g., EDGE, HGGT) on large-graph metrics.
5. Conclusion
SparseDiff represents a major step toward practical, large-scale graph generation. By replacing dense computations with sparse, query-based denoising, it breaks the quadratic bottleneck. Future work will explore hybrid approaches to scale toward multi-million node graphs and improve sampling speeds during the iterative inference phase.
Summary updated