BiasedWalk: Learning Global-aware Node Embeddings via Biased Sampling

Zhengrong Xue, Ziao Guo, Yiwei GuoarXiv 2022

Abstract: Popular node embedding methods such as DeepWalk follow the paradigm of performing random walks on the graph, and then requiring each node to be proximate to those appearing along with it. Though proved to be successful in various tasks, this paradigm reduces a graph with topology to a set of sequential sentences, thus omitting global information. To produce global-aware node embeddings, we propose BiasedWalk (originally referred to as GlobalWalk), a biased random walk strategy that favors nodes with similar semantics. Empirical evidence suggests BiasedWalk can generally enhance global awareness of the generated embeddings.

Introduction: Beyond Local Proximity

In the world of graph machine learning, the prevailing philosophy is that "you are who you associate with." This drives popular node embedding methods like DeepWalk and node2vec. By performing random walks across a graph, these algorithms treat nodes like words in a sentence, learning to represent them based on their immediate neighbors.

However, graphs are not just long strings of words; they possess complex, global structures—communities, clusters, and hierarchies—that simple random walks often overlook. BiasedWalk introduces a way to help these random walkers find their global bearings by incorporating semantic awareness into the sampling process.

The Problem: Local vs. Global Awareness

Traditional node embedding methods are excellent at capturing local proximity—knowing who your immediate "friends" are. But they struggle with global awareness. In a social network, for instance, you might have a "friend" who is a random acquaintance (a "coincidence"), while your family members and colleagues represent your core communities (a "necessity").

Conceptual social network showing local communities (Family, University) and global bridges (Pen Friend).

Standard random walks treat these connections with equal weight, effectively "flattening" the graph into a sequence and losing the community context. While some existing methods try to fix this by explicitly modeling communities, they often require researchers to guess the number of communities beforehand or rely on overly complex architectures that don't generalize well.

Methodology: Semantic Biased Walk

The core innovation of BiasedWalk is the Semantic Biased Walk. Instead of walking blindly, the algorithm uses the current state of the node embeddings to decide where to go next.

  1. Semantic Bias: When the walker is at node $u$, the probability of moving to neighbor $v$ is negatively correlated with the Euclidean distance between their embeddings in the latent space. If two nodes look "semantically similar," the walker is more likely to step toward them.
  2. Likelihood Functions: The authors tested several ways to calculate this bias, finding that a shifted exponential function ($p_{exp}(v|u) = c - \exp(\xi(u, v))$) was most effective at gently punishing transitions to semantically distant nodes.
  3. Simulated Annealing: To solve the "chicken-and-egg" problem (needing good embeddings to bias the walk, but needing the biased walk to get good embeddings), BiasedWalk uses simulated annealing. In early training, it acts like a standard uniform random walk. As training progresses, it gradually increases the weight of the semantic bias as the embeddings become more trustworthy.

Empirical Results

The authors evaluated BiasedWalk on several standard benchmarks, including Politicalbooks, Football, PoliticalBlogs, and email-Eu-core.

Community Detection

BiasedWalk outperformed DeepWalk and node2vec on three out of four datasets in terms of Accuracy (ACC). By biasing walks toward "necessary" links (nodes belonging to the same community), the model reinforces the global structure in the embedding space.

Accuracy comparison for community detection across four benchmark datasets.

The model showed comparable performance to baselines in link prediction (AUC). However, a fundamental trade-off was noted: focusing heavily on global community structure can sometimes slightly reduce the precision of predicting very specific local links. Qualitatively, visualizations of the Football dataset showed that BiasedWalk produces much tighter, more distinct clusters than its predecessors, making community boundaries visually obvious.

Conclusion and Future Work

BiasedWalk provides a prior-free way to discover graph semantics organically. While effective, the authors acknowledge a tension between local link prediction and global community awareness. Future work may involve more sophisticated ways to balance these objectives and scaling the distance-based bias calculation to billion-node graphs using approximation techniques.

Summary updated

BibTeX
@misc{xue2022biasedwalk,
  author = {Zhengrong Xue and Ziao Guo and Yiwei Guo},
  title = {{BiasedWalk: Learning Global-aware Node Embeddings via Biased Sampling}},
  year = {2022},
  eprint = {2201.09882},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.09882},
}
Figure