SENSE: Semantically Enhanced Node Sequence Embedding

Swati Rallapalli, Liang Ma, Mudhakar Srivatsa, Ananthram Swami, Heesung Kwon, Graham A. Bent, Christopher Simpkin · DOI

Abstract

Effectively capturing graph node sequences in the form of vector embeddings is critical to many applications. We achieve this by (i) first learning vector embeddings of single graph nodes and (ii) then composing them to compactly represent node sequences. Specifically, we propose SENSE-S (Semantically Enhanced Node Sequence Embedding - for Single nodes), a skip-gram based novel embedding mechanism, for single graph nodes that co-learns graph structure as well as their textual descriptions. We demonstrate that SENSE-S vectors increase the accuracy of multi-label classification tasks by up to 50% and link-prediction tasks by up to 78% under a variety of scenarios using real datasets. Based on SENSE-S, we next propose generic SENSE to compute composite vectors that represent a sequence of nodes, where preserving the node order is important. We prove that this approach is efficient in embedding node sequences, and our experiments on real data confirm its high accuracy in node order decoding.

Introduction

In graph machine learning, embedding single nodes is a well-studied problem. However, many real-world applications—such as recommended reading paths on Wikipedia or API call sequences in software—depend on sequences of nodes. SENSE addresses two primary challenges in this domain: capturing semantic richness from node descriptions and preserving structural order without causing vector size to explode.

Methodology

The SENSE framework utilizes a two-stage approach to generate high-fidelity sequence embeddings.

1. SENSE-S: Single Node Embedding

Unlike traditional methods that train text and graph embeddings in isolation, SENSE-S employs a joint skip-gram architecture. As shown in Figure 1, the model takes a pair consisting of a node $v$ and a word $\phi$ from its description. It simultaneously predicts neighboring words and neighboring nodes, resulting in a "semantically enhanced" vector where graph topology and textual context are baked into the same latent space.

The SENSE-S joint skip-gram architecture for co-learning node and word embeddings.

2. SENSE: Sequence Embedding

To represent a sequence $v_1 \to v_2 \to \dots \to v_q$ as a fixed-length vector, SENSE introduces Vector Cyclic Shifting. The $i$-th node in a sequence is cyclically shifted by $i-1$ positions before being summed into the final sequence vector. This technique leverages the quasi-orthogonality of high-dimensional vectors, allowing the original sequence to be decoded with high accuracy by checking the inner product of shifted node vectors against the aggregate sequence vector.

Experimental Evaluation

The model was evaluated using the Wikispeedia dataset (4,604 articles) and the Physics Citation Network (27,770 papers). These datasets provide a mix of rich textual descriptions and complex structural links.

Key Results

  • Multi-label Classification: SENSE-S significantly outperformed baselines. On Wikispeedia, it improved accuracy by up to 50% compared to structure-only models (node2vec) or text-only models (paragraph2vec). Figure 2 illustrates the consistently lower error rates of SENSE-S across various training/test splits.
  • Link Prediction: On the Physics Citation dataset, SENSE-S achieved up to a 78% improvement over state-of-the-art baselines.
  • Sequence Decoding: For a vector dimension of 1024, the model decoded sequences of length 10 with nearly 100% accuracy.
Multi-label classification error rates across different training/test ratios, showing SENSE-S variants outperforming baselines.

Conclusion

SENSE demonstrates that co-learning text and graph patterns is superior to iterative learning. By using cyclic shifting as a computationally efficient positional encoding, SENSE provides a robust solution for embedding node sequences that preserves both meaning and order. Future work may explore more complex compositional operators to represent even longer paths in a compressed format.

Summary updated

BibTeX
@inproceedings{rallapalli2019sense,
  author = {Swati Rallapalli and Liang Ma and Mudhakar Srivatsa and Ananthram Swami and Heesung Kwon and Graham A. Bent and Christopher Simpkin},
  title = {{SENSE: Semantically Enhanced Node Sequence Embedding}},
  booktitle = {IEEE BigData},
  year = {2019},
  doi = {10.1109/bigdata47090.2019.9006591},
}
Figure