arXiv:2610.32650cs.LGOct 2026

Manuscript Offprint

arXiv:2610.32650

WL-SeqVAE: Sequence-Based Graph Generation Using Variational Autoencoders and Weisfeiler-Leman Colors

Iakovos Evdaimon, Giannis Nikolentzos, Achilleas Tsimichodimos, Christos Xypolopoulos, Michalis Vazirgiannis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In this paper, we introduce WL-SeqVAE, a sequence-based variational autoencoder for generating graphs. The key observation behind WL-SeqVAE is that node colors induced by the Weisfeiler–Leman (WL) algorithm provide compact discrete summaries of local graph structure and can therefore serve as structural tokens for generation. Rather than learning a distribution over adjacency matrices directly, our method maps each graph to a sequence of WL colors and employs a variational autoencoder that encodes this sequence into a Gaussian latent distribution, from which an autoregressive decoder reconstructs the graph. During generation, compatibility constraints derived from the WL colors guide node and edge predictions, combining global information from the latent representation with local structural consistency. This formulation turns graph generation into a sequence generation problem and avoids directly parameterizing a quadratic adjacency matrix. We evaluate WL-SeqVAE in the tasks of molecular and general graph generation. Across the evaluated datasets, WL-SeqVAE is competitive with established baselines on several local structural and molecular quality metrics. Code is available at https://github.com/iakovosevdaimon/WL-SeqVAE.

1 Introduction

In recent years, the availability of graph-structured data has increased significantly across a wide range of application domains, including network science, chemo-informatics, and hardware design. Unlike conventional data modalities such as vectors or sequences, graphs provide a more expressive representation by explicitly capturing complex relationships and interactions among entities. For example, in chemo-informatics, molecular structures can be naturally represented as graphs, where nodes correspond to atoms and edges represent chemical bonds. Graphs thus enable the modeling of interactions that cannot be adequately captured by vector-based representations.

In several domains, there is an increasing demand for generative models capable of producing realistic graphs which preserve the underlying structural characteristics of observed samples [46]. For example, in chemo-informatics, graph generative models can produce novel molecular

∗^{*}These authors contributed equally.

structures with desirable properties, while in network science, synthetic graphs can be used for simulation and privacy-preserving data sharing. These applications require models that can capture both local connectivity patterns and global structural characteristics of graphs while generating valid and diverse graph instances.

Over the past few years, neural graph generation has become the most widely-used approach for producing synthetic graphs. Existing methods include autoregressive models [42], variational autoencoders [33], generative adversarial networks [2], normalizing flows [43] and, more recently, diffusion-based methods [36]. While existing methods have achieved promising results in different tasks, graph generation remains challenging due to the combinatorial nature of graph structures, permutation invariance, varying graph sizes, and the need to model complex dependencies and interactions among graph nodes [10]. Furthermore, the trade-off between generation quality and scalability is a major challenge, which remains largely unresolved.

In this work, we propose WL-SeqVAE, a novel generative model for graph-structured data. The central novelty of the proposed approach lies in leveraging node colors induced by the Weisfeiler–Leman (WL) algorithm [37], a powerful heuristic for graph isomorphism testing. Unlike conventional graph generative models, which aim to learn a distribution over graph structures, the proposed model learns a distribution over WL-derived node colors directly from observed data. By shifting the modeling focus from graph topology to color distributions, the proposed framework offers a fundamentally different approach to synthetic graph generation. We adopt a variational autoencoder (VAE) as the underlying generative model. An encoder maps the input node sequence to a Gaussian latent distribution, while an autoregressive decoder reconstructs the graph from a sampled latent representation. Unlike conventional autoregressive graph generators that generate one node at a time, our decoder is guided by compatibility constraints derived from the WL colors. This design combines global information encoded in the latent representation with local structural consistency enforced by the generated WL colors. The WL-SeqVAE model is evaluated in the tasks of molecular and general graph generation. The experimental results demonstrate that WL-SeqVAE is competitive with the current state-of-the-art. The proposed approach also opens up new opportunities for scalable graph generation by casting graph generation as a sequence generation problem, thus mitigating the challenges arising from the quadratic complexity of graph-structured data.

References (45)