TL;DR
This paper introduces High-Order Derivative GNN (HOD-GNN), a novel framework that enhances the expressive power of Graph Neural Networks by leveraging the derivatives of a base model with respect to input node features. By treating derivatives as a way to capture structural information via "infinitesimal perturbations," HOD-GNN achieves the expressivity of computationally expensive Subgraph GNNs while remaining highly scalable and end-to-end trainable.
What Problem Does This Paper Address?
Standard Message Passing Neural Networks (MPNNs) have a fundamental limitation: their expressive power is bounded by the 1-Weisfeiler-Lehman (1-WL) graph isomorphism test. This means they cannot distinguish between certain non-isomorphic graphs or count simple structural patterns like triangles and cycles.
To bypass this limit, researchers often use Subgraph GNNs or node-marking schemes, which perturb or label specific nodes to break symmetry. However, these methods require explicitly extracting and processing a massive collection of subgraphs, leading to severe computational bottlenecks and poor scalability on large graphs.
Meanwhile, GNN derivatives (gradients of outputs with respect to input features) have historically been used only as diagnostic tools—to analyze over-squashing, over-smoothing, or model explainability. This paper addresses a clever question: Can we use these derivatives directly as features to fundamentally boost a GNN's expressivity without the overhead of subgraph extraction?
Methods
The authors introduce HOD-GNN, an architecture family that uses high-order node derivatives of a base MPNN to generate structure-aware node embeddings.
The pipeline operates in four main steps:
- Base Pass: Process the input graph through a base MPNN to compute initial node representations and graph-level outputs.
- Derivative Computation: Compute high-order derivative tensors of the node representations and graph outputs with respect to the initial node features.
- Encoding: Pass these derivative tensors through specialized encoder networks ($U_{\text{node}}$ and $U_{\text{out}}$) to produce derivative-informed features.
- Downstream Pass: Feed these enhanced features into a downstream GNN for final prediction.
To make this computationally feasible, the authors developed an analytic, message-passing-like algorithm to compute these high-order derivatives. By utilizing Faà di Bruno's formula (a generalization of the chain rule to higher-order derivatives) and exploiting graph sparsity, they avoid the explicit enumeration of subgraphs. Crucially, because the derivative computation is fully analytic, the entire architecture can be trained end-to-end via backpropagation.
The framework is generalized from 1-HOD-GNN (derivatives with respect to a single node at a time) to k-HOD-GNN (mixed partial derivatives across $k$ distinct nodes).
Datasets
The authors evaluated HOD-GNN across several standard graph classification, regression, and structural benchmarks:
- ZINC-12K: A popular molecular dataset used for graph property regression (predicting solubility).
- Open Graph Benchmark (OGB): Three molecular classification tasks (
molhiv,molbace, andmoltox21). - Long-Range Graph Benchmark (LRGB): The
Peptides-func(classification) andPeptides-struct(regression) datasets, which contain larger graphs that typically break full-bag Subgraph GNNs. - Synthetic Substructure Counting: A synthetic dataset of 5,000 graphs used to evaluate a model's ability to count local structures like 3-cycles, 4-cycles, cliques, and paths.
Key Insights and Ideas
- Derivatives as Infinitesimal Node Marking: The core "aha moment" is that taking the derivative of a GNN's output with respect to a node's features is mathematically equivalent to analyzing the effect of an infinitesimal perturbation to that node. Through a Taylor expansion, the authors prove that leveraging higher-order derivatives allows HOD-GNN to approximate the behavior of node-marking Subgraph GNNs to arbitrary precision.
- First-Order Derivatives Can Count Triangles: The authors show that even a simple first-order derivative of a three-layer linear GCN naturally computes the number of triangles passing through a node.
- Sparsity is the Savior: Although higher-order derivative tensors are theoretically high-dimensional, they are extremely sparse for shallow or local base MPNNs. HOD-GNN explicitly exploits this sparsity to remain efficient.
- Strictly Better than Random Walks: The authors prove that even when restricted to first-order derivatives and standard ReLU activations, 1-HOD-GNN is strictly more expressive than MPNNs enhanced with Random Walk Structural Encodings (RWSE).
Key Results
HOD-GNN demonstrates an exceptional balance of expressivity and scalability:
- State-of-the-Art Molecular Performance: On ZINC and the OGB datasets, HOD-GNN consistently ranked within the top two tiers of all tested models, outperforming both standard baselines and complex structural encoding methods.
- Scaling to Large Graphs: On the challenging Peptides datasets, where full-bag Subgraph GNNs fail to run due to hardware memory limits, HOD-GNN processed the graphs directly without any subsampling, achieving top-tier results.
- Efficiency Gains: In a direct runtime and memory comparison on the
MOLHIVdataset, HOD-GNN required less than half the GPU memory of standard Subgraph GNN variants (12,964 MiB vs. 25,000+ MiB) while maintaining a faster or highly competitive training time per epoch. - Substructure Counting: HOD-GNN successfully learned to count complex local substructures (like 6-cycles), performing on par with dedicated Subgraph GNNs and vastly outperforming standard MPNNs.
Limitations and Future Work
Despite its strong theoretical and empirical showing, the authors note a few limitations:
- Dependency on Sparse Kernels: The practical efficiency of HOD-GNN relies heavily on sparse matrix operations. Currently, popular libraries like PyTorch Geometric have suboptimal implementations for these specific sparse operations, meaning further low-level optimization could unlock even massive speedups.
- Unexplored Theoretical Links: The base MPNNs used in HOD-GNN are surprisingly deep and narrow (e.g., 17–20 layers) yet do not suffer from typical over-smoothing or over-squashing issues. The authors suggest that a deeper theoretical link between GNN derivatives, expressivity, and gradient flow remains an exciting avenue for future research.
Summary updated