Which Algorithms Can Graph Neural Networks Learn?

Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, Christopher Morris

International Conference on Machine Learning 2026 · Oral

Overview

This talk investigates the foundational question of whether and how Message Passing Neural Networks (MPNNs) can learn to execute and generalize complex classical algorithms. Presented by Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, and Christopher Morris at ICML, the research bridges the gap between empirical deep learning and rigorous algorithmic guarantees. The core tension addressed in the machine learning and systems literature is simple: while neural networks offer immense flexibility, hardware acceleration, and data-driven adaptability, they notoriously lack out-of-distribution (OOD) size generalization. Conversely, classical algorithms provide strict correctness and scaling guarantees but lack flexibility.

Watch on SlidesLive

Visual summary for Which Algorithms Can Graph Neural Networks Learn? by Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, Christopher Morris
Visual summary for Which Algorithms Can Graph Neural Networks Learn? by Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, Christopher Morris

Key moments

  1. 0:00 Problem setup and main expressivity and learnability results
  2. 2:30 Motivation: Why learn algorithms with neural networks
  3. 4:30 Background and basic mechanism of message passing neural networks
  4. 5:30 Theorem on regularization-induced interpolation over compact spaces
  5. 8:30 Constructing metrics and compact spaces using computation trees
  6. 10:00 Specific algorithms covered and experimental evidence
  7. 12:00 Audience Q&A on Lipschitz behavior verification
  8. 13:30 Audience Q&A on regularization terms and compact spaces

Which Algorithms Can Graph Neural Networks Learn?

Speakers: Solveig Wittig; Antonis Vasileiou; Robert R. Nerem; Timo Stoll; Floris Geerts; Yusu Wang; Christopher Morris

Conference: ICML

YouTube: https://slideslive.com/39083737

Overview

This talk investigates the foundational question of whether and how Message Passing Neural Networks (MPNNs) can learn to execute and generalize complex classical algorithms. Presented by Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, and Christopher Morris at ICML, the research bridges the gap between empirical deep learning and rigorous algorithmic guarantees. The core tension addressed in the machine learning and systems literature is simple: while neural networks offer immense flexibility, hardware acceleration, and data-driven adaptability, they notoriously lack out-of-distribution (OOD) size generalization. Conversely, classical algorithms provide strict correctness and scaling guarantees but lack flexibility.

The speakers introduce a theoretical framework that establishes sufficient conditions—specifically connecting small regularized loss with Lipschitz continuity over a compact space—under which MPNNs can provably learn target algorithms and generalize to arbitrary graph sizes. By viewing algorithms as probes into what neural networks learn, this work provides a rigorous mathematical foundation for building differentiable, learnable algorithms that inherit the robustness of classical computing.

Background

▶ Watch: Problem setup and main expressivity and learnability results (0:00)

In the machine learning and systems space, learning algorithms with neural networks has traditionally been viewed through the lens of expressivity: can a neural network architecture implement a target function $f^$ given optimal parameters $\theta^$? While prior literature has made significant strides in proving that certain architectures (such as recurrent networks or Graph Neural Networks) can express specific graph algorithms, expressivity alone does not guarantee learnability. Practitioners frequently encounter a frustrating reality: even when a model class can theoretically express an algorithm, gradient-based optimization may fail to find the correct parameters, or the model may severely overfit to small training instances and fail to generalize to larger, unseen graph topologies.

This breakdown stems from the difficulty of extrapolating beyond the training data distribution. In graph machine learning, test graphs are often significantly larger than training graphs, turning the problem into a severe out-of-distribution challenge. Prior work struggled to provide universal generalization bounds across the infinite space of all possible graphs. This talk addresses this bottleneck by shifting the perspective: rather than attempting uncontrolled extrapolation to unbounded graphs, the authors construct a structured mathematical framework that recasts graph generalization as an interpolation problem over a compact metric space.

Key Findings

▶ Watch: Background and basic mechanism of message passing neural networks (4:30)

The central finding of this research is that for a broad, well-defined class of algorithms, properly chosen MPNNs trained on finite datasets can provably learn the algorithm and generalize to arbitrary graph sizes, provided the regularized loss is sufficiently small.

