TL;DR
This paper introduces a novel approach to measuring the similarity between graphs by treating them as distributions of node features and comparing them using Maximum Mean Discrepancy (MMD). By bypassing the heuristic "readout" functions typically required in Graph Neural Networks (GNNs), the proposed MMD-Graph Kernels (both vanilla and trainable deep versions) achieve state-of-the-art performance on graph classification and clustering tasks.
The Problem: How Do We Compare Graphs?
Comparing graphs—whether they represent molecular structures, social networks, or protein interactions—requires a reliable measure of similarity. Historically, researchers have relied on two main approaches, both of which have notable limitations:
- Traditional Graph Kernels: These methods break graphs down into substructures (like paths or graphlets) and count their occurrences. However, these substructures often overlap, artificially inflating the dimensionality of the feature space. Furthermore, they rely on manually crafted features, missing deeper, learned structural relationships.
- Graph Neural Networks (GNNs): GNNs excel at learning node-level features. But to compare entire graphs, they must compress a matrix of node embeddings into a single vector using a "readout" function (like summing or averaging all nodes). This heuristic compression often destroys rich structural information.
The authors tackle this gap by asking a fundamental question: What if we don't compress the graph at all? Instead, they propose treating the set of node embeddings in a graph as a discrete statistical distribution, allowing them to compare two graphs directly using a parameter-free statistical test.
Methods: The MMD-Graph Kernel
The authors propose the Maximum Mean Discrepancy-Graph Kernel (MMD-GK) and its trainable extension, Deep MMD-GK.
- Vanilla MMD-GK: The algorithm first uses message-passing to update each node's features based on its local neighborhood (up to $L$ levels deep). Then, instead of pooling these nodes into a single graph-level vector, it uses Maximum Mean Discrepancy (MMD)—a statistical method for measuring the distance between two distributions—to compare the sets of node representations from two different graphs. It uses a family of Gaussian kernels to compute this distance.
- Deep MMD-GK: This version introduces trainable weight matrices into the message-passing step, allowing the model to adaptively learn the best node representations.
- Training: Deep MMD-GK can be trained unsupervised (using contrastive loss or KL divergence to naturally group similar graphs) or supervised (using Supervised Contrastive Loss to explicitly pull graphs of the same label closer together).
- Theoretical Guarantees: The authors go beyond empirical design by mathematically proving the robustness of their kernels, showing bounds on how much the kernel distance deviates when node attributes or graph structures are perturbed by noise.
Key Insights
- Graphs as Populations: The core innovation is sidestepping the GNN readout bottleneck entirely. By viewing a graph as a population of sampled node embeddings, MMD can compare two graphs directly.
- Size and Permutation Invariance: Because MMD compares distributions, it naturally handles graphs with different numbers of nodes. Furthermore, it doesn't require complex, computationally expensive node-matching or permutation alignments between the two graphs.
- Provable Robustness: The theoretical analysis proves that the MMD distance between graphs degrades bi-quadratically with respect to feature noise. This means the kernel is mathematically stable and won't wildly change its similarity score due to minor data corruption (like a missing edge or slightly altered node attribute).
Key Results
The methods were evaluated on five standard benchmark datasets for graph classification and clustering (DHFR, BZR, PROTEINS, MUTAG, PTC_FM).
- Graph Classification: Deep MMD-GK achieved highly competitive or state-of-the-art accuracy across the board. For example, on the MUTAG dataset, the supervised Deep MMD-GK reached 0.915 accuracy, outperforming traditional kernels and deep learning baselines like DGCNN and DeepMap.
- Graph Clustering: The unsupervised Deep MMD-GK absolutely crushed baselines in clustering tasks. On the BZR dataset, it achieved a Normalized Mutual Information (NMI) of 0.757 and an Adjusted Rand Index (ARI) of 0.809. In stark contrast, baselines like InfoGraph and GraphCL completely failed to find meaningful clusters on this dataset (scoring < 0.05 on both metrics).
- Computational Efficiency:
The theoretical complexity of the MMD-GK is $\mathcal{O}(Lmd + \kappa n^2 d)$ (where $n$ is nodes, $m$ is edges, $d$ is feature dimension). As shown in the comparison table, this makes it computationally competitive with advanced optimal assignment kernels like the Wasserstein Weisfeiler-Lehman (WWL) kernel, while still supporting both node labels and continuous attributes.
Limitations and Future Work
- Scalability: While competitive with other advanced kernels, the $\mathcal{O}(n^2)$ complexity term associated with calculating the pairwise MMD between nodes means the method could become a bottleneck for graphs with a massive number of nodes.
- Generalization Bounds: The authors note that the objective function for supervised learning is highly nonconvex. While they provide a uniform stability parameter, finding an explicit, tight form of the generalization bound remains difficult.
- Future Work: The authors suggest focusing on improving the scalability of the MMD computations for larger graphs and deriving better, more explicit generalization error bounds for the supervised learning framework.
Summary updated