Do Graph Neural Networks Learn Generalizable Algorithms for Clustering Graphs?
Mitchell Black, Sanjoy Dasgupta, Yusu Wang
NeurIPS 2026
TL;DR. We study the behavior of GNNs trained to cluster graphs and attempt to uncover the algorithms they learn.
Abstract. We study the ability of graph neural networks (GNNs) to learn generalizable algorithms for graph clustering. While previous work has shown that GNNs can learn to cluster graphs in-distribution, it is unclear exactly what algorithms these networks are learning, or whether they generalize to unseen graphs that differ significantly from their training data.
In this paper, we pick a standard cut-based clustering cost function and train GNNs of various types to minimize this function on a suite of training examples. We then test whether the resulting networks are able to generalize to much larger graphs, or other families of graphs. We complement our empirical findings with a host of theoretical results that illustrate the range of possible heuristics that these different GNNs could be implementing. Finally, we use probes on trained networks to narrow down the heuristics actually being learned.
Our findings show that there is generalization across the board but that GNNs of different expressivity---MPNNs versus PPGNs, for instance---learn markedly different algorithms.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:47 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
This work aims to study the capacities of GNNs as learning generalizable graph clustering rather than matching graph distributions. The reviewers all appreciate this submission and position it above the acceptance threshold, ranging from borderline accept to (full) accept. Nevertheless, they also provide valuable feedback to help improve the paper, and increase its impact and traction. In particular, an important point was regarding a more explicit clarification of the notion of clustering that is being aimed for, with some comparison with graph clustering algorithms. It seems in general, in their initial reviews, the reviewers found the scope of the paper appropriate, but all had comments that point towards it being beneficial to clarify more explicitly how much does it rely on the modularity-based perspective here, or can generalize further.
Beyond this, the authors were requested to consider all the feedback provided and answer the questions provided by the reviewers (with suggestions of what they intend to revise in the camera-ready version where appropriate) to a reasonable extent, which they did in their rebuttal.
I recommend the authors also take into account this feedback when preparing the final version of their manuscript.
Final justification
The paper was already positively evaluated above acceptance threshold before the rebuttal period, and remains so after it.
Read meta-review
Meta-review
This work aims to study the capacities of GNNs as learning generalizable graph clustering rather than matching graph distributions. The reviewers all appreciate this submission and position it above the acceptance threshold, ranging from borderline accept to (full) accept. Nevertheless, they also provide valuable feedback to help improve the paper, and increase its impact and traction. In particular, an important point was regarding a more explicit clarification of the notion of clustering that is being aimed for, with some comparison with graph clustering algorithms. It seems in general, in their initial reviews, the reviewers found the scope of the paper appropriate, but all had comments that point towards it being beneficial to clarify more explicitly how much does it rely on the modularity-based perspective here, or can generalize further.
Beyond this, the authors were requested to consider all the feedback provided and answer the questions provided by the reviewers (with suggestions of what they intend to revise in the camera-ready version where appropriate) to a reasonable extent, which they did in their rebuttal.
I recommend the authors also take into account this feedback when preparing the final version of their manuscript.
Final justification
The paper was already positively evaluated above acceptance threshold before the rebuttal period, and remains so after it.
- Rating
- 5/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper investigates whether graph neural networks can learn generalizable algorithms for graph clustering rather than merely fitting the training distribution. Using modularity maximization as the target objective, the authors combine experiments and theory to show that different GNN architectures learn different clustering heuristics: MPNNs generalize surprisingly well across graph sizes and families, while more expressive models such as PPGNs often achieve stronger in-distribution performance but weaker out-of-distribution generalization. The paper further suggests, through theoretical analysis and probing, that MPNNs tend to learn procedures resembling power methods or gradient-based iterations on graph-associated matrices, highlighting the role of algorithmic alignment between architecture and learned algorithm.
Strengths and weaknesses
Strengths
- The paper addresses an important and timely question: whether GNNs learn genuinely generalizable graph-clustering algorithms rather than merely fitting the training distribution.
- It provides a strong combination of empirical evaluation, theoretical analysis, and probing-based interpretation, which makes the main claims more convincing than purely experimental evidence.
- The comparison between MPNNs and PPGNs is insightful, showing that higher expressivity does not necessarily lead to better out-of-distribution generalization.
- The proposed explanation based on architecture–algorithm alignment offers a useful perspective for understanding why certain GNN architectures generalize better on algorithmic graph tasks.
Weaknesses
- The probing evidence is suggestive but not conclusive, since the observed internal representations may be compatible with multiple algorithmic interpretations.
- The explanation for why virtual nodes substantially improve generalization remains somewhat underdeveloped and lacks deeper causal analysis.
- The empirical study focuses mainly on modularity-based graph clustering, which limits the breadth of evidence for the paper’s broader claims about GNNs learning generalizable algorithms.
Questions
-
The probing results suggest that the learned representations may resemble power-method or gradient-based iterations, but how can the authors rule out alternative heuristics that produce similar probe curves?
-
Since virtual nodes appear crucial for the strong generalization of GCNs, can the authors provide more targeted ablation studies to isolate whether the gain comes from global information aggregation, optimization stability, or increased effective model capacity?
-
The paper argues that PPGNs learn more accelerated but less transferable procedures. Can the authors provide stronger evidence that the poorer OOD performance of PPGNs is caused by algorithmic over-specialization rather than differences in optimization, normalization, or hyperparameter sensitivity?
-
The experiments mainly focus on modularity maximization. How robust are the conclusions if the clustering objective is changed to other cut-based or community-detection objectives?
-
Given that MPNNs generalize better while PPGNs often perform better in-distribution, can future architectures combine the stability of MPNN-like iterations with the efficiency of higher-order or accelerated methods?
-
Can the proposed architecture–algorithm alignment perspective be extended to graph tasks beyond clustering, such as shortest paths, matching, graph coloring, or subgraph detection?
Limitations
- The conclusions are primarily drawn from one family of graph-clustering objectives, so it remains unclear whether the same architecture–algorithm alignment explanation extends to other graph tasks.
- The paper does not provide a general method for identifying the exact algorithm learned by a trained GNN; the current probes only offer partial interpretability.
- The role of training data design is not fully resolved, especially regarding what types of synthetic graphs best encourage the learning of transferable algorithmic procedures.
Final justification
I will keep my score due to the discussion in the rebuttal period.
Formatting concerns
No.
2 comments
I thank the authors for their responses, which have resolved most of my concerns.
- Rating
- 4/6
- Confidence
- 2/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 4/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper is a case study on how well GNN architectures perform especially on the graph clustering problem and understand what they are really doing behind. It focuses on binary graph partitioning under the modularity objective, and the generalization is evaluated agaisnt most known architectures GAT, GCN, GIN, PPGNs, MPNNs with virtual nodes, and across 3 main settings (synthetics graph families, graph sizes, from small synthetic graphs to larger real world graphs).
Strengths and weaknesses
The paper is a case study on how well GNN architectures perform especially on the graph clustering problem and understand what they are really doing behind. It focuses on binary graph partitioning under the modularity objective, and the generalization is evaluated agaisnt most known architectures GAT, GCN, GIN, PPGNs, MPNNs with virtual nodes, and across 3 main settings (synthetics graph families, graph sizes, from small synthetic graphs to larger real world graphs).
- The paper compare to different GNN architectures however it doesn't sho a comparison to the graph clustering algo (louvain, label prop,..) This comparison is interesting since the paper claim that GNNs learn general clustering heuristics but it's not compared to the produced clusters from the graph clustering to see how good is the clustering quality.
- Would it be the same conclusions if we have more random seeds?
- In appendix H, it shows that training directly on ground truth cluster labels using binary cross entropy performs somehow worse than training directly on modularity. This could be a main limitation since the models may depends strongly on being trained on the same graph level objective usded for eval.
Questions
- The paper compare to different GNN architectures however it doesn't sho a comparison to the graph clustering algo (louvain, label prop,..) This comparison is interesting since the paper claim that GNNs learn general clustering heuristics but it's not compared to the produced clusters from the graph clustering to see how good is the clustering quality.
- Would it be the same conclusions if we have more random seeds?
- In appendix H, it shows that training directly on ground truth cluster labels using binary cross entropy performs somehow worse than training directly on modularity. This could be a main limitation since the models may depends strongly on being trained on the same graph level objective usded for eval.
Limitations
Yes
Final justification
The authors clarified that the primary goal is to uderstand the algo learned by GNNs rather than compare it to the SOTA graph clustering. This addresses my concern regarding the absence of comparisons with classical graph clustering algo to some extend, even though I still believe that including representative clustering baselines would provide useful context for interpreting the quality of the learned heuristics. The authors also clarified that the experiment in appendix H should be seen as an ablation on the optimization objective rather than a limitation. I find it reasonable but still thinking on how the learned algorithlic behavior depends on the choice of the training objective.
Formatting concerns
N/A
2 comments
Rebuttal
Thank you for the thoughtful review. We appreciate your comments and feedback. We address your main points below.
The paper compare to different GNN architectures however it doesn't show a comparison to the graph clustering algo (louvain, label prop,..)
Our main motivation in writing this paper is to understand what algorithms GNNs might learn in practice, not to argue that GNNs outperform existing algorithms. In particular, while GNNs might have the capacity to implement many algorithms (see Appendix C), the training dynamics and inductive bias of the architecture might make them learn certain algorithms more naturally. We show evidence that MPNNs might be learning standard power-method-like procedures, while for PPGN (even though it can implement this standard power-method too) seems to be learning an (exponentially) accelerated power-method. These algorithms are not state-of-the-art for graph clustering, and in many instances, we find that they find suboptimal clusterings. We will emphasize this point in future versions of the paper.
Would it be the same conclusions if we have more random seeds?
For the MPNN variants (GCN, GIN, etc), we find that the models perform consistently across random seeds (as seen in the variance of the evaluation metrics for these models). For PPGNs, the variance is often higher across different random seeds, but our observation of PPGNs outperforming MPNNs generally holds across seeds.
In appendix H, it shows that training directly on ground truth cluster labels using binary cross entropy performs somehow worse than training directly on modularity. This could be a main limitation since the models may depends strongly on being trained on the same graph level objective used for eval.
This is a fair point, and something we considered. Our main goal with this paper was to understand the algorithms learned by GNNs, not necessarily to achieve optimal performance. We view this experiment as an ablation on the role of the objective, and this experiment suggests that it is important; there does appear to be some information in the loss function that is crucial for performance. However, we do not view this as a limitation per se. It is not more expensive to train a network on the clustering objective compared to the classification objective.
One hypothesis for why the modularity objective is better is that it is less restrictive. The classification objective encourages the network to learn the optimal clustering; however, perhaps this is not something that can always be inferred from the network due to expressivity constraints like only being able to perform a fixed number of steps of an algorithm (e.g., Theorem 3), so it is unclear what the learned strategy for the network would be in this case. The modularity objective allows the network to return a good-if-suboptimal solution, which is perhaps more reasonable for less expressive networks. In particular, if the graph has many close-to-optimal solutions, training on the unsupervised objective would reward the network for each of these solutions, while the supervised objective would not.
Thanks, I acknowledge that I have read and considered your response
- Rating
- 4/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 4/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper investigates whether Graph Neural Networks (GNNs) can learn generalizable algorithms for graph clustering (specifically, modularity maximization) that extrapolate out-of-distribution (OOD) to larger or different types of graphs. Through a blend of empirical evaluation and theoretical analysis, the authors demonstrate that Message Passing Neural Networks (MPNNs) with Virtual Nodes generalize exceptionally well, while more expressive Provably Powerful Graph Networks (PPGNs) struggle with OOD extrapolation despite better in-distribution performance. Theoretically, the paper proves that MPNNs possess the capacity to implement power iteration and gradient descent on graph matrices, whereas PPGNs can implement exponentially accelerated versions of these algorithms. Notably, Theorem 3 establishes an impossibility result proving MPNNs cannot achieve this acceleration. Layer-wise linear probing empirically supports that the trained networks align with these respective algorithmic trajectories.
Strengths and weaknesses
Strengths:
-
The paper is technically strong, especially as a Theory contribution. Its main value is not merely an empirical observation that GNNs can cluster graphs, but a systematic analysis of the alignment between GNN architectures and classical graph clustering algorithms. The results connecting MPNNs with virtual nodes to power-method and gradient-descent-type procedures, and the comparison with accelerated procedures implementable by PPGNs, provide a solid technical basis for the paper's claims.
-
The paper is generally well organized. The narrative is clear: the authors first demonstrate generalization phenomena empirically, then provide theoretical explanations of what different GNN architectures can implement, and finally use probing and hidden-representation analyses to study what trained models may actually be doing. The separation between data generalization, size generalization, and real-world generalization also helps readers understand the empirical questions being addressed.
3.The paper addresses an important question: whether GNNs can learn generalizable algorithmic procedures rather than simply fitting the training distribution. This question is central to both neural algorithmic reasoning and graph learning. By studying this problem in the context of graph clustering, and by analyzing the role of virtual nodes and higher-order GNNs, the paper contributes to our understanding of GNN inductive biases, out-of-distribution generalization, and architecture-algorithm alignment.
- The paper is original in its synthesis of graph clustering, GNN expressivity, and neural algorithmic reasoning. While the intuitive connection between message passing and matrix iteration is not entirely surprising, the paper develops this connection systematically and uses it to compare MPNNs with PPGNs in terms of layer complexity for iterative algorithms. The combination of theoretical analysis with probing-based mechanistic evidence further strengthens the originality of the work.
Weaknesses:
-
The main technical issue is that the assumptions and scope of the theoretical results should be stated more explicitly in the main text. In particular, the MPNN lower-bound result would benefit from a clearer specification of the allowed model class, feature assumptions, hidden dimension, and whether the result concerns exact or approximate computation. This clarification is important for assessing the strength of the theoretical contribution.
-
The paper is generally readable, but the interpretation of the probing experiments should be phrased more cautiously. The current evidence supports strong correlation with power-method-like behavior, but it does not uniquely identify the internal algorithm learned by the network. The paper would be clearer if it more explicitly separated proven theoretical capacity from empirical mechanistic evidence.
-
The conclusions are mainly demonstrated under binary modularity maximization with random node features. It remains unclear how far the findings extend to other clustering objectives, multi-way clustering, or graphs with meaningful node attributes. A short discussion or additional robustness experiment on the role of node features would substantially strengthen the paper.
Questions
Please refer to the weaknesses.
Limitations
Partially. The authors discuss some relevant limitations and open questions, such as why MPNNs with virtual nodes generalize well, why PPGNs are less reliable under out-of-distribution settings, and why identifying the exact algorithm learned by a trained GNN remains difficult. However, several important limitations should be made more explicit. In particular, the paper should more clearly address the assumptions and scope of the main theoretical results, the non-identifiability of the probing-based mechanistic interpretation, the role of random normal node features as possible initialization or symmetry-breaking signals, and the limited evaluation under binary modularity maximization. A more explicit limitations discussion would make the scope, assumptions, and generality of the paper’s claims clearer.
Formatting concerns
No major formatting concerns.
1 comment
Rebuttal
Thank you for the thoughtful review. We appreciate your comments and feedback. We address your main points below.
The main technical issue is that the assumptions and scope of the theoretical results should be stated more explicitly in the main text. In particular, the MPNN lower-bound result would benefit from a clearer specification of the allowed model class, feature assumptions, hidden dimension, and whether the result concerns exact or approximate computation.
Thank you for this point. We agree that the statement and presentation of our theoretical results could be more specific. To clarify, our results are generally for approximation, as at several points, we rely on the Universal Approximation Theorem of MLPs to implement a sub-routine. We will work on improving this in the final version of the paper, e.g., explicitly stating the form of the model, bounds on the hidden dimension where possible, and that this is an approximation.
…the interpretation of the probing experiments should be phrased more cautiously. The current evidence supports strong correlation with power-method-like behavior, but it does not uniquely identify the internal algorithm learned by the network.
This is a valid point. Indeed, we cannot say assertively that the network has learned a power method implementation. We feel that the existing probing results and correlation experiments and their alignments with our theoretical results provide evidence that the heuristics learned is likely very similar to the power-method-like algorithm, even if it is not the learned algorithms are not exactly the classical algorithms. However, we agree that these are all indirect pieces of evidence. We will make this point clearer in the revised version of the paper. Interpreting the algorithms learned by neural networks are highly important research directions, and it would be very interesting, as future work, to explore how to interpret learned algorithms using circuit identification or mechanistic interpretability techniques.
The conclusions are mainly demonstrated under binary modularity maximization with random node features. It remains unclear how far the findings extend to other clustering objectives, multi-way clustering, or graphs with meaningful node attributes. A short discussion or additional robustness experiment on the role of node features would substantially strengthen the paper.
Thank you for the question. As for the role of node features, we opted for random node features, as we were primarily interested in how well GNNs could infer properties of the graph without additional information. Previous works on GNNs (e.g., [Tsitsulin et al, 2023]) for clustering did include cluster information in the node features, but we were interested in the setting where node features carried no information as this is the most difficult test of GNN capabilities.
However, we can make one interesting observation about our choice of node features, which is that it is important that our features are random, and not uniform, which is the common model used for theoretical results like WL bounds. This is because the task of clustering requires us to break symmetry. For example, if we want to cluster a path, most notions of optimal clustering would require the endpoints to be in different clusters, which would be impossible with uniform features as they would necessarily have the same representation. This is an interesting concrete example of theoretical results showing that GNNs with random features are more expressive, e.g., [Abboud et al. 2020, Kanatsoulis and Ribiero, 2024].
An additional benefit of not including node features is that the network can be applied to any graph, as it has no graph-specific dependencies in the input dimension.
We will add more discussions about all these in the revised paper.
Citations
Abboud, Ralph, et al. "The surprising power of graph neural networks with random node initialization." arXiv preprint arXiv:2010.01179 (2020).
Kanatsoulis, Charilaos, and Alejandro Ribeiro. "Counting graph substructures with graph neural networks." The twelfth international conference on learning representations. 2024.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Rebuttal
Thank you for the thoughtful review. We appreciate your comments and feedback. We address your main points below.
Questions
This is a good point, and we could have been clearer on this point in the paper. We do not believe we can rule out that GNNs are learning a heuristic. In fact, we believe it is likely that GNNs are learning a heuristic rather than exactly implementing one of these algorithms. Our main argument is only that the algorithms learned by the network are similar to one of the classical algorithms, given the evidence we observe. In Appendix F.2, we compare the internal feature representations and iterates of the different power method variants, and we see that no algorithm perfectly matches the algorithm, although they have similar convergence curves to the algorithms. (Admittedly, this comparison is complicated by the step size hyperparameter in the power-method-type algorithms, so we simply opted for best fit visually). In Appendix C and specifically Section C.4, we observe that gradient descent on most clustering objectives all have a similar form. From this, we suspect that our GNNs are learning some heuristic similar to the power method rather than the power method itself. We will try to carefully reword our paper to avoid making too strong a claim and explicitly state that our experiments could be explained by a heuristic similar to any of these methods.
As we were writing the paper, one hypothesis we had was that virtual nodes were primarily used to align the features with the final sigmoid layer; this would be akin to the sweepline algorithm performed in classical eigenvector methods for clustering. If this were true, we would only need global information at the final layer and not at the intermediate layers. To test this, we trained a GCN with a DeepSets layer as the final layer before the sigmoid. This would provide the network with global information before the sigmoid. We found that this did improve upon the performance of GCN, but it did not achieve the same performance as GCN+VN. From this we might conclude that the virtual node is performing non-trival operations at each layer, for example subtracting the degrees as would be necessary for Laplacian gradient descent.
This is a good question, and one where we put in quite a bit of effort. We performed a thorough hyperparameter search to maximize the generalization ability of PPGNs. We found normalization technique was one factor that was critical for the generalization. We had to try several normalization techniques (BatchNorm, LayerNorm) before we found a norm that worked reasonably well OOD (InstanceNorm); the other two performed poorly on only slight OOD tasks (for example, going from Large to X-Large data). Perhaps more sophisticated normalization is needed for even better generalization.
Nevertheless, it is an intriguing question why PPGN OOD generalizes worse -- and if there are any specific thoughts or suggestions for an experiment beyond a hyperparameter search, we would be more than happy to try and test them.
During the rebuttal period, we were able to perform a more in-depth analysis on the isoperimetric ratio. Recall from Appendix G that we are able to successfully train GCNs to minimize the isoperimetric ratio and avoid non-trivial solutions if we added a centering operator after each layer and we use the Gumbel softmax as the final activation layer. For a point of comparison, we trained a PPGN using Gumbel softmax as the final activation layer. We did see some similarities to the modularity case, namely PPGNs achieved overall better performance. Probes of PPGNs showed they also had faster convergence, achieving better results after a small number of layers then converging to their final solution in the last layers. Both of these make sense in the context of classical algorithms; some algorithms for maximizing isoperimetric use eigenvectors of the Laplacian, so can be implemented with the power method on the Laplacian.
One of the central questions left open by our work is why GCNs perform better OOD than PPGNs. One difficulty here is the lack of alternative higher-order architectures, which we agree is a compelling direction for future research.
Yes, algorithmic alignment is one of the key concepts in the field of neural algorithmic reasoning, and some of the papers that most inspired us were works that were focused on how the structure of the GNN enabled the learning of algorithms for specific problems like shortest path and minimum vertex cover. Our primary inspirations in the conceptualization and writing of this paper were [Nerem et al 2025], [Yau et al 2023], and [He and Vitercik, 2025]. It would be interesting to apply some of the techniques in our paper to these problems, although many of our experiments are specific or fine-tuned to the problem of clustering.
Limitations
This is an interesting open question, and one we do not have much perspective on. Two interesting points of comparison are [Nerem et al 2025] and [Wittig et al 2026]. These papers show that GNNs could learn generalizable algorithms by training on carefully constructed finite datasets. This is an interesting approach, but the difficulty in applying it to clustering is that we do not know concretely which algorithm we think our network is learning, which is the case for these papers (e.g., Bellman-Ford for shortest paths). In particular, there are some components of our networks that we don’t have a hypothesis of how they perform, e.g., converting intermediate states into cluster probabilities. Thus, our only thought on how to resolve this is more thorough testing.