NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Graph Quantized Tokenizers

Limei Wang, Kaveh Hassani, Si Zhang, Dongqi Fu, Baichuan Yuan, Weilin Cong, Zhigang Hua, Hao Wu, Ning Yao, Bo Long

TL;DR

GQT (Graph Quantized Tokenizer) is a novel framework that brings the "tokenization" revolution seen in text and vision to the world of graphs. By using self-supervised learning and Residual Vector Quantization, GQT converts complex graph structures into compact, discrete tokens. This allows vanilla Transformers to achieve state-of-the-art performance across 20 out of 22 benchmarks while reducing memory footprints by up to 270x.

The Tokenization Gap in Graph Learning

Transformers have become the foundational architecture for AI, largely because we have figured out how to efficiently turn text (via Byte-Pair Encoding) and images (via patches) into discrete tokens. Graphs, however, present a much trickier challenge due to their complex, non-Euclidean structures.

Current Graph Transformers (GTs) usually take one of two paths: they either heavily modify the Transformer architecture to bake in structural biases, or they co-train a Graph Neural Network (GNN) alongside the Transformer. Both approaches are computationally expensive and often fail to generalize across different types of graphs. The authors identify a critical "tokenization gap": the field lacks a robust, standalone way to turn a graph into a sequence of informative, discrete tokens that a standard Transformer can digest efficiently.

Introducing GQT: Decoupling Tokenization from Transformers

The authors introduce GQT, a framework that completely decouples the tokenizer from the downstream Transformer.

GQT Architecture Overview

The tokenization and encoding process involves several clever stages:

  1. The Encoder: A Graph Attention Network (GAT) acts as the primary encoder to capture local neighborhood interactions.
  2. Residual Vector Quantization (RVQ): Instead of relying on high-dimensional continuous vectors, GQT uses RVQ to map node representations into a hierarchy of discrete tokens (codebooks). This provides massive data compression and acts as a strong regularizer.
  3. Multi-Task Self-Supervised Learning (SSL): The tokenizer isn't trained on downstream labels. Instead, it uses three SSL objectives to learn robust representations:
  4. Deep Graph Infomax (DGI): Maximizes mutual information between local and global structures.
  5. GraphMAE2: A combination of masked autoencoding and teacher-student distillation.
  6. Commitment Loss: Ensures the learned representations stay close to their assigned codebook entries.
  7. Graph Serialization: To feed the graph into a Transformer, the framework augments it with Semantic Edges (connecting nodes with similar features regardless of physical distance) and uses Personalized PageRank (PPR) to determine the most relevant nodes to include in a sequence for each target node.
  8. Token Modulation: The Transformer doesn't just see raw tokens; it uses a "Structural Gating" mechanism to weight tokens based on their global importance scores.

Key Insights and Performance

The authors evaluated GQT on a massive battery of 22 benchmarks, spanning Long-Range Graph Benchmarks (LRGB), homophilic (local-heavy) datasets, heterophilic (global-heavy) datasets, and large-scale networks like ogbn-products (2.4M nodes).

Performance on Long Range Graph Benchmarks

SOTA Results and Efficiency

  • State-of-the-Art Performance: GQT achieved top-tier results on 20 out of 22 benchmarks, proving its versatility across diverse graph types.
  • Massive Efficiency Gains: For a graph with a million nodes, GQT can achieve up to a 270-fold reduction in memory compared to standard continuous embeddings. On the massive ogbn-products dataset, GQT used only 3 codebooks to achieve top accuracy, representing a 30-fold memory reduction.
  • Inference Speed: The Transformer-based approach with GQT tokens is on par with sparse GAT implementations in speed but requires half the GPU memory.

Why it Works

  • Quantization is a Feature, Not a Bug: Beyond saving memory, the "bottleneck" created by discrete quantization actually helps the model generalize better. It forces the model to ignore noise and focus on the most salient structural features.
  • Decoupling Works: By training the tokenizer separately via SSL, the resulting tokens are robust enough to be used by a simple linear classifier or a vanilla Transformer without needing to re-tune the tokenizer for every new task.
  • Semantic Edges Bridge the Gap: In "heterophilic" graphs (where neighbors are often different from each other), traditional GNNs fail. GQT’s use of semantic edges allows the Transformer to "jump" across the graph to find relevant information that isn't physically connected.

Limitations and Future Work

While training and inference are highly efficient, calculating semantic edges and PPR sequences is a pre-processing step that can be time-consuming for extremely large, dynamic graphs.

Looking ahead, the authors suggest that the next step is exploring GQT for generative graph modeling. Ultimately, the goal is to integrate GQT with Large Language Models (LLMs) to create true "Graph Foundational Models" capable of reasoning across text and complex structural data in a shared, discrete token space.

Summary updated

BibTeX
@inproceedings{wang2025learning,
  author = {Limei Wang and Kaveh Hassani and Si Zhang and Dongqi Fu and Baichuan Yuan and Weilin Cong and Zhigang Hua and Hao Wu and Ning Yao and Bo Long},
  title = {{Learning Graph Quantized Tokenizers}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=oYSsbY3G4o},
}
Figure