Neural Tangent Kernels Motivate Cross-Covariance Graphs in Neural Networks

Shervin Khalafi, Saurabh Sihag, Alejandro RibeiroICML 2024

Introduction

Graph Neural Networks (GNNs) rely heavily on a Graph Shift Operator (GSO)—typically an adjacency matrix or Laplacian that dictates how information flows between nodes. In practice, researchers often construct this graph using only the input data, such as by calculating the correlation or covariance between features. However, a persistent gap remains between the empirical success of these models and a rigorous theoretical understanding of which graph structure is optimal for a given task.

This paper tackles a fundamental question: to maximize a GNN's learning efficiency, what should the underlying graph look like? By leveraging the framework of Neural Tangent Kernels (NTKs), the authors demonstrate—both theoretically and empirically—that GNNs perform best when their underlying graph structure is based on the cross-covariance between input and output data, rather than just the input's internal correlations.

The Role of NTK Alignment

The researchers bridge the gap between a model's architecture and its learning dynamics using the concept of Alignment. In NTK theory, alignment measures how well the target output labels correspond with the principal eigenvectors of the NTK matrix. High alignment is highly desirable: it implies that gradient descent will converge faster and the model will generalize better to unseen data.

The paper’s core mathematical contribution proves that to maximize this alignment, the GSO should be a function of the cross-covariance matrix ($C_{XY}$) between the input ($X$) and the output ($Y$).

Key technical steps in their derivation include:

  • Linear Analysis: Proving the optimality of cross-covariance for simple graph filters (linear GNNs).
  • Non-linear Extension: Using Hermite polynomial expansions to extend the proof to two-layer GNNs with non-linear activation functions (like tanh). They show that the cross-covariance term remains the dominant factor in determining optimal alignment even with non-linearity.
  • Optimization Framework: Framing the graph selection as an optimization problem where the objective is to maximize a lower bound on the NTK alignment.

Key Insights and Empirical Validation

Most GNNs are built on $C_{XX}$ (input-to-input relationships). This paper argues that for regression tasks, ignoring how inputs relate to the desired outputs ($C_{XY}$) leads to sub-optimal, sluggish learning. If the graph doesn't reflect the transformation the network is trying to learn, alignment is poor.

The authors validated their theory using multi-variate time-series datasets, including the Human Connectome Project (HCP-YA) rfMRI data, PEMS07 traffic flow data, and a North American Weather dataset.

Faster Convergence

In experiments, GNNs using cross-covariance ($C_{XY}$) as the GSO reached lower training Mean Squared Error (MSE) significantly faster than those using standard input covariance ($C_{XX}$).

Training loss comparison showing faster convergence for cross-covariance models

Superior Generalization

Beyond just training speed, the $C_{XY}$-based models consistently outperformed $C_{XX}$ models on test data across various prediction horizons. The performance gap highlights the generalization benefits of aligning the graph structure with the target outputs.

Test error difference demonstrating superior generalization of cross-covariance graphs

Robustness and Transferability

While the primary theory focused on two-layer tanh networks, empirical results showed the benefits held true for deeper networks (up to 4 layers) and other activation functions like ReLU and Sigmoid. Furthermore, because GNN convolutions are "scale-free," a model trained on a cross-covariance graph from a low-dimensional dataset could be effectively transferred to a higher-dimensional version of the same population with minimal performance loss.

Limitations and Future Work

  • Dimensionality Constraints: The current theoretical derivation assumes that the input and output vectors share the same dimensionality (e.g., predicting the state of $N$ nodes from the previous state of the same $N$ nodes). Extending this to differing dimensions is a key next step.
  • Tightness of Bounds: While the authors optimized a lower bound of the alignment, the exact tightness of this bound across all scenarios remains to be fully characterized.
  • Complex Architectures: Future work could investigate how these cross-covariance insights apply to more complex architectures, such as Graph Attention Networks (GATs) or graph-based Transformers.

Summary updated

BibTeX
@inproceedings{khalafi2024neural,
  author = {Shervin Khalafi and Saurabh Sihag and Alejandro Ribeiro},
  title = {{Neural Tangent Kernels Motivate Cross-Covariance Graphs in Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=61JD8wp4Id},
}
Figure