Abstract
In recent years, network embedding methods have garnered increasing attention because of their effectiveness in various information retrieval tasks. The goal is to learn low-dimensional representations of vertexes in an information network and simultaneously capture and preserve the network structure. Critical to the performance of a network embedding method is how the edges/vertexes of the network is sampled for the learning process. Many existing methods adopt a uniform sampling method to reduce learning complexity, but when the network is non-uniform (i.e. a weighted network) such uniform sampling incurs information loss. The goal of this paper is to present a generalized vertex sampling framework that works seamlessly with most existing network embedding methods to support weighted instead of uniform vertex/edge sampling. For efficiency, we propose a delicate sequential vertex-to-context graph data structure, such that sampling a training pair for learning takes only constant time. For scalability and memory efficiency, we design the graph data structure in a way that keeps space consumption low without requiring additional space. In addition to implementing existing network embedding methods, the proposed framework can be used to implement extensions that feature high-order proximity modeling and weighted relation modeling. Experiments conducted on three datasets, including a commercial large-scale one, verify the effectiveness and efficiency of the proposed weighted network embedding methods on a variety of tasks, including word similarity search, multi-label classification, and item recommendation.
Introduction
Network embedding aims to transform nodes in a graph into low-dimensional vectors that preserve the graph's structural properties. While early methods like DeepWalk and node2vec were revolutionary, they often relied on uniform sampling, treating every connection as equally important. In real-world scenarios, networks are rarely uniform. For example, in a music streaming service, a user might listen to one song 100 times and another only once. Ignoring these weights (edge strengths) leads to significant information loss. This paper introduces the Vertex-to-Context Sampling (VCS) framework, a highly efficient approach for weighted network embedding that accounts for edge strengths without the massive memory and computational overhead typically required.
The Challenge of Weighted Sampling
Weighted sampling is traditionally computationally expensive. Storing complex transition distributions for every node can lead to "memory bloat," often exceeding the RAM of standard servers. Existing weighted sampling methods, such as those used in node2vec, require extensive edge-edge transition tables to simulate biased random walks. This complexity makes it difficult to scale to massive, production-level graphs.
As shown in Figure 5, while LINE (a) uses a simpler edge-based sampling, node2vec (b) relies on a more intricate structure that tracks transitions between edges. The VCS framework aims to simplify this by decoupling the sampling logic from the embedding model, maintaining a space complexity of only $O(|V| + |E|)$.
The Vertex-Context Sampling (VCS) Framework
The core innovation of VCS is a sequential vertex-to-context graph data structure combined with the Alias Method. The Alias Method is a clever algorithm for sampling from a discrete distribution in constant $O(1)$ time.
Figure 1 illustrates how the Alias Method (3) compares to continuous integer (1) and cumulative distribution function (2) sampling. By redistributing weights into equal-sized bins, the Alias Method allows the system to sample a training pair in constant time, regardless of the network's size or weight distribution. This efficiency allows the authors to implement weighted versions of popular algorithms like VCS-DeepWalk, VCS-LINE, and VCS-HPE seamlessly.
Experimental Results
The researchers evaluated the VCS framework on three large-scale datasets: wiki-text9, MovieLens-latest, and KKBOX (a commercial music streaming dataset).
- Performance Boost: On the KKBOX online recommendation task, the weighted VCS-HPE achieved a 14.5% mAP, nearly doubling the 6.8% achieved by the standard uniform DeepWalk.
- Memory Efficiency: The VCS approach used significantly less memory than node2vec. On the MovieLens dataset, node2vec required nearly an order of magnitude more RAM due to its complex transition tables.
- Weighting Insights: In preference networks like MovieLens, the authors found that weighting rare items more heavily (using "Rating-IRF") performed best. This suggests that a user's interest in an obscure indie film is a much stronger signal of their specific taste than their interest in a global blockbuster.
Conclusion
The VCS framework demonstrates that varying edge weights are critical signals for capturing the "locality" of a vertex. By creating a generalized sampling framework that is decoupled from the specific embedding model, the authors prove that high-order proximity and weighted relations can be modeled efficiently at scale. Future work will explore extending this sampling logic to neural network and matrix factorization-based embeddings.
Summary updated