Key discoveries and theoretical results include:

  • Regularization-Induced Interpolation: The authors prove that if both the hypothesis class and the target function are Lipschitz continuous and the input space is compact, a finite dataset exists such that achieving a small regularized loss guarantees a uniformly bounded test error across the entire input domain.
  • Compact Metric Spaces for Graphs: By mapping graphs to the space of computation trees and employing a Hausdorff-style metric, the authors prove that the space of all graphs can be made compact for orthonormalized mean aggregation, min aggregation, and max aggregation MPNNs.
  • Specific Algorithmic Coverage: The framework explicitly covers foundational algorithms including PageRank, Bellman-Ford, and dynamic programming solutions for the 0-1 knapsack problem.
  • Sample Complexity Bounds for Bellman-Ford: For the Bellman-Ford shortest path problem, the authors demonstrate that only $L + 1$ training samples are required to successfully learn $L$ steps of the algorithm, utilizing a simplified weighted $L_1$ regularization scheme.

Technical Deep Dive

▶ Watch: Constructing metrics and compact spaces using computation trees (8:30)

The technical heart of the paper relies on marrying Lipschitz continuity control with covering number arguments. The research establishes a formal pipeline connecting model optimization to global generalization through several specialized mechanisms.

Regularization Architecture

The optimization objective relies on a custom regularizer penalizing the divergence between the Lipschitz constant of the target function ($B_{f^*}$) and the learned model ($B_\theta$). The regularizer is wrapped in a Rectified Linear Unit (ReLU) activation to ensure the penalty is only applied when the learned function's Lipschitz constant exceeds that of the target function:

$$\text{Regularizer} = \text{ReLU}(B_\theta - B_{f^*})$$

This formulation avoids penalizing models with smaller Lipschitz constants while strictly bounding how rapidly the learned function and target function can diverge away from training data points.

Computation Trees and Metric Construction

Because the space of all graphs is unbounded and non-compact, the authors utilize computation trees—unwinding the recursive message-passing steps that produce the output at a target node $V$. By defining a specialized metric over these computation trees, the infinite, unconstrained space of all graphs is transformed into a compact metric space. Training graphs serve as the centers of a metric cover over this compact space. Consequently, controlling the Lipschitz constants ensures that small empirical errors on these cover centers translate directly to bounded errors across all possible computation trees.

Experimental Setup & Results

▶ Watch: Specific algorithms covered and experimental evidence (10:00)

The theoretical framework is supported by targeted analyses and experimental evidence demonstrating that the guaranteed size generalization occurs in practical training regimes.

  • Datasets & Inputs: Inputs consist of graph structures coupled with source node indicators (e.g., source $S$ in shortest path formulations), expanding from small training graphs to significantly larger test graphs.
  • Baselines & Target Problems: The empirical validation focuses on iterative algorithms where traditional GNNs typically degrade when evaluated on graphs larger than those seen during training—specifically the Bellman-Ford shortest path routing and dynamic programming routines.
  • Headline Results: Experiments confirm that when models are trained under the specified Lipschitz regularization framework, test accuracy remains stable even as graph diameters and node counts scale far beyond the training distribution. The theoretical requirement for bounding function divergence holds up empirically when loss thresholds are met.

Practical Implications

▶ Watch: Audience Q&A on regularization terms and compact spaces (13:30)

For infrastructure teams, model builders, and deployers working with graph-structured data, this work provides a blueprint for moving away from brittle, purely heuristic GNN training toward provably robust architectures.

  • Reliable OOD Scaling: Deployers can leverage these insights to build models that safely generalize to larger network topologies (e.g., social networks, routing graphs, or molecular structures) without retraining.
  • Tradeoffs and Limitations: The primary limitation lies in optimization—while the theory guarantees that if a small regularized loss is achieved, generalization follows, standard gradient descent does not mathematically guarantee finding the global minimum of this specific loss landscape. Furthermore, computing exact Lipschitz constants for deep, multi-layer MPNNs remains challenging, though upper-bounding approximations can be utilized in practice.

Key Takeaways

  • MPNNs can provably learn and generalize a broad class of classical algorithms to arbitrary graph sizes under specific conditions.
  • Generalization to unbounded graph inputs is achieved by transforming the problem into an interpolation task over a compact space of computation trees.
  • A custom Lipschitz-based regularizer ensures that local training points serve as covers that tightly bound test errors across the entire input domain.
  • Supported algorithms within this framework include PageRank, Bellman-Ford, and dynamic programming formulations for the 0-1 knapsack problem.
  • For Bellman-Ford specifically, theoretical bounds show that just $L + 1$ training samples are sufficient to learn $L$ execution steps.

About the Speaker(s)

Authors: Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, Christopher Morris.

Reviews

→ Top-rated talks at International Conference on Machine Learning 2026

All talks from International Conference on Machine Learning 2026