Robust Negative Sampling for Network Embedding.

Mohammadreza Armandpour, Patrick Ding, Jianhua Huang, Xia HuAAAI 2019

Abstract

Many recent network embedding algorithms use negative sampling (NS) to approximate a variant of the computationally expensive Skip-Gram neural network architecture (SGA) objective. In this paper, we provide theoretical arguments that reveal how NS can fail to properly estimate the SGA objective, and why it is not a suitable candidate for the network embedding problem as a distinct objective. We show NS can learn undesirable embeddings, as the result of the “Popular Neighbor Problem.” We use the theory to develop a new method “R-NS” that alleviates the problems of NS by using a more intelligent negative sampling scheme and careful penalization of the embeddings. R-NS is scalable to large-scale networks, and we empirically demonstrate the superiority of R-NS over NS for multi-label classification on a variety of real-world networks including social networks and language networks.

Introduction

Network embedding aims to map nodes in a graph into a low-dimensional space where structural similarities are preserved. Most state-of-the-art methods, such as LINE, DeepWalk, and Node2vec, rely on the Skip-Gram Architecture (SGA) optimized via Negative Sampling (NS). While NS is a popular computational shortcut, it is fundamentally different from the SGA objective it attempts to mimic. We identify a critical flaw in standard NS termed the Popular Neighbor Problem, which leads to poor-quality representations for high-degree nodes.

In standard NS, negative samples are typically drawn from the entire node population based on their degree distribution. Consequently, high-degree nodes are frequently selected as negative samples for their own neighbors. This creates a "tug-of-war" during training: the algorithm simultaneously attempts to pull a node closer to its popular neighbors (positive signal) and push it further away (negative signal). This conflict causes the embedding vectors of popular nodes to "over-shrink," resulting in small norms that are difficult to distinguish or classify.

The R-NS Method

We propose Robust Negative Sampling (R-NS) to mitigate these issues through two primary innovations:

  1. Distant Sampling: Unlike standard NS, R-NS ensures that a node’s actual neighbors are never selected as negative samples. This eliminates the contradictory training signals inherent in the Popular Neighbor Problem.
  2. Explicit Norm Penalization: Removing neighbors from the negative pool eliminates the implicit regularization (shrinkage) provided by standard NS. To compensate, R-NS introduces an explicit $L_2$ penalty on the embedding norms.

A key contribution of our work is the derivation of a closed-form formula for the penalty coefficient $\lambda$. By basing $\lambda$ on intrinsic graph properties—such as the number of edges, average edge weight, and graph density—R-NS becomes a truly unsupervised method that is robust across different network types without requiring manual hyperparameter tuning.

Experimental Evaluation

We evaluated R-NS on three large-scale real-world networks: BlogCatalog (social network), Flickr (user interaction network), and Wikipedia (word co-occurrence network).

Performance comparison of R-NS against baselines across different training ratios for Micro-F1 and Macro-F1 metrics.

As illustrated in Figure 1, R-NS consistently outperforms standard NS and other variants across all datasets and training ratios. The performance gains are particularly pronounced in low-data regimes; for instance, on the Flickr dataset, R-NS outperformed NS by 126% when only 10% of training labels were available.

Summary of performance metrics (Micro-F1 / Macro-F1) and automatically derived penalty coefficients (λ) for R-NS and baseline algorithms.

The results summarized in Figure 4 confirm the effectiveness of the derived $\lambda$ formula. R-NS maintained superior performance across varying amounts of labeled data without the need for manual parameter sweeps. On the BlogCatalog dataset using Type II embeddings, R-NS improved the Micro-F1 score by 94% over standard NS.

Conclusion

R-NS addresses the fundamental limitations of negative sampling in network embedding by resolving the Popular Neighbor Problem. Through distant sampling and theoretically grounded norm penalization, R-NS produces more expressive and robust embeddings. Future work will investigate the application of R-NS in Natural Language Processing and explore incorporating higher-order structural information into the negative sampling process.

Summary updated

BibTeX
@inproceedings{armandpour2019robust,
  author = {Mohammadreza Armandpour and Patrick Ding and Jianhua Huang and Xia Hu},
  title = {{Robust Negative Sampling for Network Embedding.}},
  booktitle = {AAAI},
  year = {2019},
  url = {https://openreview.net/forum?id=HoxlE7MzxdTB},
}
Figure