Community Detection Guarantees Using Embeddings Learned by Node2Vec

Embedding the nodes of a large network into an Euclidean space is a common objective in modern machine learning, with a variety of tools available. These embeddings can then be used as features for tasks such as community detection/node clustering or link prediction, where they achieve state of the art performance. With the exception of spectral clustering methods, there is little theoretical understanding for commonly used approaches to learning embeddings. In this work we examine the theoretical properties of the embeddings learned by node2vec. Our main result shows that the use of $k$-means clustering on the embedding vectors produced by node2vec gives weakly consistent community recovery for the nodes in (degree corrected) stochastic block models. We also discuss the use of these embeddings for node and link prediction tasks. We demonstrate this result empirically, and examine how this relates to other embedding tools for network data.

Paper

Similar papers

Peer review

Reviewer DE6D6/10 · confidence 4/52024-07-07

Summary

The paper presents theoretical results for the quality of embeddings learned by random walk based methods like DeepWalk and its generalization node2vec. More precisely, the main result shows that embeddings learned node2vec, and DeepWalk as a special case of node2vec, preserve the community structure of graphs that exhibit a community structure. This is formalized for graphs generated by a stochastic block model (SBM), a common tool for the analysis community detection algorithms. The paper is mostly theoretical with experimental results based on synthetic graphs generated by SBM.

Strengths

- The paper provides theoretical insights into a widely used embedding algorithm. - The theoretical results are non-trivial, and the proof techniques are advanced. - Overall, the paper is well-written.

Weaknesses

- The considered problem is too specific. Of course, DeepWalk and node2vec are widely used but community detection is just one of the application of node embeddings. In the appendix, the authors discuss node classification and link prediction but my understanding is that this is again based on community structures and not really convincing. There are other factors that influence node labels such as structural roles, node degree, etc. - The paper is about node2vec but the effect of the p and q parameters is not really analyzed. The results would have been much more interesting if they analyzed the interplay of p and q in node2vec and p and q in SBM. In particular, given a graph G generated by SBM(p, q) what values p, q in node2vec(p,q) would be necessary to preserve the community structure of G. - The informal Theorem 1 is actually confusing. It does not say anything about the structure of the graph or the number of communities c(u). If the graph consists of connected components or the number of communities is n, then the result is trivial.

Questions

Comment on the above issues, in particular why the influence of p and q in node2vec(p,q) is not thoroughly analyzed. I see the short discussion after Theorem 2 but cannot gain much from it. Also, Corollary 5 does not make sense as scenario i) is DeepWalk with p=q=1. Should the corollary read $\tilde{p} > \tilde{q}$ ?

Rating

6

Confidence

4

Soundness

4

Presentation

3

Contribution

3

Limitations

The paper does not present a new approach so the limitation section does not really apply here. The assumptions for the theoretical results are correctly shown, if this can be considered a limitation.

Reviewer znFf6/10 · confidence 3/52024-07-07

Summary

Theoretical results showing the consistency of node2vec embedding for community detection in SBMs and DCSBMs using k-means clustering. Versions of this problem have been approached in other work, for example, node2vec rephrased as a matrix factorisation problem [39], and rank $d$ approximations for DeepWalk [51]. This paper addresses the issues in previous works relating to approximations made within previous work, such as an Frobenius norm approximation to the cross-entropy loss, at the cost of weaker consistency results, $\ell^2$-norm as opposed to two-to-infinity norm.

Strengths

The strength and novelty of this work lies in the technical results in the Appendix. The paper would be better served with this material given more attention, perhaps in a journal rather than conference paper. However, I was unable to give the material in the Appendix a full read through, so I am working under the assumption that these results are technically sound. More clarity would be needed to show how the results differ from previous work (see below). There are some important insights about the use of node2vec for node clustering in different types of SBM and DCSBM. For example, setting $U = V$ in constrained DeepWalk where $p \le q$ is unable to cope with disassortitive (DC)SBMs. This feels like a significant issue and I would be interested to learn more why random walk based embedding algorithms fail on bipartite-like networks. It is also interesting that node2vec on DCSBMs produce clusters that only depend on the SBM community and that the degree parameters $\theta$ are unimportant. Being able to perform k-means clustering directly on the node2vec embedding is an advantage over, say, spectral methods where hyperplane or spherical projection is required to remove the effect of $\theta$ from the embeddings.

Weaknesses

