Authors: Samuel Cognolato, Luciano Serafini, Alessandro Sperduti, Andrea Cavallaro
Organizations: Department of Mathematics “Tullio Levi-Civita”, University of Padova, Padova, Italy · Fondazione Bruno Kessler (FBK), Trento, Italy · Human Inspired Technology Research Centre (HIT), University of Padova, Padova, Italy · École polytechnique fédérale de Lausanne (EPFL), Lausanne, Switzerland
Graph diffusion models are competitive approaches for generating complex graph-structured data. However, when such distributions have strict structural constraints, diffusion models may fail to capture them exactly, resulting in the generation of invalid graphs. In this paper, we propose a method for grounding graph diffusion models in domain-specific knowledge via First Order Logic (FOL), leveraging its expressive and interpretable formalism to impose structural constraints on the generative process. We incorporate domain knowledge using classifier guidance, a technique that conditions the diffusion model's distribution on external variables to exert control over the sampled data. During the generative process, classifier guidance steers the denoising trajectory to optimize an objective function, which we define as a fuzzy and differentiable relaxation of the logical rules. Our methodology requires only the specification of constraints in FOL, whose satisfaction is encouraged at inference time to guide a pre-trained generative model. We evaluate our approach by comparing the unconditional generation of knowledge graphs with our logic-guided framework, which incorporates domain ontologies as structural constraints during inference. This approach significantly increases the proportion of generated graphs that satisfy the ontological constraints.
Figures & tables
Figure 1: Our LTN-guidance comprises two branches at each denoising step: (top) the pretrained DiGress model computes the denoising probabilities pθ(Gt−1∣Gt) ; (bottom) LTN interprets the given FOL rules ϕ as the differentiable function fϕ , over which the gradient on Gt is computed, producing an approximation of p(ϕ∣Gt−1) . Classifier guidance (right) combines the two with element-wise product, returning the conditional probabilities pθ(Gt−1∣Gt,ϕ) .
Dataset
Model
%Valid ↑
%Nov. & Val. ↑
%Novel ↑
%Empty ↓
Degree ↓
Clustering ↓
Spectre ↓
syn-paths
ComplEx (w/ p(S∣E) only)
10.10
10.10
95.58
4.42
−
−
−
ProvCreator
93.14
93.14
100.00
0.00
−
−
−
DiGress (no guid)
99.43 ± 0.31
99.40 ± 0.30
99.97 ± 0.06
0.00 ± 0.00
1.6e-5 ± 9.17e-6
1.33e-6 ± 1.15e-6
1.6e-5 ± 9.17e-6
DiGress (w/ guid)
99.40 ± 0.44
99.37 ± 0.42
99.97 ± 0.06
0.00 ± 0.00
2.13e-5 ± 1.81e-5
1.33e-6 ± 1.15e-6
2.13e-5 ± 1.81e-5
syn-tipr
ComplEx (w/ p(S∣E) only)
0.00
0.00
99.64
0.36
−
−
−
ProvCreator
0.00
0.00
100.00
0.00
−
−
−
Table 1: Results on the IntelliGraphs benchmark. Because the setup is the same, the reported values for ComplEx and ProvCreator are taken from ( Thanapalasingam et al. 2023 ) and ( Wang et al. 2025 ) , respectively. For our method, we report mean ± std across three models trained with random seeds from 0 to 2, sampling 1,000 graphs per dataset, except for 200 graphs on wd-articles .
Figure 2: Comparison of unconditional and guided denoising processes in the syn-types dataset across 3 seeds.
Figure 3: Validity comparison of unconditional and guided models when introducing new compatible (restriction) or conflicting (shift) rules.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Grid-search validity (%) for the LTN-guidance weights λx and λe on the five datasets. The color-bar scale is set independently in each panel to emphasize differences within each dataset, so colors should not be compared across datasets.
Dataset
Max. validity
λx
λe
syn-paths
99.71
5⋅10−4
10−3
syn-tipr
99.71
5⋅10−4
5⋅10−5
syn-types
97.07
5⋅10−3
1
wd-movies
98.83
5⋅10−4
10−2
wd-articles
86.00
1
10−3
Appendix
Table 2: Selected LTN-guidance hyperparameters and corresponding maximum validity (%).
Synthesizing realistic graphs at scale is vital when the graphs of interest are large and real-world samples are limited or access-sensitive. Diffusion-based generators have recently driven much of the progress, offering high modeling capacity, but most such methods have quadratic computational complexity and are hence restricted to small-scale networks, currently up to 3k nodes. Existing non-quadratic methods remain limited by memorization issues and a trade-off between scalability and generation quality. Our goal is to generate large graphs whose structural statistics --- e.g., degree distribution, clustering, and path length --- faithfully reflect those of real-world sparse graphs, without resorting to memorizing the training data. We introduce a discrete graph diffusion model that restricts training to a structurally motivated subset of node pairs --- observed edges and their wedge non-edges --- reducing training complexity below quadratic in the number of nodes. To keep the noisy graph informative throughout both the forward and reverse trajectories, we design a three-class absorbing forward process governed by a degree-aware, floored cosine noise schedule: unlike a structure-blind schedule that adds noise to every pair identically, ours adapts to each node's degree and never fully erases the graph's structure, keeping the noisy graph informative at every step. Experiments across diverse datasets show that our model consistently ranks among the top methods for structural fidelity against existing discrete diffusion baselines in large graph generation.
Generative modeling of graph-structured data is crucial for tasks ranging from drug discovery to social network simulation. Among these models, denoising diffusion models have achieved great success in graph generation by learning to progressively reverse a process that adds noise to the original graph. However, the standard noise-prediction approach of diffusion models is suboptimal for graph data. The goal for a graph generative model is to learn the clean graphs' topological properties, such as connectivity and degree distribution. Because a diffusion model that predicts noise does not explicitly learn these topological properties, it is challenging for the model to output graphs with the desired structural statistics. To address this challenge, we introduce Direct Graph Flow Matching (DiGFM), a novel graph transformer model guided by two goals: predict clean graphs and improve sampling efficiency. Distinct from the prevailing diffusion approach, DiGFM employs a continuous flow-matching paradigm and integrates direct graph prediction. Specifically, DiGFM maps the prior noise distribution to the clean graph distribution via a multi-step process: the model repeatedly predicts the underlying clean graph, and a transformation is employed to convert the model output to the velocity vector that points in the direction toward the clean graph distribution. This design enables DiGFM to generate high-quality samples using only 2.5% to 15.6% of the steps required by diffusion-based models, which leads to a 5.3x to 257x speedup in wall-clock inference time. Experiments demonstrate that DiGFM outperforms or matches prior state-of-the-art models across general graph benchmarks and molecular datasets, generating graphs with strong adherence to ground-truth structural statistics at significantly faster inference speeds.
Logical rules constitute a cornerstone of knowledge graph (KG) reasoning, valued for their interpretability and ability to model relational patterns. However, existing rule mining methods predominantly focus on simple chain-like rules and therefore neglect the richer relational information encoded in graph-like structures, such as cycles and branches. This limitation is further exacerbated by computational bottlenecks caused by the combinatorial explosion of the search space, which is especially challenging for graph-like rules. Meanwhile, generative approaches such as diffusion models, despite their success in other domains, cannot be directly applied to rule mining because their training objectives are not aligned with the goal of learning high-quality rules, and non-differentiable KG rule quality metrics cannot directly guide model optimization. To address these limitations, we propose GRiD, a framework that reformulates graph-like rule discovery as a discrete generative process conditioned on the target relation. GRiD employs a two-phase training strategy. First, supervised pre-training enables GRiD to capture structural priors from subgraphs sampled from the KG meta-graph. Subsequently, reinforcement learning is applied to fine-tune GRiD through policy gradient optimization guided directly by non-differentiable rule-quality metrics. Experiments on six benchmark datasets show that GRiD achieves competitive performance on KG completion tasks. Ablation studies confirm the efficiency and robustness of GRiD and further show that graph-like rules complement chain-like rules in KG completion. Our code and datasets are available in https://github.com/Haoxiang-Cheng/GRiD.
Haoxiang Cheng, Yunfei Wang, Chao Chen +5
Laboratory for Big Data and Decision, National University of Defense Technology · National Key Laboratory of Information Systems Engineering, National University of Defense Technology · Microsoft Corporation +2