Graph Node Embeddings using Domain-Aware Biased Random Walks

Sourav Mukherjee, Tim Oates, Ryan WrightarXiv 2019

Abstract

The recent proliferation of publicly available graph-structured data has sparked an interest in machine learning algorithms for graph data. Since most traditional machine learning algorithms assume data to be tabular, embedding algorithms for mapping graph data to real-valued vector spaces has become an active area of research. Existing graph embedding approaches are based purely on structural information and ignore any semantic information from the underlying domain. In this paper, we demonstrate that semantic information can play a useful role in computing graph embeddings. Specifically, we present a framework for devising embedding strategies aware of domain-specific interpretations of graph nodes and edges, and use knowledge of downstream machine learning tasks to identify relevant graph substructures. Using two real-life domains, we show that our framework yields embeddings that are simple to implement and yet achieve equal or greater accuracy in machine learning tasks compared to domain independent approaches.

Introduction

As graph-structured data becomes increasingly prevalent in fields ranging from social network analysis to bioinformatics, the need for effective machine learning techniques on graphs has grown. Most standard machine learning models, however, require input in the form of fixed-length feature vectors. This has led to the development of graph embedding techniques, such as DeepWalk and node2vec, which transform nodes into a continuous vector space.

While these methods are powerful, they are largely domain-agnostic. They rely on the structural topology of the graph—using random walks to capture neighborhood information—while ignoring the semantic meaning of the nodes and edges. This paper argues that incorporating domain-specific knowledge into the embedding process can significantly improve the performance of downstream machine learning tasks.

The Problem: Structural vs. Semantic Information

Traditional embedding methods treat every node and edge as an abstract symbol. In a Resource Description Format (RDF) graph, this means the algorithm treats a "co-author" relationship the same way it treats a "department affiliation" relationship, provided their structural properties (like frequency or connectivity) are similar.

However, in many real-world applications, certain relationships are "noisier" than others for specific tasks. For instance, if the goal is to predict a researcher's department, their co-authorship with external researchers might be a misleading signal, whereas their project affiliations are highly relevant. Domain-independent strategies often fail to make this distinction, potentially leading to suboptimal embeddings.

The Domain-Aware RDF2Vec Framework

To address this, the authors propose a four-step framework for generating Domain-Aware Biased RDF2Vec embeddings:

  1. Data Exploration: The researcher identifies the various entity types (nodes) and relationship types (edges/predicates) within the graph schema.
  2. Attribute Selection: Based on the specific downstream task (e.g., classification), the researcher identifies which attributes or relationships are likely to be most informative.
  3. Strategy Definition: A weighting function is created to bias the random walks. Unlike structural biases that rely on global statistics (like how often a predicate appears in the whole graph), these semantic biases are based on local rules—favoring or avoiding specific edge labels or node types.
  4. Evaluation: The biased walks are used to train a Word2vec model, and the resulting embeddings are tested on a supervised learning task.

Experimental Evaluation

The framework was evaluated on two distinct RDF datasets:

  • AIFB Dataset: This dataset contains information about a research institute, including personnel, projects, and publications. The task was to predict the research group affiliation of individuals.
  • BGS Dataset: Provided by the British Geological Society, this dataset documents rock units in Great Britain. The task was to predict the "lithogenesis" (the formation process) of specific rock units.

Key Results

The results demonstrated that domain awareness provides a significant advantage, particularly when the researcher has deep knowledge of the data's context.

  • AIFB Results: The domain-aware approach showed a dramatic improvement. A standard uniform random walk achieved 68.64% accuracy. By implementing a strategy that prioritized affiliation edges and avoided noisy publication nodes, the accuracy rose to 99.86%. This outperformed the best domain-independent strategy (Object Frequency), which only reached 77.42%.
  • BGS Results: In the geology domain, the results were more competitive. The best domain-aware strategy achieved 90.07% accuracy. While this was a high mark, it was slightly lower than the best domain-independent strategy (Inverse Predicate Frequency at 93.10%), suggesting that the researchers' domain expertise in geology may have been less precise than their expertise in the academic domain.

Insights and Limitations

The study highlights that "knowing what the data means" allows for more efficient and accurate embeddings. Domain-aware strategies are computationally efficient because they rely on local node/edge types rather than global graph statistics.

However, the approach has two primary limitations. First, it requires a human-in-the-loop; a researcher must understand the data schema to define the biases. Second, it involves manual tuning of weights and hyperparameters. Future research could focus on automating the selection of these semantic biases through hyperparameter optimization or meta-learning.

Conclusion

By moving beyond purely structural analysis and incorporating semantic rules, domain-aware biased random walks offer a powerful way to tailor graph embeddings to specific tasks. The framework demonstrates that even simple semantic rules—such as avoiding known "noisy" nodes—can lead to substantial gains in predictive accuracy, particularly in complex, multi-relational datasets.

Summary updated

BibTeX
@misc{mukherjee2019graph,
  author = {Sourav Mukherjee and Tim Oates and Ryan Wright},
  title = {{Graph Node Embeddings using Domain-Aware Biased Random Walks}},
  year = {2019},
  eprint = {1908.02947},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.02947},
}
Figure