Without delving too deeply into the mathematics in the Appendix, it is not obvious to me how this paper extends the results in [10] and [11] which only get briefly mentioned on Lines 121-123. These two papers analyse the asymptotic distribution of the node2vec embedding for latent position graph models, a wide range of models which include the SBM and DCSBM. It is not clear how the theoretical results in this paper extend those results, except for looking at the consistency for k-means clustering, which is non-specific to the node2vec embedding stage. I don't want to say that the contribution in this work is 'poor', but it is hard to know what is new here in the current state. Understanding random walk embedding algorithms is important, but they have been overtaken by graph neural networks designed for this exact problem, rather than ideas shoehorned in from natural language processing. The experiment shown in Figure 3 is somewhat misleading. I read this plot as showing that k-means clustering is unsuitable for spectral embeddings of DCSBM, like the political blog network, rather than spectral embedding failing.

Questions

The main issue is how do the results here compare to the work of [10] and [11]? Section 1.2 on Related Works describes how this work extends [39] and [51], but the fact that these two strongly relevant papers are only given a brief sentence feels a significant oversight. What conditions are needed/prevent two-to-infinity norm consistency compared to the $\ell_2$-norm in this setting? What about other clustering algorithms other that k-means? The results show asymptotically k-means will give the correct clustering, other papers [41] show that there are issues for fixed $n$ which are avoided by other clustering algorithms such as fitting Gaussian mixture models. Practically, any matrix $M$ transformation $U \rightarrow UM$ and $V \rightarrow VM^{-\top}$ is a valid embedding which will affect the k-means clusters. Similar results for core-periphery SBMs (On a 'two-truths' phenomenon in spectral graph clustering, Priebe et al), another important type of SBM for practical embeddings?

Rating

6

Confidence

3

Soundness

3

Presentation

2

Contribution

2

Limitations

Error bars needed in Figures 1 and 2 showing the multiple experiments described in Lines 296-297. Needs comparison to other embedding algorithms, for example, spectral embedding. Misleading experiment given in Figure 3 (see above).

Reviewer NUS88/10 · confidence 3/52024-07-08

Summary

The performance of node2vec for community detection in the degree-corrected stochastic block model is studied. It is proven that for sufficiently sparse DCSBMs, node2vec followed by $k$-means results in a clustering with only a vanishing fraction of misclassified vertices. Experiments are performed to demonstrate the results.

Strengths

The paper is very well-written and pleasant to read. The results are extremely useful in understanding the performance of node2vec in downstream tasks.

Weaknesses

The presented results are interesting, but not much intuition is provided. Minor comments: * The sentence from lines 21 to 24 is unnecessarily long and difficult. * on line 110: shouldn't $d\ge O(\kappa)$ be $d=\Omega(\kappa)$? Or do you mean something else? * Brackets mismatch in the $\log\sigma$ at the end of (10) * The $\mathcal{E}$ (presumably the edge-set) of (7) is not introduced * The notation $A_{2,\infty}$ in Theorem 2 collides with the adjacency matrix notation. * Figures are too small

Questions

Is there any hope of extending the results to partial recovery in the sparse regime? That is, $\rho_n=\Theta(n^{-1})$ so that the average degree remains bounded as $n\rightarrow\infty$. Can the results be extended to the case where the number of communities grows with $n$? If so, how fast can it grow with $n$? The NMI$\approx0$ that is shown in Figure 3 is surprising. Can we improve this by taking a different Laplacian?

Rating

8

Confidence

3

Soundness

4

Presentation

3

Contribution

4

Limitations

The authors have adequately addressed the limitations by clearly stating the assumptions.

Reviewer DE6D2024-08-09

Thank you for your responses. Your observation that the effect of p and q is minimal, is actually quite interesting. I would highlight this as a separate result. This is exactly the kind of results that would make the paper more interesting to a broader audience. I still have my doubts that the paper would be interesting to the broader graph ML community but overall this is a solid work and I decided to increase my score.

Reviewer znFf2024-08-12

Thank you for your response. I am slightly more optimistic about two-to-infinity norm consistency, but it was interesting to hear your views. For spectral embedding techniques, results can be shown using Davis-Kahan to get useful bounds. Since node2vec can be equated to a matrix factorisation in certain settings [39], I am hopeful something could be possible. Perhaps, even a CLT style result showing the asymptotic distribution of the node2vec embedding. This motivated my question about clustering algorithms, but I accept that k-means will be good enough if we want most nodes to be correctly labelled as with asymptotic probability 1 as $n \to \infty$. Again, I feel the strength and novelty of this work lies in the Appendix. The paper is an important technique improvement of previous work, although admittedly I am not the intended audience of this work. Thank you for proposing to include further discussion on [10] and [11] in the revised paper. I have improved my score as a result of this rebuttal.

Reviewer NUS82024-08-12

I thank the authors for answering my questions. The comment about extending the consistency result to a growing number of communities sounds interesting. I encourage the authors to elaborate on this in the revised version of the paper. I will keep my score unchanged.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC