Graph Traversal with Tensor Functionals: A Meta-Algorithm for Scalable Learning

Elan Sopher Markowitz, Keshav Balasubramanian, Mehrnoosh Mirtaheri, Sami Abu-El-Haija, Bryan Perozzi, Greg Ver Steeg, Aram Galstyan

Introduction

Graph Representation Learning (GRL) encompasses a diverse set of techniques that are primarily split into two distinct families: Message Passing (MP) networks (like Graph Convolutional Networks) and Node Embedding (NE) methods (like node2vec). Historically, these families have been implemented using entirely different programming paradigms, making unified research and deployment challenging.

Furthermore, scaling these algorithms to massive graphs is notoriously difficult. Full-batch MP methods require processing the entire graph at once, frequently leading to memory exhaustion. Conversely, NE methods often require a slow, multi-step pipeline of pre-sampling and saving random walks to disk before training can even begin. Existing software frameworks, such as PyTorch Geometric (PyG) or DGL, standardize data formats but largely re-implement these algorithms as-is, inheriting their original scalability bottlenecks.

To address this, researchers have introduced Graph Traversal via Tensor Functionals (GTTF), a unifying meta-algorithm that uses tensor operations to perform stochastic graph traversals. GTTF allows researchers to implement, scale, and accelerate a wide variety of GRL methods with just a few lines of code, outperforming heavily optimized libraries in both speed and memory.

Methodology: The GTTF Meta-Algorithm

Instead of abstracting the model computation (as standard message-passing frameworks do), GTTF abstracts the learning algorithm itself into a stochastic graph traversal process. This is achieved through two primary components:

1. CompactAdj Data Structure GTTF relies on a highly efficient sparse tensor representation of the adjacency matrix called CompactAdj. This structure allows standard, highly optimized tensor operations to sample neighbors in parallel, bypassing the need for slow, iterative graph processing.

CompactAdj Data Structure

2. The GTTF Functional At its core, GTTF is a recursive algorithm that builds a "walk forest"—a tree of sampled neighbors starting from a batch of seed nodes.

Walk Forest Generation

The functional accepts two user-defined functions to dictate its behavior:

  • BIASFN: Determines the transition probabilities during the walk (e.g., uniform, weighted, or attention-based).
  • ACCUMULATEFN: Collects the necessary information during the traversal to compute the model's objective (e.g., gathering a sampled adjacency matrix for a GCN, or tracking co-occurrences for DeepWalk).

By simply swapping out these two functions, GTTF can perfectly mimic the expected behavior of a massive variety of GRL algorithms on-the-fly, entirely within standard deep learning frameworks like TensorFlow or PyTorch.

Key Insights

  • Unification through Traversal: Despite their apparent differences, both Message Passing and Node Embedding methods fundamentally rely on graph structure and can be mathematically approximated via stochastic graph traversals.
  • Unbiased Estimation: GTTF's stochastic traversals provide mathematically proven, unbiased gradient estimates of the full-batch objectives for a wide class of GRL methods, with controllable variance.
  • On-the-fly Walk Generation: By using tensor operations to generate walk forests dynamically during training, GTTF eliminates the artificial limits and massive disk I/O bottlenecks of traditional random walk methods.
  • Algorithmic Abstraction: By rewriting the underlying algorithm rather than just porting the math to a new library, previously unscalable methods can suddenly be applied to massive datasets.

Experimental Results

The framework was evaluated across 10 diverse graph datasets (including citation networks, social graphs like Reddit, and e-commerce networks) for Link Prediction, Semi-Supervised Classification, and Fully-Supervised Classification.

  • Scaling the Unscalable: GTTF successfully scaled the WYS (Watch Your Step) algorithm to the massive LiveJournal and Reddit datasets, setting new state-of-the-art Link Prediction results. On Reddit, it achieved an ROC-AUC of 98.6, whereas the original WYS implementation simply ran out of memory.
  • Memory Efficiency: When training a standard GCN on the Reddit dataset, GTTF used only 2.44 GB of memory. In contrast, both DGL and PyG ran Out of Memory (OOM).
  • Speed: GTTF trains significantly faster than optimized frameworks. For GraphSAGE on Reddit, GTTF took 1.8 seconds per epoch, compared to 5.8s for PyG and 17.3s for DGL.
  • Accuracy Parity: GTTF implementations of GCN, GraphSAGE, MixHop, GAT, and GCNII matched the predictive accuracy of their original, full-batch, or custom-sampled counterparts, proving that the stochastic approximation does not degrade performance.

Limitations and Future Work

While highly efficient on a single machine, scaling GTTF to extremely massive graphs that exceed single-machine storage requires row-wise partitioning of the adjacency matrix across multiple machines—an NP-hard problem left for future work. Additionally, for models like GAT, uniform sampling might select neighbors with near-zero attention weights, potentially slowing down convergence.

However, GTTF opens exciting new avenues for research. Because the framework exposes traversal parameters (like $p$ and $q$ in node2vec) directly to the objective function, these parameters theoretically become trainable via gradient descent, eliminating the need for tedious grid searches in the future.

Summary updated

BibTeX
@inproceedings{markowitz2021graph,
  author = {Elan Sopher Markowitz and Keshav Balasubramanian and Mehrnoosh Mirtaheri and Sami Abu-El-Haija and Bryan Perozzi and Greg Ver Steeg and Aram Galstyan},
  title = {{Graph Traversal with Tensor Functionals: A Meta-Algorithm for Scalable Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure