NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Network Embedding as Matrix Factorization: Unifying DeepWalk, LINE, PTE, and node2vec

Jiezhong Qiu, Yuxiao Dong, Hao Ma, Jian Li, Kuansan Wang, Jie Tang

Introduction

In the mid-2010s, the field of network embedding underwent a paradigm shift. Inspired by the success of word2vec in natural language processing, researchers developed algorithms like DeepWalk, LINE, and node2vec. These methods treat random walks on a graph as "sentences" and nodes as "words," using Skip-Gram with Negative Sampling (SGNS) to learn low-dimensional representations. While empirically powerful, these methods remained "black boxes" with poorly understood mathematical objectives. This work bridges the gap between stochastic walk-based methods and classical matrix factorization, providing a unifying theoretical framework.

Theoretical Unification

The core contribution of this research is the proof that popular network embedding methods are implicitly performing matrix factorization. By leveraging the insight that SGNS is equivalent to factorizing a specific word-context matrix, the authors derive closed-form expressions for the matrices targeted by:

  1. DeepWalk: It factorizes a matrix derived from the average of transition probability matrices across different walk lengths, normalized by the graph's volume.
  2. LINE: This is shown to be a special case of DeepWalk where the context window size ($T$) is exactly one.
  3. PTE: This method is viewed as the joint factorization of multiple network Laplacians in heterogeneous networks.
  4. node2vec: It factorizes a complex matrix involving the stationary distribution and transition tensors of second-order random walks.

NetMF: Explicit Matrix Factorization

Building on these theoretical derivations, the authors propose NetMF (Network Matrix Factorization). Unlike traditional methods that rely on millions of stochastic random walks, NetMF explicitly constructs the target matrix and applies Singular Value Decomposition (SVD) to find embeddings. This approach eliminates the variance inherent in random walk sampling. For large context windows where the matrix becomes dense, NetMF utilizes an approximation algorithm based on the top eigenvalues of the normalized graph Laplacian.

DeepWalk as a Spectral Filter

A significant insight from this unification is the interpretation of DeepWalk as a "low-pass filter" on the graph's spectrum. The model inherently prefers large positive eigenvalues of the normalized adjacency matrix. As the context window size $T$ increases, this filtering effect intensifies, explaining why larger windows are more effective at capturing global community structures.

DeepWalk as a spectral filter: (a) shows the filtering function for different window sizes T; (b) shows the actual eigenvalues of the Cora network before and after filtering.

Experimental Results

NetMF was evaluated against state-of-the-art baselines on four real-world datasets: BlogCatalog, PPI, Wikipedia, and Flickr. The results demonstrate that explicit factorization consistently outperforms stochastic approximations.

On the PPI dataset, NetMF achieved a Micro-F1 score improvement of over 50% compared to DeepWalk when only 10% of nodes were labeled. Similarly, on the Flickr dataset, NetMF maintained a significant performance lead across various training ratios.

Predictive performance on the Flickr dataset. NetMF (blue squares) consistently outperforms DeepWalk (red triangles) and LINE (purple crosses).

Conclusion and Future Directions

By unifying disparate network embedding methods under the umbrella of matrix factorization, this work provides both theoretical clarity and a superior algorithm in NetMF. However, challenges remain. The element-wise logarithm required in the derived matrices results in dense structures that are computationally expensive for massive graphs. Future work involves scaling these explicit factorization techniques to graphs with billions of edges and refining the matrix forms for second-order dynamics like those in node2vec.

Summary updated

BibTeX
@inproceedings{qiu2017network,
  author = {Jiezhong Qiu and Yuxiao Dong and Hao Ma and Jian Li and Kuansan Wang and Jie Tang},
  title = {{Network Embedding as Matrix Factorization: Unifying DeepWalk, LINE, PTE, and node2vec}},
  booktitle = {WSDM},
  year = {2017},
  doi = {10.1145/3159652.3159706},
}
Figure