[Paper Review] Understanding Negative Sampling in Graph Representation Learning
This paper theoretically analyzes negative sampling in graph representation learning, demonstrating that an optimal negative sampling distribution should be sub-linearly correlated to the positive distribution (i.e., $p_n(u|v) \propto p_d(u|v)^\alpha$ with $0 < \alpha < 1$). It proposes MCNS, a scalable negative sampling method using self-contrast approximation and Metropolis-Hastings sampling, which significantly improves performance across link prediction, node classification, and recommendation tasks on five datasets with diverse GNN and network embedding models.
Graph representation learning has been extensively studied in recent years. Despite its potential in generating continuous embeddings for various networks, both the effectiveness and efficiency to infer high-quality representations toward large corpus of nodes are still challenging. Sampling is a critical point to achieve the performance goals. Prior arts usually focus on sampling positive node pairs, while the strategy for negative sampling is left insufficiently explored. To bridge the gap, we systematically analyze the role of negative sampling from the perspectives of both objective and risk, theoretically demonstrating that negative sampling is as important as positive sampling in determining the optimization objective and the resulted variance. To the best of our knowledge, we are the first to derive the theory and quantify that the negative sampling distribution should be positively but sub-linearly correlated to their positive sampling distribution. With the guidance of the theory, we propose MCNS, approximating the positive distribution with self-contrast approximation and accelerating negative sampling by Metropolis-Hastings. We evaluate our method on 5 datasets that cover extensive downstream graph learning tasks, including link prediction, node classification and personalized recommendation, on a total of 19 experimental settings. These relatively comprehensive experimental results demonstrate its robustness and superiorities.
Motivation & Objective
- To systematically analyze the role of negative sampling in graph representation learning from both optimization objective and risk perspectives.
- To identify the theoretical conditions under which negative sampling minimizes variance and optimizes the learning objective.
- To derive a principled negative sampling distribution that is sub-linearly correlated to the positive sampling distribution.
- To develop a scalable and effective negative sampling strategy that leverages theoretical insights for improved downstream performance.
- To empirically validate the superiority of the proposed method across diverse graph learning tasks and architectures.
Proposed method
- Theoretical analysis shows that negative sampling is as critical as positive sampling in shaping the optimization objective and minimizing estimation variance.
- The paper derives the optimal negative sampling distribution as $p_n(u|v) \propto p_d(u|v)^\alpha$ with $0 < \alpha < 1$, where $p_d(u|v)$ is the positive sampling distribution.
- MCNS approximates the ideal positive distribution using self-contrast from current node embeddings to guide negative sampling.
- A Metropolis-Hastings algorithm is employed to accelerate sampling, leveraging local graph structure to skip burn-in and maintain efficiency.
- The method exploits the Markov property of adjacent nodes to ensure fast mixing and high-quality negative samples without performance degradation.
- The approach is compatible with both GNNs and traditional network embedding models, enabling broad applicability.
Experimental results
Research questions
- RQ1What is the theoretical impact of negative sampling on the optimization objective and estimation variance in graph representation learning?
- RQ2How should the negative sampling distribution be designed relative to the positive sampling distribution to minimize risk and improve performance?
- RQ3Can a principled negative sampling strategy outperform heuristic defaults like degree-based sampling in diverse downstream tasks?
- RQ4To what extent does the proposed method improve performance across different graph learning models and datasets?
- RQ5How does mismatched negative sampling (e.g., sampling distant nodes) affect model performance, and can this be quantitatively explained?
Key findings
- The optimal negative sampling distribution is sub-linearly correlated to the positive distribution, contradicting the common intuition of sampling distant nodes.
- MCNS significantly outperforms eight existing negative sampling strategies across 19 experimental settings on five real-world datasets.
- Performance improves with increased negative sampling count $k$ up to a point, after which bias from higher $k$ degrades performance, validating the theoretical risk trade-off.
- Sampling distant nodes with low $p_d(u)$ leads to performance degradation, confirming the theory that mismatched negative distributions harm learning.
- The inverseDNS strategy, which samples from low-probability items, shows decreasing MRR and Hits@k as candidate size $M$ increases, empirically validating the theory.
- MCNS maintains high performance across diverse models (e.g., GraphSAGE, GCN) and tasks (link prediction, node classification, recommendation), demonstrating robustness.
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.