Learning Graph-Level Representations with Gated Recurrent Neural Networks

Yu Jin, Joseph F. JáJáarXiv 2018

Abstract

Graph-level representation learning is a critical task for applications such as chemical property prediction and protein classification. Traditional methods often struggle with the irregular structure of graphs or lose structural information through simple aggregation. This paper introduces GraphLSTM, a framework that transforms graphs into sequences via differentiable random walks. By utilizing Gumbel-Softmax for differentiable sampling and a modified LSTM architecture that incorporates local neighborhood context, the model effectively captures both sequential and topological information. Experimental results on benchmark datasets demonstrate that GraphLSTM achieves state-of-the-art performance with efficient convergence.

Introduction

In machine learning, graphs present a unique challenge due to their irregular, non-grid-like structure. While node-level tasks are well-studied, graph-level tasks—such as determining the toxicity of a molecule—require a single, fixed-length vector representation for the entire graph. Common approaches that aggregate node embeddings via simple summation or averaging often discard vital structural information.

Recurrent Neural Networks (RNNs) are adept at capturing long-range dependencies in sequential data, but graphs lack a natural linear order. This paper addresses the challenge of ordering graph nodes into sequences that an RNN can process effectively, making the ordering process a learnable component of the model rather than a heuristic choice.

Methodology

The proposed GraphLSTM framework consists of a three-stage pipeline designed to bridge the gap between graph topology and sequential processing.

Overview of the GraphLSTM framework: Step 1 involves unsupervised node embedding; Step 2 uses differentiable random walks to generate node sequences; Step 3 processes these sequences with a modified RNN to produce a graph-level representation.

1. Unsupervised Node Embedding

The first stage involves learning initial node representations inspired by the Word2Vec (CBOW) model. The model is trained to predict a node's label based on the embeddings of its neighbors, ensuring that the starting vectors capture the local structural context of each node.

2. Differentiable Random Walks

To convert a graph into a sequence, the authors employ random walks. To make this process end-to-end trainable, they utilize the Gumbel-Softmax distribution. This mathematical technique provides a "soft," differentiable approximation of discrete sampling, allowing the model to learn optimal random walk parameters during the training phase.

3. Modified GraphLSTM Architecture

Standard LSTMs are designed for single-input sequences. To better preserve graph topology, the authors modified the LSTM gates to accept two inputs at each time step: the embedding of the current node ($e_t$) and an aggregated representation of its immediate neighbors ($Nb_t$).

The modified GraphLSTM cell architecture. The red paths highlight the integration of neighbor information ($Nb_t$) into the forget, input, and output gates, allowing the model to maintain topological awareness.

This architectural change ensures that the RNN maintains a sense of the graph's local neighborhood at every step of the sequence, rather than treating the walk as a simple linear string of nodes.

Experimental Evaluation

The model was evaluated on five standard biological and chemical graph classification benchmarks:

  • MUTAG: Small molecules (188 samples).
  • ENZYMES: Protein structures (600 samples).
  • NCI1 & NCI109: Chemical compounds (4,000+ samples each).
  • DD: Large protein structures (1,178 samples).

These datasets serve as standard benchmarks for comparing GraphLSTM against classical graph kernels and modern Graph Convolutional Networks (GCNs).

Results and Discussion

Performance and Efficiency

GraphLSTM demonstrated superior or competitive accuracy compared to state-of-the-art methods like Weisfeiler-Lehman (WL) kernels and Deep Graph CNNs (DGCNN). On the ENZYMES dataset, it achieved 65.33% accuracy, a significant improvement over previous top performers (61.10%). Furthermore, the model exhibited faster convergence, reaching high accuracy in fewer training epochs than models like structure2vec.

Key Insights

  • Non-Associative Aggregation: Unlike permutation-invariant operators (e.g., Sum or Max), the RNN-based approach captures the specific order or path through a graph, which is crucial for tasks like identifying chiral molecules.
  • Learned Trajectories: By making the random walk differentiable, the model learns to prioritize paths that are most informative for the final classification task.
  • Importance of Context: Ablation studies confirmed that pretrained embeddings significantly outperform raw node features, highlighting the necessity of capturing neighborhood context before sequential processing.

Conclusion

GraphLSTM successfully integrates the sequential modeling strengths of RNNs with the structural complexity of graphs. While the model shows robustness to node ordering, future work may address theoretical hurdles regarding graph isomorphism sensitivity and the computational overhead of processing large-scale graphs. The authors also suggest exploring alternative gated architectures, such as GRUs, to further optimize parameter efficiency.

Summary updated

BibTeX
@misc{jin2018learning,
  author = {Yu Jin and Joseph F. JáJá},
  title = {{Learning Graph-Level Representations with Gated Recurrent Neural Networks}},
  year = {2018},
  eprint = {1805.07683},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.07683},
}
Figure