cs.LGMar 11, 2026

Graph Tokenization for Bridging Graphs and Transformers

Authors: Zeyuan Guo, Enmao Diao, Cheng Yang, Chuan Shi

Organizations: Beijing University of Posts and Telecom., Beijing 100876, China · DreamSoul

Abstract

The success of large pretrained Transformers is closely tied to tokenizers, which convert raw input into discrete symbols. Extending these models to graph-structured data remains a significant challenge. In this work, we introduce a graph tokenization framework that generates sequential representations of graphs by combining reversible graph serialization, which preserves graph information, with Byte Pair Encoding (BPE), a widely adopted tokenizer in large language models (LLMs). To better capture structural information, the graph serialization process is guided by global statistics of graph substructures, ensuring that frequently occurring substructures appear more often in the sequence and can be merged by BPE into meaningful tokens. Empirical results demonstrate that the proposed tokenizer enables Transformers such as BERT to be directly applied to graph benchmarks without architectural modifications. The proposed approach achieves state-of-the-art results on 14 benchmark datasets and frequently outperforms both graph neural networks and specialized graph transformers. This work bridges the gap between graph-structured data and the ecosystem of sequence models. Our code is available at bluehere.

Figures & tables

Appendix figures & tables21 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Lost in Tokenization: Fundamental Trade-offs in Graph Tokenization for Transformers

    May 21, 2026Maya Bechler-Speicher, Gilad Yehudai, Gil Harari +3Transformer ExpressivityGraph Representation Learning

  2. Riemannian Graph Tokenizer for Structural Knowledge Transfer

    Oct 11, 2026Qimin Zhou, Haibo Liu, Yujie Wang +2Graph Representation LearningCross-Domain Transfer Learning

  3. Teaching LLMs to See Graphs: Unifying Text and Structural Reasoning

    May 11, 2026Dario VajdaLLM Reasoning with GraphsText-Attributed Graph Learning