Best of Both Worlds: Advantages of Hybrid Graph Sequence Models

Ali Behrouz, Ali Parviz, Mahdi Karami, Clayton Sanford, Bryan Perozzi +1 more
11/23/2024
cs.LGcs.SI

No official code found. Best implementation: hugoaslm/GSM-Graph-Sequence-Model (0 stars, last commit 2025-12-27).

Abstract

Modern sequence models (e.g., Transformers, linear RNNs, etc.) emerged as dominant backbones of recent deep learning frameworks, mainly due to their efficiency, representational power, and/or ability to capture long-range dependencies. Adopting these sequence models for graph-structured data has recently gained popularity as the alternative to Message Passing Neural Networks (MPNNs). There is, however, a lack of a common foundation about what constitutes a good graph sequence model, and a mathematical description of the benefits and deficiencies in adopting different sequence models for learning on graphs. To this end, we first present Graph Sequence Model (GSM), a unifying framework for adopting sequence models for graphs, consisting of three main steps: (1) Tokenization, which translates the graph into a set of sequences; (2) Local Encoding, which encodes local neighborhoods around each node; and (3) Global Encoding, which employs a scalable sequence model to capture long-range dependencies within the sequences. This framework allows us to understand, evaluate, and compare the power of different sequence model backbones in graph tasks. Our theoretical evaluations of the representation power of Transformers and modern recurrent models through the lens of global and local graph tasks show that there are both negative and positive sides for both types of models. Building on this observation, we present GSM++, a fast hybrid model that uses the Hierarchical Affinity Clustering (HAC) algorithm to tokenize the graph into hierarchical sequences, and then employs a hybrid architecture of Transformer to encode these sequences. Our theoretical and experimental results support the design of GSM++, showing that GSM++ outperforms baselines in most benchmark evaluations.

View on arXivView PDF

Code Implementations(1)

Reproduction of experiments from the paper "Best of Both Worlds: Advantages of Hybrid Graph Sequence Models". We implement GSM++, a hybrid architecture that leverages robust sequence modeling for graphs using SSM and Transformer layers

01PythonDec 27, 20259 months ago

Similar Papers

Cite this paper

@article{behrouz2024best,
  title  = {Best of Both Worlds: Advantages of Hybrid Graph Sequence Models},
  author = {Ali Behrouz and Ali Parviz and Mahdi Karami and Clayton Sanford and Bryan Perozzi and Vahab Mirrokni},
  year   = {2024},
  eprint = {2411.15671},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.15671v1},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.15671.svg)](https://codeofpaper.com/paper/2411.15671)

Discussion