arXiv:2609.05328cs.LGSep 2026

Manuscript Offprint

arXiv:2609.05328

Embedded Graph Flows for Categorical Graph Generation

Ethan Ma, Zihan Wang, Chris Siu Yeung Chow, Xinguo Feng, Qingqing Li, Rui Jiang, Naipeng Dong, Guangdong Bai

Abstract

Generating categorical graphs requires choosing node and edge types that form a coherent structure without depending on node order. Many graph generators encode categories as fixed one-hot vectors, which can impose an artificial geometry in which categories are equidistant. We propose Embedded Graph Flows (EGF), a generative model that learns continuous embeddings for node and unordered-edge categories and transports Gaussian noise towards these learnt endpoints using a permutation-equivariant graph transformer. A terminal readout maps the embeddings back to discrete graph categories. Across molecular benchmarks, EGF achieved competitive performance. On QM9, EGF gives the best result on all four reported metrics among the three methods, including a Fréchet ChemNet Distance (FCD) of 0.150, compared with 0.717 for the categorical-diffusion baseline DiGress and 0.812 for the bridge-based baseline GruM. When applied to larger molecules in ZINC250k, EGF retains the lowest maximum mean discrepancy (MMD) using the neighbourhood subgraph pairwise distance kernel (NSPDK), indicating close agreement with the local substructures of the reference molecules. Our code is available at https://github.com/Trusted-System-Lab/EGF.

Keywords: graph generation; flow matching; learned graph embeddings; typed undirected graphs; molecular graph generation

1 Introduction

Categorical graph generation must choose node and edge types jointly because connectivity and type compatibility couple local decisions across the graph. The model must also accommodate variable graph sizes and preserve permutation symmetry: relabelling the nodes cannot change the graph distribution. These requirements are critical in molecular generation, where one incompatible atom-bond assignment invalidates an otherwise plausible structure.

Existing methods evolve either categorical node and edge states, continuous arrays tied to fixed category codes, or probabilities over fixed one-hot endpoints [7, 11, 16, 21]. For continuous graph representations, the category encoding fixes the geometry of the state space. With one-hot endpoints, all distinct labels remain equidistant throughout training. Embedded Language Flows uses a trainable continuous embedding space for sequence representations [9]. Figure 1 illustrates this representational difference. We ask whether endpoint geometry can likewise be learned for categorical graphs while accommodating padding and preserving undirected-edge and node-relabelling symmetries.

Figure

Figure 1. Transport spaces and supervision for DiGress [21], GruM [11], and EGF, illustrated with C, N, and O. DiGress moves between simplex vertices with stepwise cross-entropy. GruM follows an Ornstein-Uhlenbeck bridge mixture over Gaussian-initialised, category-coded arrays and predicts G^\widehat{G} with weighted mean-squared error before quantisation. EGF moves a Gaussian source through Rd\mathbb{R}^d, using mean-squared error along the path and cross-entropy at t=1t=1. In its panel, WW abbreviates WrW_r followed by arg max.

Our work. Embedded Graph Flows (EGF) places node and unordered-edge categories at trainable anchors in Rd\mathbb{R}^d. The anchors define the clean endpoints of the transport paths and provide the regression targets during training. A permutation-equivariant graph transformer predicts clean embeddings at points sampled along straight conditional paths from Gaussian noise. During generation, these predictions define a vector field that is integrated as an ordinary differential equation, and a learned terminal readout assigns categories. For padded, undirected graphs, the mask excludes padded slots from supervision and decoding. Each unordered node pair follows one trajectory to one terminal decision, and transport remains equivariant under node relabelling.

Contributions. EGF makes endpoint geometry trainable by learning node and edge category anchors jointly with continuous transport and terminal decoding. Its masked, undirected formulation is permutation-equivariant and assigns one shared state to each unordered node pair throughout training and generation. Empirically, we evaluate EGF on two widely used molecular benchmarks [17, 20]: QM9 for small organic molecules and ZINC250k for larger drug-like molecules. Under a common evaluator, EGF gives the best QM9 result on all four reported metrics. Its Fréchet ChemNet Distance (FCD) is 0.150, compared with 0.717 for DiGress and 0.812 for GruM, and its maximum mean discrepancy (MMD) computed with the neighbourhood subgraph pairwise distance kernel (NSPDK) is the lowest of the three on both benchmarks.