Embedded Graph Flows for Categorical Graph Generation

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

TL;DR

The authors introduce Embedded Graph Flows (EGF), a novel generative model for categorical graphs (like molecules) that learns continuous embeddings for node and edge categories rather than relying on rigid, fixed one-hot encodings. By combining this learnable geometry with a permutation-equivariant graph transformer and flow matching, EGF achieves state-of-the-art performance on standard molecular generation benchmarks.

What Problem Does This Paper Address?

Generating categorical graphs—such as molecular structures where nodes are atoms and edges are chemical bonds—is a complex challenge. A generative model must jointly determine node and edge types while respecting permutation symmetry (the order in which nodes are listed shouldn't change the graph's identity).

Most existing continuous graph generators encode categories using fixed one-hot vectors. However, this imposes an artificial geometry where every single category is equidistant from every other category (e.g., Carbon is just as "distant" from Nitrogen as it is from Oxygen). This rigid structure fails to capture the natural, continuous relationships and compatibility constraints between different atom and bond types.

Comparison of transport spaces and supervision between DiGress, GruM, and EGF.

Methods

EGF addresses this geometric limitation by placing node and unordered-edge categories into a trainable continuous embedding space ($\mathbb{R}^d$). These learned positions act as "anchors" or endpoints for the generation process.

The core architecture consists of:

  1. Flow Matching: The model defines a deterministic, straight-line trajectory that transports standard Gaussian noise ($z_0$) toward these learned clean endpoints ($x$) at time $t=1$.
  2. Two-Branch Training: To jointly optimize transport and classification, EGF uses a shared graph transformer trained on two distinct objectives:
  3. Denoising Branch: Learns to predict the clean embeddings along the straight-line path using Mean Squared Error (MSE).
  4. Decoding Branch: Trains a terminal categorical readout by feeding noise-perturbed clean embeddings to the transformer and applying a cross-entropy loss at $t=1$.
  5. Symmetry and Masking: To handle variable graph sizes and maintain undirected edge consistency, EGF masks out padded slots and ensures that each unordered node pair shares exactly one trajectory and decision throughout the process.
The two-branch training architecture of EGF, separating denoising and decoding paths.

Datasets

The model was evaluated on two widely recognized molecular graph benchmarks:

  • QM9: A dataset containing small organic molecules with up to 9 nodes (atoms).
  • ZINC250k: A dataset containing larger, drug-like molecules with up to 38 nodes.

Key Insights and Ideas

  • Data-Driven Geometry: By making the endpoint geometry trainable, the data itself shapes the relationships between categories. The model can learn which atoms or bonds behave similarly, easing the transport problem.
  • Shared Representation for Transport and Readout: Instead of predicting velocity directly, the network predicts the clean endpoint. This allows the same $d$-dimensional representation to be shared seamlessly between the continuous transport phase and the discrete decoding phase.
  • Balanced Loss Functions: Because the number of edges grows quadratically ($N^2$) relative to the linear growth of nodes ($N$), the authors normalize node and edge errors separately to prevent edge generation from dominating the training signal.

Key Results

EGF demonstrated highly competitive performance against strong baselines like DiGress (categorical diffusion) and GruM (bridge-based diffusion):

QM9 (Small Molecules)

EGF achieved the best results across all four evaluated metrics:

  • Fréchet ChemNet Distance (FCD): 0.150, significantly outperforming DiGress (0.717) and GruM (0.812). A lower FCD indicates the generated molecules closely match the chemical distribution of the reference data.
  • Validity: 99.87% of generated graphs were chemically valid before any structural repair.

ZINC250k (Larger Molecules)

  • NSPDK MMD: EGF achieved the lowest Maximum Mean Discrepancy (0.0024), showing that it excels at capturing local atom-bond neighborhoods and substructures even as graph complexity scales up.
The deterministic Euler rollout during sampling, moving from Gaussian noise to a final decoded molecule.

Limitations and Future Work

  • Static Embeddings: Currently, the category-to-endpoint mapping is static ($W_A$ and $W_B$ are simple linear transformations). This means an atom type has the exact same anchor regardless of its local chemical environment, which may limit expressiveness in very large molecules.
  • Computational Scaling: EGF stores edge states densely ($N^2$ tensor entries). While efficient for smaller graphs, scaling to massive macromolecular structures will require more memory-efficient or sparse representations.
  • Property Omissions: The current implementation omits stereochemistry, isotope identity, and radical-electron counts, which are crucial for downstream practical drug discovery.

Summary updated

BibTeX
@misc{ma2026embedded,
  author = {Ethan Ma and Zihan Wang and Chris Siu Yeung Chow and Xinguo Feng and Qingqing Li and Rui Jiang and Naipeng Dong and Guangdong Bai},
  title = {{Embedded Graph Flows for Categorical Graph Generation}},
  year = {2026},
  eprint = {2609.05328},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.05328},
}
Figure