Flatten Graphs as Sequences: Transformers are Scalable Graph Generators
Dexiong Chen, Markus Krimmel, Karsten M. Borgwardt
Abstract
We introduce AutoGraph, a scalable autoregressive model for attributed graph generation using decoder-only transformers. By flattening graphs into random sequences of tokens through a reversible process, AutoGraph enables modeling graphs as sequences without relying on additional node features that are expensive to compute, in contrast to diffusion-based approaches. This results in sampling complexity and sequence lengths that scale optimally linearly with the number of edges, making it scalable and efficient for large, sparse graphs. A key success factor of AutoGraph is that its sequence prefixes represent induced subgraphs, creating a direct link to sub-sentences in language modeling. Empirically, AutoGraph achieves state-of-the-art performance on synthetic and molecular benchmarks, with up to 100x faster generation and 3x faster training than leading diffusion models. It also supports substructure-conditioned generation without fine-tuning and shows promising transferability, bridging language modeling and graph generation to lay the groundwork for graph foundation models. Our code is available at https://github.com/BorgwardtLab/AutoGraph.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers4
- Refine Drugs, Don’t Complete Them: Uniform-Source Discrete Flows for Fragment-Based Drug DiscoveryBenno Kaech, Luis Wyss, Karsten Borgwardt, Gianvito GrassoICLR 2026 · 3 citations
- PolyGraph Discrepancy: a classifier-based metric for graph generationMarkus Krimmel, Philip Hartout, Karsten M. Borgwardt, Dexiong ChenICLR 2026 · 3 citations
- Hard-Constrained Graph Generation with Discrete-Projection DiffusionXuesong Zhang, Haifeng Sun, Qi Qi, Shengkuan Li et al.ICML 2026
- SimGFM: Simplifying Discrete Flow Matching for Graph GenerationChunyu Luo, Yuankai Luo, Xiao-Ming Wu, Lei ShiICML 2026
Builds on32
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- Visual Autoregressive Modeling: Scalable Image Generation via Next-Scale PredictionKeyu Tian, Yi Jiang, Zehuan Yuan, Bingyue Peng et al.NeurIPS 2024 · 1,199 citations
- Equivariant Diffusion for Molecule Generation in 3DEmiel Hoogeboom, Victor Garcia Satorras, Clément Vignac, Max WellingICML 2022 · 865 citations
- GraphAF: a Flow-based Autoregressive Model for Molecular Graph GenerationChence Shi, Minkai Xu, Zhaocheng Zhu, Weinan Zhang et al.ICLR 2020 · 532 citations
Related papers
- Pard: Permutation-Invariant Autoregressive Diffusion for Graph GenerationLingxiao Zhao, Xueying Ding, Leman AkogluNeurIPS 2024 · 33 citations
- Graph Generative Pre-trained TransformerXiaohui Chen, Yinkai Wang, Jiaxing He, Yuanqi Du et al.ICML 2025
- Autoregressive Diffusion Model for Graph GenerationLingkai Kong, Jiaming Cui, Haotian Sun, Yuchen Zhuang et al.ICML 2023 · 105 citations
- Scalable Deep Generative Modeling for Sparse GraphsHanjun Dai, Azade Nazi, Yujia Li, Bo Dai et al.ICML 2020 · 95 citations
- From Sequence to Structure: Uncovering Substructure Reasoning in TransformersXinnan Dai, Kai Yang, Jay Revolinsky, Kai Guo et al.NeurIPS 2025 · 3 citations
