[Paper Review] Comprehend DeepWalk as Matrix Factorization
This paper demonstrates that DeepWalk is mathematically equivalent to matrix factorization, where node embeddings are learned by factorizing a matrix M whose entries represent the logarithm of the expected number of times a node appears as a context node within a fixed window during random walks. The key contribution is showing that both Negative Sampling and Softmax variants of DeepWalk implicitly factorize a matrix derived from node-context co-occurrence statistics, with M capturing the logarithm of the average random walk transition probability between nodes.
Word2vec, as an efficient tool for learning vector representation of words has shown its effectiveness in many natural language processing tasks. Mikolov et al. issued Skip-Gram and Negative Sampling model for developing this toolbox. Perozzi et al. introduced the Skip-Gram model into the study of social network for the first time, and designed an algorithm named DeepWalk for learning node embedding on a graph. We prove that the DeepWalk algorithm is actually factoring a matrix M where each entry M_{ij} is logarithm of the average probability that node i randomly walks to node j in fix steps.
Motivation & Objective
- To formalize the mathematical equivalence between DeepWalk and matrix factorization.
- To analyze how the Skip-Gram with Negative Sampling and Softmax variants of DeepWalk implicitly factorize a matrix M.
- To interpret the entries of M as logarithmic transformations of expected random walk transition probabilities between nodes.
- To clarify the role of sampling strategies and normalization in shaping the learned node representations.
Proposed method
- Derive the objective function for Skip-Gram with Negative Sampling and show that optimizing it leads to an implicit matrix factorization of a PMI-like matrix.
- Formulate the Softmax-based objective function and demonstrate that its optimal solution yields a matrix M whose entries are the logarithm of the conditional probability of node-context co-occurrence.
- Define matrix M as M_ij = log(#(v_i,c_j)/#(v_i)) + b_v_i, where b_v_i is a node-specific bias term.
- Use the idealized random walk sampling process to show that #(v_i,c_j)/#(v_i) approximates the average probability of reaching node j from node i in t steps.
- Establish that M_ij is proportional to the logarithm of the expected number of times node j appears in the context window of node i during random walks.
- Prove that the matrix factorization is equivalent to learning a low-rank approximation of the logarithmic co-occurrence matrix, linking DeepWalk to classical matrix factorization.
Experimental results
Research questions
- RQ1How does the Skip-Gram model with Negative Sampling in DeepWalk relate to matrix factorization?
- RQ2What matrix is implicitly being factorized during DeepWalk training under the Negative Sampling objective?
- RQ3How does the Softmax variant of DeepWalk compare to Negative Sampling in terms of the underlying matrix factorization?
- RQ4What is the probabilistic interpretation of the entries in the matrix M learned by DeepWalk?
- RQ5How do random walk sampling strategies affect the structure of the matrix M?
Key findings
- The DeepWalk algorithm with Negative Sampling implicitly factorizes a matrix M where each entry M_ij is the Pointwise Mutual Information (PMI) of node-context pair (v_i, c_j), shifted by log k.
- For the Softmax variant, the optimal embedding dot product satisfies v_i · c_j = log(#(v_i,c_j)/#(v_i)) + b_v_i, showing that M_ij is the logarithm of the conditional co-occurrence probability.
- Under ideal random walk sampling, the ratio #(v_i,c_j)/#(v_i) corresponds to the average probability that node j appears within a window of size t around node i.
- The matrix M_ij = log(#(v_i,c_j)/#(v_i)) is equivalent to the logarithm of the average transition probability from node i to node j in t steps via random walks.
- When normalized with b_v_i = log(2t), M_ij becomes the logarithm of the expected number of times node j appears in the context of node i.
- The paper establishes that DeepWalk is fundamentally a matrix factorization method operating on a logarithmic transformation of node-context co-occurrence statistics.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.