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

LayerDAG: A Layerwise Autoregressive Diffusion Model for Directed Acyclic Graph Generation

Mufei Li, Viraj Shitole, Eli Chien, Changhai Man, Zhaodong Wang, Srinivas, Ying Zhang, Tushar Krishna, Pan Li

Introduction

Directed Acyclic Graphs (DAGs) are the foundational "skeletons" of modern computing. They represent everything from the flow of data in a microchip to the sequence of operations in a machine learning model. Generating synthetic DAGs is vital for benchmarking new hardware or compilers without leaking sensitive intellectual property.

However, generating realistic DAGs is notoriously difficult because they must satisfy two strict types of constraints:

  1. Directional Dependencies: Information must flow forward without ever forming a loop.
  2. Logical Dependencies: Specific rules must be met, such as "Operation X requires exactly two inputs" or "Matrix A must have dimensions matching Matrix B."

Existing models often struggle with scale—failing to generate valid graphs beyond 20-30 nodes—or they ignore the "partial order" of graphs, forcing an arbitrary linear sequence on nodes that should actually be treated as parallel. To address this, researchers have introduced LayerDAG, a novel generative model that combines autoregressive sequences with diffusion models to create realistic, large-scale DAGs.

The LayerDAG Approach

LayerDAG treats a DAG not as a flat list of nodes, but as a sequence of topological layers. By decomposing a DAG into a sequence of bipartite graphs, it captures both the high-level directional flow and the granular logical constraints required for hardware synthesis and compiler optimization.

LayerDAG decomposes a DAG into a sequence of bipartite graphs, capturing both directional and logical dependencies.
  • Layerwise Tokenization: The model breaks the DAG down into a sequence of bipartite graphs. Each "token" in this sequence represents a new layer of nodes and the edges connecting them to all previous layers. This naturally prevents cycles and respects the graph's inherent directionality.
  • The Hybrid Approach:
    • Autoregressive Generation: The model predicts the number of nodes in the next layer based on what has been built so far.
  • Diffusion Models: Within each layer, LayerDAG uses a discrete diffusion process (D3PM) to "denoise" node attributes and edges. This allows the model to capture complex, multi-dimensional logical rules that simple statistical models miss.
  • Efficiency Trick: The authors implemented a layer-index-based denoising schedule. Since later layers in a large graph are often more complex, the model allocates more denoising steps to later layers, balancing generation quality with computational speed.

Key Insights and Datasets

The researchers evaluated LayerDAG on both synthetic and real-world benchmarks, including LP (Latent Preferential DAGs) (a new synthetic dataset with strict logical rules), TPU Tile (kernel graphs from ML workloads), HLS (data flow graphs for FPGA programming), and NA-Edge (neural architecture graphs). Crucially, these datasets include graphs with up to 400 nodes, significantly larger than the small-scale graphs typically seen in previous research.

Two major insights emerged from this approach:

  1. Respect the Partial Order: Forcing a single linear order on nodes (like a string of text) hurts generalization. By generating nodes in "layers" where nodes in the same layer are incomparable, LayerDAG maintains the correct inductive bias for DAGs.
  2. Decoupling is Key: By separating the directional problem (which layer comes next?) from the logical problem (how do these nodes connect?), the model can use the best tool for each job—autoregression for the former and diffusion for the latter.

Key Results

LayerDAG significantly outperformed baselines like GraphRNN, D-VAE, and GraphPNAS across the board.

Performance comparison showing LayerDAG achieving significantly higher validity and lower MMD scores compared to baseline models.
  • Validity: On constrained synthetic datasets, LayerDAG achieved a validity score ranging from 0.56 to 0.96 (depending on the constraint strictness, denoted as $\rho$), while baselines often hovered around 0.25.
  • Statistical Accuracy: It produced graphs that closely matched the structural properties (layer size, path lengths) of real-world data, reflected in substantially lower Maximum Mean Discrepancy (MMD) scores.
  • Generalization: In "out-of-distribution" tests—where the model had to generate graphs with performance labels it hadn't seen during training—LayerDAG was the only model to maintain a positive correlation with ground-truth metrics. The synthetic DAGs generated by LayerDAG are so realistic they can be used to train "surrogate models" to accurately predict the performance of unseen real-world hardware designs.

Limitations and Future Work

While LayerDAG handles categorical attributes (like operation types) exceptionally well, the current implementation focuses less on continuous, real-valued attributes, though the framework can be extended to handle them. Additionally, while the model scales impressively to 400 nodes, generating even larger "mega-graphs" (thousands of nodes) remains a frontier. Future work may also explore more sophisticated encoders beyond the BiMPNN used here to capture even deeper structural nuances.

Summary updated

BibTeX
@inproceedings{li2025layerdag,
  author = {Mufei Li and Viraj Shitole and Eli Chien and Changhai Man and Zhaodong Wang and Srinivas and Ying Zhang and Tushar Krishna and Pan Li},
  title = {{LayerDAG: A Layerwise Autoregressive Diffusion Model for Directed Acyclic Graph Generation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=kam84eEmub},
}
Figure